/* ============================================================
   editorial.css — 首页排版层
   目标：用刊物式标题、编号与细分隔线替代圆角卡片 + 阴影，
   让界面更像人工编排的学习手册，而不是通用仪表盘模板。
   只覆盖页面骨架与首页索引区，不改动功能面板内部结构。
   ============================================================ */

:root {
    --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
    /* 默认主题：冷灰纸 + 墨蓝，和护眼纸色（暖米 + 赭石）明确分开 */
    --ed-accent: #1d4e89;
    --ed-accent-soft: rgba(29, 78, 137, 0.1);
    --ed-rule: rgba(20, 33, 51, 0.14);
    --ed-rule-strong: rgba(20, 33, 51, 0.4);

    --bg-primary: #f2f5f9;
    --bg-secondary: #e7ecf3;
    --bg-card: #ffffff;
    --text-primary: #111c2b;
    --text-secondary: #46566b;
    --text-light: #7d8ca0;
    --border-light: #d9e1ea;
    --border-medium: #bcc8d7;
    --card-shadow: 0 1px 2px rgba(16, 28, 45, 0.05), 0 10px 26px rgba(16, 28, 45, 0.07);
}

[data-theme="dark"] {
    --ed-accent: #7cb7ff;
    --ed-accent-soft: rgba(124, 183, 255, 0.14);
    --ed-rule: rgba(226, 236, 248, 0.14);
    --ed-rule-strong: rgba(226, 236, 248, 0.34);

    --bg-primary: #0b121c;
    --bg-secondary: #121b28;
    --bg-card: #16212f;
    --text-primary: #e8eef7;
    --text-secondary: #a4b3c6;
    --text-light: #7b8b9f;
    --border-light: #26313f;
    --border-medium: #38465a;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 34px rgba(0, 0, 0, 0.4);
}

html {
    background: var(--bg-primary);
}

body {
    background: var(--bg-primary);
}

/* theme-dark.css 里的 [data-theme="dark"] body 是固定冷灰蓝，
   会盖住主题令牌（护眼纸色深色尤其明显），这里按同一特异性收回。 */
[data-theme="dark"] body {
    background: var(--bg-primary);
}

/* ---------- 报头 ---------- */

.main-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    text-align: left;
    padding: 38px 0 20px;
    margin-bottom: 0;
    background: transparent;
    border: 0;
    border-bottom: 3px double var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.main-header::before {
    display: none;
}

.masthead-mark {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: var(--ed-accent);
    border: 1px solid var(--ed-accent);
    transform: rotate(-3deg);
}

.masthead-mark .hspcb-i {
    width: 26px;
    height: 26px;
}

.masthead-kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-accent);
    margin: 0 0 16px;
}

.main-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.3rem, 4.5vw, 4rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: 0.01em;
    margin: 0;
    color: var(--text-primary);
}

.main-header h1 span {
    color: var(--text-secondary);
}

.masthead-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}

.masthead-meta span + span::before {
    content: "／";
    margin: 0 10px;
    color: var(--ed-rule-strong);
}

/* ---------- 导航：文字索引，不做胶囊 ---------- */

.subject-nav {
    justify-content: flex-start;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    padding: 0;
    margin-bottom: 0;
    background: var(--bg-primary);
    border: 0;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    z-index: var(--z-sticky);
}

.subject-nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 8px;
    min-width: 0;
    padding: 14px 16px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
}

.nav-btn:hover {
    background: transparent;
    transform: none;
}

.nav-btn:active {
    transform: none;
}

.nav-btn.active,
.nav-btn-exam.active,
.nav-btn-platform.active,
.nav-btn-chinese.active,
.nav-btn-math.active,
.nav-btn-english.active {
    background: transparent;
    color: var(--ed-accent);
    box-shadow: none;
    border-bottom-color: var(--ed-accent);
}

.nav-btn .icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    margin: 0;
    font-size: 14px;
    line-height: 1;
    color: var(--text-secondary);
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
}

.nav-btn .icon .hspcb-i {
    width: 14px;
    height: 14px;
}

.nav-btn.active .icon {
    color: var(--ed-accent);
    border-color: var(--ed-accent);
}

.nav-btn .label,
.nav-btn.active .label {
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.nav-btn.active .label {
    color: var(--ed-accent);
}

/* ---------- 页面主体不再套大卡片 ---------- */

main {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-height: 600px;
}

#home-section {
    padding-top: 0;
}

/* ---------- 首屏：不对称双栏 ---------- */

.welcome-card {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(230px, 0.8fr);
    gap: clamp(28px, 6vw, 88px);
    align-items: start;
    padding: clamp(34px, 5vw, 66px) 0 clamp(28px, 4vw, 48px);
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.welcome-card::after {
    display: none;
}

main .section .welcome-card .eyebrow {
    margin: 0 0 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-accent);
}

main .section .welcome-card h2 {
    margin: 0 0 22px;
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 4.6vw, 4.1rem);
    font-weight: 600;
    line-height: 1.14;
    color: var(--text-primary);
}

.welcome-card h2 em {
    font-style: normal;
    color: var(--ed-accent);
    border-bottom: 3px solid var(--ed-accent);
}

main .section .welcome-card .welcome-deck {
    max-width: 36em;
    margin: 0;
    font-size: 16px;
    line-height: 1.95;
    color: var(--text-secondary);
}

/* 数据栏：像刊物页脚的统计表 */
.welcome-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--ed-rule-strong);
    border-left: 1px solid var(--ed-rule);
}

.stat {
    padding: 18px 16px 16px;
    border-right: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule);
}

.stat-num {
    display: block;
    font-family: Georgia, "Times New Roman", var(--font-serif);
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    display: block;
    margin-top: 9px;
    font-size: 12px;
    line-height: 1.55;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

main .section .welcome-card .margin-note {
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--ed-rule);
    font-family: var(--font-serif);
    font-size: 13px;
    line-height: 2;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

/* 特色清单改为带编号的索引行 */
.feature-list {
    counter-reset: feat;
    margin: 30px 0 0;
    border-top: 1px solid var(--ed-rule-strong);
}

main .section .feature-list li {
    counter-increment: feat;
    position: relative;
    display: block;
    padding: 14px 0 14px 2.6rem;
    margin: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "0" counter(feat);
    position: absolute;
    left: 0;
    top: 17px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ed-accent);
}

.feature-list li:hover {
    background: transparent;
    border-left: 0;
    transform: none;
}

.feature-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 按钮改为文字链接 + 一个实心主按钮 */
.welcome-card .hero-cta {
    margin-top: 24px;
    gap: 0;
    align-items: center;
}

.welcome-card .hero-btn {
    margin-right: 28px;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--text-primary);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: 0.04em;
    box-shadow: none;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.welcome-card .hero-btn:hover {
    transform: none;
    box-shadow: none;
    color: var(--ed-accent);
    border-bottom-color: var(--ed-accent);
}

.welcome-card .hero-btn-primary {
    padding: 12px 24px;
    margin-right: 28px;
    background: var(--ed-accent);
    border: 1px solid var(--ed-accent);
    color: #fff;
    border-radius: 0;
}

.welcome-card .hero-btn-primary:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* ---------- 三个高频入口：刊头下方的目录条 ---------- */

.primary-entries {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 clamp(36px, 5vw, 56px);
    border-top: 1px solid var(--ed-rule-strong);
    border-bottom: 1px solid var(--ed-rule-strong);
}

.primary-entry {
    position: relative;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 24px 22px 2px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
}

.primary-entry:last-child {
    border-right: 0;
}

.primary-entry:hover {
    background: transparent;
    border-color: var(--ed-rule);
    transform: none;
    box-shadow: none;
}

.primary-entry:hover .pe-title {
    color: var(--ed-accent);
}

.primary-entry:hover::after {
    color: var(--ed-accent);
}

.primary-entry::after {
    content: "↗";
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 12px;
    line-height: 1;
    color: var(--text-light);
}

.primary-entry .pe-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: var(--ed-accent);
    border: 1px solid var(--ed-rule-strong);
}

.primary-entry .pe-title {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.primary-entry .pe-desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

/* ---------- 区块标题 ---------- */

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 0;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--ed-rule-strong);
}

.section-heading h3 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.heading-note {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: 0.14em;
    color: var(--text-light);
    white-space: nowrap;
}

/* ---------- 六科索引：表格化，而不是六张彩色卡 ---------- */

.subject-cards {
    counter-reset: subj;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-bottom: clamp(36px, 5vw, 56px);
    border-left: 1px solid var(--ed-rule);
    border-top: 1px solid var(--ed-rule);
}

.subject-card,
.subject-card.physics,
.subject-card.chemistry,
.subject-card.biology,
.subject-card.chinese,
.subject-card.math,
.subject-card.english {
    counter-increment: subj;
    padding: 22px 24px 26px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.subject-card::before {
    content: "0" counter(subj);
    display: block;
    margin-bottom: 11px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.1em;
    color: var(--ed-accent);
}

.subject-card:hover,
.subject-card.physics:hover,
.subject-card.chemistry:hover,
.subject-card.biology:hover,
.subject-card.chinese:hover,
.subject-card.math:hover,
.subject-card.english:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.subject-card:hover h4 {
    color: var(--ed-accent);
}

.subject-card h4,
.subject-card.physics h4,
.subject-card.chemistry h4,
.subject-card.biology h4,
.subject-card.chinese h4,
.subject-card.math h4,
.subject-card.english h4 {
    margin: 0 0 9px;
    padding-bottom: 11px;
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    border-bottom: 1px solid var(--ed-rule);
}

.subject-card ul {
    margin: 0;
    padding: 0;
}

.subject-card ul li {
    padding: 0;
    border-bottom: 1px dotted var(--ed-rule);
}

.subject-card ul li:last-child {
    border-bottom: 0;
}

.subject-card ul li a {
    display: block;
    padding: 10px 0;
    background: transparent;
    border-radius: 0;
    font-size: 15px;
    line-height: 1.8;
    font-weight: 400;
    color: var(--text-secondary);
}

.subject-card ul li a:hover {
    background: transparent;
    color: var(--ed-accent);
}

/* ---------- 工具索引：目录式网格 ---------- */

.quick-access,
.tools-section {
    margin-top: clamp(32px, 4vw, 48px);
}

.quick-access h3,
.tools-section h3 {
    margin: 0;
    padding: 0 0 13px;
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    border-bottom: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    gap: 10px;
}

.quick-access h3::before,
.tools-section h3::before {
    content: "§";
    margin: 0;
    font-family: var(--font-serif);
    font-size: 16px;
    color: var(--ed-accent);
    transform: none;
}

.quick-access h3::after,
.tools-section h3::after {
    display: none;
}

.quick-access h3 .heading-note,
.tools-section h3 .heading-note {
    margin-left: auto;
}

.quick-access .tool-grid,
.tools-section .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-left: 1px solid var(--ed-rule);
    border-top: 1px solid var(--ed-rule);
}

.quick-access .tool-card,
.tools-section .tool-card {
    min-height: 150px;
    padding: 18px 18px 20px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    z-index: auto;
}

.quick-access .tool-card:hover,
.tools-section .tool-card:hover {
    background: transparent;
    border-color: var(--ed-rule);
    box-shadow: none;
    transform: none;
    z-index: auto;
}

.quick-access .tool-card:hover h4,
.tools-section .tool-card:hover h4 {
    color: var(--ed-accent);
}

.quick-access .tool-card:hover .tool-icon,
.tools-section .tool-card:hover .tool-icon {
    color: var(--ed-accent);
    border-color: var(--ed-accent);
}

.quick-access .tool-card::after,
.tools-section .tool-card::after {
    display: none;
}

.quick-access .tool-icon,
.tools-section .tool-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1;
    color: var(--ed-accent);
    border: 1px solid var(--ed-rule-strong);
}

.quick-access .tool-icon .hspcb-i,
.tools-section .tool-icon .hspcb-i {
    width: 14px;
    height: 14px;
}

.quick-access .tool-card h4,
.tools-section .tool-card h4 {
    margin: 0 0 5px;
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-access .tool-card p,
.tools-section .tool-card p {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.quick-access .tool-tag,
.tools-section .tool-tag {
    padding: 0;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--text-light) !important;
}

/* 键盘焦点保持清晰 */
.nav-btn:focus-visible,
.primary-entry:focus-visible,
.subject-card a:focus-visible,
.hero-btn:focus-visible,
.tool-card:focus-visible,
.tool-collapse-toggle:focus-visible {
    outline: 2px solid var(--ed-accent);
    outline-offset: 2px;
}

/* 全部工具开关：文字索引，不用胶囊按钮 */
.tool-collapse-toggle {
    display: block;
    margin: 0 0 14px auto;
    padding: 0 0 5px;
    border: 0;
    border-bottom: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: 0.12em;
    cursor: pointer;
}

.tool-collapse-toggle:hover {
    color: var(--ed-accent);
    border-bottom-color: var(--ed-accent);
}

/* 页脚：与报头呼应的双线收尾 */
.main-footer {
    margin-top: clamp(40px, 6vw, 72px);
    padding: 24px 0 12px;
    background: transparent;
    border-top: 3px double var(--ed-rule-strong);
    text-align: left;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.8;
    letter-spacing: 0.04em;
}

.main-footer p {
    margin: 0 0 7px;
}

.main-footer a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--ed-accent);
}

.main-footer a:hover {
    color: var(--ed-accent);
}

/* ---------- 响应式 ---------- */

/* 标题内的线性图标（替代彩色 emoji） */
.hspcb-i-inline {
    display: inline-flex;
    width: 1em;
    height: 1em;
    margin-right: 7px;
    vertical-align: -0.1em;
}

.hspcb-i-inline svg {
    width: 100%;
    height: 100%;
}

