:root {
  --brand-1: #0663D5;
  --brand-2: #4155E5;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --text: #16181D;
  --muted: #5B6170;
  --line: #E2E5EE;
  --link: #0663D5;
  --chip-bg: #EAF0FD;
  --chip-text: #2A4BC9;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1016;
    --surface: #171A23;
    --text: #ECEEF4;
    --muted: #A2A8B8;
    --line: #2A2F3D;
    --link: #7EA8FF;
    --chip-bg: #1F2740;
    --chip-text: #AFC4FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1016;
  --surface: #171A23;
  --text: #ECEEF4;
  --muted: #A2A8B8;
  --line: #2A2F3D;
  --link: #7EA8FF;
  --chip-bg: #1F2740;
  --chip-text: #AFC4FF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
        "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
a { color: var(--link); }

.hero {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  padding: 20px 16px 36px;
}
.hero-inner, main, footer { max-width: 760px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.lang-toggle { display: flex; gap: 4px; background: rgba(255,255,255,.16); border-radius: 999px; padding: 3px; }
.lang-toggle button {
  border: 0; background: transparent; color: #fff; font: inherit; font-size: 14px;
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: #fff; color: var(--brand-1); font-weight: 600; }
.hero h1 { margin: 28px 0 6px; font-size: 30px; line-height: 1.25; }
.hero p { margin: 0; opacity: .9; }

main { padding: 8px 16px 32px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
}
.card h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.35; }
.card h3 { margin: 18px 0 4px; font-size: 16px; }
.card p, .card ul { margin: 8px 0; }
.card ul { padding-left: 20px; }
.card li { margin: 4px 0; }
.muted { color: var(--muted); font-size: 14px; }
.chip {
  display: inline-block; background: var(--chip-bg); color: var(--chip-text);
  border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600;
}
.summary { border-left: 4px solid var(--brand-2); }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 600; }
details p, details ul { color: var(--text); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.links a {
  color: #fff; text-decoration: none; background: rgba(255,255,255,.18);
  border-radius: 999px; padding: 8px 16px; font-weight: 600;
}
footer { padding: 0 16px 40px; color: var(--muted); font-size: 14px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; overflow-wrap: anywhere; }

/* Bilingual: without JS both languages show; with JS only the chosen one. */
html.js[data-lang="en"] [lang="zh-Hant"]:not(html),
html.js[data-lang="zh-Hant"] [lang="en"]:not(html) { display: none !important; }
html:not(.js) .lang-toggle { display: none; }
