:root {
    --primary: #1a6eff;
    --primary-light: #e8f1ff;
    --primary-dark: #0d4fc4;
    --primary-gradient: linear-gradient(135deg, #1a6eff 0%, #0d4fc4 100%);
    --text: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-light: #8a8aa0;
    --bg: #ffffff;
    --bg-warm: #f8fafc;
    --bg-card: #ffffff;
    --border: #e8ecf4;
    --shadow: 0 4px 24px rgba(26, 110, 255, 0.08);
    --shadow-hover: 0 12px 40px rgba(26, 110, 255, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --warning: #ff6b35;
    --warning-light: #fff3ed;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --success: #16a34a;
    --success-light: #f0fdf4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== NAVIGATION（复刻官网） ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(26, 110, 255, 0.08);
    transition: var(--transition);
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06); }
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 18px;
}
.logo-icon img { height: 44px; }
.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.logo-text span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 1px;
}
.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    background: var(--primary-light);
}
.mobile-toggle {
    display: none;
    width: 40px; height: 40px;
    border: none;
    background: var(--primary-light);
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.mobile-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== FOOTER（复刻官网） ===== */
.footer {
    background: var(--text);
    color: white;
    padding: 64px 0 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}
.footer-brand .logo-icon {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}
.footer-brand .logo-icon img { height: 84px; }
.footer-brand p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    max-width: 320px;
}
.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}
.footer-col a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-bottom p,
.footer-bottom a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== 公共 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.section { padding: 80px 0; }
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-light);
}
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

/* ===== 页面头部 ===== */
.tool-hero {
    padding: 140px 0 60px;
    background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
    text-align: center;
}
.tool-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 16px;
    letter-spacing: 1px;
}
.tool-hero h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}
.tool-hero h1 .highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tool-hero p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 32px;
    line-height: 1.9;
}
.tool-hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}
.tool-hero-stats .stat-num {
    font-size: 30px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}
.tool-hero-stats .stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* ===== 工具主区 ===== */
.tool-main { padding-top: 48px; }

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 32px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.panel-head h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.panel-head h3 svg { color: var(--primary); }
.result-file-name {
    font-size: 13px;
    color: var(--text-light);
    font-family: monospace;
    background: var(--bg-warm);
    padding: 4px 12px;
    border-radius: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 0;
}
.link-btn.danger { color: var(--danger); }

/* ===== 上传区 ===== */
.dropzone {
    border: 2px dashed rgba(26, 110, 255, 0.35);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    padding: 56px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}
.dropzone:hover, .dropzone:focus, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.dz-icon {
    width: 88px; height: 88px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(26, 110, 255, 0.12);
    transition: var(--transition);
}
.dropzone:hover .dz-icon { transform: scale(1.06); }
.dropzone h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.dropzone p { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.dz-badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.dz-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: white;
    border: 1px solid rgba(26, 110, 255, 0.2);
    padding: 4px 12px;
    border-radius: 100px;
}
.dz-tips {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.7;
}
.dz-tips svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }

/* ===== 文件列表 ===== */
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: var(--transition);
}
.file-item:hover { border-color: rgba(26, 110, 255, 0.25); }
.file-item.selected { border-color: var(--primary); background: var(--primary-light); }
.file-item .fi-icon {
    width: 40px; height: 40px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.file-item .fi-icon svg { width: 20px; height: 20px; }
.file-item .fi-info { flex: 1; min-width: 0; }
.file-item .fi-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-item .fi-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.file-item .fi-status { font-size: 12px; font-weight: 600; flex-shrink: 0; }
.fi-status.ok { color: var(--success); }
.fi-status.err { color: var(--danger); }
.file-item .fi-remove {
    width: 32px; height: 32px;
    border: none;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    flex-shrink: 0;
}
.file-item .fi-remove:hover { background: var(--danger-light); color: var(--danger); }
.file-item .fi-remove svg { width: 15px; height: 15px; }

/* ===== 文档统计 ===== */
.doc-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.doc-stat {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
}
.doc-stat .ds-value { font-size: 22px; font-weight: 900; color: var(--primary); line-height: 1.1; }
.doc-stat .ds-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== 预览区 ===== */
.preview-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 0;
    flex-wrap: wrap;
}
.ptab {
    padding: 10px 20px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    transition: var(--transition);
}
.ptab:hover { color: var(--primary); }
.ptab.active { color: var(--primary); border-bottom-color: var(--primary); }
.preview-body {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow: hidden;
}
.preview-pane {
    display: none;
    max-height: 520px;
    overflow-y: auto;
    background: white;
}
.preview-pane.active { display: block; }
.code-pane {
    margin: 0;
    padding: 20px 24px;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== 转换后的文档排版样式 ===== */
.doc-content { padding: 28px 32px; font-size: 14px; line-height: 1.9; color: var(--text); }
.doc-content h1 { font-size: 24px; font-weight: 900; margin: 20px 0 12px; line-height: 1.4; }
.doc-content h2 { font-size: 20px; font-weight: 800; margin: 18px 0 10px; line-height: 1.4; }
.doc-content h3 { font-size: 17px; font-weight: 700; margin: 16px 0 8px; }
.doc-content h4 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.doc-content h5, .doc-content h6 { font-size: 14px; font-weight: 700; margin: 12px 0 6px; }
.doc-content p { margin: 10px 0; }
.doc-content img { max-width: 100%; height: auto; border-radius: 6px; }
.doc-content table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13px; }
.doc-content th, .doc-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.doc-content th { background: var(--bg-warm); font-weight: 700; }
.doc-content ul, .doc-content ol { margin: 10px 0; padding-left: 24px; }
.doc-content li { margin: 4px 0; }
.doc-content blockquote {
    margin: 12px 0;
    padding: 10px 16px;
    border-left: 3px solid var(--primary);
    background: var(--primary-light);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}
