:root, body.theme-formal {
  --bg: #efe8dc;
  --fg: #1c2430;
  --muted: #5e584e;
  --line: #ddd4c4;
  --surface: #f7f1e6;
  --field: #fffdf8;
  --accent: #9e2b2b;
  --accent-ink: #f7f1e6;
  --seal: #9e2b2b;
  --seal-ink: #f7f1e6;
  --paper: #fffdf8;
  --ink: #1c2430;
  --rule: #e4d9c8;
  --sans: "PingFang HK", "Noto Sans HK", "Heiti TC", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti TC", "PMingLiU", serif;
  --radius: 6px;
  --shadow: 0 16px 40px rgb(40 28 16 / 8%);
  color-scheme: light;
}
body.theme-fashion {
  --bg: #0c0c0e;
  --fg: #f4f4f2;
  --muted: #b4b4bc;
  --line: #2a2a2e;
  --surface: #141416;
  --field: #16161a;
  --accent: #ff3d8a;
  --accent-ink: #1a0610;
  --seal: #ff3d8a;
  --seal-ink: #1a0610;
  --paper: #141416;
  --ink: #f4f4f2;
  --rule: #2e2e34;
  --sans: "Avenir Next", "Futura", "PingFang HK", "Noto Sans HK", sans-serif;
  --serif: "Avenir Next", "Futura", "PingFang HK", sans-serif;
  --radius: 0px;
  --shadow: none;
  color-scheme: dark;
}
body.theme-cute {
  --bg: #fff4ec;
  --fg: #3d2422;
  --muted: #7a534c;
  --line: #f0cfc3;
  --surface: #fff;
  --field: #fff;
  --accent: #e85d4c;
  --accent-ink: #fff;
  --seal: #ff8b74;
  --seal-ink: #fff;
  --paper: #fffdfb;
  --ink: #3d2422;
  --rule: #f3d5c8;
  --sans: "Avenir Next", "PingFang HK", "Noto Sans HK", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti TC", serif;
  --radius: 22px;
  --shadow: 0 10px 28px rgb(180 90 60 / 12%);
  color-scheme: light;
}
body.theme-rich {
  --bg: #100e0a;
  --fg: #f6edd8;
  --muted: #d4c09a;
  --line: #3a311c;
  --surface: #18150f;
  --field: #1c1812;
  --accent: #e0b85a;
  --accent-ink: #1a1408;
  --seal: #8f1d1d;
  --seal-ink: #f3d48a;
  --paper: #17140e;
  --ink: #f6edd8;
  --rule: #4a3d22;
  --sans: "PingFang HK", "Noto Sans HK", sans-serif;
  --serif: "Didot", "Bodoni MT", "Songti TC", "PMingLiU", serif;
  --radius: 4px;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
body.theme-cute { font-size: 17px; }
body.theme-rich .top { border-top: 3px solid var(--accent); }
body.has-dock { padding-bottom: 84px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .btn, .dock a, .look, .swatch, .lang button, .picks label, summary {
  cursor: pointer;
  touch-action: manipulation;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: clamp(34px, 7vw, 64px); line-height: 1.02; }
h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }
h3 { font-size: 22px; }
p { margin: 0; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(840px, calc(100% - 32px)); margin: 0 auto; }
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-row, .subrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; flex-wrap: wrap;
}
.subrow { padding-top: 0; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.seal {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  background: var(--seal); color: var(--seal-ink);
  font-family: var(--serif); font-size: 18px; border-radius: 4px;
}
body.theme-fashion .seal { border-radius: 0; }
body.theme-cute .seal { border-radius: 50%; }
body.theme-rich .seal { box-shadow: inset 0 0 0 1px var(--accent); }
.brand b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 560; letter-spacing: -0.03em; line-height: 1; }
body.theme-fashion .brand b, body.theme-fashion h1, body.theme-fashion .profit { font-family: var(--sans); font-weight: 680; letter-spacing: -0.05em; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px; }
.tools, .row, .links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.links a, .btn, button.btn {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650;
}
.btn.solid, button.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.wide { width: 100%; }
.lang { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang button {
  min-height: 44px; border: 0; background: transparent; color: var(--muted);
  padding: 0 10px; border-radius: 0;
}
.lang button.on { background: var(--surface); color: var(--fg); }
.look-row, .swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.look-row form, .swatches form { margin: 0; min-width: 0; }
.look, .swatch { width: 100%; min-height: 48px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: var(--radius); }
.look { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); flex: none; }
.d-fashion { background: #ff3d8a; }
.d-cute { background: #ff8b74; }
.d-formal { background: #9e2b2b; }
.d-rich { background: #e0b85a; }
.look.on .dot { box-shadow: 0 0 0 1px var(--accent-ink); }
.look.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.look small, .swatch small { display: block; font-size: 12px; font-weight: 450; opacity: .8; }
.swatch { text-align: left; padding: 12px; min-height: 92px; }
.swatch.on { outline: 2px solid var(--fg); outline-offset: 2px; }
.t-fashion { background: #0c0c0e; color: #f4f4f2; border-color: #2a2a2e; border-radius: 0; }
.t-fashion b { color: #ff4d8d; }
.t-cute { background: #fff1e8; color: #4a2c2a; border-color: #f0cfc3; border-radius: 20px; }
.t-cute b { color: #e85d4c; }
.t-formal { background: #fffdf8; color: #1c2430; border-color: #e4d9c8; }
.t-formal b { color: #9e2b2b; }
.t-rich { background: #14110c; color: #f6edd8; border-color: #6a5424; box-shadow: inset 0 0 0 1px rgba(224, 184, 90, .55); }
.t-rich b { color: #e0b85a; }
.hero { padding: 36px 0 12px; display: grid; gap: 28px; }
.lede { font-size: 18px; color: var(--muted); max-width: 40rem; }
.kicker { color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
body.theme-formal .kicker { color: var(--seal); }
.price { margin-top: 16px; font-family: var(--serif); font-size: 40px; letter-spacing: -0.04em; line-height: 1; }
.price span { color: var(--muted); font-family: var(--sans); font-size: 14px; letter-spacing: 0; }
.section { padding: 22px 0 8px; }
.grid2, .grid3, .stats { display: grid; gap: 12px; }
.stats { grid-template-columns: 1fr 1fr; }
.card, .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card p, .stat span, .muted { color: var(--muted); }
.stat span { display: block; font-size: 12px; }
.stat b, .money {
  font-family: var(--serif);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.stat b { font-size: 22px; }
.profit {
  font-family: var(--serif);
  font-size: clamp(40px, 10vw, 68px);
  line-height: .95;
  letter-spacing: -0.04em;
  margin: 6px 0 4px;
}
body.theme-fashion .profit, body.theme-rich .profit { color: var(--accent); }
.sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
body.theme-formal .sheet { border: 1px solid var(--rule); }
body.theme-rich .sheet { box-shadow: inset 0 0 0 1px rgba(224, 184, 90, .45); }
.sheet .sub { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
body.theme-formal .sheet .sub, body.theme-cute .sheet .sub { color: #6d6458; }
body.theme-cute .sheet .sub { color: #8a645c; }
.sline { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.sline span { min-width: 0; }
.sline b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 560; }
.sline.header { color: #7a7166; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding-top: 14px; }
body.theme-fashion .sline.header, body.theme-rich .sline.header { color: var(--muted); }
body.theme-fashion .sline.header { letter-spacing: .16em; }
.sline.total { border-top: 1px solid var(--rule); margin-top: 4px; }
.sline.grand { border-top: 3px double var(--rule); margin-top: 6px; font-size: 18px; }
body.theme-fashion .sline.grand b, body.theme-rich .sline.grand b { color: var(--accent); }
.sline.d1 { padding-left: 12px; }
.sline.d2 { padding-left: 24px; }
.banner, .flashbar {
  border: 1px solid var(--line);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: var(--radius);
}
.flash { background: var(--accent); color: var(--accent-ink); padding: 10px 16px; }
main { padding-bottom: 28px; }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  background: var(--field);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--fg); min-height: 44px; }
.check input { width: 22px; min-height: 22px; height: 22px; margin-top: 2px; }
.yearbar { display: flex; gap: 8px; align-items: end; }
.yearbar label { flex: 1; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.picks label {
  min-height: 48px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.pick { position: absolute; width: 1px; height: 1px; opacity: 0; }
.book { position: relative; }
.book .panel { display: none; }
.book:has(#k-exp:checked) .panel.exp,
.book:has(#k-inc:checked) .panel.inc,
.book:has(#k-xf:checked) .panel.xf { display: grid; gap: 12px; }
.book:has(#k-exp:checked) label[for="k-exp"],
.book:has(#k-inc:checked) label[for="k-inc"],
.book:has(#k-xf:checked) label[for="k-xf"] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
@supports not selector(:has(*)) {
  .book .panel { display: grid; gap: 12px; margin-top: 12px; }
}
.vlist { display: grid; gap: 8px; }
.vrow {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
  text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; min-height: 48px;
}
.vrow b { font-weight: 650; }
.vrow small, .meta { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a {
  text-decoration: none; min-height: 40px; padding: 8px 10px;
  border-bottom: 2px solid transparent; color: var(--muted);
}
.tabs a.on { color: var(--fg); border-color: var(--accent); }
.dock {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.dock a {
  min-height: 48px; display: flex; align-items: center; justify-content: center;
  text-align: center; text-decoration: none; color: var(--muted);
  font-size: 12px; line-height: 1.15; padding: 6px 2px;
}
.dock a.on { color: var(--fg); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 22px 0 36px; }
.member { display: grid; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
body.theme-fashion .badge { border-radius: 0; }
ol.steps, ul.clean { margin: 8px 0 0; padding-left: 1.1rem; display: grid; gap: 8px; }
hr.quiet { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.15fr .85fr; align-items: end; padding-top: 64px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  .look small { display: none; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media print {
  .top, .dock, .noprint, .flash, .looks, .yearbar, .picks, .lang, .foot { display: none !important; }
  body, body.has-dock { background: white !important; color: black !important; padding: 0 !important; }
  .sheet { box-shadow: none !important; color: black !important; background: white !important; }
  .sline.header, .muted, .sub { color: #333 !important; }
}