.module-tab .hspcb-i-inline {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

.knowledge-section h3 .hspcb-i-inline {
    width: 18px;
    height: 18px;
}

/* 学科内容区去掉整块浅色面板，内容直接落在纸面上 */
.module-content {
    padding: 8px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    min-height: 0;
    box-shadow: none;
}

/* 学科页：模块切换沿用首页的细线索引，不再用胶囊/色块 */
.module-tabs {
    gap: 0;
    padding: 0;
    margin-bottom: 24px;
    background: transparent;
    border-bottom: 1px solid var(--ed-rule-strong);
    border-radius: 0;
}

.module-tab {
    padding: 11px 16px;
    background: transparent;
    border: 0;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.module-tab:hover {
    background: transparent;
    color: var(--ed-accent);
}

.module-tab.active {
    background: transparent !important;
    color: var(--ed-accent) !important;
    border-bottom-color: var(--ed-accent);
    box-shadow: none;
}

/* 知识点：从彩色卡片改为纸面条目 */
.knowledge-section h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ed-rule-strong);
}

.knowledge-section h3::after {
    display: none;
}

.knowledge-card {
    background: transparent;
    padding: 20px 0;
    margin-bottom: 0;
    border: 0;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
}

.knowledge-card:hover {
    box-shadow: none;
    transform: none;
}

.knowledge-card h4 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    margin: 0 0 10px;
}

.key-point {
    padding: 8px 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px dotted var(--ed-rule);
    border-radius: 0;
    font-size: 15px;
    line-height: 1.8;
}

.key-point:last-child {
    border-bottom: 0;
}

.common-mistake {
    margin-top: 8px;
    padding: 9px 12px;
    background: transparent;
    border: 0;
    border-left: 2px solid var(--danger);
    border-radius: 0;
    font-size: 15px;
    line-height: 1.75;
}

/* 高频入口主按钮也改为描边款 */
.welcome-card .hero-btn-primary {
    background: transparent;
    border: 1px solid var(--ed-accent);
    color: var(--ed-accent);
}

.welcome-card .hero-btn-primary:hover {
    background: var(--ed-accent);
    color: #fff;
}

/* ============================================================
   全站统一层：把首页的纸质刊物语言推进到所有 section
   只统一形状、字阶和按钮质感，不改各工具内部布局。

   统一字阶（正文层）：11 角标 / 12 元信息 / 13 次级说明 /
   15 正文 / 16 导语与卡片标题 / 18 主入口标题 / 22 区块标题。
   显示型数字与大标题（38/48、clamp 首屏）单独成阶，不纳入正文。
   ============================================================ */

:root,
[data-theme="dark"] {
    --radius-xs: 0px;
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
    --radius-xl: 0px;
    --radius-full: 0px;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-card: none;
    --shadow-glow-primary: none;
}

/* 标题层级：统一宋体标题与字重，正文统一为 15px / 1.85 */
main .section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.55rem, 2.1vw, 1.95rem);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.02em;
}

main .section h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

main .section h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
}

main .section p,
main .section li {
    font-size: 15px;
    line-height: 1.85;
}

/* 按钮：去掉胶囊、渐变、投影和厚重底色，保留状态色 */
main button {
    border-radius: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
    font-family: inherit;
}

main .section button:not([data-style]):not(.primary-entry):not(.tool-card):not(.hero-btn):not(.nav-btn):not(.module-tab),
main .section .btn {
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

main .section button:not([data-style]):not(.primary-entry):not(.tool-card):not(.hero-btn):not(.nav-btn):not(.module-tab):hover,
main .section .btn:hover {
    background: transparent;
    border-color: var(--ed-accent);
    color: var(--ed-accent);
}

main .section .btn-primary,
main .section .btn-danger {
    background: transparent;
    border-color: var(--ed-accent);
    color: var(--ed-accent);
}

main .section button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 表单控件与按钮共用同一套直角、字阶 */
main input,
main select,
main textarea {
    border-radius: 0 !important;
    font-family: inherit;
    font-size: 15px;
}

main input[type="checkbox"],
main input[type="radio"] {
    border-radius: 0 !important;
}

/* 常见卡片统一去圆角/去阴影，保留底色区分 */
main .knowledge-card,
main .card,
main .panel,
main .info-card,
main .stat-card,
main .quiz-card,
main .exam-card {
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 640px) {
    main .section h2 {
        font-size: 1.5rem;
    }

    main .section h3 {
        font-size: 1.2rem;
    }

    main .section p,
    main .section li {
        font-size: 15px;
    }
}



/* ============================================================
   备考中心：同样改成纸面仪表盘，去掉紫色渐变和彩色徽章
   ============================================================ */

.practice-area {
    padding: 0;
    border: 0;
}

.exam-dashboard,
.practice-area,
.stats-panel {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.exam-header {
    text-align: left;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ed-rule-strong);
}

.exam-header h2 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.exam-header h2 .hspcb-i-inline {
    width: 22px;
    height: 22px;
    margin-right: 2px;
}

.exam-header .exam-subtitle {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.year-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 8px;
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    color: var(--ed-accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    vertical-align: 2px;
}

.dashboard-grid {
    gap: 36px;
    align-items: start;
}

.stats-panel {
    padding: 0 28px 0 0;
    border: 0;
    border-right: 1px solid var(--ed-rule);
}

.overall-score {
    padding: 0 0 20px;
    margin-bottom: 20px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
}

.overall-score h3 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
}

.score-circle {
    width: 118px;
    height: 118px;
    margin: 16px auto;
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 50%;
    box-shadow: none;
}

.score-number {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 38px;
    line-height: 1;
    color: var(--ed-accent);
}

.score-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

.level-badge {
    display: inline-block;
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    color: var(--ed-accent);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.level-desc {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.subject-scores h4,
.subject-scores h3 {
    margin: 0 0 10px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
}

.subject-score-item {
    padding: 9px 0;
    border-bottom: 1px dotted var(--ed-rule);
}

.subj-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: var(--ed-accent);
}

.subj-icon .hspcb-i-inline {
    width: 16px;
    height: 16px;
    margin: 0;
}

.score-bar-container {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

/* 轨道 + 填充两层：0% 时轨道仍在，但不会出现红色满条 */
.score-track {
    flex: 1;
    min-width: 0;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.score-bar {
    flex: 0 0 auto;
    height: 100%;
    min-width: 0;
    background: var(--ed-accent);
    border-radius: 999px;
}

.score-text {
    min-width: 36px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.quick-stats {
    padding: 14px 0 0;
    border-top: 1px solid var(--ed-rule);
    background: transparent;
}

.qs-num {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    line-height: 1.1;
    color: var(--text-primary);
}

.qs-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.btn-reset-stats {
    width: 100%;
    margin-top: 16px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.btn-reset-stats:hover {
    background: transparent;
    border-color: var(--ed-accent);
    color: var(--ed-accent);
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.filter-bar select {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 14px;
}

.btn-random-exam {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--ed-accent);
    border-radius: 0;
    box-shadow: none;
    color: var(--ed-accent);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-random-exam:hover {
    background: var(--ed-accent);
    color: #fff;
}

.exam-item {
    padding: 16px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
}

.exam-item:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.exam-subject-tag {
    padding: 2px 7px;
    background: transparent !important;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    color: var(--ed-accent) !important;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.exam-year,
.exam-type,
.exam-points {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.exam-question-preview {
    margin: 8px 0 10px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.btn-start-exam {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.btn-start-exam:hover {
    background: transparent;
    border-color: var(--ed-accent);
    color: var(--ed-accent);
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-panel {
        padding: 0 0 20px;
        border-right: 0;
        border-bottom: 1px solid var(--ed-rule);
    }

    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1100px) {
    .quick-access .tool-grid,
    .tools-section .tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .main-header {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 28px;
    }

    .masthead-mark {
        grid-column: 1;
        grid-row: auto;
        width: 44px;
        height: 44px;
        margin-top: 18px;
    }

    .masthead-mark .hspcb-i {
        width: 20px;
        height: 20px;
    }

    .welcome-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
    }

    .welcome-copy,
    .welcome-deck,
    .feature-list,
    .feature-list li,
    .welcome-stats {
        min-width: 0;
        max-width: 100%;
    }

    .feature-list li {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .welcome-stats {
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .subject-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-access .tool-grid,
    .tools-section .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .primary-entry {
        padding: 16px 16px 18px 2px;
    }
}

@media (max-width: 640px) {
    .container {
        max-width: 100%;
        padding: 14px;
    }

    .main-header h1 {
        font-size: clamp(1.9rem, 9vw, 2.6rem);
    }

    .welcome-stats {
        grid-template-columns: 1fr 1fr;
    }

    .subject-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .primary-entries {
        grid-template-columns: minmax(0, 1fr);
    }

    .primary-entry {
        border-right: 0;
        border-bottom: 1px solid var(--ed-rule);
    }

    .primary-entry:last-child {
        border-bottom: 0;
    }

    .quick-access .tool-grid,
    .tools-section .tool-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .quick-access .tool-card,
    .tools-section .tool-card {
        min-height: 0;
    }

    .subject-nav {
        position: static;
        flex-wrap: wrap;
        overflow: visible;
    }

    .nav-btn {
        padding: 10px 10px 8px;
    }
}

/* ============================================================
   移动端收口（v1.9.1）
   ============================================================ */

@media (max-width: 768px) {
    .subject-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        position: sticky;
        top: 0;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 11px 12px 9px;
        font-size: 13px;
    }

    .nav-btn .label {
        display: inline !important;
    }

    .nav-btn .icon {
        display: none !important;
    }

    .quick-access .tool-grid,
    .tools-section .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .module-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .module-tab {
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .main-header {
        padding-top: 20px;
    }

    .main-header h1 {
        font-size: 1.9rem;
        line-height: 1.15;
    }

    .masthead-kicker {
        margin-bottom: 8px;
        font-size: 11px;
    }

    .masthead-meta {
        margin-top: 12px;
        font-size: 12px;
    }

    .masthead-mark {
        display: none;
    }

    /* 子页面压缩报头，把首屏让给内容 */
    body:not([data-view="home"]) .main-header {
        padding: 14px 0 10px;
        border-bottom: 1px solid var(--ed-rule);
    }

    body:not([data-view="home"]) .masthead-kicker,
    body:not([data-view="home"]) .masthead-meta {
        display: none;
    }

    body:not([data-view="home"]) .main-header h1 {
        margin: 0;
        font-size: 1.4rem;
    }

    .welcome-card {
        gap: 26px;
        padding: 26px 0 20px;
    }

    main .section .welcome-card h2 {
        margin-bottom: 14px;
        font-size: clamp(1.75rem, 8.5vw, 2.3rem);
        line-height: 1.18;
    }

    main .section .welcome-card .welcome-deck {
        font-size: 16px;
        line-height: 1.85;
    }

    .feature-list {
        margin-top: 22px;
    }

    main .section .feature-list li {
        padding: 12px 0 12px 2.2rem;
        font-size: 15px;
        line-height: 1.75;
    }

    .feature-list li::before {
        top: 14px;
        font-size: 11px;
    }

    .stat {
        padding: 14px 12px;
    }

    .stat-num {
        font-size: 2rem;
    }

    .primary-entry {
        padding: 14px 14px 16px 2px;
    }

    .quick-access .tool-card,
    .tools-section .tool-card {
        min-height: 0;
        padding: 13px 11px;
    }

    .quick-access .tool-card h4,
    .tools-section .tool-card h4 {
        font-size: 15px;
        line-height: 1.4;
    }

    .quick-access .tool-card p,
    .tools-section .tool-card p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.5;
    }

    main {
        padding-bottom: 64px;
    }

    main .section p,
    main .section li {
        font-size: 15px;
        overflow-wrap: break-word;
    }

    main .section h2 {
        font-size: 1.4rem;
    }

    main .section h3 {
        font-size: 1.15rem;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px;
    }

    .hspcb-modal-mask {
        align-items: flex-end;
        padding: 0;
    }

    .hspcb-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 0;
    }
}

@media (max-width: 360px) {
    .quick-access .tool-grid,
    .tools-section .tool-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* ============================================================
   语数外对齐层
   数学 / 英语：去掉彩色知识面板，回到透明纸面；
   语文：把独立蓝色卡片主题并入全站纸面语言，并修掉移动端目录全展开。
   ============================================================ */

#math-section .knowledge-panel,
#english-section .knowledge-panel {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

#math-section .knowledge-panel h2,
#english-section .knowledge-panel h2 {
    margin: 0 0 10px;
    padding-bottom: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--ed-rule-strong);
}

/* ---- 语文 ---- */

#chinese-section .chinese-knowledge {
    background: transparent;
    color: var(--text-secondary);
}

#chinese-section .chinese-knowledge .header {
    padding: 0 0 16px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    border-bottom: 1px solid var(--ed-rule-strong);
    border-radius: 0;
}

#chinese-section .chinese-knowledge .header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

#chinese-section .chinese-knowledge .header .subtitle {
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

#chinese-section .chinese-knowledge .search-box {
    margin: 16px 0 0;
    max-width: 420px;
}

#chinese-section .chinese-knowledge .search-box input {
    padding: 10px 14px;
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
}

#chinese-section .chinese-knowledge .search-box input:focus {
    border-color: var(--ed-accent);
    box-shadow: none;
}

/* 目录：细线索引，去掉蓝色块与装饰 emoji */
#chinese-section .chinese-knowledge .sidebar {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--ed-rule-strong);
    border-radius: 0;
}

#chinese-section .chinese-knowledge .sidebar-header {
    padding: 12px 0;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    border-radius: 0;
}

#chinese-section .chinese-knowledge .nav-item {
    border-bottom: 1px solid var(--ed-rule);
}

#chinese-section .chinese-knowledge .nav-item-title {
    padding: 10px 0;
    color: var(--text-primary);
    font-size: 13px;
}

