/* ============ 首页 ============ */
.hero {
    text-align: center;
    padding: 48px 0 36px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: var(--text);
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

.import-section {
    max-width: 640px;
    margin: 0 auto;
}

.book-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.book-actions-row .btn {
    text-decoration: none;
}

.drop-zone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: var(--shadow-md);
}

.drop-zone-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.drop-zone-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.privacy-note {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============ 状态/错误提示 ============ */
.status-bar {
    max-width: 640px;
    margin: 18px auto 0;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.9rem;
    text-align: center;
}

.error-bar {
    max-width: 640px;
    margin: 18px auto 0;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
}

/* ============ 解析结果 ============ */
.result-section {
    max-width: 640px;
    margin: 28px auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-meta-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.book-info-cover {
    width: 88px;
    height: 120px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-soft), #f1f5fb);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: var(--primary);
    flex-shrink: 0;
    overflow: hidden;
}

.book-info-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-meta-text h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    word-break: break-all;
}

.res-author {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.res-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.chapter-card h3,
.preview-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-badge {
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}

.home-chapter-list {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s ease;
    border-radius: var(--radius-sm);
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: var(--primary-soft);
}

.chapter-index {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
}

.chapter-title {
    flex: 1;
    font-size: 0.93rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

/* ============ 内容区（功能 / 步骤 / 格式 / FAQ） ============ */
.home-section {
    max-width: 860px;
    margin: 56px auto 0;
}

.section-title {
    font-size: 1.45rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.format-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.format-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.format-table th,
.format-table td {
    text-align: left;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
}

.format-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.format-table tr:last-child td {
    border-bottom: none;
}

.format-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.format-ok {
    color: var(--success);
    font-weight: 600;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 18px;
}

.faq-item summary {
    cursor: pointer;
    padding: 15px 28px 15px 0;
    font-weight: 600;
    font-size: 0.95rem;
    list-style: none;
    position: relative;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 1.2rem;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-bottom: 16px;
}

/* 页脚 */
.footer-brand {
    margin-bottom: 10px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 10px;
}

.footer-copy {
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.7rem;
    }

    .drop-zone {
        padding: 40px 16px;
    }

    .home-section {
        margin-top: 40px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .format-table th,
    .format-table td {
        padding: 11px 12px;
    }
}
