:root {
  --bg: #ECEEF6;
  --surface: #FFFFFF;
  --surface-2: #F6F7FC;
  --ink: #10142A;
  --ink-soft: #474D6B;
  --muted: #7E86A4;
  --line: #DCDFEE;
  --line-strong: #C6CADF;
  --accent: #3B54D6;
  --accent-ink: #2E42B4;
  --accent-wash: #E6E9FA;
  --gold: #A8721A;
  --gold-ink: #8C5D12;
  --gold-wash: #F6EEDA;
  --danger: #B84438;
  --danger-wash: #F7E6E3;
  --shadow: 0 1px 2px rgba(16,20,42,.05), 0 14px 34px -20px rgba(16,20,42,.30);
  --font-cjk: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --maxw: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0D1A; --surface: #12162B; --surface-2: #0E1122;
    --ink: #E8EBF8; --ink-soft: #AAB1CE; --muted: #6F769A;
    --line: #232848; --line-strong: #303658;
    --accent: #7186F6; --accent-ink: #93A2FB; --accent-wash: #151B38;
    --gold: #EBB24E; --gold-ink: #F2C673; --gold-wash: #241D0D;
    --danger: #E8776B; --danger-wash: #241410;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 20px 44px -24px rgba(0,0,0,.75);
  }
}
:root[data-theme="light"] {
  --bg: #ECEEF6; --surface: #FFFFFF; --surface-2: #F6F7FC;
  --ink: #10142A; --ink-soft: #474D6B; --muted: #7E86A4;
  --line: #DCDFEE; --line-strong: #C6CADF;
  --accent: #3B54D6; --accent-ink: #2E42B4; --accent-wash: #E6E9FA;
  --gold: #A8721A; --gold-ink: #8C5D12; --gold-wash: #F6EEDA;
  --danger: #B84438; --danger-wash: #F7E6E3;
  --shadow: 0 1px 2px rgba(16,20,42,.05), 0 14px 34px -20px rgba(16,20,42,.30);
}
:root[data-theme="dark"] {
  --bg: #0A0D1A; --surface: #12162B; --surface-2: #0E1122;
  --ink: #E8EBF8; --ink-soft: #AAB1CE; --muted: #6F769A;
  --line: #232848; --line-strong: #303658;
  --accent: #7186F6; --accent-ink: #93A2FB; --accent-wash: #151B38;
  --gold: #EBB24E; --gold-ink: #F2C673; --gold-wash: #241D0D;
  --danger: #E8776B; --danger-wash: #241410;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 20px 44px -24px rgba(0,0,0,.75);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-cjk); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding: clamp(34px, 5vw, 56px) 0; }
h1, h2, h3 { text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); }

.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; padding-bottom: 13px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.brand .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; box-shadow: 0 2px 8px -2px var(--accent); }
.brand small { font-family: var(--font-mono); font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.topbar .tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); border: 1px solid var(--line-strong); padding: 4px 10px; border-radius: 100px; }

.hero .wrap { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(28px, 4vw, 52px); align-items: center; }
.hero h1 { font-size: clamp(28px, 4.2vw, 43px); font-weight: 800; line-height: 1.14; margin: 18px 0 0; }
.hero h1 .hl { color: var(--accent-ink); }
.hero h1 .hg { color: var(--gold-ink); }
.hero .lede { margin-top: 18px; font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-soft); max-width: 46ch; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); padding: 7px 13px; border-radius: 100px; color: var(--ink-soft); }
.chip .ic { color: var(--accent-ink); font-size: 14px; }
.chip.g .ic { color: var(--gold-ink); }

.term { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.term-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.term-head .lbl { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.term-head .live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink); }
.term-head .live b { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
@keyframes ping { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 55%,transparent);} 70%{box-shadow:0 0 0 7px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }

.tabs { display: flex; padding: 6px; gap: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tab { flex: 1; border: none; background: transparent; cursor: pointer; font-family: var(--font-cjk); font-size: 13px; font-weight: 700; color: var(--muted); padding: 9px 8px; border-radius: 9px; transition: all .15s ease; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px -1px rgba(0,0,0,.15); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.screen { position: relative; min-height: 348px; padding: 26px 22px; display: grid; place-items: center; text-align: center; background: radial-gradient(120% 90% at 50% -20%, var(--accent-wash), transparent 60%), var(--surface); }
.stage { display: none; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.stage.on { display: flex; animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:none; } }
.screen-title { font-size: 19px; font-weight: 700; }
.screen-sub { font-size: 13.5px; color: var(--ink-soft); max-width: 34ch; }

.badge-ic { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; font-size: 31px; background: var(--accent-wash); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.badge-ic.gold { background: var(--gold-wash); color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 25%, transparent); }

.qr-frame { position: relative; width: clamp(180px, 58vw, 216px); height: clamp(180px, 58vw, 216px); border-radius: 12px; background: #fff; padding: 10px; border: 1px solid var(--line-strong); box-shadow: 0 6px 18px -10px rgba(0,0,0,.4); }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 4px; }
.qr-scan { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--accent); box-shadow: 0 0 10px 2px var(--accent); border-radius: 2px; top: 10px; animation: scan 1.9s ease-in-out infinite; }
@keyframes scan { 0%,100%{ top: 12px; } 50%{ top: calc(100% - 14px);} }

.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--accent-wash); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.gold { border-color: var(--gold-wash); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
.poll { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

.stamp { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; color: #fff; background: var(--accent); animation: stamp .45s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 10px 26px -10px var(--accent); }
.stamp.bad { background: var(--danger); box-shadow: 0 10px 26px -10px var(--danger); }
@keyframes stamp { 0%{ transform: scale(0) rotate(-14deg); opacity: 0;} 60%{ transform: scale(1.14) rotate(4deg);} 100%{ transform: scale(1) rotate(0); opacity:1;} }

.pass { width: 100%; max-width: 300px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; box-shadow: 0 14px 30px -16px rgba(0,0,0,.5); animation: stamp .5s cubic-bezier(.2,1.3,.4,1); }
.pass .lanyard { height: 18px; background: var(--surface-2); display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.pass .lanyard i { display: block; width: 46px; height: 6px; border-radius: 100px; background: var(--line-strong); }
.pass .strip { background: var(--gold); color: #fff; padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; }
.pass .strip .t { font-weight: 800; letter-spacing: .16em; font-size: 14px; }
.pass .strip .t b { font-weight: 700; letter-spacing: .04em; font-size: 12px; opacity: .9; margin-left: 7px; }
.pass .strip .vic { font-size: 18px; }
.pass .qr { padding: 18px 18px 8px; display: grid; place-items: center; }
.pass .qr .box { width: 100%; max-width: 240px; aspect-ratio: 1; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px; box-shadow: 0 6px 16px -10px rgba(0,0,0,.4); }
.pass .qr .box img { width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: pixelated; }
.pass .qr .box .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; color: var(--muted); }
.pass .meta { display: flex; gap: 10px; padding: 4px 18px; }
.pass .meta .cell { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; text-align: left; }
.pass .meta .k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pass .meta .v { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pass .hint { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding: 10px 18px 16px; text-align: center; line-height: 1.5; }

.term-foot { padding: 16px; border-top: 1px dashed var(--line-strong); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.btn { width: 100%; border: none; cursor: pointer; font-family: var(--font-cjk); font-size: 15.5px; font-weight: 700; padding: 14px; border-radius: 12px; background: var(--accent); color: #fff; transition: transform .12s ease, filter .15s ease; text-decoration: none; text-align: center; display: block; }
.btn.gold { background: var(--gold); }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); font-size: 13.5px; padding: 11px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: default; pointer-events: none; }

.meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.stat .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--font-mono); font-size: 34px; font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.stat.g .v { color: var(--gold-ink); }

.shead { max-width: 62ch; margin-bottom: 30px; }
.shead h2 { font-size: clamp(22px, 3vw, 29px); font-weight: 800; margin-top: 12px; }
.shead p { margin-top: 12px; color: var(--ink-soft); font-size: 15.5px; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.step .n { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .08em; margin-top: 12px; }
.step.v .n { color: var(--accent-ink); }
.step.i .n { color: var(--gold-ink); }
.step h3 { font-size: 17px; margin-top: 10px; }
.step p { font-size: 13.5px; color: var(--ink-soft); margin-top: 8px; }
.step .api { display: inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); padding: 4px 9px; border-radius: 7px; }
.step.v .api b { color: var(--accent-ink); }
.step.i .api b { color: var(--gold-ink); }
.step .role-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 100px; }
.step.v .role-tag { background: var(--accent-wash); color: var(--accent-ink); }
.step.i .role-tag { background: var(--gold-wash); color: var(--gold-ink); }
.step .arrow { position: absolute; right: -20px; top: 50%; transform: translateY(-50%); color: var(--line-strong); font-size: 20px; z-index: 2; }
.step:last-child .arrow { display: none; }

footer { border-top: 1px solid var(--line); padding: 26px 0 42px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
footer p { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step .arrow { display: none; }
  /* 手機：讓互動終端機更靠前、間距更緊 */
  .hero { padding-top: 24px; }
  .hero .lede { max-width: none; }
  .hero > .wrap > div:first-child { text-align: center; }
  .hero .chips { justify-content: center; }
  .hero .eyebrow { justify-content: center; }
}
@media (max-width: 480px) {
  section { padding: 30px 0; }
  .wrap { padding: 0 16px; }
  .screen { padding: 22px 16px; min-height: 320px; }
  .term-foot { padding: 14px; }
  .meta-row { gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 30px; }
  .hero h1 { font-size: clamp(26px, 8vw, 34px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
