:root {
  --ink: #202937;
  --muted: #687384;
  --paper: #f7f8f5;
  --card: #ffffff;
  --line: #e1e5e8;
  --accent: #286c65;
  --accent-dark: #1c514d;
  --accent-soft: #e4f0ed;
  --gold: #b47a32;
  --danger: #a4463c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, #edf4f0, transparent 38rem), var(--paper); line-height: 1.55; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 76px; padding: 0 5vw; display: flex; align-items: center; gap: 36px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.86); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 180px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--accent); font-weight: 800; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: 4px; }
.main-nav { display: flex; gap: 4px; align-self: stretch; }
.main-nav a { display: flex; flex-direction: column; justify-content: center; padding: 0 13px; color: var(--muted); font-size: .91rem; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--accent-dark); border-bottom-color: var(--accent); text-decoration: none; }
.main-nav small { font-size: .69rem; color: #9aa3aa; margin-top: 1px; }
.session-pill { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.shell { width: min(1160px, 90vw); margin: 0 auto; }
.search-panel { margin: 48px 0 30px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 46px; align-items: end; }
.eyebrow { color: var(--accent); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; font-weight: 700; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; line-height: 1.16; }
h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); max-width: 720px; margin: 0 0 14px; }
h2 { font-size: clamp(1.7rem, 3vw, 2.65rem); margin: 0 0 10px; }
h3 { font-size: 1.35rem; margin: 0 0 7px; }
.lede { color: var(--muted); max-width: 620px; margin: 0; font-size: 1.03rem; }
.search-form { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); box-shadow: 0 10px 35px rgba(32,41,55,.06); }
.search-form label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 7px; }
.search-row { display: flex; gap: 8px; }
input { width: 100%; border: 1px solid #cbd4d5; background: #fff; border-radius: 10px; padding: 11px 13px; color: var(--ink); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(40,108,101,.12); }
button { border: 0; border-radius: 9px; padding: 10px 15px; color: var(--accent-dark); background: var(--accent-soft); }
button:hover { filter: brightness(.97); }
button.primary { background: var(--accent); color: white; }
button.secondary { background: white; border: 1px solid var(--line); }
button.quiet { background: transparent; color: var(--muted); }
button.danger { color: white; background: var(--danger); }
.app-content { min-height: 420px; padding-bottom: 70px; }
.loading, .empty { color: var(--muted); padding: 50px 0; text-align: center; }
.loading span, .empty span { color: #99a2a8; font-size: .9rem; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin: 32px 0 18px; }
.section-head p { color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 19px; box-shadow: 0 8px 25px rgba(32,41,55,.035); }
.card:hover { border-color: #bad1cd; }
.card p { margin: 5px 0; color: var(--muted); }
.card .zh { color: var(--ink); font-size: .94rem; }
.tag { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: .72rem; margin: 0 5px 5px 0; }
.tag.gold { background: #f7eddd; color: #875a22; }
.tag.gray { background: #edf0f1; color: var(--muted); }
.result-list { display: grid; gap: 9px; }
.result { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.result:hover { border-color: #bad1cd; text-decoration: none; }
.result .result-type { color: var(--muted); font-size: .77rem; white-space: nowrap; }
.node-hero { padding: 28px; background: linear-gradient(120deg, #ffffff, #edf5f1); border: 1px solid var(--line); border-radius: 20px; }
.node-hero .title-row { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.node-title { font-size: clamp(2.4rem, 5vw, 4.7rem); margin: 0; }
.node-title + .zh { font-size: 1.17rem; color: var(--muted); margin-top: 5px; }
.definition { max-width: 720px; font-size: 1.07rem; margin: 22px 0 0; }
.definition .zh { display: block; color: var(--muted); font-size: .94rem; margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.columns { display: grid; grid-template-columns: 1.2fr .8fr; gap: 17px; margin-top: 18px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.panel h3 { display: flex; justify-content: space-between; align-items: baseline; }
.panel h3 small { color: var(--muted); font-family: inherit; font-size: .75rem; font-weight: 400; }
.sense { padding: 14px 0; border-top: 1px solid var(--line); }
.sense:first-of-type { border-top: 0; padding-top: 0; }
.sense strong { color: var(--accent-dark); }
.sense .zh { color: var(--muted); font-size: .9rem; }
.example { margin: 9px 0; padding-left: 13px; border-left: 3px solid #d4e7e3; }
.example .es { display: block; }
.example .zh { display: block; color: var(--muted); font-size: .9rem; }
.relation-list, .link-list { display: grid; gap: 7px; }
.relation-list.map-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.relation-list.map-list .relation { border: 1px solid var(--line); border-radius: 12px; padding: 12px; grid-template-columns: 1fr; background: #f7fbf9; }
.relation { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.relation:first-child { border-top: 0; }
.relation small { color: var(--muted); display: block; }
.relation .reason { font-size: .82rem; color: var(--muted); grid-column: 1 / -1; }
.path-bar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 13px 15px; background: #f0f6f3; border: 1px solid #d6e7e2; border-radius: 12px; margin-bottom: 15px; }
.path-bar span { color: var(--muted); }
.path-bar a { font-weight: 650; }
.dialogue-line { display: grid; grid-template-columns: 100px 1fr; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }
.dialogue-line:first-child { border-top: 0; }
.speaker { color: var(--accent-dark); font-size: .8rem; font-weight: 700; }
.dialogue-line .zh { display: block; color: var(--muted); margin-top: 5px; }
.inline-link { color: var(--accent-dark); border-bottom: 1px dotted var(--accent); }
.review-card { max-width: 700px; margin: 25px auto; text-align: center; padding: 34px; }
.review-prompt { font-family: Georgia, serif; font-size: 1.8rem; margin: 26px 0 10px; }
.review-answer { color: var(--muted); min-height: 28px; }
.answer-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 25px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.stat strong { display: block; font-size: 1.8rem; color: var(--accent-dark); }
.stat span { color: var(--muted); font-size: .82rem; }
.article-body { background: white; border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 5vw, 48px); }
.article-body h2 { margin-top: 35px; }
.article-body p { max-width: 780px; font-size: 1.04rem; }
.article-source { color: var(--muted); font-size: .8rem; margin-top: 12px; }
.two-line { color: var(--muted); font-size: .9rem; }
.two-line strong { color: var(--ink); }
.footer { text-align: center; color: #89939a; border-top: 1px solid var(--line); padding: 25px; font-size: .83rem; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; background: #223332; color: white; padding: 13px 16px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,.2); }
@media (max-width: 820px) {
  .topbar { gap: 13px; padding: 0 5vw; overflow-x: auto; }
  .brand { min-width: 145px; }
  .main-nav a { padding: 0 7px; font-size: .8rem; }
  .session-pill { display: none; }
  .search-panel, .columns { grid-template-columns: 1fr; gap: 20px; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .relation-list.map-list { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .node-hero .title-row { display: block; }
  .node-hero .title-row button { margin-top: 15px; }
}