#chinese-section .chinese-knowledge .nav-item-title:hover,
#chinese-section .chinese-knowledge .nav-item-title.active {
    background: transparent;
    color: var(--ed-accent);
}

#chinese-section .chinese-knowledge .nav-item-title > span:not(.arrow) {
    display: none;
}

#chinese-section .chinese-knowledge .nav-item-title .arrow {
    color: var(--text-light);
}

#chinese-section .chinese-knowledge .nav-children {
    background: transparent;
}

#chinese-section .chinese-knowledge .nav-children a {
    padding: 6px 0 6px 14px;
    color: var(--text-secondary);
    font-size: 13px;
    border-left: 1px solid var(--ed-rule);
}

#chinese-section .chinese-knowledge .nav-children a:hover {
    background: transparent;
    color: var(--ed-accent);
    border-left-color: var(--ed-accent);
}

/* 正文模块：蓝条标题改纸面条目 */
#chinese-section .chinese-knowledge .module {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    overflow: visible;
}

#chinese-section .chinese-knowledge .module-header {
    padding: 16px 0 10px;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--ed-rule);
}

#chinese-section .chinese-knowledge .module-body {
    padding: 8px 0 0;
}

#chinese-section .chinese-knowledge .section {
    padding: 14px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    margin-bottom: 0;
}

#chinese-section .chinese-knowledge .section-title {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 1rem;
}

#chinese-section .chinese-knowledge .subsection-title {
    color: var(--ed-accent);
}

#chinese-section .chinese-knowledge .info-box,
#chinese-section .chinese-knowledge .template-box {
    background: transparent;
    border-radius: 0;
    border-left: 2px solid var(--ed-accent);
    font-size: 14px;
}

#chinese-section .chinese-knowledge table {
    border: 1px solid var(--ed-rule);
    border-radius: 0;
    font-size: 13px;
}

#chinese-section .chinese-knowledge th {
    background: transparent;
    color: var(--text-primary);
    border-bottom: 1px solid var(--ed-rule-strong);
}

#chinese-section .chinese-knowledge th,
#chinese-section .chinese-knowledge td {
    border: 1px solid var(--ed-rule);
}

#chinese-section .chinese-knowledge tr:nth-child(even),
#chinese-section .chinese-knowledge tr:hover {
    background: transparent;
}

#chinese-section .chinese-knowledge .tag {
    background: transparent;
    color: var(--ed-accent);
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
}

#chinese-section .chinese-knowledge strong {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    #chinese-section .chinese-knowledge .header h1 {
        font-size: 1.35rem;
    }

    #chinese-section .chinese-knowledge .search-box input {
        font-size: 16px;
    }

    #chinese-section .chinese-knowledge .module-header {
        font-size: 1.2rem;
    }

    /* 语文表格列多，窄屏改为横向滚动，避免逐字竖排 */
    #chinese-section .chinese-knowledge .section {
        overflow-x: auto;
    }

    #chinese-section .chinese-knowledge table {
        min-width: 460px;
    }
}

/* ============================================================
   平台结构图：纸面线条，去掉彩色胶囊与投影
   ============================================================ */

main .platform-arch-diagram {
    padding: 6px 0 0;
    text-align: left;
}

main .arch-core,
main .arch-brain {
    display: block;
    padding: 12px 16px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

main .arch-arrow {
    display: block;
    margin: 8px 0;
    color: var(--text-light);
    font-size: 15px;
}

main .arch-wings {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 0;
}

main .arch-wing-left,
main .arch-wing-right {
    flex: 1;
    min-width: 180px;
    padding: 12px 14px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    font-weight: 500;
}

main .arch-wing-left strong,
main .arch-wing-right strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
}

main .arch-wing-left span,
main .arch-wing-right span {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ============================================================
   平台其余页签：把内联绘制的卡片/表头/标签收回纸面，
   数据条（progress bar）保持原样不动。
   ============================================================ */

#platform-section .knowledge-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow) !important;
}

#platform-section .knowledge-section h3,
#platform-section .knowledge-section h4 {
    color: var(--text-primary) !important;
}

#platform-section .knowledge-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px !important;
}

#platform-section .knowledge-card th {
    padding: 8px;
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--ed-rule) !important;
    font-weight: 600;
}

#platform-section .knowledge-card td {
    padding: 8px;
    background: transparent !important;
    border: 1px solid var(--ed-rule) !important;
}

#platform-section .knowledge-card tr {
    background: transparent !important;
}

/* 只在带背景色的 span（彩色标签/徽章）上生效，避免误伤数据条里的文字标签 */
#platform-section .knowledge-card span[style*="background"] {
    padding: 2px 8px !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
    font-size: 13px !important;
}

/* 内联彩色文字（阶段标签、资源计数等）收回主文字色 */
#platform-section .knowledge-card td[style*="color"],
#platform-section .knowledge-card span[style*="color"] {
    color: var(--text-primary) !important;
}

/* 进度条：轨道改纸面细线，填充改单色墨水；宽度仍由脚本控制 */
#platform-section .knowledge-card div[style*="height: 16px"],
#platform-section .knowledge-card div[style*="height:16px"],
#platform-section .knowledge-card div[style*="height: 18px"],
#platform-section .knowledge-card div[style*="height:18px"],
#platform-section .knowledge-card div[style*="height: 8px"],
#platform-section .knowledge-card div[style*="height:8px"] {
    background: transparent !important;
    border: 1px solid var(--ed-rule) !important;
    border-radius: 0 !important;
}

#platform-section .knowledge-card div[style*="height: 100%"],
#platform-section .knowledge-card div[style*="height:100%"] {
    background: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    border-radius: 0 !important;
}

/* ============================================================
   桌面版留白与卡片质感
   说明：正文仍是纸面，但内容块恢复「面 + 边 + 圆角 + 轻投影」，
   让 PC 宽屏下不再是一整片没有边距的纯文字。
   ============================================================ */
@media (min-width: 769px) {
    .container {
        max-width: 1280px;
        padding-left: 40px;
        padding-right: 40px;
        padding-top: 32px;
        padding-bottom: 56px;
    }
}

.welcome-card,
.knowledge-card,
.tool-card,
.primary-entry {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.welcome-card {
    padding: 28px 30px;
}

.knowledge-card {
    padding: 22px 24px;
    margin-bottom: 16px;
}

.knowledge-section h3 + .knowledge-card {
    margin-top: 14px;
}

.tool-card {
    padding: 18px 18px;
}

/* 语文页的 8 个模块也改成卡片，避免长页面全是一整块平铺文字 */
#chinese-section .chinese-knowledge .module {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 20px 22px;
}

@media (max-width: 768px) {
    .welcome-card {
        padding: 20px 16px;
    }

    .knowledge-card {
        padding: 18px 14px;
        border-radius: 10px;
    }

    .tool-card {
        border-radius: 10px;
    }

    #chinese-section .chinese-knowledge .module {
        padding: 16px 14px;
        border-radius: 10px;
    }
}

/* ============================================================
   移动端补充修正
   ============================================================ */
@media (max-width: 640px) {
    /* 通知条改为底部 snackbar，避免压住顶部品牌与标题 */
    .hspcb-notify-root {
        top: auto;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        right: 12px;
        max-width: none;
        align-items: stretch;
    }

    .hspcb-toast {
        max-width: none;
        border-radius: 12px;
    }

    /* 备考中心标题与年份徽章不再互相挤压 */
    .exam-header h2 {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 10px;
        font-size: 1.3rem;
        line-height: 1.4;
    }

    .exam-header .year-badge {
        flex: 0 0 auto;
        margin-left: 0;
        padding: 2px 8px;
        font-size: 12px;
    }

    .exam-header h2 .hspcb-i-inline {
        flex: 0 0 auto;
    }
}

/* ============================================================
   移动端收尾：目录可收起 / 横向滚动提示 / 底部安全间距
   ============================================================ */

/* 桌面不显示切换条 */
#chinese-section .chinese-knowledge .sidebar-toggle {
    display: none;
}

@media (max-width: 1024px) {
    #chinese-section .chinese-knowledge .sidebar-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        margin: 0;
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--ed-rule-strong);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.06em;
        color: var(--text-primary);
        cursor: pointer;
    }

    #chinese-section .chinese-knowledge .sidebar-toggle .chev {
        color: var(--text-light);
        transition: transform 0.2s ease;
    }

    #chinese-section .chinese-knowledge .sidebar.is-open .sidebar-toggle .chev {
        transform: rotate(180deg);
    }

    /* 收起态只留「知识目录」条；展开后再显示分类 */
    #chinese-section .chinese-knowledge .sidebar .sidebar-header,
    #chinese-section .chinese-knowledge .sidebar > .nav-item {
        display: none;
    }

    #chinese-section .chinese-knowledge .sidebar.is-open > .nav-item {
        display: block;
    }
}

@media (max-width: 768px) {
    /* 横向导航 / 页签右侧渐隐，提示还有内容可滑动 */
    .subject-nav,
    .module-tabs {
        -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) calc(100% - 26px), transparent 100%);
        mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) calc(100% - 26px), transparent 100%);
    }
}

@media (max-width: 640px) {
    /* 给右下角悬浮按钮留出安全间距，避免挡住末段正文 */
    .container {
        padding-bottom: 96px;
    }
}

/* ============================================================
   移动端 App 导航：顶部汉堡抽屉（一级）+ 常驻分段页签（二级）
   ============================================================ */
.m-menu-btn,
.m-drawer {
    display: none;
}

@media (max-width: 768px) {
    /* 一级收进抽屉，顶部只留汉堡 */
    .subject-nav {
        display: none !important;
    }

    .main-header {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .main-header .masthead-kicker,
    .main-header .masthead-meta,
    .main-header .masthead-mark {
        display: none;
    }

    .main-header h1 {
        flex: 1;
        margin: 0;
        font-size: 1.2rem;
    }

    .m-menu-btn {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 40px;
        height: 40px;
        padding: 0 10px;
        border: 1px solid var(--border-light);
        border-radius: 10px;
        background: transparent;
        cursor: pointer;
    }

    .m-menu-btn span {
        display: block;
        height: 1.5px;
        background: var(--text-primary);
        border-radius: 2px;
    }

    /* 二级模块：常驻分段页签，可横滑 */
    .module-tabs {
        display: flex !important;
        gap: 4px;
        padding: 4px;
        margin: 10px 0 14px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .module-tabs .module-tab {
        flex: 0 0 auto;
        padding: 8px 14px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        font-family: inherit;
        font-size: 13px;
        white-space: nowrap;
        color: var(--text-secondary);
        cursor: pointer;
    }

    .module-tabs .module-tab.active {
        background: var(--bg-card);
        color: var(--text-primary);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
    }

    /* 左侧抽屉 */
    .m-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 12000;
    }

    .m-drawer[hidden] {
        display: none;
    }

    .m-drawer-mask {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.44);
    }

    .m-drawer-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 82%;
        max-width: 320px;
        overflow-y: auto;
        padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px));
        background: var(--bg-card);
        border-right: 1px solid var(--border-light);
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.24);
        animation: mDrawerIn 0.22s ease;
    }

    .m-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
    }

    .m-drawer-title {
        font-family: var(--font-serif);
        font-size: 1.05rem;
        color: var(--text-primary);
    }

    .m-drawer-close {
        border: 0;
        background: none;
        padding: 4px 6px;
        font-family: inherit;
        font-size: 13px;
        color: var(--text-light);
        cursor: pointer;
    }

    .m-drawer-group-title {
        margin: 14px 0 6px;
        font-size: 12px;
        letter-spacing: 0.08em;
        color: var(--text-light);
    }

    .m-drawer-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .m-drawer-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 11px 10px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        font-family: inherit;
        font-size: 14px;
        text-align: left;
        color: var(--text-primary);
        cursor: pointer;
    }

    .m-drawer-item.active {
        background: var(--bg-secondary);
        font-weight: 600;
    }

    .m-drawer-item .icon {
        display: inline-flex;
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        color: var(--text-secondary);
    }

    .m-drawer-item .icon svg {
        width: 18px;
        height: 18px;
    }

    /* 二级：模块页签 / 语文目录分类（默认收起，同一时间只开一组） */
    .m-drawer-sublist {
        display: none;
        flex-direction: column;
        gap: 1px;
        margin: 2px 0 8px 30px;
        padding-left: 8px;
        border-left: 1px solid var(--ed-rule);
    }

    .m-drawer-sublist.open {
        display: flex;
    }

    .m-drawer-caret {
        margin-left: auto;
        font-size: 10px;
        color: var(--text-light);
        transition: transform 0.2s ease;
    }

    .m-drawer-item.open .m-drawer-caret {
        transform: rotate(180deg);
    }

    .m-drawer-subitem {
        border: 0;
        background: none;
        padding: 7px 8px;
        border-radius: 0 8px 8px 0;
        font-family: inherit;
        font-size: 12.5px;
        text-align: left;
        color: var(--text-secondary);
        cursor: pointer;
    }

    .m-drawer-subitem.active {
        color: var(--ed-accent);
        font-weight: 600;
    }

    .m-drawer-subitem:hover {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    body.m-drawer-open {
        overflow: hidden;
    }

    body.m-drawer-open .hspcb-notify-root {
        display: none;
    }
}

