:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1a1a19;
  --muted: #6b6b66;
  --line: #e4e4df;
  --accent: #3d5afe;
  --accent-ink: #ffffff;
  --ok: #1e8e3e;
  --warn: #b26a00;
  --bad: #c62828;
  --chip: #eef0ff;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111113;
    --surface: #1b1b1f;
    --text: #ececec;
    --muted: #9a9aa2;
    --line: #2c2c33;
    --accent: #8c9eff;
    --accent-ink: #0d0d10;
    --chip: #23263a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', 'Noto Sans TC', sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; gap: 12px; }
header.top .brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
nav a { margin-left: 16px; text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--text); }
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0; }
.banner { background: var(--chip); border-radius: var(--radius); padding: 12px 16px; margin: 20px 0; font-size: 14px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tier h3 { margin: 0; font-size: 18px; }
.tier .price { font-size: 28px; font-weight: 700; margin: 8px 0 2px; }
.tier .min { color: var(--muted); font-size: 13px; }
.tier ul { padding-left: 18px; margin: 12px 0 16px; color: var(--muted); font-size: 14px; }
.tier .actions { display: grid; gap: 8px; }
button, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { filter: brightness(1.05); }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
section { margin: 36px 0; }
section > h2 { font-size: 20px; margin: 0 0 14px; }
.wall { display: flex; flex-wrap: wrap; gap: 8px; }
.wall span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
footer { color: var(--muted); font-size: 13px; padding: 32px 0 48px; border-top: 1px solid var(--line); margin-top: 48px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
dialog .body { padding: 20px; }
dialog h3 { margin-top: 0; }
input[type='text'], input:not([type]), select {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select { width: auto; }
.stack > * + * { margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; }
.status { font-size: 14px; min-height: 1.5em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.hidden { display: none !important; }
