:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --ink: #1c1b18;
  --ink-soft: #5b574e;
  --ink-faint: #8a857a;
  --line: #e7e3d8;
  --line-strong: #d8d3c6;
  --brand: #2f6df6;
  --brand-soft: #eaf1ff;
  --gold: #b8893b;
  --radius-18: 18px;
  --radius-12: 12px;
  --maxw: 760px;
  --font: "Figtree", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Noto Serif SC", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --surface: #1f1c16;
    --surface-2: #27231b;
    --ink: #f3efe6;
    --ink-soft: #c2bcae;
    --ink-faint: #8f897b;
    --line: #36312a;
    --line-strong: #443e34;
    --brand: #6f9bff;
    --brand-soft: #1b2740;
    --gold: #d6a85a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.7;
  font-size: 17px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top nav */
.dict-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.dict-nav .logo { font-weight: 800; letter-spacing: .2px; }
.dict-nav .links { margin-left: auto; display: flex; gap: 16px; font-size: 15px; }
.dict-nav .links a { color: var(--ink-soft); }

main { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 80px; }

/* hero */
.char-hero { text-align: center; padding: 28px 0 12px; }
.glyph-frame {
  width: 200px; height: 200px; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-18);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  overflow: hidden;
}
.glyph-frame img { width: 78%; height: 78%; object-fit: contain; }
.glyph-frame .placeholder {
  font-family: var(--serif); font-size: 96px; color: var(--ink-faint);
}
.kicker {
  display: inline-block; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
}
.char-hero h1 {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(30px, 6vw, 44px); margin: 6px 0 4px;
}
.char-hero .sub { color: var(--ink-soft); margin: 0 0 18px; }
.glyph-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; font-weight: 700;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(47,109,246,.35);
}
.glyph-cta:hover { text-decoration: none; filter: brightness(1.05); }

/* sections */
section.block { margin-top: 38px; }
section.block > h2 {
  font-size: 22px; font-weight: 800; margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
p { margin: 0 0 14px; }
.ink-char { font-family: var(--serif); font-weight: 700; }

/* word table */
.words { display: grid; gap: 10px; }
.word-row {
  display: grid; grid-template-columns: auto 1fr; gap: 14px;
  align-items: baseline; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-12);
}
.word-row .w { font-family: var(--serif); font-size: 22px; font-weight: 800; }
.word-row .py { color: var(--ink-faint); font-size: 14px; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-12); padding: 14px 16px;
}
.faq-item q { font-style: normal; font-weight: 700; }
.faq-item .a { color: var(--ink-soft); margin-top: 6px; }

/* related */
.related { display: flex; flex-wrap: wrap; gap: 12px; }
.rel-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 92px; padding: 14px 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-12); text-align: center;
}
.rel-card .c { font-family: var(--serif); font-size: 30px; font-weight: 800; color: var(--ink); }
.rel-card .m { font-size: 12px; color: var(--ink-faint); }
.rel-card:hover { text-decoration: none; border-color: var(--brand); }

footer.dict-foot {
  max-width: var(--maxw); margin: 60px auto 0; padding: 24px 20px;
  border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 14px;
  text-align: center;
}
@media (max-width: 520px) {
  .glyph-frame { width: 160px; height: 160px; }
  .rel-card { width: 80px; }
}
