:root {
  --ink: #18222f; --sub: #4a5a6a; --acc: #ff5a3c; --acc-ink: #c93a1c; --teal: #0b7f92;
  --line: #dfe8f1; --card: #fff; --ok: #12805c; --ok-bg: #e6f6ef; --bad: #b3261e; --bad-bg: #fdecea;
  --zh: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, var(--zh);
  background: linear-gradient(180deg, #fff8e8 0, #ffffff 340px, #eaf6ff 100%) no-repeat #eaf6ff; min-height: 100vh;
}
[lang="zh-Hans"] { font-family: var(--zh); }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--acc-ink); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }

.site-header { max-width: 1040px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; }
.brand { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand-zi { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--acc); color: #fff; font-size: 20px; font-weight: 700; }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a { color: var(--sub); text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 10px; border-radius: 999px; }
.site-header nav a:hover { background: #fff; color: var(--acc-ink); }

main { max-width: 1040px; margin: 0 auto; padding: 4px 16px 48px; }
h1 { font-size: clamp(26px, 5.2vw, 40px); line-height: 1.18; margin: 6px 0 12px; letter-spacing: -.01em; }
h1 [lang="zh-Hans"] { color: var(--acc-ink); }
.h1-py { color: var(--teal); font-weight: 700; }
h2 { font-size: clamp(21px, 3.6vw, 26px); line-height: 1.25; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: #2c3a49; }
.note, .cap { color: var(--sub); font-size: 15px; }

section, .prose { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 22px 22px 12px; margin: 18px 0; box-shadow: 0 8px 24px rgba(40, 90, 140, .08); }
.home-hero { background: none; border: 0; box-shadow: none; padding: 10px 0 0; margin: 0; }
.home-hero .lead { max-width: 760px; }

.crumbs { font-size: 14px; color: var(--sub); margin: 0 0 4px; }
.crumbs a { color: var(--sub); }

.hero { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: center; padding: 6px 0 4px; }
.hero-glyph { background: #fff; border: 2px solid var(--line); border-radius: 24px; padding: 12px; box-shadow: 0 8px 24px rgba(40, 90, 140, .10);
  background-image: linear-gradient(var(--line), var(--line)), linear-gradient(var(--line), var(--line)); background-size: 100% 1px, 1px 100%; background-position: center; background-repeat: no-repeat; }
.glyph { display: block; width: 100%; height: auto; }
.glyph .s { fill: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(4, auto); gap: 8px; margin: 0 0 14px; justify-content: start; }
.facts div { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); font-weight: 700; }
.facts dd { margin: 0; font-weight: 700; font-size: 16px; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; }

.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; background: var(--acc-ink); color: #fff; border: 2px solid var(--acc-ink); border-radius: 999px; padding: 9px 20px; }
.btn:hover { background: #a82e14; border-color: #a82e14; color: #fff; }
.btn.ghost { background: #fff; color: var(--teal); border-color: var(--teal); }
.btn.ghost:hover { background: #e9f7fa; color: var(--teal); }
.btn.small { font-size: 14px; padding: 5px 14px; }
:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }

.video-wrap { max-width: 360px; margin: 0 auto 12px; }
video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; background: #eef4fa; border-radius: 16px; border: 2px solid var(--line); }
#video .cap { text-align: center; max-width: 560px; margin-left: auto; margin-right: auto; }

.oracle { float: right; width: 150px; margin: 0 0 10px 18px; text-align: center; }
.oracle img { width: 120px; height: 120px; background: #fff8e8; border: 2px solid var(--line); border-radius: 16px; padding: 10px; }
.oracle figcaption { font-size: 12.5px; color: var(--sub); line-height: 1.4; margin-top: 4px; }
.aid { clear: both; background: #fff6e5; border: 2px solid #f3d9a4; border-radius: 14px; padding: 12px 16px 2px; margin: 0 0 14px; }
.aid h3 { color: #8a5207; }
section::after { content: ""; display: block; clear: both; }

.stroke-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-bottom: 12px; }
.anim-box { width: 190px; text-align: center; }
.hz-anim { display: block; width: 190px; height: 190px; background: #fff; border: 2px solid var(--line); border-radius: 18px; margin-bottom: 8px; }
.hz-anim .faint { fill: #e3e9f0; }
.hz-anim .draw { fill: none; stroke: var(--ink); stroke-width: 220; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len); stroke-dashoffset: 0; animation: hz-draw .7s ease-in-out backwards; animation-delay: calc(var(--i) * .95s + .4s); }
@keyframes hz-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .hz-anim .draw { animation: none; } html { scroll-behavior: auto; } }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.steps li { width: 84px; text-align: center; font-size: 13px; font-weight: 700; color: var(--sub); }
.step { display: block; width: 84px; height: 84px; background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.step .s { fill: var(--ink); } .step .s.hl { fill: var(--acc); } .step .s.faint { fill: #e9eef4; }

.table-wrap { overflow-x: auto; margin-bottom: 12px; }
table.words { border-collapse: collapse; width: 100%; }
.words th, .words td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.words thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); }
.words tbody th { font-size: 24px; font-weight: 600; white-space: nowrap; }
.py { color: var(--teal); font-weight: 600; white-space: nowrap; }
.lit { color: var(--sub); }

.qs { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: q; }
.q { counter-increment: q; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px 10px; margin: 0 0 12px; }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.q legend::before { content: counter(q) ". "; color: var(--acc-ink); }
.opt { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; margin: 0 0 8px; cursor: pointer; min-height: 46px; }
.opt:hover { border-color: #b9cde0; }
.opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--acc-ink); flex: none; }
.opt:has(input:checked) { border-color: var(--teal); background: #f1fafc; }
.opt.is-right { border-color: var(--ok); background: var(--ok-bg); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.fb { margin: 4px 0 4px; font-size: 15px; font-weight: 600; }
.q.right .fb { color: var(--ok); } .q.wrong .fb, .q.blank .fb { color: var(--bad); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.score { font-weight: 800; font-size: 19px; margin: 0 0 12px; }
.score.show { background: #fff6e5; border: 2px solid #f3d9a4; border-radius: 14px; padding: 10px 14px; }
.score.show.perfect { background: var(--ok-bg); border-color: #9fd8c0; color: var(--ok); }
.key { margin: 0 0 12px; color: var(--sub); font-size: 15px; }
.key summary { cursor: pointer; font-weight: 700; color: var(--teal); }

.cards { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; background: #fff; transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-3px); border-color: var(--acc); color: var(--ink); }
.card .glyph { width: 76%; margin: 0 auto 4px; }
.card-zi { font-size: 21px; font-weight: 700; }
.card-en { font-weight: 600; }
.card-more { font-size: 13px; color: var(--acc-ink); font-weight: 700; }
.how { padding-left: 22px; margin: 0 0 12px; }
.how li { margin-bottom: 6px; }
.prose ul { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose h2 { margin-top: 22px; }

.prevnext { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.prevnext a { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 8px 16px; text-decoration: none; font-weight: 600; }
.site-footer { max-width: 1040px; margin: 0 auto; padding: 18px 16px 40px; color: var(--sub); font-size: 14px; }
.site-footer p { margin: 0 0 6px; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr 104px; gap: 12px; align-items: start; }
  .hero-glyph { padding: 6px; border-radius: 16px; margin-top: 8px; }
  .hero-text { display: contents; }
  .hero h1 { grid-column: 1; grid-row: 1; margin-top: 8px; }
  .hero-glyph { grid-column: 2; grid-row: 1; }
  .hero .lead, .hero .facts, .hero .jump { grid-column: 1 / -1; }
  .lead { font-size: 16.5px; }
  .facts { grid-template-columns: repeat(2, 1fr); justify-content: stretch; }
  section, .prose { padding: 16px 14px 6px; border-radius: 16px; }
  .oracle { width: 108px; margin-left: 12px; }
  .oracle img { width: 96px; height: 96px; }
  .anim-box { margin: 0 auto; }
  .steps { justify-content: center; }
  .steps li, .step { width: 68px; } .step { height: 68px; }
  .words tbody th { font-size: 21px; }
  .words th, .words td { padding: 8px 6px; }
}