@keyframes mDrawerIn {
    from {
        transform: translateX(-18px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================
   移动端容器去嵌套：只保留最外层 .container 的 14px 边距
   语文页内嵌了第二层 .container，考试页 .exam-dashboard 另带 32px
   ============================================================ */
@media (max-width: 768px) {
    #chinese-section .chinese-knowledge .container {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .exam-dashboard {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ============================================================
   做题进度趋势：桌面竖向柱状，移动端横向细条
   ============================================================ */
.bar-chart-horizontal {
    display: none;
}

.hbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hbar-row + .hbar-row {
    margin-top: 10px;
}

.hbar-year {
    flex: 0 0 42px;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.hbar-track {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.hbar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
}

.hbar-fill.total {
    background: var(--border-light);
}

.hbar-fill.correct {
    background: var(--ed-accent);
}

.hbar-stats {
    flex: 0 0 auto;
    min-width: 78px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-light);
}

@media (max-width: 640px) {
    .bar-chart-vertical {
        display: none;
    }

    .bar-chart-horizontal {
        display: block;
    }

    .progress-chart-section {
        padding: 14px;
    }

    .progress-chart-section .chart-container {
        min-height: 0;
        height: auto;
    }

    .progress-chart-section .no-data {
        margin: 0;
        padding: 14px 0;
        font-size: 12px;
        text-align: left;
    }
}

/* ============================================================
   考试中心移动端：压缩首屏、重排筛选与操作层级
   ============================================================ */
@media (max-width: 640px) {
    .exam-header {
        text-align: left;
    }

    .exam-header h2 {
        justify-content: flex-start;
    }

    .exam-subtitle {
        text-align: left;
    }

    /* 综合得分：圆形缩小，与等级/建议并排，首屏让位给练习 */
    .overall-score {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "title title"
            "circle badge"
            "circle desc";
        column-gap: 14px;
        align-items: center;
        padding-bottom: 16px;
        margin-bottom: 16px;
        text-align: left;
    }

    .overall-score h3 {
        grid-area: title;
        margin-bottom: 8px;
    }

    .score-circle {
        grid-area: circle;
        width: 84px;
        height: 84px;
        margin: 0;
    }

    .score-number {
        font-size: 28px;
    }

    .score-unit {
        font-size: 11px;
    }

    .level-badge {
        grid-area: badge;
        justify-self: start;
        align-self: end;
    }

    .level-desc {
        grid-area: desc;
        align-self: start;
        margin-top: 6px;
        font-size: 12.5px;
        line-height: 1.6;
    }

    /* 重置统计降级为次要文字操作 */
    .btn-reset-stats {
        width: auto;
        margin: 12px auto 0;
        padding: 6px 10px;
        border: 0;
        color: var(--text-light);
        font-size: 12px;
    }

    .filter-bar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 14px;
    }

    .filter-bar select {
        min-width: 0;
        height: 40px;
        font-size: 13px;
    }

    .btn-random-exam {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 42px;
        border: 1px solid var(--ed-accent);
        background: transparent;
        color: var(--ed-accent);
        font-weight: 600;
    }

    .progress-chart-section {
        margin-top: 18px;
    }

    .progress-chart-section .chart-container {
        min-height: 0;
        height: auto;
        padding: 12px 0 0;
    }
}

/* 考试中心优先级：答题区置顶放大，统计下沉 */
.practice-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
}

.practice-head h3 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-primary);
}

.practice-head span {
    font-size: 12px;
    color: var(--text-light);
}

@media (max-width: 640px) {
    .exam-header {
        margin-bottom: 10px;
    }

    .exam-header h2 {
        font-size: 1.15rem;
    }

    .exam-subtitle {
        display: none;
    }

    .year-badge {
        font-size: 10px;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 18px;
        width: 100%;
    }

    /* 容器已由 .container 提供 14px 边距，内层不再重复加边距 */
    .exam-dashboard {
        padding: 0;
    }

    .exam-dashboard .practice-area,
    .exam-dashboard .stats-panel {
        width: 100%;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    /* 答题区排到统计之前（style.css 曾把 stats-panel 设为 order:-1） */
    .practice-area {
        order: -1;
    }

    .stats-panel {
        order: 0;
    }

    .practice-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        margin: 0 0 10px;
    }

    .practice-head h3 {
        margin: 0;
        font-family: var(--font-serif);
        font-size: 1.1rem;
        color: var(--text-primary);
    }

    .practice-head span {
        font-size: 12px;
        color: var(--text-light);
    }

    /* 三个筛选等分一行；随机出题移到标题行 */
    .filter-bar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 16px;
        overflow: visible;
    }

    .filter-bar select {
        width: 100%;
        min-width: 0;
        height: 38px;
        padding: 0 6px;
        font-size: 12px;
    }

    .practice-head .btn-random-exam {
        flex: 0 0 auto;
        height: 32px;
        padding: 0 12px;
        border: 1px solid var(--ed-accent);
        border-radius: 8px;
        background: transparent;
        color: var(--ed-accent);
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
    }

    /* 题目卡片放大，成为页面主体 */
    .exam-item {
        margin-bottom: 12px;
        padding: 16px 14px;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        background: var(--bg-card);
    }

    .exam-question-preview {
        margin: 10px 0 14px;
        font-size: 15px;
        line-height: 1.8;
        color: var(--text-primary);
    }

    .exam-item .exam-actions {
        display: flex;
        width: 100%;
    }

    .exam-item .btn-start-exam {
        flex: 1 1 auto;
        width: 100%;
        height: 44px;
        font-size: 14px;
        font-weight: 600;
    }

    /* 统计面板作为次要信息，弱化边界 */
    .stats-panel {
        padding-top: 16px;
        border-top: 1px solid var(--ed-rule-strong);
    }
}

/* ============================================================
   回到顶部：与设置 / 主题按钮同处右下角悬浮组，纵向排队
   内容超过一屏、且已下滑一段后出现；默认隐藏不占交互
   ============================================================ */
.hspcb-fab-stack .hspcb-backtop {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.hspcb-fab-stack .hspcb-backtop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

.hspcb-fab-stack .hspcb-backtop svg {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .hspcb-fab-stack .hspcb-backtop {
        transition: none;
    }
}

/* ============================================================
   字体统一层 v2：把所有组件的字号 / 字重收敛回同一套字阶
   11 角标 · 12 元信息 · 13 页签 · 14 辅助与表格 ·
   15 正文 · 16 卡片标题 · 18 入口标题 · 22 区块标题
   展示型（首屏大标题、统计数字）不在此层。
   ============================================================ */

/* ---------- 字体族：正文一律无衬线，标题保留宋体 ---------- */
main .section p,
main .section li,
main .section td,
main .section th,
main .section label,
main .section input,
main .section select,
main .section textarea,
main .section .key-point,
main .section .common-mistake,
main .section .info-box,
main .section .template-box {
    font-family: var(--font-sans);
}

main .section h2,
main .section h3,
main .section .module-header,
main .section .section-title {
    font-family: var(--font-serif);
}

/* ---------- 页面级标题 ---------- */
main .section h1,
#chinese-section .chinese-knowledge h1,
#chinese-section .chinese-knowledge .header h1 {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
}

/* ---------- 卡片标题：统一 16 / 600（抹掉 20、17、15.3 等游离值） ---------- */
main .section h4,
main .section .knowledge-card h4,
main .section .tool-card h4,
main .section .exam-card h4,
main .section .quiz-card h4,
main .section .info-card h4,
main .section .question-box h4,
main .section .analysis-box h4,
main .section .result-card h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* 三级小标题比卡片标题低半档 */
main .section .subsection-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* 首页学科卡标题属于「入口标题」档，18px，不再单独 20px */
main .section .subject-card h4,
main .section .subject-card.physics h4,
main .section .subject-card.chemistry h4,
main .section .subject-card.biology h4,
main .section .subject-card.chinese h4,
main .section .subject-card.math h4,
main .section .subject-card.english h4 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
}

/* ---------- 正文 / 表格 ---------- */
main .section p,
main .section li,
main .section dd,
main .section blockquote,
main .section .key-point,
main .section .common-mistake,
main .section .info-box,
main .section .template-box {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.85;
}

main table th,
main table td {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
}

main table th {
    font-weight: 600;
}

/* ---------- 强调：统一 600，清掉 700 / 800 的混排 ---------- */
main .section strong,
main .section b,
main .section .key-point strong,
main .section .key-point b,
main .section .easy-wrong,
main .section .score-text,
main .section .qs-num {
    font-weight: 600;
}

/* ---------- 元信息 / 角标 ---------- */
main .section .pe-desc,
main .section .stat-label,
main .section .exam-year,
main .section .exam-type,
main .section .exam-points,
main .section .qs-label,
main .section .year-badge {
    font-size: 12px;
    font-weight: 400;
}

main .section .exam-subject-tag,
main .section .level-badge {
    font-size: 11px;
    font-weight: 500;
}

/* ---------- 页签与按钮 ---------- */
main .section .module-tab {
    font-size: 13px;
    font-weight: 500;
}

main .section .module-tab.active {
    font-weight: 600;
}

main .section button:not([data-style]):not(.primary-entry):not(.tool-card):not(.hero-btn):not(.nav-btn):not(.module-tab),
main .section .btn {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* 表格内的强调跟随表格字号，不再跳成 15 */
main table strong,
main table b {
    font-size: inherit;
}

/* 桌面端页签多：压缩内边距保持单行，避免只剩一个页签的孤行 */
@media (min-width: 1025px) {
    main .section .module-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    main .section .module-tabs::-webkit-scrollbar {
        display: none;
    }

    main .section .module-tab {
        flex: 0 0 auto;
        padding: 7px 9px;
        font-size: 12.5px;
    }
}

@media (max-width: 640px) {
    main .section h1,
    #chinese-section .chinese-knowledge h1,
    #chinese-section .chinese-knowledge .header h1 {
        font-size: 26px;
    }

    main .section .subject-card h4,
    main .section .subject-card.physics h4,
    main .section .subject-card.chemistry h4,
    main .section .subject-card.biology h4,
    main .section .subject-card.chinese h4,
    main .section .subject-card.math h4,
    main .section .subject-card.english h4 {
        font-size: 17px;
    }
}

/* ============================================================
   PC 报头卡片（重设计）：双线内框 + 右侧藏书票 + 标题短红线
   只作用于桌面默认 / 护眼主题，玻璃主题保留自己的横幅
   ============================================================ */
@media (min-width: 1025px) {
    html:not([data-theme-pack="liquid-glass"]) .main-header {
        grid-template-columns: minmax(0, 1fr) 196px;
        align-items: stretch;
        gap: 0;
        padding: 0;
        margin-bottom: 8px;
        border: 1px solid var(--ed-rule-strong);
        border-bottom: 1px solid var(--ed-rule-strong);
        border-radius: 0;
        background: var(--bg-card);
        box-shadow: var(--card-shadow);
        overflow: hidden;
        position: relative;
    }

    html:not([data-theme-pack="liquid-glass"]) .main-header::before {
        content: "";
        display: block;
        position: absolute;
        inset: 8px;
        border: 1px solid var(--ed-rule);
        pointer-events: none;
        z-index: 0;
    }

    html:not([data-theme-pack="liquid-glass"]) .main-header > .masthead-kicker,
    html:not([data-theme-pack="liquid-glass"]) .main-header > h1,
    html:not([data-theme-pack="liquid-glass"]) .main-header > .masthead-meta {
        position: relative;
        z-index: 1;
        padding-left: 34px;
        padding-right: 30px;
    }

    html:not([data-theme-pack="liquid-glass"]) .masthead-kicker {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 30px 0 16px;
        font-size: 11px;
        line-height: 1.6;
        letter-spacing: 0.26em;
        color: var(--text-secondary);
    }

    html:not([data-theme-pack="liquid-glass"]) .masthead-kicker::before {
        content: "";
        flex: none;
        width: 7px;
        height: 7px;
        background: var(--ed-accent);
    }

    html:not([data-theme-pack="liquid-glass"]) .main-header h1 {
        margin: 0;
        font-size: clamp(2.15rem, 3.4vw, 3.3rem);
        line-height: 1.08;
        letter-spacing: 0.015em;
    }

    html:not([data-theme-pack="liquid-glass"]) .main-header h1::after {
        content: "";
        display: block;
        width: 56px;
        height: 3px;
        margin-top: 20px;
        background: var(--ed-accent);
    }

    html:not([data-theme-pack="liquid-glass"]) .masthead-meta {
        margin: 16px 0 30px;
        padding-top: 14px;
        border-top: 1px solid var(--ed-rule);
        font-family: var(--font-mono);
        font-size: 11px;
        line-height: 1.7;
        letter-spacing: 0.16em;
        color: var(--text-light);
    }

    html:not([data-theme-pack="liquid-glass"]) .masthead-mark {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: stretch;
        justify-self: stretch;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        border-left: 1px solid var(--ed-rule);
        border-radius: 0;
        transform: none;
        color: var(--ed-accent);
        background-color: var(--bg-secondary);
        background-image:
            radial-gradient(110% 80% at 50% 0%, var(--ed-accent-soft), transparent 60%),
            repeating-linear-gradient(135deg, transparent 0 12px, var(--ed-rule) 12px 13px);
    }

    html:not([data-theme-pack="liquid-glass"]) .masthead-mark .hspcb-i {
        width: 64px;
        height: 64px;
        padding: 16px;
        box-sizing: border-box;
        border: 1px solid var(--ed-accent);
        outline: 1px solid var(--ed-rule-strong);
        outline-offset: 4px;
        background: var(--bg-card);
    }
}

/* ============================================================
   移动端紧凑排版：与 PC 的舒展留白明确区分
   容器 10px、卡片 12px、标题与列表间距整体收紧一档
   ============================================================ */
