/* 税务法规聚合平台 - 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "微软雅黑", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #222;
    background: #f5f7fa;
    line-height: 1.6;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* 手机端汉堡按钮 + 遮罩（桌面端隐藏） */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: #1e293b;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* 左侧导航 */
.sidebar {
    width: 260px;
    background: #1e293b;
    color: #cbd5e1;
    padding: 16px 0;
    overflow-y: auto;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    padding: 0 20px 4px;
    border-bottom: 1px solid #334155;
    margin-bottom: 4px;
    cursor: pointer;
    transition: color 0.15s;
}

.logo:hover {
    color: #60a5fa;
}

.subtitle {
    font-size: 12px;
    color: #64748b;
    padding: 4px 20px 16px;
}

.nav { padding: 8px 0; }

.nav-category {
    font-size: 14px;
    font-weight: 800;
    color: #e2e8f0;
    padding: 12px 20px 4px;
    letter-spacing: 0.5px;
}

.nav-item {
    padding: 8px 20px 8px 28px;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-item:hover { background: #0f172a; color: #fff; }

.nav-item.active {
    background: #0f172a;
    color: #60a5fa;
    border-left-color: #60a5fa;
}

/* ===== 树状导航：标题靠左，">"箭头置右，展开时旋转 90° ===== */
.nav-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.nav-toggle:hover { color: #93c5fd; }
.nav-toggle .nav-label { flex: 1; }
/* 板块合并列表页：一级标题高亮（cat 路由） */
.nav-toggle.active { color: #60a5fa; }
.nav-toggle.active .nav-label { color: #60a5fa; }

.nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    color: #38bdf8;
    margin-left: 8px;
    margin-top: -3px;  /* ">" 字形偏上，微调使其落在文字垂直中心 */
    flex: none;
    transition: transform 0.15s;
}
.nav-toggle.open .nav-arrow { transform: rotate(90deg); }

.nav-children.collapsed { display: none; }

/* 二级可展开组标题（考点笔记科目、听音训练分类等）：样式与普通条目一致（仅保留右侧">"箭头可展开） */
.nav-children .nav-category.nav-toggle {
    padding: 8px 20px 8px 28px;
    font-size: 14px;
    font-weight: normal;
    color: #cbd5e1;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.nav-children .nav-category.nav-toggle:hover { background: #0f172a; color: #fff; }
.nav-children .nav-category.nav-toggle.active { background: #0f172a; color: #60a5fa; border-left-color: #60a5fa; }
.nav-children .nav-children .nav-item { padding-left: 46px; }

/* 首页介绍：浅底静雅 Hero + 2×2 编号卡片（单色墨蓝，克制高级） */
.welcome .home-lines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 880px;
    margin: 0 auto;
    align-items: stretch;
    counter-reset: hc;
}
.welcome .home-line {
    counter-increment: hc;
    position: relative;
    text-align: left;
    padding: 22px 24px 22px 74px;
    border: 1px solid #e8eef6;
    border-radius: 12px;
    background: #ffffff;
    color: #334155;
    font-size: 18px; font-weight: 600;
    letter-spacing: 0.5px; line-height: 1.6;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.welcome .home-line:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
}
.welcome .home-line::before {
    content: counter(hc, decimal-leading-zero);
    position: absolute; left: 24px; top: 50%;
    transform: translateY(-50%);
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #1e3a8a;
    color: #ffffff;
    font-size: 12px; font-weight: 800; letter-spacing: 0;
}
/* 关键词：同字号，墨蓝加粗 */
.welcome .home-line em {
    font-style: normal;
    font-weight: 800;
    color: #1e3a8a; letter-spacing: 0.5px; margin-right: 4px;
}
/* 左上角细能量条 */
.welcome .home-line::after {
    content: "";
    position: absolute; left: 0; top: 20px;
    width: 3px; height: 24px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, #1e3a8a, #60a5fa);
}
.welcome .home-disclaimer { margin-top: 30px; font-size: 12px; color: #94a3b8; letter-spacing: 0.5px; }
@media (max-width: 768px) {
    .welcome .home-lines { grid-template-columns: 1fr; gap: 12px; }
    .welcome .home-line { font-size: 16px; padding: 16px 16px 16px 62px; }
    .welcome .home-line::before { left: 16px; width: 28px; height: 28px; font-size: 11px; }
    .welcome .home-line::after { top: 16px; height: 20px; }
    .welcome .home-disclaimer { margin-top: 22px; }
}

/* 知识库 md 正文排版 */
.kb-doc {
    line-height: 1.9;
    font-size: 15px;
    color: #1e293b;
    word-break: break-word;
}
.kb-doc h1, .kb-doc h2, .kb-doc h3 { margin: 1.2em 0 0.5em; line-height: 1.4; }
.kb-doc h1 { font-size: 22px; }
.kb-doc h2 { font-size: 19px; }
.kb-doc h3 { font-size: 17px; }
.kb-doc p { margin: 0.8em 0; }
.kb-doc table { border-collapse: collapse; margin: 1em 0; width: 100%; }
.kb-doc th, .kb-doc td { border: 1px solid #cbd5e1; padding: 6px 10px; font-size: 14px; }
.kb-doc th { background: #f1f5f9; }
.kb-doc blockquote {
    border-left: 3px solid #93c5fd;
    margin: 0.8em 0;
    padding: 4px 14px;
    color: #475569;
    background: #f8fafc;
}
.kb-doc code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.kb-doc pre { background: #f8fafc; padding: 12px; border-radius: 6px; overflow-x: auto; }
.kb-doc ul, .kb-doc ol { padding-left: 1.6em; margin: 0.6em 0; }

.nav-item .count {
    font-size: 11px;
    color: #64748b;
    background: #334155;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 8px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #334155;
    margin-top: 12px;
}

.btn-refresh {
    width: 100%;
    padding: 8px 12px;
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-refresh:hover { background: #475569; }

/* 主内容区 */
.main {
    flex: 1;
    padding: 24px 32px;
    overflow-x: hidden;
    max-width: calc(100vw - 260px);
}

/* 标题行：左侧标题与右端按钮组（访问原站/语言/下载App）同一水平线 */
.header-title-row {
    display: flex;
    align-items: flex-start;   /* 顶部对齐，让右端按钮与标题文字（h2）齐平 */
    justify-content: space-between;
    flex: 1;
    gap: 12px;
    flex-wrap: wrap;
}

/* 右端操作区：访问原站 + 语言切换 + 下载 App，横向排列 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    /* 视觉对齐 h2（20px 字号）文字行中心 */
    margin-top: 1px;
}

/* 移动端：按钮组换行到标题下方 */
@media (max-width: 768px) {
    .header-actions {
        flex-wrap: wrap;
    }
}

.topbar-btn {
    padding: 5px 12px;
    background: #fff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.4;
    transition: border-color 0.15s, background 0.15s;
}

.topbar-btn:hover {
    border-color: #1e3a8a;
    background: #f8fafc;
}

/* 语言下拉菜单 */
.lang-switch {
    position: relative;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    z-index: 60;
    overflow: hidden;
}

.lang-option {
    padding: 9px 16px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s;
}

.lang-option:hover { background: #eff6ff; color: #1e3a8a; }

.lang-option.active {
    color: #1e3a8a;
    font-weight: 700;
    background: #f0f7ff;
}

/* 下载 App 二维码弹窗 */
.qrcode-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.qrcode-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 28px 36px 24px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
}

.qrcode-dialog h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #0f172a;
}

.qrcode-img {
    width: 240px;
    height: 240px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.qrcode-tip {
    margin: 14px 0 0;
    font-size: 13px;
    color: #64748b;
}

.qrcode-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 50%;
}

.qrcode-close:hover { background: #f1f5f9; color: #334155; }

/* 搜索框 */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* 左侧"内容搜索"标签：深色加粗、字号增大 */
.search-label {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #1e3a8a;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.search-input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.search-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* 版块搜索按钮：中蓝色填充、白字 */
.search-btn-section {
    background: #3b82f6;
    color: #fff;
    border: 1px solid #2563eb;
}

.search-btn-section:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

.search-btn-section:disabled {
    color: #94a3b8;
    border-color: #cbd5e1;
    background: #f1f5f9;
    cursor: not-allowed;
}

/* 全平台搜索按钮：深蓝色主色 */
.search-btn-all {
    background: #1e3a8a;
    color: #fff;
}

.search-btn-all:hover { background: #1e40af; }

.search-btn-all:disabled { background: #94a3b8; cursor: not-allowed; }

/* 搜索结果列表项 */
.search-result-item {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover { background: #f1f5f9; }

.search-result-item .result-title {
    font-size: 15px;
    color: #1e40af;
    margin-bottom: 6px;
    line-height: 1.4;
}

.search-result-item .result-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.search-result-item .result-snippet {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.search-result-item .result-snippet em {
    background: #fef3c7;
    color: #92400e;
    font-style: normal;
    padding: 0 2px;
    border-radius: 2px;
}

.search-info {
    padding: 8px 0 16px;
    color: #64748b;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    gap: 16px;
}

.header-text { flex: 1; min-width: 0; }

.main-header h2 {
    font-size: 20px;
    color: #0f172a;
    word-break: break-word;
}

.meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* 返回按钮 + 朗读按钮：垂直堆叠 */
.header-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    align-self: center;
}

.back-btn {
    padding: 6px 14px;
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.back-btn:hover { background: #f1f5f9; border-color: #94a3b8; }

/* 朗读按钮 + 连续朗读复选框：水平排列 */
.read-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 朗读按钮：朗读 / 停止 两态，不加粗 */
.read-btn {
    padding: 6px 14px;
    background: #fff;
    color: #1e3a8a;
    border: 1px solid #1e3a8a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.read-btn:hover {
    background: #1e3a8a;
    color: #fff;
}

/* 朗读中（停止态）：深蓝填充 */
.read-btn.active {
    background: #1e3a8a;
    color: #fff;
}

/* 连续朗读复选框：与朗读按钮同色系 */
.read-continue-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.read-continue-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #1e3a8a;
    cursor: pointer;
}

.btn-link {
    display: inline-block;
    padding: 6px 12px;
    background: #3b82f6;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    flex-shrink: 0;
    align-self: center;
}

.btn-link:hover { background: #2563eb; }

.hidden { display: none !important; }

/* 内容容器 */
.content { min-height: 400px; }

.welcome {
    padding: 56px 32px 50px;
    text-align: center;
    color: #475569;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
    border: 1px solid #e8eef6;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    margin-top: 12px;
}

.welcome h3 {
    font-size: 38px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 36px;
    letter-spacing: 0;
    line-height: 1.35;
}

/* 主标语：品牌名重点突出（墨蓝特粗）+ 主句粗体，靠颜色与字号分层 */
.welcome h3 .slogan-brand {
    font-weight: 800;
    font-size: 42px;
    letter-spacing: 7px;
    color: #1e3a8a;
    margin-right: -5px;
}

.welcome h3 .slogan-sep {
    font-weight: 700;
    font-size: 32px;
    color: #94a3b8;
    margin: 0 12px;
}

.welcome h3 .slogan-bold {
    font-weight: 800;
    font-size: 44px;
    letter-spacing: 4px;
    color: #0f172a;
    margin-right: -4px;
}

.welcome h3::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin: 20px auto 0;
    border-radius: 2px;
    background: #b08d3f;
}

.welcome p {
    font-size: 17px;
    line-height: 1.9;
    margin: 14px 0;
    color: #64748b;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.welcome p strong {
    color: #1e40af;
    font-weight: 700;
    margin-right: 4px;
}

/* 列表 */
.item-list { display: flex; flex-direction: column; gap: 10px; }

.item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 14px 18px;
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.item-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #e0e7ff;
    color: #1e40af;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.item-body { flex: 1; min-width: 0; }

.item-title {
    font-size: 15px;
    font-weight: 500;
    color: #1e40af;
    margin-bottom: 6px;
}

.item-title:hover { text-decoration: underline; }

.item-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.item-meta span { display: inline-flex; align-items: center; }

/* 法规有效性徽章（列表元标签 + 详情元数据行共用） */
.validity-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}
.validity-tag.validity-valid {
    color: #15803d;
    background: #dcfce7;
}
.validity-tag.validity-repealed {
    color: #b91c1c;
    background: #fee2e2;
}
/* 深色模式适配 */
body.dark .validity-tag.validity-valid { color: #4ade80; background: rgba(34, 197, 94, .15); }
body.dark .validity-tag.validity-repealed { color: #f87171; background: rgba(239, 68, 68, .15); }

/* 翻页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 24px 0 8px;
    flex-wrap: wrap;
}

.page-btn, .page-num {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.15s;
    min-width: 32px;
    text-align: center;
    display: inline-block;
}

.page-btn:hover, .page-num:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e40af;
}

.page-btn.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    background: #f8fafc;
}

.page-btn.disabled:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #cbd5e1;
}

.page-num.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

.page-num.active:hover {
    background: #2563eb;
    color: #fff;
}

.page-ellipsis {
    color: #94a3b8;
    padding: 0 4px;
    font-size: 13px;
}

/* 跳转输入框 */
.page-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    color: #64748b;
    font-size: 13px;
}

.page-input {
    width: 56px;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
}

.page-input:focus {
    border-color: #3b82f6;
}

.page-input::-webkit-outer-spin-button,
.page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-input[type=number] {
    -moz-appearance: textfield;
}

.page-go {
    padding: 5px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.page-go:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.empty {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* 详情元数据栏 */
.detail-meta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 24px;
}

.meta-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.meta-row .meta-label {
    flex-shrink: 0;
    color: #64748b;
}

.meta-row .meta-value {
    color: #0f172a;
    word-break: break-all;
}

.meta-row a.meta-value { color: inherit; text-decoration: none; }
.meta-row a.meta-value:hover { text-decoration: none; }

.meta-empty { color: #94a3b8; font-style: italic; }

/* ============================================
   响应式：≤768px 手机/平板 - 侧边栏抽屉化
   ============================================ */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        display: none;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        display: block;
    }

    .main {
        max-width: 100%;
        padding: 56px 16px 24px;
    }

    /* 搜索栏：标签独占一行，input 独占一行，两个按钮平分一行 */
    .search-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .search-label {
        font-size: 16px;
        width: 100%;
    }

    .search-input {
        width: 100%;
        flex: 1 1 100%;
    }

    .search-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 13px;
    }

    /* 主头部：返回按钮独占一行 */
    .main-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-header h2 {
        font-size: 18px;
    }

    /* 首页欢迎区：缩小 padding 和字号 */
    .welcome {
        padding: 34px 16px 30px;
    }

    .welcome h3 {
        font-size: 24px;
        letter-spacing: 0;
        margin-bottom: 22px;
    }

    .welcome h3 .slogan-brand { font-size: 25px; letter-spacing: 4px; margin-right: -3px; }
    .welcome h3 .slogan-sep { font-size: 20px; margin: 0 6px; }
    .welcome h3 .slogan-bold { font-size: 27px; letter-spacing: 2px; margin-right: -2px; }

    .welcome h3::after {
        width: 40px;
        height: 3px;
        margin-top: 14px;
    }

    .welcome p {
        font-size: 15px;
        line-height: 1.8;
    }
}

/* ============================================
   响应式：≤480px 小屏手机 - 进一步紧凑
   ============================================ */
@media (max-width: 480px) {
    .main {
        padding: 56px 12px 20px;
    }

    .search-bar {
        padding: 8px 10px;
        gap: 6px;
    }

    .search-label {
        font-size: 14px;
    }

    .search-btn {
        font-size: 12px;
        padding: 8px 8px;
    }

    .main-header h2 {
        font-size: 17px;
    }

    .welcome h3 {
        font-size: 20px;
    }

    .welcome p {
        font-size: 14px;
    }
}

.tag {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 2px;
}

/* 详情页底部翻页 */
.detail-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 0 8px;
    margin-top: 24px;
    border-top: 1px solid #e2e8f0;
    gap: 16px;
}

.detail-nav a {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-nav a:hover { text-decoration: underline; }
.detail-nav .next { text-align: right; }

.markdown-body { font-size: 14px; line-height: 1.8; color: #1f2937; }

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin: 20px 0 12px;
    color: #0f172a;
    font-weight: 600;
}

.markdown-body h1 { font-size: 22px; }
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 16px; }

.markdown-body p { margin: 10px 0; }

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}

.markdown-body th, .markdown-body td {
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    text-align: left;
}

.markdown-body th { background: #f1f5f9; font-weight: 600; }

.markdown-body ul, .markdown-body ol { padding-left: 24px; margin: 10px 0; }

.markdown-body a { color: #2563eb; }
.markdown-body code {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.markdown-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
}

.markdown-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.markdown-body img { max-width: 100%; }

/* ====== 翻译提示条（英文模式详情页） ====== */
.translate-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 13px;
    color: #1e40af;
}

.translate-banner.translate-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.translate-banner.translate-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.translate-spin {
    width: 12px;
    height: 12px;
    border: 2px solid #93c5fd;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: translate-rotate 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes translate-rotate {
    to { transform: rotate(360deg); }
}

/* ===== 听音训练（增值税听音填空） ===== */
.listen-tip {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 14px;
}

.listen-random-btn {
    display: inline-block;
    background: #38bdf8;
    color: #04263a;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.15s, transform 0.1s;
}
.listen-random-btn:hover { background: #0ea5e9; }
.listen-random-btn:active { transform: scale(0.97); }

.listen-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    position: sticky;
    top: 8px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.listen-play-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.listen-play-btn:hover { background: #15803d; }
.listen-play-btn:active { transform: scale(0.97); }

.listen-progress { font-weight: 700; color: #334155; }
.listen-progress.all-done { color: #16a34a; }

/* "自动下一题"勾选（播放按钮旁） */
.listen-auto-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.listen-auto-label input {
    width: 15px;
    height: 15px;
    accent-color: #16a34a;
    cursor: pointer;
}

/* 页脚备案信息（恒显中文，不参与语言切换） */
.beian-footer {
    margin-top: 28px;
    padding: 14px 0 2px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}
.beian-footer a {
    color: #94a3b8;
    text-decoration: none;
}
.beian-footer a:hover {
    color: #475569;
    text-decoration: underline;
}
.beian-sep {
    margin: 0 10px;
    color: #cbd5e1;
}
.beian-gongan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.beian-gongan img {
    vertical-align: -2px;
}

.listen-change-btn {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.listen-change-btn:hover { background: #e2e8f0; }

.listen-show-btn {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.listen-show-btn:hover { background: #fef3c7; }

.listen-instruction {
    color: #64748b;
    font-size: 13px;
    margin: 10px 2px 14px;
}

.listen-banner {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    margin: 12px 0;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

/* 全对庆祝特效：随机大拇指 / 撒花（覆盖全屏、不挡输入） */
.listen-celebrate {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}
.listen-celebrate.hidden { display: none; }
.celebrate-emoji {
    position: absolute;
    left: 50%;
    top: 42%;
    font-size: 110px;
    animation: celebrate-pop 1.7s ease-out forwards;
}
@keyframes celebrate-pop {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-25deg); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.25) rotate(8deg); opacity: 1; }
    45% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
    60% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.12) rotate(0deg); opacity: 0; }
}
.celebrate-piece {
    position: absolute;
    top: -20px;
    display: block;
    width: 10px;
    height: 16px;
    border-radius: 2px;
    animation: celebrate-fall 1.8s linear forwards;
}
@keyframes celebrate-fall {
    0% { transform: translate(0, -30px) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx, 0px), 105vh) rotate(720deg); opacity: 0.85; }
}

.listen-doc {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    line-height: 2.1;
    font-size: 15px;
    color: #1e293b;
    word-break: break-word;
}
.listen-clause-tag {
    display: inline-block;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 14px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}
.listen-para { margin: 0 0 14px; }

.listen-blank {
    border: none;
    border-bottom: 2px dashed #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 4px 4px 0 0;
    padding: 1px 6px;
    margin: 0 2px;
    font: inherit;
    color: #1d4ed8;
    text-align: center;
    outline: none;
    transition: background 0.15s, border-color 0.15s;
}
.listen-blank:focus {
    border-bottom-color: #2563eb;
    background: rgba(37, 99, 235, 0.14);
}
.listen-blank.correct {
    border-bottom: 2px solid #16a34a;
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    font-weight: 700;
}
.listen-blank.revealed {
    border-bottom: 2px solid #d97706;
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    font-weight: 600;
}
.listen-blank.wrong {
    border-bottom-color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    animation: listen-shake 0.35s;
}

@keyframes listen-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.listen-toast {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translate(-50%, -10px);
    background: #16a34a;
    color: #fff;
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s, transform 0.22s;
    z-index: 1200;
}
.listen-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
