/* ============================================
   章节双语学习版式 + 模拟题套题 + 订阅
   考纲 = 衬线体（Noto Serif SC / Source Serif 4）
   拓展讲解 = 无衬线体（Noto Sans SC，站点正文字体）
   ============================================ */

:root {
  --syl-bg: #fffdf8;
  --syl-rule: #c9a84c;
  --en-ink: #4a4a68;
  --ok: #2a6b4a;
  --bad: #b5253a;
}

/* ── 语言切换条 ── */
.lang-bar {
  position: sticky; top: 64px; z-index: 50;
  background: rgba(250,248,244,0.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.lang-bar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0.55rem 2rem;
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-soft);
}
.lang-bar .seg { display: inline-flex; border: 1px solid var(--border-gold); border-radius: 8px; overflow: hidden; }
.lang-bar button {
  font: inherit; font-size: 13px; padding: 5px 12px; border: 0; background: transparent;
  color: var(--ink-mid); cursor: pointer;
}
.lang-bar button + button { border-left: 1px solid var(--border-gold); }
.lang-bar button[aria-pressed="true"] { background: var(--ink); color: var(--gold-light); }
.lang-bar button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.lang-bar .legend { display: inline-flex; gap: 1rem; margin-left: auto; }
.lang-bar .legend span { display: inline-flex; align-items: center; gap: 6px; }
.lang-bar .legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lang-bar .legend .k-syl i { background: var(--syl-rule); }
.lang-bar .legend .k-ext i { background: var(--ink-faint); }
.lang-bar .legend .k-syl { font-family: 'Noto Serif SC', serif; }

/* 语言显示控制 */
html.show-zh .en { display: none !important; }
html.show-en .zh { display: none !important; }
html.show-en .bi { grid-template-columns: 1fr !important; }