@media (max-width: 768px) {
    /* 容器与页头 */
    body > .container {
        padding: 0 10px 88px;
    }

    .main-header {
        padding: 14px 0 12px;
        gap: 8px;
    }

    .masthead-kicker {
        margin-bottom: 6px;
        font-size: 10px;
    }

    /* 首页首屏 */
    .welcome-card {
        padding: 16px 12px 14px;
        gap: 18px;
    }

    main .section .welcome-card .eyebrow {
        margin-bottom: 8px;
        font-size: 10px;
    }

    #home-section h2 {
        margin-bottom: 10px;
        font-size: 1.45rem;
    }

    main .section .welcome-card .welcome-deck {
        font-size: 14.5px;
        line-height: 1.75;
    }

    .stat {
        padding: 10px 10px 9px;
    }

    .stat-num {
        font-size: 1.65rem;
    }

    .stat-label {
        margin-top: 5px;
        font-size: 11px;
    }

    main .section .welcome-card .margin-note {
        padding-top: 10px;
        font-size: 12px;
        line-height: 1.8;
    }

    .feature-list {
        margin-top: 18px;
    }

    main .section .feature-list li {
        padding: 9px 0 9px 28px;
        font-size: 14px;
        line-height: 1.7;
    }

    .feature-list li::before {
        top: 12px;
        font-size: 10px;
    }

    .welcome-card .hero-cta {
        margin-top: 14px;
    }

    .welcome-card .hero-btn {
        margin-right: 16px;
        padding: 6px 0;
        font-size: 13px;
    }

    .welcome-card .hero-btn-primary {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 10px;
    }

    /* 首页三入口 */
    .primary-entries {
        margin-bottom: 22px;
    }

    .primary-entry {
        padding: 11px 12px 12px 2px;
        gap: 10px;
    }

    .primary-entry .pe-title {
        font-size: 17px;
    }

    .pe-desc {
        font-size: 11.5px;
        line-height: 1.6;
    }

    /* 页签：矮一档 */
    .module-tabs {
        margin: 8px 0 10px;
        padding: 3px;
        gap: 2px;
    }

    .module-tab {
        padding: 6px 11px;
        font-size: 12.5px;
    }

    /* 学科正文 */
    .module-content {
        padding: 4px 0 0;
    }

    main .section .knowledge-card {
        padding: 12px;
        margin: 10px 0 12px;
    }

    main .section .knowledge-card h4 {
        margin-bottom: 8px;
    }

    main .section .key-point {
        padding: 6px 0;
        font-size: 14.5px;
        line-height: 1.72;
    }

    main .section .common-mistake {
        margin: 6px 0;
        padding: 8px 10px;
        font-size: 14px;
        line-height: 1.65;
    }

    .knowledge-section h3 {
        margin: 14px 0 8px;
    }

    main .section p,
    main .section li {
        line-height: 1.75;
    }

    /* 区块标题 */
    main .section h2 {
        margin-bottom: 10px;
        font-size: 1.2rem;
    }

    main .section h3 {
        margin: 14px 0 8px;
        font-size: 1.05rem;
    }

    /* 考试中心 */
    .practice-head {
        margin-bottom: 8px;
    }

    .filter-bar {
        margin-bottom: 10px;
        gap: 6px;
    }

    .exam-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    .exam-question-preview {
        font-size: 14px;
        line-height: 1.7;
    }

    .stats-panel {
        padding-top: 12px;
    }

    .exam-item .btn-start-exam {
        height: 38px;
    }

    .progress-chart-section {
        margin: 10px 0;
        padding-top: 10px;
    }

    /* 工具页 */
    .tool-header {
        padding: 12px 14px;
        margin-bottom: 8px;
        border-radius: 14px;
    }

    .tool-header h2 {
        font-size: 1.05rem;
    }

    /* 语文知识库 */
    #chinese-section .chinese-knowledge .header {
        margin-bottom: 8px;
    }

    #chinese-section .chinese-knowledge .module-header {
        margin-bottom: 8px;
        padding: 9px 12px;
        font-size: 1rem;
    }

    #chinese-section .chinese-knowledge .section-title {
        margin: 12px 0 6px;
    }

    #chinese-section .chinese-knowledge .subsection-title {
        margin: 10px 0 4px;
    }

    #chinese-section table th,
    #chinese-section table td {
        padding: 6px 8px;
    }

    /* 通用卡片与提示块 */
    main .section .tool-card {
        padding: 12px;
    }

    main .section .info-box {
        margin: 6px 0;
        padding: 8px 10px;
    }
}

/* ============================================================
   默认主题（冷灰蓝）：现代周刊版式
   白卡片 + 10px 圆角 + 轻边框，阅读区块留呼吸，但不过度松散
   ============================================================ */
