/* 3% 特訓營活動頁的樣式（tasks.md 002 Phase 4N 起）。畫面以雛形 `specs/plans/002-training-camp-calendar-gifts/ui/index.html`
   第 12–486 行的 CSS 為準，不重新設計；色票與緩動用 `./tokens.css` 的變數。只做淺色一套（`color-scheme: light`）。
   雛形的「示範控制」列、入口情境示意、外框、落選的動畫與印章版本都不做。
   類別名稱避開開發站示範面板（`./dev.css`）用的 `.panel`、`.seg`、`.ribbon`、`.sk`。 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--red-950);
  overflow-x: clip;
  background-image: repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.04) 0 1px, transparent 1px 14px), repeating-linear-gradient(-45deg, rgba(212, 175, 55, 0.04) 0 1px, transparent 1px 14px);
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
.page { width: 100%; max-width: 480px; margin: 0 auto; background: var(--paper); min-height: 100vh; min-height: 100dvh; position: relative; }
@media (min-width: 768px) { .page { border-left: 1px solid var(--gold-500); border-right: 1px solid var(--gold-500); } }
:focus-visible { outline: 2px solid var(--red-800); outline-offset: 2px; }
.redzone :focus-visible { outline-color: var(--gold-500); }
.num { font-variant-numeric: lining-nums tabular-nums; }
.gnum {
  font-family: var(--serif); font-weight: 900; color: var(--gold-200);
  background: linear-gradient(180deg, #fff0d2 0%, #f6dbb7 45%, #b9854a 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(60, 6, 10, 0.6)); font-variant-numeric: lining-nums tabular-nums; line-height: 1;
}
@supports not (background-clip: text) { .gnum { -webkit-text-fill-color: currentColor; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; color: #fff; }

/* 深紅區 */
.redzone {
  background: radial-gradient(120% 60% at 50% 0%, #93131a 0%, transparent 70%), repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.04) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(212, 175, 55, 0.04) 0 1px, transparent 1px 14px), var(--red-900);
  color: #fff; border-bottom: 1px solid var(--gold-500); padding: 0 16px 12px;
}
.top { height: 36px; display: flex; align-items: center; justify-content: space-between; }
.top b { font-size: 15px; }
.top .who { font-size: 13px; color: var(--gold-100); }
.linkbtn { text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; color: inherit; min-height: 44px; min-width: 44px; }
.top .linkbtn { min-height: 40px; min-width: 0; padding: 0 2px; }
.hero { text-align: center; padding: 2px 0 0; }
.hero .crown { height: 20px; display: flex; justify-content: center; }
.cap {
  display: inline-block; background: var(--red-700); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 18px;
  border-top: 1px solid var(--gold-500); border-bottom: 1px solid var(--gold-500);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%, 6px 50%);
}
.hero h1 { font-family: var(--serif); font-weight: 900; font-size: 24px; line-height: 1.25; margin: 4px 0; text-wrap: balance; }
.hero .lead { margin: 0 0 8px; color: var(--gold-100); font-size: 15px; line-height: 1.5; }
.b1 { font-size: 15px; color: var(--gold-300); }
.b2 { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 4px; margin-top: 2px; }
.b2 .hero-num { font-size: 38px; }
.b2u { font-size: 15px; color: var(--gold-100); }
.how { margin: 4px 0 0; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.hero.compact { padding: 2px 0 0; }
.hero.compact .row1 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.hero.compact .cap { font-size: 12px; padding: 0 14px; }
.hero.compact h1 { font-size: 18px; line-height: 1.3; margin: 0; }
.hero.compact .b-line { font-size: 14px; color: var(--gold-300); margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.hero.compact .b-line .gnum { font-size: 28px; }
.hero.compact .how { font-size: 13px; margin-top: 6px; }
.star { background: none; border: 0; padding: 0 2px; color: inherit; font: inherit; cursor: pointer; text-decoration: none; min-width: 20px; }
.fn-link .star { color: var(--red-800); }

/* 獎勵面板 */
.rpanel { border-top: 1px solid var(--gold-500); margin-top: 8px; padding-top: 4px; }
.statusbar { display: flex; align-items: center; justify-content: space-between; min-height: 28px; gap: 8px; }
.st-left { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; min-width: 0; }
.st-ic { width: 16px; height: 16px; flex: none; display: inline-flex; }
.st-ic:empty { display: none; }
.spin { width: 14px; height: 14px; border: 2px solid rgba(246, 219, 183, 0.3); border-top-color: var(--gold-200); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; border: 0; width: auto; height: auto; }
  .spin::after { content: '…'; }
}
.steps { display: flex; align-items: center; gap: 0; flex: none; }
.steps i { display: block; width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgba(255, 240, 210, 0.3); background: transparent; }
.steps i.done { background: var(--gold-500); border-color: var(--gold-500); }
.steps i.active { width: 8px; height: 8px; background: var(--gold-200); border-color: var(--gold-200); }
.steps s { display: block; width: 12px; height: 1px; background: rgba(255, 240, 210, 0.3); }
.st-extra { font-size: 13px; color: var(--gold-300); }
.st-extra.err { display: flex; gap: 8px; align-items: flex-start; }
.stats { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 12px; margin-top: 4px; align-items: start; }
.stats .sep { background: rgba(212, 175, 55, 0.4); height: 100%; min-height: 80px; }
.stat .lb { font-size: 13px; color: var(--gold-300); }
.stat .big { display: flex; align-items: baseline; gap: 4px; height: 44px; }
.stat .big .gnum { font-size: 40px; }
.stat .big small { font-size: 15px; color: var(--gold-300); }
.stat .sub { font-size: 13px; color: var(--gold-300); }
.skel { display: block; width: 64px; height: 40px; background: rgba(255, 240, 210, 0.12); border-radius: 4px; }
.fnote { font-size: 12px; color: var(--gold-300); margin: 4px 0 0; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; border-radius: 8px; font-weight: 700; font-size: 15px;
  border: 1px solid transparent; text-align: center; padding: 8px 12px;
}
.btn.gold { background: linear-gradient(180deg, #f6dbb7, #e9c98f); color: var(--red-950); border-color: var(--gold-500); }
.btn.gold:active { background: #e9c98f; }
.btn.red { background: var(--red-700); color: #fff; box-shadow: inset 0 0 0 1px rgba(246, 219, 183, 0.5); }
.btn.red:active { background: var(--red-800); }
.btn.sec { background: #fff; color: var(--red-800); border-color: var(--red-800); font-weight: 500; min-height: 44px; }
.btn.secd { background: transparent; color: var(--gold-100); border-color: var(--gold-500); font-weight: 500; min-height: 44px; }
.btn.dis { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }
.btn.busy { opacity: 0.85; }
.btn.sm { width: auto; min-height: 40px; padding: 6px 14px; }
.tbtn { background: none; border: 0; color: var(--red-800); font-weight: 700; font-size: 13px; min-height: 44px; padding: 0 6px; cursor: pointer; }
.errtext { font-size: 13px; color: #ffb4b0; margin: 6px 0 0; text-align: center; }
.errbox { display: flex; gap: 8px; align-items: flex-start; background: var(--error-bg); color: var(--error); border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* 訓練量表：15 格，一個有簽到的日子亮一格；10、20、30 有長刻度 */
.gauge { position: relative; height: 38px; margin-top: 4px; }
.gauge .trk { position: absolute; left: 0; right: 0; top: 14px; height: 10px; display: flex; gap: 2px; }
.gauge-cell { flex: 1; position: relative; border-radius: 2px; background: rgba(255, 240, 210, 0.18); transition: background 0.32s var(--ease-out); overflow: hidden; }
.gauge-cell[data-lit='true'] { background: var(--gold-200); }
.gauge-cell.push::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0.9; animation: gpush 0.5s var(--ease-out) forwards; }
@keyframes gpush { from { transform: translateX(-100%); opacity: 0.9; } to { transform: translateX(100%); opacity: 0; } }
.gauge .lt { position: absolute; top: 12px; width: 1px; height: 14px; background: var(--gold-300); }
.gauge .ml { position: absolute; top: 26px; font-size: 12px; line-height: 1.2; color: var(--gold-300); transform: translateX(-50%); white-space: nowrap; }
.gauge .ml.last { transform: none; left: auto !important; right: 18px; top: 0; }
.gauge .ml.on { color: var(--gold-100); font-weight: 700; }
.gauge .gcrown { position: absolute; right: 0; top: 0; line-height: 0; }
.gauge .rfx { position: absolute; top: 11px; width: 20px; height: 20px; margin-left: -10px; border: 1px solid var(--gold-200); border-radius: 50%; animation: ringx 0.36s var(--ease-out) forwards; pointer-events: none; }
@keyframes ringx { from { transform: scale(0.6); opacity: 0.6; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gauge-cell { transition: none; } .gauge-cell.push::after { display: none; } }

/* 象牙白區 */
.sec { padding: 0 16px; margin-top: 32px; }
.sec-top { padding: 10px 16px 0; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.3; margin: 0 0 12px; }
h1, h2, h3, .tt, .r-title { text-wrap: balance; }
.wkhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.wkhead b { font-family: var(--serif); font-size: 15px; }
.wkhead span { font-size: 13px; color: var(--ink-2); }
.strip { padding-top: 6px; display: grid; grid-template-columns: repeat(8, 38px); gap: 5px; justify-content: center; position: relative; }
.cell {
  position: relative; width: 38px; min-height: 68px; padding: 3px 0 5px; border: 0; background: transparent; border-radius: 6px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-family: var(--sans); color: var(--ink);
}
.cell .wk { font-size: 11px; line-height: 1; color: var(--ink-2); }
.cell .dt { font-size: 13px; line-height: 1; font-weight: 700; }
.cell .sub { font-size: 11px; line-height: 1; min-height: 11px; margin-top: 2px; white-space: nowrap; color: var(--ink-2); }
.cell .slot { position: relative; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.cell.today { box-shadow: inset 0 0 0 2px var(--red-700); }
.cell .pill { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--red-700); color: #fff; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 999px; white-space: nowrap; z-index: 2; }
.cell.grad { box-shadow: inset 0 0 0 1px var(--gold-ink); background: #fff8ea; }
.cell.grad.today { box-shadow: inset 0 0 0 2px var(--red-700); }
.cell.miss .dt, .cell.past .dt { color: var(--ink-2); }
.ring { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--red-700); }
.ring.dash { border: 1.5px dashed var(--missed-ring); }
.rib { position: absolute; right: -3px; top: -3px; }
.float { position: absolute; left: 0; top: 0; width: 30px; height: 30px; opacity: 0; transform: translateY(-28px) scale(1.1); z-index: 6; pointer-events: none; }
.float.in { animation: fin 0.28s var(--ease-out) forwards; }
.float.press { animation: press 0.22s var(--ease-in) forwards; }
.float.retract { animation: retract 0.26s var(--ease-in) forwards; }
.float .bobber { width: 30px; height: 30px; }
.float.bob .bobber { animation: bob 0.9s var(--ease-bob) infinite alternate; }
@keyframes fin { from { opacity: 0; transform: translateY(-40px) scale(1.1); } to { opacity: 1; transform: translateY(-28px) scale(1.1); } }
@keyframes press { from { opacity: 1; transform: translateY(-28px) scale(1.1); } to { opacity: 1; transform: translateY(0) scale(0.9); } }
@keyframes retract { from { opacity: 1; transform: translateY(-28px) scale(1.1); } to { opacity: 0; transform: translateY(-48px) scale(1.1); } }
@keyframes bob { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
.land svg { animation: bounce 0.14s var(--ease-out); }
@keyframes bounce { from { transform: scale(0.9); } to { transform: scale(1); } }
.slot.halo::before { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--red-700); opacity: 0; animation: halo 0.36s var(--ease-out); }
@keyframes halo { from { transform: scale(0.6); opacity: 0.35; } to { transform: scale(1.5); opacity: 0; } }
.cell.flash { animation: flash 0.36s; }
@keyframes flash { from { background: #fbeaea; } to { background: transparent; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .land svg, .slot.halo::before, .cell.flash { animation: none; }
  .float.bob .bobber { animation: none; }
}

/* 今天解鎖卡與明天預告 */
.tcard-wrap { min-height: 88px; margin: 8px 16px 0; }
.tcard-slot { min-height: 88px; }
.tcard { display: block; background: var(--card); border-radius: 8px; border-left: 3px solid var(--red-700); padding: 10px 16px; box-shadow: 0 1px 2px rgba(60, 20, 10, 0.08), 0 0 0 1px var(--line); position: relative; }
.tcard.show { animation: rise 0.32s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tcard.show, .next.show { animation: none; } }
.tcard .k { font-size: 12px; font-weight: 700; color: var(--red-700); }
.tcard .k span { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.tcard .tt { font-size: 17px; line-height: 1.4; font-weight: 700; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .ex { font-size: 13px; color: var(--ink-2); margin: -2px 0 8px; }
.tcard .act { display: flex; justify-content: flex-end; }
.tcard.close { border-left-color: var(--gold-ink); background: #fff8ea; }
.tcard.close .tt { -webkit-line-clamp: unset; }
.tcard.close .ex { margin: 0; color: var(--ink); }
.next { margin: 6px 16px 0; font-size: 13px; display: flex; gap: 6px; align-items: flex-start; min-height: 20px; }
.next .nx { color: var(--ink-2); }
.next.show { animation: rise 0.32s var(--ease-out) 0.12s backwards; }

/* 快捷列 */
.quick { position: sticky; top: var(--wrapH, 0px); bottom: 0; z-index: 20; display: flex; gap: 8px; padding: 12px 16px 0; background: transparent; margin-top: 8px; }
.quick.stuck { background: rgba(251, 248, 243, 0.96); padding: 4px 16px; border-bottom: 1px solid var(--line); margin-top: 0; }
.quick.stuck-b { background: rgba(251, 248, 243, 0.96); padding: 6px 16px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(40, 10, 5, 0.08); }
.quick button { flex: 1; min-width: 0; height: 44px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink); padding: 0 6px; white-space: nowrap; }
.quick button b { color: var(--red-800); }
.quick button.on { box-shadow: inset 0 -2px 0 var(--red-700); }
.anchor { scroll-margin-top: 64px; }

/* 課表與清單 */
.lhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lhead h2 { margin: 0; }
.segtab { display: flex; background: var(--paper-2); border-radius: 999px; padding: 2px; min-height: 44px; margin-bottom: 12px; }
.segtab button { flex: 1; border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink-2); min-height: 40px; }
.segtab button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(60, 20, 10, 0.08), 0 0 0 1px var(--line); }
.wkbar { background: var(--paper-2); min-height: 36px; display: flex; justify-content: space-between; align-items: center; padding: 4px 12px; margin-top: 8px; }
.wkbar b { font-family: var(--serif); font-size: 15px; }
.wkbar span { font-size: 13px; color: var(--ink-2); }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows > li { border-bottom: 1px solid var(--line); position: relative; }
.row { display: grid; grid-template-columns: 44px 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 72px; padding: 10px 4px; position: relative; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; }
a.row:active, button.row:active { background: var(--paper-2); }
.row.today { box-shadow: inset 0 0 0 2px var(--red-700); border-radius: 8px; }
.row .pill { position: absolute; top: -1px; left: 8px; background: var(--red-700); color: #fff; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 999px; }
.r-date b { display: block; font-family: var(--serif); font-weight: 900; font-size: 28px; line-height: 1; }
.r-date small { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.r-stamp { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.r-mid { min-width: 0; }
.r-title { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; margin-top: 2px; }
.r-note { font-size: 13px; color: var(--ink-2); }
.r-act { font-size: 13px; text-align: right; max-width: 86px; color: var(--ink-2); }
.r-act.go { color: var(--red-800); font-weight: 700; }
.r-act.sm { font-size: 12px; max-width: 100px; }
.row.dim .r-title, .row.dim .r-date b { color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 3px; height: 20px; border-radius: 4px; font-size: 12px; font-weight: 500; padding: 0 6px; white-space: nowrap; }
.tag.course { background: #fbeaea; color: var(--red-800); }
.tag.report { background: var(--paper-2); color: var(--ink); }
.tag.lottery, .tag.grad { background: #fff8ea; color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold-ink); }
.rlist .row { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; }
.rlist .d { font-size: 12px; color: var(--ink-2); }
.rlist .r-title { font-size: 17px; font-weight: 700; line-height: 1.4; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; }
.filters button { flex: none; min-height: 44px; border-radius: 999px; padding: 0 14px; font-size: 13px; background: #fff; border: 1px solid var(--line); }
.filters button.on { background: var(--red-700); border-color: var(--red-700); color: #fff; }
details.miss { margin-top: 8px; }
details.miss summary { min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--ink-2); cursor: pointer; }
details.miss .mi { font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.empty-note { margin: 0; color: var(--ink-2); }
.serial { background: #fff8ea; border: 1px solid var(--gold-ink); border-radius: 8px; padding: 12px 16px 16px; text-align: center; margin: 16px 16px 0; }
.serial h3 { font-size: 17px; line-height: 1.4; margin: 4px 0 10px; }
.serial code, .cert code { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 700; background: var(--paper-2); border-radius: 6px; padding: 8px; user-select: all; margin-bottom: 10px; overflow-wrap: anywhere; }
.serial .two { display: flex; flex-direction: column; gap: 8px; }
.mut { font-size: 13px; color: var(--ink-2); }
.gdouble { height: 5px; border-top: 1px solid var(--gold-line); border-bottom: 1px solid var(--gold-line); margin: 32px 16px 0; }

/* 4 格關鍵數字、倒數 */
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.g4 { background: rgba(255, 240, 210, 0.06); border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 8px; padding: 6px 10px; text-align: center; line-height: 1.2; }
/* 每格的三段用 inline-block 疊起來：看起來是上下三行，innerText 讀到的是同一行（「3%」跟「研究顯示」在同一格同一句） */
.g4 > * { display: inline-block; width: 100%; }
.g4 .pf { font-size: 12px; color: var(--gold-300); }
.g4 .gnum { font-size: 28px; margin: 0; line-height: 1.15; }
.g4 .ds { font-size: 13px; color: var(--gold-100); }
.cd { font-weight: 400; color: var(--gold-300); font-size: 13px; text-align: center; margin: 12px 0 4px; }
.cd span { font-family: var(--serif); font-weight: 700; color: var(--gold-200); font-size: 20px; white-space: nowrap; }
.cond { font-size: 13px; color: var(--gold-100); text-align: center; margin: 8px 0 0; }
.dark-note { font-size: 13px; line-height: 1.45; color: var(--gold-100); text-align: center; margin: 4px 0 0; }

/* 開賣 */
.sale { text-align: center; padding-top: 12px; }
.sale .t18 { font-family: var(--serif); font-weight: 700; font-size: 18px; margin: 8px 0 4px; }
.sale .add { font-size: 15px; display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.sale .add .gnum { font-size: 44px; }
.sale .res { font-size: 13px; color: var(--gold-300); margin: 6px 0 14px; }

/* 活動辦法 */
.how3 { list-style: none; padding: 0; margin: 0; }
.how3 li { display: grid; grid-template-columns: 32px 1fr; gap: 8px; margin-bottom: 12px; }
.how3 .no { font-family: var(--serif); font-weight: 900; font-size: 24px; color: var(--red-800); line-height: 1.2; }
.how3 p { margin: 0; }
.fn { font-size: 12px; color: var(--ink-2); line-height: 1.6; margin: 0 0 6px; }
.main-copy { margin: 0 0 12px; }
.rep { display: flex; justify-content: space-between; align-items: center; min-height: 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 32px 16px 0; font-size: 15px; }
.rep span { color: var(--red-800); font-weight: 700; }
.endmsg { text-align: center; padding: 24px 0 8px; }
.endmsg h1 { font-family: var(--serif); font-weight: 900; font-size: 24px; margin: 0 0 6px; }
.endmsg p { margin: 0; color: var(--gold-100); }

/* 提示、遮罩、底部面板 */
.toast {
  position: fixed; top: calc(var(--wrapH, 0px) + 12px); left: 50%; transform: translateX(-50%); min-height: 44px; max-width: min(360px, calc(100vw - 32px));
  background: rgba(43, 26, 22, 0.92); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 8px; z-index: 200; display: flex; align-items: center; text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s, visibility 0s linear 0.2s;
}
.toast.on { opacity: 1; visibility: visible; transition-delay: 0s; }
.mask { position: fixed; inset: 0; background: rgba(43, 26, 22, 0.45); z-index: 100; animation: fadein 0.2s; }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 480px; transform: translateX(-50%); max-height: 80vh; max-height: 80dvh; overflow: auto; background: var(--paper);
  border-radius: 12px 12px 0 0; box-shadow: 0 -8px 24px rgba(40, 10, 5, 0.18); z-index: 101; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); text-align: center; animation: sheetup 0.36s var(--ease-out);
}
@keyframes sheetup { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .sheet, .mask { animation: none; } }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-family: var(--serif); font-size: 20px; font-weight: 700; margin: 8px 0; }
.sheet h3:focus { outline: none; }
.sheet .tt { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.sheet .btn { margin-bottom: 4px; }
.cert { background: #fffaf0; position: relative; padding: 20px 12px 12px; margin: 4px 0 12px; }
.cert::before, .cert::after, .cert i::before, .cert i::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--gold-line); }
.cert::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.cert::after { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.cert i::before { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.cert i::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.cert i { position: absolute; inset: 0; pointer-events: none; }
.cert h4 { font-family: var(--serif); font-weight: 900; font-size: 24px; color: var(--red-800); margin: 6px 0; }
.cert .pending-serial { font-size: 15px; color: var(--ink-2); background: var(--paper-2); border-radius: 6px; padding: 10px 8px; margin-bottom: 10px; }
.mini { display: grid; grid-template-columns: repeat(5, 16px); gap: 4px; justify-content: center; margin: 6px 0; }

/* 全屏蓋章簽到層（fs=mask） */
.fs { position: fixed; inset: 0; z-index: 150; cursor: pointer; }
.fs-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 330px 70px at 50% calc(max(200px, 26vh) + 186px), rgba(43, 10, 12, 0.97) 0 60%, rgba(43, 10, 12, 0) 100%),
    radial-gradient(ellipse 300px 190px at 50% calc(max(200px, 26vh) + 175px), rgba(43, 10, 12, 0.6), rgba(43, 10, 12, 0)), rgba(43, 10, 12, 0.78);
  animation: fadein 0.2s;
}
.fs.out .fs-bg { animation: fadeout 0.3s forwards; }
.fs.out2 { animation: fadeout 0.2s forwards; pointer-events: none; }
.fs-c { position: relative; padding-top: max(200px, 26vh); display: flex; flex-direction: column; align-items: center; width: 100%; text-align: center; }
.fs-cw { position: relative; width: 160px; height: 176px; }
.fs-card { width: 160px; height: 176px; background: var(--paper); border: 1px solid var(--gold-500); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); }
.fs-dt { position: absolute; left: 0; right: 0; top: 12px; text-align: center; color: var(--ink); pointer-events: none; }
.fs-dt small { margin-left: 8px; }
.fs-dt b { font: 900 34px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.fs-dt small { font-size: 14px; color: var(--ink-2); }
.fs.out .fs-dt, .fs.out .fs-card { animation: fadeout 0.3s forwards; }
.fs-stamp { position: absolute; left: 50%; top: 52px; width: 120px; height: 120px; margin-left: -60px; z-index: 2; animation: fadein 0.2s; }
.fs-stamp-i { width: 120px; height: 120px; transform: translateY(-190px) scale(1.15); }
.fs-stamp-i svg { display: block; width: 120px; height: 120px; background: rgba(251, 248, 243, 0.92); border-radius: 50%; }
.fs-stamp-i.bob { animation: fsbob 0.9s var(--ease-bob) infinite alternate; }
@keyframes fsbob { from { transform: translateY(-194px) scale(1.15); } to { transform: translateY(-186px) scale(1.15); } }
.fs-stamp-i.press { animation: fspress 0.36s forwards; transform: none; }
@keyframes fspress { 0% { transform: translateY(-190px) scale(1.15); animation-timing-function: var(--ease-in); } 72% { transform: translateY(0) scale(0.92); animation-timing-function: var(--ease-out); } 100% { transform: translateY(0) scale(1); } }
.fs-stamp-i.retract { animation: fsret 0.26s var(--ease-in) forwards; }
@keyframes fsret { from { opacity: 1; transform: translateY(-190px) scale(1.15); } to { opacity: 0; transform: translateY(-210px) scale(1.15); } }
.fs-stamp-i.press svg { background: transparent; }
.fs.hit .fs-card { animation: fstrem 0.08s; }
@keyframes fstrem { 50% { transform: translateY(2px); } }
.fs.hit.out .fs-card { animation: fadeout 0.3s forwards; }
.fs.out .fs-t1, .fs.out .fs-t2, .fs.out .fs-w2, .fs.out .fs-skip { animation: fadeout 0.2s forwards; }
.fs.hit .fs-cw::before { content: ''; position: absolute; left: 50%; top: 52px; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; background: var(--red-700); opacity: 0; animation: fshalo 0.4s var(--ease-out); z-index: 1; }
@keyframes fshalo { from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1.6); opacity: 0; } }
.fs-t1 { margin-top: 28px; font-size: 17px; line-height: 1.4; color: var(--gold-100); min-height: 36px; }
.fs-done { font: 900 28px/1.3 var(--serif); background: linear-gradient(180deg, #fff0d2 0%, #f6dbb7 45%, #b9854a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; min-height: 0; }
.fs-t2 { font-size: 15px; line-height: 24px; color: var(--gold-100); display: none; }
.fs-t2.on { display: block; animation: fadein 0.2s; }
.fs-w2 { font-size: 13px; line-height: 24px; color: var(--gold-300); }
.fs-w2:empty { display: none; }
.fs-msg { min-height: 24px; margin-top: 4px; }
.fs-skip { position: absolute; left: 0; right: 0; bottom: 120px; text-align: center; font-size: 12px; color: var(--gold-300); }

/* 載入中（還不知道登入結果、進度還沒回來）：骨架用淡色，版面和實際內容同尺寸，換上實際內容時不跳 */
.skel-who { display: inline-block; width: 96px; height: 14px; border-radius: 4px; background: rgba(255, 240, 210, 0.16); vertical-align: middle; }
.spin.dk { border-color: rgba(185, 133, 74, 0.3); border-top-color: var(--gold-600); }
.ld-note { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.ld-rows { list-style: none; margin: 0; padding: 0; }
.ld-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.ld-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); }
.ld-lines { flex: 1; display: grid; gap: 8px; }
.ld-bar { display: block; height: 12px; width: 70%; border-radius: 4px; background: var(--paper-2); }
.ld-bar.short { width: 40%; }
.ld .skel, .ld-dot, .ld-bar { animation: ldpulse 1.4s ease-in-out infinite; }
@keyframes ldpulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .ld .skel, .ld-dot, .ld-bar { animation: none; } }
