:root {
  color-scheme: light;
  --ink: #17344F;
  --muted: #4E6070;
  --accent: #2A7E71;
  --accent-strong: #226B60;
  --accent-soft: #E2F1EE;
  --paper: #F5F8F7;
  --surface: #FFFFFF;
  --line: #DCE5E6;
  --line-strong: #C9D6D8;
  --pearl: #F3CB6B;
  --sand: #FBF6EC;
  --sand-line: #EBDDC4;
  --sand-ink: #6B5B3E;
  --serif-cn: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --serif-en: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --body-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --pill: 999px;
  --gutter: 32px;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
:is(h1, h2, h3)[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.shell { width: min(calc(1200px - 2 * var(--gutter)), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-content { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand img { object-fit: contain; }
.brand-wordmark { font: 800 22px/1.1 var(--serif-cn); letter-spacing: .04em; }
.brand-wordmark small { display: block; margin-top: 4px; color: var(--muted); font: 600 10px/1.2 var(--body-font); letter-spacing: .2em; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; border: 1px solid transparent; border-radius: var(--pill); padding-inline: 15px; }
nav a[aria-current=page], nav a:hover { background: var(--accent-soft); }
nav a[aria-current=page] { font-weight: 700; }
nav a[href="/account"] { border-color: var(--line-strong); }
main { padding-block: 38px 72px; }
#app, .reading-shell { width: auto; max-width: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif-cn); line-height: 1.2; overflow-wrap: anywhere; }
h1[lang=en], h2[lang=en], h3[lang=en] { font-family: var(--serif-en); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding-block: 26px 56px;
}
.kicker { font-size: 13px; color: var(--accent-strong); font-weight: 650; }
.hero .kicker, #direction { width: fit-content; border-radius: var(--pill); padding: 6px 14px; }
.hero .kicker { border: 1px solid var(--line-strong); background: var(--surface); }
.hero h1 { margin-top: 20px; font-size: 25px; }
.hero-slogan { margin-top: 12px; font: 800 clamp(34px, 4.4vw, 59px)/1.24 var(--serif-cn); }
.pearl-highlight { background: linear-gradient(transparent 64%, var(--pearl) 64% 92%, transparent 92%); }
.hero-caption { color: var(--muted); margin-block: 16px 24px; }
.hero-actions, .actions, .card-navigation, .term-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-study-action { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.hero-complete { padding: 4px 10px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 650; }
.primary, .secondary, .inline, .audio, .study-nav-button {
  min-height: 44px; border-radius: var(--pill); padding: 8px 16px; font-weight: 650; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
}
.primary { min-height: 56px; background: var(--accent); color: var(--surface); }
.primary:hover { background: var(--accent-strong); }
.secondary, .audio, .study-nav-button { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.secondary:hover, .audio:hover, .audio.playing, .study-nav-button:hover:not(:disabled) { background: var(--accent-soft); }
.inline { color: var(--accent-strong); background: transparent; padding-inline: 8px; }
.inline:hover:not(:disabled) { text-decoration: underline; }
.hero-actions .secondary { min-height: 56px; }
.hero-visual {
  display: flex;
  align-items: flex-start;
  min-height: 410px;
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--sand) url("/study/cover.jpg") 78% 50% / cover no-repeat;
}
.progress-card { width: min(285px, 100%); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); padding: 20px; color: var(--muted); box-shadow: 0 18px 40px rgba(23, 52, 79, .15); }
.progress-figure { margin-block: 5px 12px; color: var(--ink); }
.progress-figure strong { font: 600 clamp(40px, 5vw, 58px)/1 var(--serif-en); }
.progress-card.is-empty .progress-figure strong { color: var(--muted); font-size: 32px; }
.progress-card p { margin-top: 9px; font-size: 14px; }
progress { width: 100%; height: 8px; display: block; border: 0; border-radius: var(--pill); background: var(--accent-soft); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--accent-soft); }
progress::-webkit-progress-value { background: var(--accent); border-radius: var(--pill); }
progress::-moz-progress-bar { background: var(--accent); border-radius: var(--pill); }
.lookup { padding-block: 42px; border-block: 1px solid var(--line); background: var(--surface); }
.lookup-heading { display: grid; gap: 16px; margin-bottom: 14px; }
.lookup h2, .reading-teaser h2 { font-size: 30px; margin-bottom: 6px; }
.muted { color: var(--muted); }
.search-box {
  display: flex; align-items: center; gap: 12px; min-height: 64px;
  background: var(--surface); border: 2px solid var(--ink); padding: 0 18px; border-radius: 20px; color: var(--accent-strong);
}
.search-box:focus-within { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
.search-box svg { flex: none; }
.search-box input { appearance: none; padding: 13px 0; min-width: 0; width: 100%; color: var(--ink); background: transparent; border: none; }
.search-box input:focus { outline: none; }
.lookup-controls { margin-bottom: 16px; }
.lookup-controls button[aria-pressed=true] { color: var(--surface); background: var(--ink); }
.results, .recap-list { margin: 0; padding: 0; list-style: none; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 14px; }
.result { background: var(--paper); width: 100%; height: 100%; min-height: 88px; border: 1px solid var(--line); border-radius: 20px; text-align: left; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); }
.result:hover { background: var(--accent-soft); }
.result > :first-child { min-width: 0; }
.result strong { font: 600 25px/1.2 var(--serif-en); overflow-wrap: anywhere; }
.result-meaning { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.result-arrow { color: var(--accent-strong); }
.empty, .notice { padding: 20px; color: var(--muted); }
.more { margin-top: 15px; }
.reading-teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; padding: clamp(20px, 4vw, 36px); border: 1px solid var(--sand-line); border-radius: 28px; background: var(--sand); }
.reading-teaser p { color: var(--sand-ink); }
.study-shell { max-width: 780px; }
.study-card { background: var(--surface); border: 1px solid var(--line); border-radius: 32px; padding: clamp(20px, 5vw, 48px); }
.study-card h1 { font-size: clamp(32px, 5vw, 52px); margin: 16px 0 12px; overflow-wrap: anywhere; }
.study-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
#direction { color: var(--ink); background: var(--accent-soft); }
.actions, .card-navigation { margin-top: 18px; }
.recap-list { margin-block: 16px 20px; }
.recap-list li + li { border-top: 1px solid var(--line); }
.recap-list summary { cursor: pointer; min-height: 44px; padding: 10px 4px; overflow-wrap: anywhere; }
.recap-list details p { margin: 6px 0; color: var(--muted); overflow-wrap: anywhere; }
dialog { width: min(720px, calc(100% - 32px)); max-height: 88vh; border: 1px solid var(--line); border-radius: 28px; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(23,52,79,.45); }
.term-sheet { padding: clamp(18px, 4.5vw, 34px); }
.term-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 12px; overflow-wrap: anywhere; }
.term-heading h2 { font-size: clamp(28px, 5vw, 46px); overflow-wrap: anywhere; }
.term-heading > * { min-width: 0; }
.term-heading button { flex: none; }
.entry-section { margin-top: 19px; border-top: 1px solid var(--line); padding-top: 16px; overflow-wrap: anywhere; }
.entry-section h3 { font-size: 19px; margin-bottom: 8px; }
.definition + .definition, .example + .example { margin-top: 14px; }
.definition .muted, .example .muted { margin-top: 4px; }
.entry-section [lang=en] { font-family: var(--serif-en); }
.example { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.example .audio { margin-top: 10px; }
.term-actions { margin-top: 18px; }
.status { position: fixed; inset: auto 16px 16px; max-width: 520px; width: fit-content; margin: auto; padding: 9px 15px; border-radius: 12px; color: var(--surface); background: var(--ink); z-index: 2; }
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .header-content { align-items: flex-start; flex-direction: column; }
  nav a { padding-inline: 12px; }
  main { padding-top: 22px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 4px 32px; }
  .hero-actions > *, .reading-teaser > a { width: 100%; }
  .hero-study-action > .primary { flex: 1 0 auto; }
  .hero-visual { position: relative; isolation: isolate; min-height: 255px; padding: 12px; background: #FBFCF8; }
  .hero-visual::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 0 60%;
    border-radius: 0 31px 31px 0;
    background: url("/study/cover.jpg") right center / cover no-repeat;
  }
  .progress-card { width: min(285px, 60%); padding: 12px; background: #FBFCF8; box-shadow: none; }
  .progress-card p, .result-meaning { font-size: 15px; }
  .search-box { width: 100%; }
  .lookup { padding-block: 28px; }
}
@media (max-width: 600px) {
  .results { grid-template-columns: minmax(0, 1fr); }
}
@media (width < 360px) {
  .hero-visual { min-height: 0; }
  .hero-visual::before { content: none; }
  .progress-card { width: 100%; }
}

.site-footer { padding-block: 24px; color: var(--muted); font-size: 13px; }