@media (min-width: 1025px) {
    html:not([data-theme-pack]) main .section .knowledge-card,
    html:not([data-theme-pack]) main .section .tool-card,
    html:not([data-theme-pack]) main .section .subject-card {
        padding: 20px 22px;
        border: 1px solid var(--border-light);
        border-radius: 10px;
        background: var(--bg-card);
        box-shadow: var(--card-shadow);
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

    html:not([data-theme-pack]) main .section .knowledge-card:hover,
    html:not([data-theme-pack]) main .section .tool-card:hover,
    html:not([data-theme-pack]) main .section .subject-card:hover {
        transform: translateY(-2px);
        border-color: var(--border-medium);
        box-shadow: 0 2px 4px rgba(16, 28, 45, 0.06), 0 16px 32px rgba(16, 28, 45, 0.1);
    }

    html:not([data-theme-pack]) main .section .knowledge-card + .knowledge-card {
        margin-top: 14px;
    }

    html:not([data-theme-pack]) main .section .exam-item {
        padding: 16px 18px;
        border-radius: 10px;
    }

    html:not([data-theme-pack]) .module-content {
        padding-top: 18px;
    }

    html:not([data-theme-pack]) main .section h2 {
        margin-bottom: 16px;
    }

    html:not([data-theme-pack]) main .section h3 {
        margin: 22px 0 12px;
    }

    html:not([data-theme-pack]) main .section .key-point {
        padding: 10px 14px;
        border-radius: 6px;
        background: var(--bg-secondary);
    }

    html:not([data-theme-pack]) main .section table {
        border: 1px solid var(--border-light);
        border-radius: 8px;
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
    }
}

/* ============================================================
   默认主题 · 暗色：卡片底色提亮一档，避免整页糊成一块
   ============================================================ */
[data-theme="dark"]:not([data-theme-pack]) main .section .knowledge-card,
[data-theme="dark"]:not([data-theme-pack]) main .section .tool-card,
[data-theme="dark"]:not([data-theme-pack]) main .section .subject-card {
    background: var(--bg-card);
}

/* ============================================================
   应用工作区骨架（v2.0）
   桌面端：左侧固定导航栏 + 右侧工具条 + 内容工作区
   移动端：.app-sidebar / .app-shell 用 display:contents 还原成
   原有的「页头 + 横向页签 + 正文」线性流，移动布局不受影响。
   ============================================================ */

:root {
    --ws-radius: 16px;
    --ws-radius-sm: 12px;
    --ws-card-bg: var(--bg-card);
    --ws-line: var(--border-light);
    --ws-shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 8px 24px rgba(15, 27, 45, 0.06);

    /* 侧栏：默认冷灰蓝主题用深色板，和内容区的白卡形成强对比 */
    --ws-side-bg: #101d31;
    --ws-side-glow: rgba(76, 132, 214, 0.22);
    --ws-side-ink: #eef4fc;
    --ws-side-muted: #9db0c8;
    --ws-side-line: rgba(255, 255, 255, 0.09);
    --ws-side-hover: rgba(255, 255, 255, 0.07);
    --ws-side-active: rgba(255, 255, 255, 0.12);
    --ws-side-accent: #7fb2ff;
    --ws-side-icon: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"]:not([data-theme-pack]) {
    --ws-side-bg: #0b1524;
    --ws-side-glow: rgba(80, 140, 220, 0.18);
    --ws-side-ink: #e8eef7;
    --ws-side-muted: #90a3bb;
    --ws-side-line: rgba(226, 236, 248, 0.1);
    --ws-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 26px rgba(0, 0, 0, 0.32);
}

/* 护眼纸色：侧栏是浅暖纸，靠细线分界，不用深色板 */
html[data-theme-pack="sepia"] {
    --ws-radius: 8px;
    --ws-radius-sm: 6px;
    --ws-card-bg: var(--bg-card);
    --ws-line: rgba(120, 86, 40, 0.2);
    --ws-shadow: 0 1px 0 rgba(120, 86, 40, 0.07);
    --ws-side-bg: #efe1c6;
    --ws-side-glow: rgba(154, 74, 36, 0.1);
    --ws-side-ink: #3a2f20;
    --ws-side-muted: #7b6a50;
    --ws-side-line: rgba(120, 86, 40, 0.2);
    --ws-side-hover: rgba(154, 74, 36, 0.09);
    --ws-side-active: rgba(154, 74, 36, 0.14);
    --ws-side-accent: #9a4a24;
    --ws-side-icon: rgba(120, 86, 40, 0.09);
}

html[data-theme="dark"][data-theme-pack="sepia"] {
    --ws-side-bg: #201811;
    --ws-side-glow: rgba(217, 154, 106, 0.14);
    --ws-side-ink: #f0e6d4;
    --ws-side-muted: #b3a184;
    --ws-side-line: rgba(240, 230, 212, 0.12);
    --ws-side-hover: rgba(240, 230, 212, 0.06);
    --ws-side-active: rgba(240, 230, 212, 0.1);
    --ws-side-accent: #d99a6a;
    --ws-side-icon: rgba(240, 230, 212, 0.08);
}

/* 液态玻璃：侧栏是磨砂玻璃，透出页面光斑；圆角更大、强调色为薄荷绿 */
html[data-theme-pack="liquid-glass"] {
    --ws-radius: 20px;
    --ws-radius-sm: 14px;
    --ws-card-bg: var(--bg-card);
    --ws-line: var(--lg-edge);
    --ws-shadow: var(--lg-body-shadow);
    --ws-side-bg: transparent;
    --ws-side-glow: rgba(107, 203, 156, 0.18);
    --ws-side-ink: var(--text-primary);
    --ws-side-muted: var(--text-secondary);
    --ws-side-line: var(--lg-edge);
    --ws-side-hover: var(--lg-soft-1);
    --ws-side-active: var(--lg-soft-1);
    --ws-side-accent: var(--primary);
    --ws-side-icon: rgba(255, 255, 255, 0.4);
}

/* 移动端 / 平板：包装层不产生任何布局盒子，回到线性文档流 */
.app-sidebar,
.app-shell {
    display: contents;
}

.app-nav-group,
.app-side-note,
.app-topbar {
    display: none;
}

/* ---------- 桌面端工作区 ---------- */

@media (min-width: 1025px) {
    /* 只作用于最外层容器；语文知识库内部还有一个 .container 两栏布局，
       不能被工作区栅格覆盖 */
    body > .container {
        display: grid;
        grid-template-columns: 276px minmax(0, 1fr);
        column-gap: 0;
        max-width: none;
        padding: 0;
        min-height: 100vh;
    }

    .app-sidebar {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 0;
        align-self: start;
        height: 100vh;
        overflow-y: auto;
        margin: 0;
        padding: 26px 16px 18px;
        background-color: var(--ws-side-bg);
        background-image:
            radial-gradient(120% 60% at 0% 0%, var(--ws-side-glow), transparent 62%);
        border-right: 1px solid var(--ws-side-line);
        color: var(--ws-side-ink);
        scrollbar-width: thin;
        scrollbar-color: var(--ws-side-line) transparent;
    }

    .app-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .app-sidebar::-webkit-scrollbar-thumb {
        background: var(--ws-side-line);
        border-radius: 999px;
    }

    /* 品牌区 */
    .container .app-sidebar .main-header {
        display: block;
        position: static;
        grid-template-columns: none;
        padding: 2px 10px 18px;
        margin: 0 0 10px;
        border: 0;
        border-bottom: 1px solid var(--ws-side-line);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        text-align: left;
    }

    .container .app-sidebar .main-header::before,
    .container .app-sidebar .main-header::after {
        display: none;
    }

    .container .app-sidebar .masthead-mark,
    .container .app-sidebar .masthead-meta {
        display: none;
    }

    .container .app-sidebar .masthead-kicker {
        margin: 0 0 8px;
        padding: 0;
        font-size: 10px;
        line-height: 1.5;
        letter-spacing: 0.22em;
        color: var(--ws-side-muted);
    }

    .container .app-sidebar .masthead-kicker::before {
        display: none;
    }

    .container .app-sidebar .main-header h1 {
        margin: 0;
        padding: 0;
        font-family: var(--font-sans);
        font-size: 21px;
        font-weight: 700;
        line-height: 1.3;
        letter-spacing: 0.01em;
        color: var(--ws-side-ink);
        background: none;
        -webkit-background-clip: border-box;
        background-clip: border-box;
    }

    .container .app-sidebar .main-header h1::after {
        display: none;
    }

    /* 侧栏导航 */
    .container .app-sidebar .subject-nav {
        position: static;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 2px;
        overflow: visible;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .container .app-sidebar .app-nav-group {
        display: block;
        margin: 14px 12px 6px;
        font-family: var(--font-mono);
        font-size: 10px;
        line-height: 1.5;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--ws-side-muted);
        opacity: 0.75;
    }

    .container .app-sidebar .app-nav-group:first-child {
        margin-top: 2px;
    }

    .container .app-sidebar .nav-btn {
        width: 100%;
        flex: 0 0 auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        min-width: 0;
        padding: 10px 12px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
    }

    .container .app-sidebar .nav-btn:hover {
        background: var(--ws-side-hover);
        transform: none;
    }

    .container .app-sidebar .nav-btn:active {
        transform: none;
    }

    .container .app-sidebar .nav-btn .icon {
        flex: none;
        width: 26px;
        height: 26px;
        margin: 0;
        border: 0;
        border-radius: 8px;
        background: var(--ws-side-icon);
        color: var(--ws-side-muted);
    }

    .container .app-sidebar .nav-btn .icon .hspcb-i {
        width: 15px;
        height: 15px;
    }

    .container .app-sidebar .nav-btn .label {
        font-size: 14px;
        font-weight: 500;
        line-height: 1.4;
        letter-spacing: 0.02em;
        color: var(--ws-side-muted);
    }

    .container .app-sidebar .nav-btn.active,
    .container .app-sidebar .nav-btn-exam.active,
    .container .app-sidebar .nav-btn-platform.active,
    .container .app-sidebar .nav-btn-chinese.active,
    .container .app-sidebar .nav-btn-math.active,
    .container .app-sidebar .nav-btn-english.active {
        background: var(--ws-side-active);
        color: var(--ws-side-ink);
        border-bottom-color: transparent;
        box-shadow: inset 2px 0 0 var(--ws-side-accent);
    }

    .container .app-sidebar .nav-btn.active .icon {
        background: var(--ws-side-accent);
        border-color: transparent;
        color: var(--ws-side-bg);
    }

    .container .app-sidebar .nav-btn.active .label {
        color: var(--ws-side-ink);
        font-weight: 600;
    }

    .app-side-note {
        display: block;
        margin: auto 0 0;
        padding: 16px 10px 0;
        border-top: 1px solid var(--ws-side-line);
        font-size: 11px;
        line-height: 1.7;
        letter-spacing: 0.02em;
        color: var(--ws-side-muted);
    }

    /* 右侧工作区 */
    .app-shell {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .app-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        position: sticky;
        top: 0;
        z-index: var(--z-sticky);
        height: 66px;
        padding: 0 18px;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--ws-line);
    }

    .app-crumbs {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        font-family: var(--font-mono);
        font-size: 12px;
        line-height: 1.5;
        letter-spacing: 0.08em;
        color: var(--text-light);
    }

    .app-crumbs-root {
        white-space: nowrap;
    }

    .app-crumbs-sep {
        color: var(--ed-rule-strong);
    }

    .app-crumbs-now {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-family: var(--font-sans);
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.02em;
        color: var(--text-primary);
    }

    .app-topbar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: none;
    }

    .app-action {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        height: 34px;
        padding: 0 14px;
        border: 1px solid var(--ws-line);
        border-radius: 999px;
        background: var(--ws-card-bg);
        color: var(--text-secondary);
        font-size: 12.5px;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
        cursor: pointer;
        transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
    }

    .app-action:hover {
        border-color: var(--ed-accent);
        color: var(--ed-accent);
    }

    .app-action-icon {
        display: inline-flex;
        width: 15px;
        height: 15px;
    }

    .app-action-icon .hspcb-i {
        width: 15px;
        height: 15px;
    }

    .app-shell > main {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 8px 18px 0;
        box-sizing: border-box;
        min-height: 60vh;
    }

    .app-shell > .main-footer {
        width: 100%;
        max-width: none;
        margin: 32px 0 0;
        padding: 18px 18px 24px;
        box-sizing: border-box;
        border-top: 1px solid var(--ws-line);
        font-size: 12px;
        line-height: 1.8;
    }

    #home-section {
        padding-top: 0;
    }

    /* ---------- 首页：应用仪表盘式排布 ---------- */

    .welcome-card {
        grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
        gap: 34px;
        align-items: stretch;
        padding: 30px 32px;
        margin: 0 0 18px;
        background: var(--ws-card-bg);
        border: 1px solid var(--ws-line);
        border-radius: var(--ws-radius);
        box-shadow: var(--ws-shadow);
        overflow: hidden;
    }

    main .section .welcome-card .eyebrow {
        display: inline-flex;
        align-items: center;
        margin: 0 0 14px;
        padding: 4px 10px;
        border: 1px solid var(--ws-line);
        border-radius: 999px;
        font-size: 10px;
        line-height: 1.5;
        letter-spacing: 0.16em;
        color: var(--text-secondary);
    }

    main .section .welcome-card h2 {
        margin: 0 0 14px;
        font-size: clamp(1.85rem, 2.5vw, 2.45rem);
        line-height: 1.2;
    }

    main .section .welcome-card .welcome-deck {
        max-width: 40em;
        font-size: 15px;
        line-height: 1.8;
    }

    .welcome-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-content: start;
        padding: 0;
        border: 0;
    }

    .welcome-stats .stat {
        padding: 16px 16px 14px;
        background: var(--bg-secondary);
        border: 1px solid var(--ws-line);
        border-radius: var(--ws-radius-sm);
    }

    .welcome-stats .stat-num {
        font-size: 26px;
        line-height: 1;
    }

    .welcome-stats .stat-label {
        margin-top: 7px;
        font-size: 11px;
        letter-spacing: 0.06em;
    }

    main .section .welcome-card .margin-note {
        grid-column: 1 / -1;
        padding: 12px 0 0;
        border-top: 1px solid var(--ws-line);
        font-family: var(--font-sans);
        font-size: 12px;
        line-height: 1.7;
    }

    .feature-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 26px;
        margin-top: 22px;
    }

    main .section .feature-list li {
        padding: 10px 0 10px 26px;
        font-size: 14px;
        line-height: 1.75;
    }

    .feature-list li::before {
        top: 12px;
    }

    .welcome-card .hero-cta {
        margin-top: 20px;
    }

    .welcome-card .hero-btn,
    .welcome-card .hero-btn-primary {
        margin-right: 10px;
        padding: 10px 18px;
        border: 1px solid var(--ws-line);
        border-radius: 999px;
        background: var(--ws-card-bg);
        color: var(--text-primary);
        font-size: 13px;
    }

    .welcome-card .hero-btn:hover {
        border-color: var(--ed-accent);
        color: var(--ed-accent);
    }

    .welcome-card .hero-btn-primary {
        border-color: var(--ed-accent);
        background: var(--ed-accent);
        color: #fff;
    }

    .welcome-card .hero-btn-primary:hover {
        background: var(--ed-accent);
        color: #fff;
    }

    /* 高频入口：三张卡片 */
    .primary-entries {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        margin: 0 0 28px;
        border: 0;
    }

    .primary-entry {
        align-items: center;
        gap: 14px;
        padding: 16px 18px;
        background: var(--ws-card-bg);
        border: 1px solid var(--ws-line);
        border-radius: var(--ws-radius);
        box-shadow: var(--ws-shadow);
        transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    }

    .primary-entry:last-child {
        border-right: 1px solid var(--ws-line);
    }

    .primary-entry:hover {
        transform: translateY(-2px);
        border-color: var(--border-medium);
        box-shadow: 0 10px 26px rgba(15, 27, 45, 0.1);
    }

    .primary-entry .pe-icon {
        flex: none;
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        margin: 0;
        border: 0;
        border-radius: 12px;
        background: var(--ed-accent-soft);
        color: var(--ed-accent);
    }

    .primary-entry .pe-icon .hspcb-i {
        width: 20px;
        height: 20px;
    }

    .primary-entry .pe-title {
        font-size: 15px;
        line-height: 1.4;
    }

    .pe-desc {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.6;
    }

    /* 区块标题 */
    .section-heading {
        margin: 4px 0 14px;
        padding: 0;
        border: 0;
    }

    .section-heading h3 {
        font-family: var(--font-sans);
        font-size: 17px;
        letter-spacing: 0.01em;
    }

    .section-heading::after {
        content: "";
        flex: 1;
        height: 1px;
        margin-left: 4px;
        background: var(--ws-line);
    }

    /* 六科索引：卡片网格，顶部学科色条 */
    .subject-cards {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        margin-bottom: 28px;
        border: 0;
    }

    .subject-card,
    .subject-card.physics,
    .subject-card.chemistry,
    .subject-card.biology,
    .subject-card.chinese,
    .subject-card.math,
    .subject-card.english {
        padding: 18px 20px 14px;
        background: var(--ws-card-bg);
        border: 1px solid var(--ws-line);
        border-top: 3px solid var(--ed-accent);
        border-radius: var(--ws-radius);
        box-shadow: var(--ws-shadow);
        overflow: hidden;
    }

    .subject-card.physics { border-top-color: var(--physics); }
    .subject-card.chemistry { border-top-color: var(--chemistry); }
    .subject-card.biology { border-top-color: var(--biology); }
    .subject-card.chinese { border-top-color: var(--chinese); }
    .subject-card.math { border-top-color: var(--math); }
    .subject-card.english { border-top-color: var(--english); }

    .subject-card::before {
        margin-bottom: 8px;
        font-size: 11px;
        color: var(--text-light);
    }

    .subject-card h4,
    .subject-card.physics h4,
    .subject-card.chemistry h4,
    .subject-card.biology h4,
    .subject-card.chinese h4,
    .subject-card.math h4,
    .subject-card.english h4 {
        margin: 0 0 6px;
        padding-bottom: 10px;
        font-family: var(--font-sans);
        font-size: 17px;
        border-bottom: 1px solid var(--ws-line);
    }

    .subject-card ul li a {
        padding: 7px 0;
        font-size: 13.5px;
        line-height: 1.65;
    }

    main .section .subject-cards .subject-card:hover,
    main .section .subject-cards .subject-card.physics:hover,
    main .section .subject-cards .subject-card.chemistry:hover,
    main .section .subject-cards .subject-card.biology:hover,
    main .section .subject-cards .subject-card.chinese:hover,
    main .section .subject-cards .subject-card.math:hover,
    main .section .subject-cards .subject-card.english:hover {
        background: var(--ws-card-bg);
        transform: translateY(-2px);
        box-shadow: 0 12px 30px rgba(15, 27, 45, 0.1);
    }

    /* 工具索引：紧凑卡片网格 */
    .quick-access,
    .tools-section {
        margin-top: 26px;
    }

    .quick-access h3,
    .tools-section h3 {
        padding: 0 0 10px;
        font-family: var(--font-sans);
        font-size: 17px;
        letter-spacing: 0.01em;
        border-bottom: 1px solid var(--ws-line);
    }

    .quick-access h3::before,
    .tools-section h3::before {
        content: none;
    }

    .quick-access .tool-grid,
    .tools-section .tool-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
        margin-top: 14px;
        border: 0;
    }

    .quick-access .tool-card,
    .tools-section .tool-card {
        min-height: 0;
        padding: 16px 16px 14px;
        background: var(--ws-card-bg);
        border: 1px solid var(--ws-line);
        border-radius: var(--ws-radius-sm);
        box-shadow: var(--ws-shadow);
        transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    }

    .quick-access .tool-card:hover,
    .tools-section .tool-card:hover {
        background: var(--ws-card-bg);
        border-color: var(--border-medium);
        box-shadow: 0 8px 22px rgba(15, 27, 45, 0.09);
        transform: translateY(-2px);
    }

    .quick-access .tool-icon,
    .tools-section .tool-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 12px;
        border: 0;
        border-radius: 8px;
        background: var(--ed-accent-soft);
        color: var(--ed-accent);
        font-size: 12px;
    }

    .quick-access .tool-icon .hspcb-i,
    .tools-section .tool-icon .hspcb-i {
        width: 16px;
        height: 16px;
    }

    .quick-access .tool-card h4,
    .tools-section .tool-card h4 {
        margin: 0 0 4px;
        font-family: var(--font-sans);
        font-size: 14px;
        letter-spacing: 0;
    }

    .quick-access .tool-card p,
    .tools-section .tool-card p {
        margin: 0 0 8px;
        font-size: 12px;
        line-height: 1.6;
    }

    .quick-access .tool-tag,
    .tools-section .tool-tag {
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .tool-collapse-toggle {
        margin: 0 0 12px auto;
    }

    /* 工具页 / 学科页的内容排版沿用纸质层，只统一上边距 */
    .tool-header {
        margin-top: 6px;
    }
}

/* ---------- 工作区 · 护眼纸色：侧栏纸纹 + 卡片细节 ---------- */

@media (min-width: 1025px) {
    html[data-theme-pack="sepia"] .app-sidebar {
        background-image:
            radial-gradient(120% 60% at 0% 0%, var(--ws-side-glow), transparent 62%),
            repeating-linear-gradient(0deg, rgba(47, 39, 27, 0.016) 0 1px, transparent 1px 4px);
    }

    html[data-theme-pack="sepia"] .container .app-sidebar .nav-btn {
        border-radius: 6px;
    }

    html[data-theme-pack="sepia"] .container .app-sidebar .nav-btn.active {
        box-shadow: inset 3px 0 0 var(--ws-side-accent);
    }

    html[data-theme-pack="sepia"] .app-topbar {
        background: var(--bg-primary);
        border-bottom: 1px solid var(--ws-line);
    }

    html[data-theme-pack="sepia"] .welcome-stats .stat {
        background: rgba(255, 252, 244, 0.6);
    }

    html[data-theme="dark"][data-theme-pack="sepia"] .welcome-stats .stat {
        background: rgba(58, 45, 29, 0.45);
    }
}

/* ---------- 工作区 · 液态玻璃：磨砂侧栏 + 玻璃工具条 ---------- */