/* ── 考纲块（衬线） ── */
.syl {
  background: var(--syl-bg);
  border: 1px solid var(--border-gold);
  border-top: 3px solid var(--syl-rule);
  border-radius: 4px 4px 10px 10px;
  padding: 1.1rem 1.4rem 0.6rem;
  margin: 0.5rem 0 1.75rem;
  font-family: 'Noto Serif SC', 'Source Serif 4', 'Songti SC', serif;
}
.syl-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-weight: 700; color: var(--ink); font-size: 1rem; margin-bottom: 0.6rem;
}
.syl-head .en { font-family: 'Source Serif 4', serif; font-weight: 400; font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }
.syl ol { list-style: none; counter-reset: syl; margin: 0 !important; padding: 0; }
.syl li {
  counter-increment: syl; position: relative;
  padding: 0.55rem 0 0.55rem 2.1rem; border-top: 1px dashed var(--border-gold);
  margin: 0 !important;
}
.syl li::before {
  content: counter(syl); position: absolute; left: 0; top: 0.62rem;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--gold-faint); color: #8a6d1f; border: 1px solid var(--border-gold);
  font: 600 12px/1.45rem 'Source Serif 4', serif; text-align: center;
}
.syl li.hot::after {
  content: '高频'; position: absolute; right: 0; top: 0.65rem;
  font: 500 11px/1 'Noto Sans SC', sans-serif; color: var(--red);
  border: 1px solid rgba(181,37,58,0.35); padding: 3px 6px; border-radius: 4px;
}
.syl li.hot { padding-right: 3.2rem; }
.syl .zh { color: var(--ink); font-size: 1.02rem; line-height: 1.8; font-weight: 500; }
.syl .en { font-family: 'Source Serif 4', Georgia, serif; color: var(--en-ink); font-size: 0.98rem; line-height: 1.6; margin-top: 2px; }
.syl b { color: #8a1c2c; font-weight: 700; }

/* ── 拓展讲解（无衬线，中英对照） ── */
.ext-label {
  font-size: 13px; color: var(--ink-soft); margin: 1.25rem 0 0.75rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.ext-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.bi { display: grid; grid-template-columns: 1fr; gap: 0.35rem 2rem; margin-bottom: 1.1rem; }
@media (min-width: 1000px) { .bi { grid-template-columns: 1.05fr 1fr; } }
.bi .zh { color: var(--ink-mid); font-weight: 300; line-height: 1.9; }
.bi .en { color: var(--en-ink); font-weight: 300; line-height: 1.7; font-size: 0.95rem; }
@media (min-width: 1000px) { .bi .en { border-left: 1px solid var(--border); padding-left: 1.25rem; } }
.ch-section h3.sub { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; color: var(--ink); font-weight: 500; }
.ch-section h3.sub .en { font-weight: 400; color: var(--ink-soft); font-size: 0.92rem; margin-left: 0.5rem; }

/* 词汇表 */
.terms { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.5rem; font-size: 0.95rem; }
.terms th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-soft); border-bottom: 1px solid var(--border-gold); padding: 6px 10px; }
.terms td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.terms td:first-child { font-family: 'Source Serif 4', serif; font-weight: 600; color: var(--ink); white-space: nowrap; }
.terms td:last-child { color: var(--ink-soft); font-weight: 300; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 记忆提示 */
.memo {
  background: var(--ink); color: #f1ead8; border-radius: 10px;
  padding: 0.9rem 1.2rem; margin: 0.5rem 0 1.5rem; font-size: 0.95rem;
}
.memo strong { color: var(--gold-light); }
.memo .en { color: #c8c2b0; font-size: 0.9rem; margin-top: 4px; }

/* 图 */
.fig { margin: 1rem 0 1.75rem; }
.fig img, .fig svg { width: 100%; height: auto; border-radius: 8px; display: block; }
.fig.photo img { max-height: 420px; object-fit: cover; }
.fig.svg { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.fig figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 0.5rem; line-height: 1.6; }
.fig figcaption .en { display: block; font-style: italic; }
.fig .credit { font-size: 11px; color: var(--ink-faint); }

/* 时间线 */
.tl { list-style: none; margin: 0.5rem 0 1.5rem !important; padding: 0; border-left: 2px solid var(--gold-light); }
.tl li { position: relative; padding: 0 0 1rem 1.25rem; margin: 0 !important; }
.tl li::before { content: ''; position: absolute; left: -7px; top: 0.55rem; width: 12px; height: 12px; border-radius: 50%; background: var(--cream); border: 2px solid var(--gold); }
.tl .yr { font-family: 'Source Serif 4', serif; font-weight: 700; color: #8a6d1f; margin-right: 0.5rem; }
.tl .zh { color: var(--ink); }
.tl .en { color: var(--en-ink); font-size: 0.92rem; }

/* 章末自测 */
.selftest .st-q { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 0.9rem; }
.st-q .qen { font-family: 'Source Serif 4', serif; font-weight: 600; color: var(--ink); }
.st-q .qzh { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.5rem; }
.st-q .opts { list-style: none; margin: 0 !important; padding: 0; display: grid; gap: 6px; }
.st-q .opts button {
  width: 100%; text-align: left; font: inherit; background: var(--cream); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--ink-mid); line-height: 1.5;
}
.st-q .opts button:hover { border-color: var(--gold); }
.st-q .opts button .k { font-weight: 600; margin-right: 6px; color: var(--ink); }
.st-q .opts button .ozh { display: block; font-size: 0.88rem; color: var(--ink-soft); }
.st-q .opts button.right { border-color: var(--ok); background: rgba(42,107,74,0.08); }
.st-q .opts button.wrong { border-color: var(--bad); background: rgba(181,37,58,0.06); }
.st-q .why { display: none; margin-top: 0.6rem; font-size: 0.92rem; color: var(--ink-mid); background: var(--gold-faint); border-radius: 8px; padding: 0.6rem 0.9rem; }
.st-q.done .why { display: block; }

/* ── 订阅 ── */
.subscribe {
  max-width: 1100px; margin: 0 auto 2rem; padding: 1.5rem 0 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.5rem; align-items: center;
}
.subscribe h4 { color: #fff; font-size: 1.05rem; margin-bottom: 0.25rem; font-family: 'Noto Serif SC', serif; }
.subscribe p { color: rgba(255,255,255,0.65); font-size: 13px; line-height: 1.7; margin: 0; }
.subscribe form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.subscribe input[type=email] {
  flex: 1 1 220px; min-width: 0; padding: 0.7rem 0.9rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); color: #fff; font: inherit; font-size: 14px;
}
.subscribe input[type=email]::placeholder { color: rgba(255,255,255,0.45); }
.subscribe button {
  padding: 0.7rem 1.2rem; border-radius: 8px; border: 0; background: var(--gold); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.subscribe button[disabled] { opacity: 0.6; cursor: wait; }
.subscribe .consent { flex-basis: 100%; font-size: 12px; color: rgba(255,255,255,0.55); }
.subscribe .consent a { color: var(--gold-light); }
.subscribe .msg { flex-basis: 100%; font-size: 13px; min-height: 1.2em; }
.subscribe .msg.ok { color: #9fe0b8; }
.subscribe .msg.err { color: #ffb3bd; }
.subscribe .hp { position: absolute; left: -9999px; }
@media (max-width: 768px) { .subscribe { grid-template-columns: 1fr; padding-left: 0; padding-right: 0; } }

/* ── 模拟题套题 ── */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.8rem; margin: 1rem 0 2rem; }
.set-card {
  display: block; text-decoration: none; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.1rem; transition: border-color .2s;
}
.set-card:hover, .set-card:focus-visible { border-color: var(--gold); outline: none; }
.set-card .n { font-family: 'Source Serif 4', serif; font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1; }
.set-card .t { font-size: 13px; color: var(--ink-soft); margin-top: 0.35rem; }
.set-card .best { font-size: 12px; margin-top: 0.5rem; color: var(--ink-faint); }
.set-card .best.pass { color: var(--ok); }

.mx-wrap { max-width: 820px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.mx-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mx-timer { font-family: 'Source Serif 4', serif; font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.mx-timer.urgent { color: var(--bad); }
.mx-progress { height: 4px; background: var(--cream-dark); border-radius: 2px; overflow: hidden; margin-bottom: 1rem; }
.mx-progress div { height: 100%; background: var(--gold); width: 0; transition: width .2s; }
.mx-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.4rem 1.5rem; }
.mx-card .num { font-size: 12px; color: var(--ink-faint); margin-bottom: 0.4rem; }
.mx-card .qen { font-family: 'Source Serif 4', serif; font-size: 1.15rem; font-weight: 600; color: var(--ink); line-height: 1.5; }
.mx-card .qzh { color: var(--ink-soft); margin: 0.3rem 0 1rem; }
.mx-card .hint { font-size: 12px; color: var(--ink-soft); margin: -0.6rem 0 0.8rem; }
.mx-opts { display: grid; gap: 8px; }
.mx-opts button {
  display: flex; gap: 10px; text-align: left; width: 100%; font: inherit; cursor: pointer;
  background: var(--cream); border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--ink);
}
.mx-opts button:hover { border-color: var(--gold-light); }
.mx-opts button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-faint); }
.mx-opts .k { font-family: 'Source Serif 4', serif; font-weight: 700; width: 1.2rem; flex: none; }
.mx-opts .oen { display: block; font-family: 'Source Serif 4', serif; }
.mx-opts .ozh { display: block; font-size: 0.9rem; color: var(--ink-soft); }
.mx-nav { display: flex; gap: 0.6rem; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; }
.mx-btn { font: inherit; font-size: 14px; padding: 0.65rem 1.2rem; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--ink); }
.mx-btn.primary { background: var(--ink); color: var(--gold-light); border-color: var(--ink); }
.mx-btn:disabled { opacity: 0.4; cursor: default; }
.mx-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1rem; }
.mx-dots button { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: #fff; font: 12px/1 inherit; cursor: pointer; color: var(--ink-soft); }
.mx-dots button.ans { background: var(--gold-faint); border-color: var(--border-gold); color: var(--ink); }
.mx-dots button.cur { outline: 2px solid var(--ink); }
.mx-mode { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; cursor: pointer; }
html.exam-en .mx-card .qzh, html.exam-en .mx-opts .ozh { display: none; }
.mx-result { text-align: center; padding: 1.5rem 0 1rem; }
.mx-result .score { font-family: 'Source Serif 4', serif; font-size: 3rem; font-weight: 700; color: var(--ink); }
.mx-result .badge { display: inline-block; margin-top: 0.4rem; padding: 4px 14px; border-radius: 100px; font-weight: 600; }
.mx-result .badge.pass { background: rgba(42,107,74,0.12); color: var(--ok); }
.mx-result .badge.fail { background: rgba(181,37,58,0.1); color: var(--bad); }
.mx-review .item { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 0.7rem; }
.mx-review .item.bad { border-left-color: var(--bad); }
.mx-review .qen { font-family: 'Source Serif 4', serif; font-weight: 600; }
.mx-review .qzh { color: var(--ink-soft); font-size: 0.92rem; }
.mx-review .ans { font-size: 0.92rem; margin-top: 0.4rem; }
.mx-review .ans .r { color: var(--ok); font-weight: 500; }
.mx-review .ans .w { color: var(--bad); }
.mx-review .exp { font-size: 0.9rem; color: var(--ink-mid); margin-top: 0.4rem; background: var(--cream); border-radius: 6px; padding: 0.5rem 0.75rem; }
.mx-static { margin-top: 2.5rem; }
.mx-static summary { cursor: pointer; font-weight: 500; }

@media (max-width: 768px) {
  .lang-bar-inner { padding: 0.5rem 1rem; }
  .lang-bar .legend { margin-left: 0; }
  .syl { padding: 0.9rem 1rem 0.4rem; }
  .mx-card { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { .mx-progress div { transition: none; } }

/* 移动端：去掉通用 section 内边距，加宽正文 */
@media (max-width: 768px) {
  .ch-layout { padding: 32px 1rem 60px; gap: 1.5rem; }
  .ch-content section.ch-section { padding: 0; }
  .syl li.hot { padding-right: 0; }
  .syl li.hot::after { display: none; }
  .syl li.hot::before { background: #fbe9ec; color: var(--red); border-color: rgba(181,37,58,0.35); }
  .ch-toc ul { gap: 8px 14px; font-size: 13px; }
}
a.mx-btn { text-decoration: none; display: inline-block; }
.mx-nav > span { display: inline-flex; gap: 0.5rem; }
@media (max-width: 480px) { .mx-nav { flex-wrap: nowrap; } .mx-btn { padding: 0.6rem 0.8rem; } }
