/* 注音雙拼 site — shared tokens and base. Palette from the app icon: ink tile, ivory keycaps, one vermilion dot. */
:root {
  --bg: #f6f3ec;          /* ivory paper */
  --surface: #fffdf8;
  --ink: #1d1c1a;         /* sumi ink */
  --muted: #6b665d;
  --line: #e2dccf;
  --key: #fffdf8;         /* keycap */
  --key-edge: #d6cfbf;
  --accent: #c8402c;      /* vermilion seal, used sparingly */
  --accent-ink: #ffffff;
  --hl: #f3e2c4;          /* highlighted key */
  --tile: #1f1e1c;        /* the ink tile behind the icon */
  --ok: #2f7a4b;
  --font: "Noto Sans TC", "PingFang TC", "Heiti TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #161513; --surface: #1f1e1b; --ink: #efe9dc; --muted: #a39d90; --line: #33312c;
  --key: #2a2825; --key-edge: #3e3b35; --accent: #e0644d; --hl: #4a3a22; --tile: #0d0c0b; --ok: #6cc48d;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #161513; --surface: #1f1e1b; --ink: #efe9dc; --muted: #a39d90; --line: #33312c;
  --key: #2a2825; --key-edge: #3e3b35; --accent: #e0644d; --hl: #4a3a22; --tile: #0d0c0b; --ok: #6cc48d;
  color-scheme: dark }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(22px, 3.2vw, 30px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }

.wrap { max-width: 1040px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* top bar */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.nav .links { display: flex; gap: 18px; margin-left: auto; font-size: 15px; }
.nav .links a { text-decoration: none; color: var(--muted); }
.nav .links a:hover, .nav .links a[aria-current="page"] { color: var(--ink); }

/* keycaps */
kbd, .kbd { font-family: var(--mono); font-size: .86em; display: inline-block; min-width: 1.9em; text-align: center; padding: 0 .45em;
  border: 1px solid var(--key-edge); border-bottom-width: 3px; border-radius: 6px; background: var(--key); color: var(--ink); line-height: 1.6; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--bg); opacity: .9; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.live { border-color: var(--ok); color: var(--ok); }

footer { border-top: 1px solid var(--line); margin-top: 72px; padding-block: 28px 40px; color: var(--muted); font-size: 13px; }
footer .wrap { display: grid; gap: 6px; }

@media (max-width: 560px) { .nav .links { gap: 12px; font-size: 14px; } .brand span { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