@media (min-width: 1025px) {
    html[data-theme-pack="liquid-glass"] .app-sidebar {
        background:
            linear-gradient(168deg, rgba(107, 203, 156, 0.24), rgba(255, 255, 255, 0.52) 46%, rgba(59, 130, 246, 0.12)) !important;
        background-image: linear-gradient(168deg, rgba(107, 203, 156, 0.24), rgba(255, 255, 255, 0.52) 46%, rgba(59, 130, 246, 0.12)) !important;
        -webkit-backdrop-filter: blur(20px) saturate(1.6);
        backdrop-filter: blur(20px) saturate(1.6);
        border-right: 1px solid var(--lg-edge);
    }

    html[data-theme="dark"][data-theme-pack="liquid-glass"] .app-sidebar {
        background:
            linear-gradient(168deg, rgba(61, 135, 115, 0.34), rgba(20, 29, 44, 0.6) 48%, rgba(35, 86, 74, 0.4)) !important;
        background-image: linear-gradient(168deg, rgba(61, 135, 115, 0.34), rgba(20, 29, 44, 0.6) 48%, rgba(35, 86, 74, 0.4)) !important;
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .main-header {
        padding: 2px 10px 18px !important;
        background: transparent !important;
        border: 0 !important;
        border-bottom: 1px solid var(--lg-edge) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .main-header h1 {
        background: none;
        -webkit-background-clip: border-box;
        background-clip: border-box;
        color: var(--text-primary) !important;
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .subject-nav {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .nav-btn {
        border-radius: 12px;
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .nav-btn.active {
        background: linear-gradient(135deg, var(--lg-soft-1), var(--lg-soft-2)) !important;
        box-shadow: inset 0 0 0 1px var(--lg-soft-line) !important;
        color: var(--lg-soft-ink) !important;
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .nav-btn.active .icon {
        background: rgba(255, 255, 255, 0.55);
        color: var(--lg-soft-ink);
    }

    html[data-theme-pack="liquid-glass"] .container .app-sidebar .nav-btn.active .label {
        color: var(--lg-soft-ink) !important;
    }

    html[data-theme-pack="liquid-glass"] .app-topbar {
        background: var(--lg-tint-strong);
        -webkit-backdrop-filter: blur(18px) saturate(1.7);
        backdrop-filter: blur(18px) saturate(1.7);
        border-bottom: 1px solid var(--lg-edge);
    }

    html[data-theme-pack="liquid-glass"] .app-action {
        background: var(--lg-tint) !important;
        border: 1px solid var(--lg-edge) !important;
        -webkit-backdrop-filter: blur(12px) saturate(1.5);
        backdrop-filter: blur(12px) saturate(1.5);
    }

    html[data-theme-pack="liquid-glass"] .welcome-stats .stat {
        background: var(--lg-soft-1);
        border-color: var(--lg-edge);
    }

    html[data-theme-pack="liquid-glass"] .primary-entry {
        border-radius: 18px;
    }
}

/* 桌面端顶栏在小屏笔记本上压缩，避免动作按钮挤掉面包屑 */
@media (min-width: 1025px) and (max-width: 1180px) {
    .app-topbar {
        padding: 0 14px;
    }

    .app-shell > main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .app-shell > .main-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .app-crumbs-root {
        display: none;
    }
}

/* ============================================================
   语文知识库：对齐工作区版式
   页头改为「标题 + 副标题 / 右侧搜索」的紧凑条；
   目录与正文各自成卡片，目录吸顶，正文占满剩余宽度。
   ============================================================ */

@media (min-width: 1025px) {
    #chinese-section .chinese-knowledge {
        padding-top: 2px;
    }

    #chinese-section .chinese-knowledge .header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
        align-items: end;
        column-gap: 28px;
        row-gap: 5px;
        padding: 4px 2px 16px;
        margin: 0 0 18px;
        border-bottom: 1px solid var(--ws-line);
    }

    #chinese-section .chinese-knowledge .header h1 {
        grid-column: 1;
        margin: 0;
        font-size: clamp(1.35rem, 1.9vw, 1.75rem);
        line-height: 1.3;
    }

    #chinese-section .chinese-knowledge .header .subtitle {
        grid-column: 1;
        margin: 0;
        font-size: 12.5px;
        letter-spacing: 0.06em;
    }

    #chinese-section .chinese-knowledge .search-box {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    #chinese-section .chinese-knowledge .search-box input {
        height: 40px;
        padding: 0 16px;
        border: 1px solid var(--ws-line);
        border-radius: 999px;
        background: var(--ws-card-bg);
        font-size: 14px;
    }

    /* 两栏：目录卡 + 正文卡 */
    #chinese-section .chinese-knowledge .container {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    #chinese-section .chinese-knowledge .sidebar {
        width: 236px;
        flex: 0 0 236px;
        top: 84px;
        max-height: calc(100vh - 104px);
        padding-bottom: 6px;
        background: var(--ws-card-bg);
        border: 1px solid var(--ws-line);
        border-radius: var(--ws-radius);
        box-shadow: var(--ws-shadow);
        overflow-y: auto;
    }

    #chinese-section .chinese-knowledge .sidebar-header {
        padding: 12px 14px;
        border-bottom: 1px solid var(--ws-line);
        font-size: 11px;
        letter-spacing: 0.14em;
        color: var(--text-secondary);
    }

    #chinese-section .chinese-knowledge .nav-item {
        margin: 0;
        border-bottom: 1px solid var(--ws-line);
    }

    #chinese-section .chinese-knowledge .nav-item:last-child {
        border-bottom: 0;
    }

    #chinese-section .chinese-knowledge .nav-item-title {
        padding: 9px 14px;
        font-size: 13px;
    }

    #chinese-section .chinese-knowledge .nav-children a {
        padding: 6px 14px 6px 22px;
        font-size: 12.5px;
        border-left: 0;
    }

    #chinese-section .chinese-knowledge .main-content {
        flex: 1;
        min-width: 0;
    }

    #chinese-section .chinese-knowledge .module {
        padding: 0 22px 8px;
        margin-bottom: 16px;
        background: var(--ws-card-bg);
        border: 1px solid var(--ws-line);
        border-radius: var(--ws-radius);
        box-shadow: var(--ws-shadow);
        overflow: hidden;
    }

    #chinese-section .chinese-knowledge .module:last-child {
        margin-bottom: 0;
    }

    #chinese-section .chinese-knowledge .module-header {
        margin: 0 -22px;
        padding: 16px 22px 12px;
        border-bottom: 1px solid var(--ws-line);
        font-size: 1.2rem;
    }

    #chinese-section .chinese-knowledge .module-body {
        padding: 4px 0 0;
    }

    #chinese-section .chinese-knowledge .section {
        padding: 14px 0;
        border-top: 1px solid var(--ws-line);
    }

    #chinese-section .chinese-knowledge .section:first-child {
        padding-top: 8px;
        border-top: 0;
    }

    #chinese-section .chinese-knowledge table {
        border-radius: 8px;
        overflow: hidden;
    }

    #chinese-section .chinese-knowledge th {
        background: var(--bg-secondary);
    }
}

/* ============================================================
   主题质感升级（v2.1）
   以「液态玻璃 + 暗色」的层次为基准，给其余浅色主题补上
   分层光源、浮起卡片和强调色细节，避免整页糊成一块。
   ============================================================ */

/* ---------- 默认冷灰蓝：冷调光晕 + 数据卡强调 ---------- */

html[data-theme="light"]:not([data-theme-pack]) body {
    background-image:
        radial-gradient(900px 460px at 100% -6%, rgba(46, 92, 160, 0.13), transparent 62%),
        radial-gradient(800px 420px at -8% 26%, rgba(46, 92, 160, 0.07), transparent 60%);
    background-attachment: fixed;
}

html[data-theme="dark"]:not([data-theme-pack]) body {
    background-image:
        radial-gradient(900px 460px at 100% -6%, rgba(76, 132, 214, 0.18), transparent 62%),
        radial-gradient(760px 420px at -8% 30%, rgba(76, 132, 214, 0.09), transparent 60%);
    background-attachment: fixed;
}

html[data-theme="light"]:not([data-theme-pack]) .app-sidebar {
    background-image:
        radial-gradient(120% 55% at 0% 0%, rgba(79, 140, 220, 0.28), transparent 62%),
        linear-gradient(180deg, #182942, #0d1727 78%);
}

html[data-theme="light"]:not([data-theme-pack]) .app-topbar {
    background: rgba(247, 250, 253, 0.8);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}

html[data-theme="dark"]:not([data-theme-pack]) .app-topbar {
    background: rgba(10, 17, 28, 0.76);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}

html:not([data-theme-pack]) .welcome-card {
    background-image: radial-gradient(620px 260px at 100% 0%, var(--ed-accent-soft), transparent 62%);
}

html:not([data-theme-pack]) .welcome-stats .stat {
    position: relative;
    padding-left: 20px;
}

html[data-theme="light"]:not([data-theme-pack]) .welcome-stats .stat {
    background-image: linear-gradient(158deg, #f2f6fc, #ffffff 68%);
    border-color: #dbe4ef;
    box-shadow: 0 1px 2px rgba(16, 28, 45, 0.05);
}

html[data-theme="dark"]:not([data-theme-pack]) .welcome-stats .stat {
    background-image: linear-gradient(158deg, #1a2536, #141d2a 70%);
    border-color: #26313f;
}

html:not([data-theme-pack]) .welcome-stats .stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ed-accent);
    opacity: 0.85;
}

html:not([data-theme-pack]) .welcome-stats .stat-num {
    color: var(--ed-accent);
}

html:not([data-theme-pack]) .primary-entry .pe-icon {
    box-shadow: inset 0 0 0 1px rgba(29, 78, 137, 0.12);
}

html[data-theme="light"]:not([data-theme-pack]) .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, #2f6ab5, #1d4e89);
    border-color: transparent;
}

html[data-theme="dark"]:not([data-theme-pack]) .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, #5b9bea, #2f6ab5);
    border-color: transparent;
}

html:not([data-theme-pack]) .section-heading::after {
    background: linear-gradient(90deg, var(--ed-accent-soft), var(--ws-line));
}

/* ---------- 护眼纸色：暖光晕 + 纸面卡片的强调条 ---------- */

html[data-theme-pack="sepia"] body {
    background-image:
        radial-gradient(860px 420px at 100% -8%, rgba(154, 74, 36, 0.13), transparent 60%),
        repeating-linear-gradient(0deg, rgba(47, 39, 27, 0.02) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(47, 39, 27, 0.016) 0 1px, transparent 1px 3px);
}

html[data-theme="dark"][data-theme-pack="sepia"] body {
    background-image:
        radial-gradient(860px 420px at 100% -8%, rgba(217, 154, 106, 0.16), transparent 60%),
        repeating-linear-gradient(0deg, rgba(240, 230, 212, 0.014) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(240, 230, 212, 0.011) 0 1px, transparent 1px 3px);
}

html[data-theme-pack="sepia"] .welcome-stats .stat {
    position: relative;
    padding-left: 20px;
    background-image: linear-gradient(158deg, #fffdf6, #f6ecd8 70%);
    border-color: rgba(120, 86, 40, 0.24);
}

html[data-theme="dark"][data-theme-pack="sepia"] .welcome-stats .stat {
    background-image: linear-gradient(158deg, #2c2116, #241c12 70%);
}

html[data-theme-pack="sepia"] .welcome-stats .stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ed-accent);
    opacity: 0.8;
}

html[data-theme-pack="sepia"] .welcome-stats .stat-num {
    color: var(--ed-accent);
}

html[data-theme-pack="sepia"] main .section .subject-cards .subject-card {
    border-top: 3px solid var(--ed-accent);
}

html[data-theme-pack="sepia"] .section-heading::after {
    background: linear-gradient(90deg, var(--ed-accent-soft), var(--ws-line));
}

/* ---------- 液态玻璃（浅色）：加强光斑与薄荷色数据卡 ---------- */

html[data-theme-pack="liquid-glass"] body {
    background-image:
        radial-gradient(60rem 40rem at 6% -12%, rgba(59, 130, 246, 0.2), transparent 60%),
        radial-gradient(52rem 36rem at 104% 12%, rgba(45, 212, 191, 0.2), transparent 60%),
        radial-gradient(48rem 34rem at 50% 118%, rgba(129, 140, 248, 0.16), transparent 60%);
    background-attachment: fixed;
}

html[data-theme-pack="liquid-glass"] .welcome-stats .stat {
    background-image: linear-gradient(155deg, rgba(107, 203, 156, 0.24), rgba(255, 255, 255, 0.68));
    border-color: var(--lg-edge);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"][data-theme-pack="liquid-glass"] .welcome-stats .stat {
    background-image: linear-gradient(155deg, rgba(95, 184, 150, 0.24), rgba(20, 29, 44, 0.62));
}

html[data-theme-pack="liquid-glass"] .welcome-stats .stat-num {
    color: var(--ed-accent);
}

html[data-theme-pack="liquid-glass"] .section-heading::after {
    background: linear-gradient(90deg, var(--lg-soft-1), var(--ws-line));
}

html[data-theme-pack="liquid-glass"] .primary-entry:hover {
    box-shadow: 0 16px 38px -22px var(--lg-pop-glow), inset 0 1px 0 var(--lg-highlight);
}

/* ============================================================
   主题配色方案 v2.2 — 三套主题各自成体系
   默认：冷靛蓝（royal indigo）—— 页面冷灰、侧栏深靛、强调电光蓝紫
   护眼：暖纸 + 赭石（burnt sienna）—— 纸色底、赭石强调
   玻璃：冰蓝 + 薄荷绿（mint teal）—— 冰底、玻璃、薄荷强调
   选择器带 data-theme，特异性高于各主题包的 :root，后加载也不被覆盖。
   ============================================================ */

/* ---------- 默认主题 · 冷靛蓝 ---------- */

html:not([data-theme-pack])[data-theme="light"] {
    --ed-accent: #3d4fd6;
    --ed-accent-soft: rgba(61, 79, 214, 0.1);
    --ed-rule: rgba(23, 29, 64, 0.14);
    --ed-rule-strong: rgba(23, 29, 64, 0.38);

    --bg-primary: #eef1fb;
    --bg-secondary: #e2e7f7;
    --bg-card: #ffffff;
    --text-primary: #141a33;
    --text-secondary: #465072;
    --text-light: #7b85a8;
    --border-light: #d8dff0;
    --border-medium: #b9c3e0;
    --card-shadow: 0 1px 2px rgba(24, 32, 90, 0.06), 0 10px 26px rgba(24, 32, 90, 0.08);

    --primary: #3d4fd6;
    --primary-light: #6b7cf0;
    --primary-dark: #2b38a8;
    --primary-lighter: #e7eaff;
    --primary-glow: rgba(61, 79, 214, 0.22);

    --ws-line: #d8dff0;
    --ws-card-bg: #ffffff;
    --ws-shadow: 0 1px 2px rgba(24, 32, 90, 0.05), 0 8px 24px rgba(24, 32, 90, 0.07);
    --ws-side-bg: #151b3a;
    --ws-side-glow: rgba(94, 114, 255, 0.3);
    --ws-side-ink: #eef1ff;
    --ws-side-muted: #a7b0d6;
    --ws-side-line: rgba(255, 255, 255, 0.1);
    --ws-side-hover: rgba(255, 255, 255, 0.07);
    --ws-side-active: rgba(255, 255, 255, 0.12);
    --ws-side-accent: #97a6ff;
    --ws-side-icon: rgba(255, 255, 255, 0.07);
}