.doc-content a { color: var(--primary); }
.doc-content code {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: 'SF Mono', Consolas, monospace;
}

/* ===== 下载操作区 ===== */
.download-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}
.dl-btn:hover { transform: translateY(-2px); }
.dl-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.dl-pdf { background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%); box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3); }
.dl-html { background: linear-gradient(135deg, #1a6eff 0%, #0d4fc4 100%); box-shadow: 0 4px 16px rgba(26, 110, 255, 0.3); }
.dl-md { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3); }
.dl-txt { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3); }

.pdf-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.pdf-progress-bar {
    flex: 1;
    max-width: 320px;
    height: 8px;
    background: var(--bg-warm);
    border-radius: 100px;
    overflow: hidden;
}
.pdf-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 100px;
    transition: width 0.3s ease;
}

/* ===== 功能特性 ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: var(--transition);
}
.feature-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: rgba(26, 110, 255, 0.2);
}
.feature-card .f-icon {
    width: 48px; height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.feature-card .f-icon svg { width: 24px; height: 24px; color: var(--primary); }
.feature-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }

/* ===== 使用说明 ===== */
.howto {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.howto-title { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.howto-list { padding-left: 20px; }
.howto-list li { font-size: 13.5px; color: var(--text-secondary); line-height: 2; }
.howto-list li strong { color: var(--text); }
.howto-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--warning-light);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #9a3412;
    line-height: 1.8;
}
.howto-warn svg { flex-shrink: 0; margin-top: 2px; color: var(--warning); }

/* ===== PDF 离屏渲染容器 ===== */
#pdfStage {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 794px;
    background: white;
    z-index: -1;
}
#pdfStage .pdf-render {
    width: 694px;
    padding: 40px 50px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 12px;
    line-height: 1.9;
    color: #1a1a2e;
    background: white;
}
#pdfStage .pdf-render h1 { font-size: 22px; font-weight: 900; margin: 14px 0 10px; }
#pdfStage .pdf-render h2 { font-size: 18px; font-weight: 800; margin: 12px 0 8px; }
#pdfStage .pdf-render h3 { font-size: 15px; font-weight: 700; margin: 10px 0 6px; }
#pdfStage .pdf-render h4, #pdfStage .pdf-render h5, #pdfStage .pdf-render h6 { font-size: 13px; font-weight: 700; margin: 8px 0 4px; }
#pdfStage .pdf-render p { margin: 6px 0; }
#pdfStage .pdf-render img { max-width: 100%; height: auto; }
#pdfStage .pdf-render table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 11px; }
#pdfStage .pdf-render th, #pdfStage .pdf-render td { border: 1px solid #d0d5e0; padding: 5px 8px; text-align: left; }
#pdfStage .pdf-render th { background: #f0f4fa; font-weight: 700; }
#pdfStage .pdf-render ul, #pdfStage .pdf-render ol { margin: 6px 0; padding-left: 22px; }
#pdfStage .pdf-render blockquote {
    margin: 8px 0;
    padding: 6px 12px;
    border-left: 3px solid #1a6eff;
    background: #e8f1ff;
}
#pdfStage .pdf-render a { color: #1a6eff; }
#pdfStage .pdf-render code { background: #f0f4fa; padding: 0 4px; border-radius: 3px; font-size: 11px; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: white;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 100px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    max-width: calc(100vw - 48px);
    text-align: center;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.success { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); }
.toast.error { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }

/* ===== 滚动条 ===== */
.preview-pane::-webkit-scrollbar { width: 8px; height: 8px; }
.preview-pane::-webkit-scrollbar-track { background: var(--bg-warm); }
.preview-pane::-webkit-scrollbar-thumb { background: rgba(26, 110, 255, 0.25); border-radius: 100px; }
.preview-pane::-webkit-scrollbar-thumb:hover { background: rgba(26, 110, 255, 0.45); }

/* ===== 响应式：与官网断点保持一致 ===== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* 导航：与官网一致的汉堡菜单 */
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 16px 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        gap: 4px;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }

    /* 页脚：单列 */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }

    .section { padding: 48px 0; }
    .tool-hero { padding: 110px 0 40px; }
    .tool-hero-stats { gap: 24px; }
    .tool-hero-stats .stat-num { font-size: 24px; }
    .tool-hero-stats .stat-label { font-size: 11px; }

    .panel { padding: 20px; }
    .dropzone { padding: 36px 16px; }
    .dz-icon { width: 64px; height: 64px; border-radius: 18px; }
    .dropzone h3 { font-size: 15px; }
    .dropzone p { font-size: 12px; }

    .doc-stats { grid-template-columns: repeat(2, 1fr); }
    .doc-content { padding: 18px; }
    .code-pane { padding: 14px 16px; font-size: 11.5px; }
    .preview-pane { max-height: 420px; }
    .ptab { padding: 9px 14px; font-size: 12px; }

    .download-bar { flex-direction: column; }
    .dl-btn { width: 100%; justify-content: center; }

    .feature-grid { grid-template-columns: 1fr; }
    .feature-card { padding: 20px; }

    .howto { padding: 20px; }
    .howto-list li { font-size: 12.5px; line-height: 1.9; margin-bottom: 6px; }
}

@media (max-width: 480px) {
    .tool-hero h1 { font-size: 24px; }
    .tool-hero p { font-size: 13px; }
    .doc-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .doc-stat { padding: 10px 8px; }
    .doc-stat .ds-value { font-size: 18px; }
    .file-item { flex-wrap: wrap; }
    .file-item .fi-info { flex-basis: calc(100% - 54px); }
}