html:not([data-theme-pack])[data-theme="dark"] {
    --ed-accent: #93a2ff;
    --ed-accent-soft: rgba(147, 162, 255, 0.14);
    --ed-rule: rgba(210, 218, 255, 0.14);
    --ed-rule-strong: rgba(210, 218, 255, 0.34);

    --bg-primary: #090d1c;
    --bg-secondary: #111733;
    --bg-card: #151c3a;
    --text-primary: #e9ecff;
    --text-secondary: #a8b0d4;
    --text-light: #7e87ab;
    --border-light: #242c4f;
    --border-medium: #38436b;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.42);

    --primary: #93a2ff;
    --primary-light: #b6c0ff;
    --primary-dark: #6b7af0;
    --primary-lighter: #1b2348;
    --primary-glow: rgba(147, 162, 255, 0.16);

    --ws-line: #242c4f;
    --ws-card-bg: #151c3a;
    --ws-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 26px rgba(0, 0, 0, 0.34);
    --ws-side-bg: #0a0f24;
    --ws-side-glow: rgba(99, 116, 255, 0.22);
    --ws-side-ink: #e9ecff;
    --ws-side-muted: #98a2cc;
    --ws-side-line: rgba(210, 218, 255, 0.1);
    --ws-side-hover: rgba(255, 255, 255, 0.06);
    --ws-side-active: rgba(255, 255, 255, 0.1);
    --ws-side-accent: #93a2ff;
    --ws-side-icon: rgba(255, 255, 255, 0.07);
}

/* ---------- 护眼纸色 · 暖纸 + 赭石 ---------- */

html[data-theme-pack="sepia"][data-theme="light"] {
    --ed-accent: #a8471c;
    --ed-accent-soft: rgba(168, 71, 28, 0.13);
    --ed-rule: rgba(120, 86, 40, 0.2);
    --ed-rule-strong: rgba(120, 86, 40, 0.42);

    --bg-primary: #f4e6cc;
    --bg-secondary: #ead9ba;
    --bg-card: #fffaf0;
    --text-primary: #2e2416;
    --text-secondary: #5c4d36;
    --text-light: #8b7a5e;
    --border-light: #e0cfae;
    --border-medium: #c9b48b;
    --card-shadow: 0 1px 0 rgba(120, 86, 40, 0.1), 0 10px 24px rgba(120, 86, 40, 0.08);

    --primary: #a8471c;
    --primary-light: #c46a37;
    --primary-dark: #84340f;
    --primary-lighter: #f6e3d3;
    --primary-glow: rgba(168, 71, 28, 0.18);

    --ws-line: rgba(120, 86, 40, 0.24);
    --ws-card-bg: #fffaf0;
    --ws-shadow: 0 1px 0 rgba(120, 86, 40, 0.1), 0 8px 22px rgba(120, 86, 40, 0.08);
    --ws-side-bg: #ead7b4;
    --ws-side-glow: rgba(168, 71, 28, 0.14);
    --ws-side-ink: #332817;
    --ws-side-muted: #7b6a50;
    --ws-side-line: rgba(120, 86, 40, 0.22);
    --ws-side-hover: rgba(168, 71, 28, 0.1);
    --ws-side-active: rgba(168, 71, 28, 0.16);
    --ws-side-accent: #a8471c;
    --ws-side-icon: rgba(120, 86, 40, 0.1);
}

html[data-theme-pack="sepia"][data-theme="dark"] {
    --ed-accent: #e0915a;
    --ed-accent-soft: rgba(224, 145, 90, 0.14);
    --ed-rule: rgba(240, 230, 212, 0.16);
    --ed-rule-strong: rgba(240, 230, 212, 0.34);

    --bg-primary: #1b1410;
    --bg-secondary: #241b13;
    --bg-card: #2b2117;
    --text-primary: #f4ead8;
    --text-secondary: #c9b79a;
    --text-light: #9d8b6f;
    --border-light: #3a2d1f;
    --border-medium: #54432f;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 32px rgba(0, 0, 0, 0.36);

    --primary: #e0915a;
    --primary-light: #f0b184;
    --primary-dark: #b76f3e;
    --primary-lighter: #3a2a1c;
    --primary-glow: rgba(224, 145, 90, 0.16);

    --ws-line: #3a2d1f;
    --ws-card-bg: #2b2117;
    --ws-shadow: 0 1px 2px rgba(0, 0, 0, 0.38), 0 10px 24px rgba(0, 0, 0, 0.3);
    --ws-side-bg: #201811;
    --ws-side-glow: rgba(217, 154, 106, 0.16);
    --ws-side-ink: #f0e6d4;
    --ws-side-muted: #b3a184;
    --ws-side-line: rgba(240, 230, 212, 0.12);
    --ws-side-hover: rgba(240, 230, 212, 0.06);
    --ws-side-active: rgba(240, 230, 212, 0.1);
    --ws-side-accent: #e0915a;
    --ws-side-icon: rgba(240, 230, 212, 0.08);
}

/* ---------- 液态玻璃 · 冰蓝 + 薄荷绿 ---------- */

html[data-theme-pack="liquid-glass"][data-theme="light"] {
    --ed-accent: #0f8c74;
    --ed-accent-soft: rgba(15, 140, 116, 0.14);
    --ed-rule: rgba(12, 60, 70, 0.14);
    --ed-rule-strong: rgba(12, 60, 70, 0.36);

    --bg-primary: #e8f3fb;
    --bg-secondary: #dcebf7;
    --bg-card: #f8fdff;
    --text-primary: #0c2230;
    --text-secondary: #3f5a68;
    --text-light: #7590a0;
    --border-light: #cfe4f0;
    --border-medium: #aecbdd;
    --card-shadow: 0 1px 2px rgba(9, 50, 66, 0.05), 0 12px 30px rgba(9, 50, 66, 0.08);

    --primary: #0f8c74;
    --primary-light: #4fb999;
    --primary-dark: #0b6757;
    --primary-lighter: #d9f2ec;
    --primary-glow: rgba(15, 140, 116, 0.2);

    --ws-line: #cfe4f0;
    --ws-card-bg: #f8fdff;
    --ws-shadow: 0 1px 2px rgba(9, 50, 66, 0.05), 0 10px 26px rgba(9, 50, 66, 0.07);
    --ws-side-accent: #0f8c74;
}

html[data-theme-pack="liquid-glass"][data-theme="dark"] {
    --ed-accent: #7fe8c4;
    --ed-accent-soft: rgba(127, 232, 196, 0.14);
    --ed-rule: rgba(208, 245, 236, 0.14);
    --ed-rule-strong: rgba(208, 245, 236, 0.32);

    --bg-primary: #04131a;
    --bg-secondary: #0a2029;
    --bg-card: #0f2731;
    --text-primary: #e7f7f4;
    --text-secondary: #a3c4c4;
    --text-light: #7c9c9c;
    --border-light: #173741;
    --border-medium: #255160;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.36), 0 14px 34px rgba(0, 0, 0, 0.34);

    --primary: #7fe8c4;
    --primary-light: #a6f2da;
    --primary-dark: #4fc4a0;
    --primary-lighter: #10312f;
    --primary-glow: rgba(127, 232, 196, 0.16);

    --ws-line: #173741;
    --ws-card-bg: #0f2731;
    --ws-shadow: 0 1px 2px rgba(0, 0, 0, 0.34), 0 10px 26px rgba(0, 0, 0, 0.3);
    --ws-side-accent: #7fe8c4;
}

/* ---------- 配色落地：替换 v2.1 里写死的旧色值 ---------- */

/* 默认主题：光晕、侧栏、顶栏、数据卡、主按钮改为靛蓝体系 */
html[data-theme="light"]:not([data-theme-pack]) body {
    background-image:
        radial-gradient(900px 460px at 100% -6%, rgba(61, 79, 214, 0.14), transparent 62%),
        radial-gradient(800px 420px at -8% 26%, rgba(61, 79, 214, 0.08), transparent 60%);
}

html[data-theme="dark"]:not([data-theme-pack]) body {
    background-image:
        radial-gradient(900px 460px at 100% -6%, rgba(99, 116, 255, 0.2), transparent 62%),
        radial-gradient(760px 420px at -8% 30%, rgba(99, 116, 255, 0.1), transparent 60%);
}

html[data-theme="light"]:not([data-theme-pack]) .app-sidebar {
    background-image:
        radial-gradient(120% 55% at 0% 0%, rgba(94, 114, 255, 0.32), transparent 62%),
        linear-gradient(180deg, #1a2044, #0b1024 78%);
}

html[data-theme="dark"]:not([data-theme-pack]) .app-sidebar {
    background-image:
        radial-gradient(120% 55% at 0% 0%, rgba(99, 116, 255, 0.22), transparent 62%),
        linear-gradient(180deg, #111634, #070b1a 80%);
}

html[data-theme="light"]:not([data-theme-pack]) .app-topbar {
    background: rgba(247, 249, 255, 0.82);
}

html[data-theme="dark"]:not([data-theme-pack]) .app-topbar {
    background: rgba(9, 13, 28, 0.78);
}

html[data-theme="light"]:not([data-theme-pack]) .welcome-stats .stat {
    background-image: linear-gradient(158deg, #f1f3fd, #ffffff 68%);
    border-color: #dbe0f6;
}

html[data-theme="dark"]:not([data-theme-pack]) .welcome-stats .stat {
    background-image: linear-gradient(158deg, #171e3c, #111733 70%);
    border-color: #242c4f;
}

html:not([data-theme-pack]) .primary-entry .pe-icon {
    box-shadow: inset 0 0 0 1px rgba(61, 79, 214, 0.14);
}

html[data-theme="light"]:not([data-theme-pack]) .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, #4d5fe6, #2f3fb0);
}

html[data-theme="dark"]:not([data-theme-pack]) .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, #93a2ff, #5d6fe6);
}

/* 护眼主题：页头与主按钮用赭石渐变 */
html[data-theme-pack="sepia"] .app-sidebar {
    border-right-color: rgba(120, 86, 40, 0.24);
}

html[data-theme-pack="sepia"][data-theme="light"] .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, #b95526, #84340f);
    border-color: transparent;
}

html[data-theme-pack="sepia"][data-theme="dark"] .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, #e0915a, #b76f3e);
    border-color: transparent;
}

/* 玻璃主题：数据卡与主按钮用薄荷渐变 */
html[data-theme-pack="liquid-glass"] .welcome-card .hero-btn-primary {
    background-image: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-color: transparent;
}

/* ============================================================
   移动端页头卡片（v2.3）
   所有页面统一为「品牌图标 + 标题 + 菜单」的顶栏卡片；
   卡片与页面首块的间距统一走 --m-head-gap，避免各页各自为政。
   ============================================================ */

@media (max-width: 768px) {
    body > .container {
        --m-head-gap: 10px;
        padding: 8px 10px 88px;
    }

    body > .container .main-header {
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 9px 11px !important;
        margin: 0 0 var(--m-head-gap) !important;
        background: var(--bg-card) !important;
        background-image: none !important;
        border: 1px solid var(--border-light) !important;
        border-radius: var(--ws-radius, 16px) !important;
        box-shadow: var(--card-shadow) !important;
        overflow: visible !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    body > .container .main-header::before,
    body > .container .main-header::after {
        display: none !important;
    }

    body > .container .main-header .masthead-kicker,
    body > .container .main-header .masthead-meta {
        display: none !important;
    }

    /* 品牌图标：小方块，贴在标题左侧 */
    body > .container .main-header .masthead-mark {
        display: grid !important;
        order: -1;
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        margin: 0;
        padding: 0;
        place-items: center;
        border: 1px solid var(--ed-accent);
        border-radius: 10px;
        background: var(--ed-accent-soft);
        color: var(--ed-accent);
        transform: none;
        outline: 0;
        box-shadow: none;
    }

    body > .container .main-header .masthead-mark .hspcb-i {
        width: 18px;
        height: 18px;
        padding: 0;
        border: 0;
        outline: 0;
        background: none;
    }

    body > .container .main-header h1 {
        order: 0;
        flex: 1;
        min-width: 0;
        margin: 0 !important;
        padding: 0;
        font-size: 1.15rem !important;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 汉堡按钮贴右，和图标同尺寸 */
    body > .container .main-header .m-menu-btn {
        order: 2;
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        padding: 0 8px;
        border: 1px solid var(--border-light);
        border-radius: 10px;
        background: var(--bg-secondary);
    }

    body > .container .main-header .m-menu-btn span {
        height: 1.5px;
        background: var(--text-secondary);
    }

    /* 所有页面首块与页头卡片保持同一间距 */
    body > .container main > .section {
        padding-top: var(--m-head-gap);
    }

    body > .container main > #home-section {
        padding-top: var(--m-head-gap);
    }

    body > .container main > .section > :first-child,
    body > .container main > .section > :first-child > :first-child {
        margin-top: 0 !important;
    }

    /* 语文知识库自带内边距，单独归零，避免叠加 */
    body > .container #chinese-section .chinese-knowledge {
        padding-top: 0 !important;
    }

    body > .container #chinese-section .chinese-knowledge .header {
        margin-top: 0 !important;
    }
}
