/* 旭翔公益：全站基礎樣式（B 案「公開帳本」）。顏色、字級、間距、圓角、陰影一律 var(--token)。 */

/* ---------- 0 基礎與瀏覽器表面 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--fg) var(--bg-alt); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-normal); overflow-x: hidden; caret-color: var(--accent); accent-color: var(--fg); }
::selection { background: var(--highlight); color: var(--highlight-fg); }
::placeholder { color: var(--muted-fg); opacity: 1; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
p, li, dd, blockquote { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); line-height: var(--leading-tight); word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
.h3 { font-size: var(--text-xl); }
a { color: var(--accent-ink); text-underline-offset: var(--space-1); }
a:hover { text-decoration-thickness: var(--stroke-thin); }
img, svg { max-width: 100%; }
img { height: auto; }
code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: var(--space-1) solid var(--focus-ring); outline-offset: var(--space-1); }
[id] { scroll-margin-top: var(--space-4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.container { width: 100%; max-width: var(--container-wide); margin-inline: auto; padding-inline: var(--space-3); }
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: absolute; left: var(--space-3); top: var(--space-3); display: inline-flex; align-items: center; min-height: 48px; background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); z-index: var(--z-toast); font-weight: 700; }
.nw { white-space: nowrap; }
.icon { width: var(--space-4); height: var(--space-4); flex: none; }
.num, .mono { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); font-weight: var(--display-weight); }
.meta { color: var(--subtle-fg); font-size: var(--text-sm); }
.meta .icon { vertical-align: middle; margin-right: var(--space-1); width: var(--text-base); height: var(--text-base); }
.stack > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-6); }
.inline-form { display: inline-block; margin: 0; }
@media (min-width: 720px) { .container { padding-inline: var(--space-5); } }

/* ---------- 1 按鈕、膠囊、連結 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: var(--space-2) var(--space-4); font: 700 var(--text-md)/var(--leading-snug) var(--font-body); color: var(--fg); background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--shadow-sm); text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--bg-alt); transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn:active { box-shadow: none; transform: translateY(3px); }
.btn-primary { background: var(--cta); color: var(--cta-fg); }
.btn-primary:hover { background: var(--cta-hover); }
.btn-secondary:hover { background: var(--highlight); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-alt); box-shadow: none; transform: none; text-decoration: underline; text-decoration-thickness: var(--stroke-thin); text-underline-offset: var(--space-1); }
.btn-flat { box-shadow: none; }
.btn-flat:hover { box-shadow: var(--shadow-sm); }
.btn:disabled { background: var(--bg-alt); color: var(--subtle-fg); border: var(--stroke-thin) dashed var(--subtle-fg); box-shadow: none; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform var(--dur-state) var(--ease), box-shadow var(--dur-state) var(--ease), background-color var(--dur-state) var(--ease); }
}

.pill { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--space-5); padding: 0 var(--space-3); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--fg); font-size: var(--text-sm); font-weight: 700; line-height: 1; white-space: nowrap; }
.pill-hl { background: var(--highlight); color: var(--highlight-fg); }
.pill-ok { background: var(--success-soft); }
.pill-wait { background: var(--warning); color: var(--warning-fg); }
.pill-bad { background: var(--danger-soft); }
.pill-ink { background: var(--fg); color: var(--band-fg); }

.link-arrow { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; font-weight: 700; color: var(--accent-ink); text-underline-offset: var(--space-1); }
.link-arrow .icon { width: var(--space-4); height: var(--space-4); }
@media (prefers-reduced-motion: no-preference) {
  .link-arrow .icon, .news .go { transition: transform var(--dur-state) var(--ease); }
  .link-arrow:hover .icon, .news a:hover .go { transform: translateX(var(--space-1)); }
}

/* ---------- 2 頁首與主選單 ---------- */
.site-header { background: var(--surface); border-bottom: var(--stroke) solid var(--border); position: relative; z-index: var(--z-dropdown); }
.header-inner { display: flex; align-items: center; gap: var(--space-3); min-height: var(--space-7); }
.brand { border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: var(--space-3); min-height: 48px; color: var(--fg); text-decoration: none; }
.brand b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); line-height: 1; white-space: nowrap; }
.brand-mark { --coin-d: var(--space-5); }
.brand:hover b { color: var(--accent-ink); }
/* 十字圓標硬幣：正面＋6 層側邊＋背面，CSS 3D；比例見 ui.js MARK_FACE */
.mark-line, .mark-cross { fill: var(--mark-ink); } .mark-ring { fill: var(--mark-red); } .mark-disc { fill: var(--surface); }
.coin { --coin-d: var(--space-5); --coin-t: 3px; position: relative; display: inline-block; flex: none; width: var(--coin-d); height: var(--coin-d); perspective: calc(var(--coin-d) * 6); }
.coin-spin { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; }
.coin-face, .coin-edge { position: absolute; inset: 0; border-radius: 50%; }
.coin-face { transform: translateZ(calc(var(--coin-t) / 2)); backface-visibility: hidden; }
.coin-face svg { display: block; width: 100%; height: 100%; }
.coin-face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 26%, rgb(255 255 255 / 0.5), rgb(255 255 255 / 0) 44%); }
.coin-back { transform: rotateY(180deg) translateZ(calc(var(--coin-t) / 2)); }
.coin-edge { background: var(--mark-rim); }
.coin-edge:nth-child(2) { transform: translateZ(calc(var(--coin-t) * 0.357)); }
.coin-edge:nth-child(3) { transform: translateZ(calc(var(--coin-t) * 0.214)); }
.coin-edge:nth-child(4) { transform: translateZ(calc(var(--coin-t) * 0.071)); }
.coin-edge:nth-child(5) { transform: translateZ(calc(var(--coin-t) * -0.071)); }
.coin-edge:nth-child(6) { transform: translateZ(calc(var(--coin-t) * -0.214)); }
.coin-edge:nth-child(7) { transform: translateZ(calc(var(--coin-t) * -0.357)); }
@keyframes coin-turn { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@keyframes coin-turn-hover { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@keyframes coin-cycle { 0%, 52% { transform: rotateY(0); } 82%, 100% { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .site-header .brand-mark .coin-spin { animation: coin-turn 1.4s var(--ease) 0.4s 1 both; }
  .brand:hover .coin-spin, .brand:focus-visible .coin-spin { animation: coin-turn-hover 1.2s var(--ease) 1 both; }
}
.brand-short { display: none; }
.nav-toggle { margin-left: auto; padding-inline: var(--space-3); }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: inline-block; }
.site-nav { display: none; position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: var(--stroke) solid var(--border); padding: var(--space-2) var(--space-3) var(--space-4); }
.site-nav.is-open { display: flex; }
.nav-link { display: flex; align-items: center; min-height: 52px; padding-inline: var(--space-3); color: var(--fg); font-weight: 700; font-size: var(--text-md); text-decoration: none; border-bottom: var(--stroke-thin) solid var(--hairline); border-radius: var(--radius-md); }
.nav-link:hover { background: var(--bg-alt); border-radius: var(--radius-pill); text-decoration: underline; text-decoration-thickness: var(--stroke-thin); text-underline-offset: var(--space-1); }
.nav-link:active { background: var(--highlight); }
.nav-link[aria-current="page"] { background: var(--sky); border-bottom-color: transparent; border-radius: var(--radius-pill); }
.nav-auth { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.nav-auth .btn, .nav-auth .inline-form { width: 100%; }
.nav-auth .inline-form .btn { width: 100%; }
@media (min-width: 1180px) {
  .brand b { font-size: var(--text-xl); }
  .brand-mark { --coin-d: var(--space-6); }
  .header-inner { min-height: var(--space-8); }
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: flex; position: static; flex-direction: row; align-items: center; margin-left: auto; padding: 0; border: 0; background: none; gap: var(--space-1); }
  .nav-link { min-height: 48px; border-bottom: 0; font-size: var(--text-base); padding-inline: var(--space-3); }
  .nav-auth { flex-direction: row; margin: 0 0 0 var(--space-3); }
  .nav-auth .btn, .nav-auth .inline-form, .nav-auth .inline-form .btn { width: auto; }
}
@media (max-width: 359px), (min-width: 1180px) and (max-width: 1359px) { .brand-full { display: none; } .brand-short { display: inline; } } /* 全名＋選單鈕放不下的寬度用簡稱；首屏另有大字全名 */

/* ---------- 3 版面共用 ---------- */
.section { padding-block: var(--space-6); }
.section-flush { padding-top: 0; }
@media (min-width: 720px) { .section { padding-block: var(--space-7); } }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.section-head .h2 { margin: 0; }
.h2 { font-size: var(--text-2xl); }
.h2s { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); line-height: var(--leading-tight); margin-bottom: var(--space-3); }
.h3s { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); line-height: var(--leading-snug); margin-bottom: var(--space-2); }
@media (min-width: 720px) { .h2 { font-size: var(--text-3xl); } .h2s { font-size: var(--text-2xl); } }
.lead { font-size: var(--text-md); color: var(--muted-fg); max-width: var(--measure); margin-top: var(--space-3); line-height: var(--leading-snug); }
.after { margin-top: var(--space-5); }
.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
@media (min-width: 880px) { .two { grid-template-columns: 1fr 1fr; gap: var(--space-6); } .two-detail { grid-template-columns: 1.1fr 1fr; align-items: start; } }

.page-hero { position: relative; background: var(--sky) url(/img/page-sky-2400.webp) no-repeat center / cover; border-bottom: var(--stroke) solid var(--border); padding-block: var(--space-5) var(--space-6); }
.page-hero h1 { max-width: 20em; }
.page-hero .lede { margin-top: var(--space-3); }
.lede { font-size: var(--text-md); line-height: var(--leading-snug); color: var(--fg); max-width: var(--measure); text-wrap: pretty; }
.page-meta { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-sm); color: var(--subtle-fg); margin-bottom: var(--space-2); }
.crumb { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; font-weight: 700; color: var(--accent-ink); }
@media (min-width: 720px) { .page-hero { padding-block: var(--space-6) var(--space-7); } .page-hero h1 { font-size: var(--text-4xl); } .lede { font-size: var(--text-lg); } }

/* ---------- 4 首頁開頭：公開帳本格線 ---------- */
.hero { padding-block: var(--space-4) var(--space-6); }
@media (min-width: 720px) { .hero { padding-block: var(--space-6) var(--space-7); } }
.ledger-grid { display: grid; gap: var(--stroke); background: var(--border); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); overflow: hidden; grid-template-columns: minmax(0, 1fr); }
.cell { background: var(--surface); padding: var(--space-4); min-width: 0; display: flex; flex-direction: column; }
.cell-title { background: var(--bg); container-type: inline-size; padding-block: var(--space-5); }
.cell-sample { background: var(--bg-alt); }
@media (max-width: 719px) {
  .ledger-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cell-title, .cell-sample { grid-column: 1 / -1; }
  .cell-stat { padding: var(--space-3); }
  .cell-stat .stat-label, .cell-stat .stat-period, .cell-stat .stat-empty p { font-size: var(--text-sm); }
  .cell-stat .stat-empty { padding-top: var(--space-3); margin-top: 0; }
  .cell-stat .stat-label { min-height: calc(2em * var(--leading-snug)); }
  .sample-card .row { padding-block: var(--space-2); }
}
.h1 { font-size: clamp(40px, 21cqi, 88px); line-height: var(--leading-tight); letter-spacing: -0.02em; }
.slogan { margin-top: var(--space-4); font-size: var(--text-md); line-height: var(--leading-snug); font-weight: 500; text-wrap: balance; }
.hero-lede { margin-top: var(--space-3); color: var(--muted-fg); line-height: var(--leading-snug); max-width: var(--measure); text-wrap: pretty; }
.hero-cta { margin-top: auto; padding-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch; }
.hero-cta .sub { font-size: var(--text-sm); color: var(--muted-fg); }
.hero-cta .sub a { font-weight: 700; display: inline-flex; align-items: center; min-height: 48px; padding-inline: var(--space-1); }
.cell .stat-label { font-size: var(--text-md); font-weight: 700; }
.cell .stat-value { margin-top: var(--space-3); display: flex; align-items: baseline; gap: var(--space-2); font-family: inherit; font-size: inherit; container-type: inline-size; }
.cell .stat-value .num { font-size: clamp(var(--text-2xl), 15cqi, var(--text-4xl)); line-height: 1; overflow-wrap: anywhere; }
.cell .stat-value .unit { font-size: var(--text-md); font-weight: 700; }
.cell-pts .num { color: var(--accent); }
.stat-period { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--subtle-fg); }
.stat-empty { margin-top: auto; padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.stat-empty p { font-weight: 500; text-wrap: balance; }
.sample-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.sample-head h2, .sample-head h3 { font-family: var(--font-body); font-size: var(--text-md); font-weight: 700; margin: 0; }
.sample-card { margin-top: var(--space-3); border-block: var(--stroke-thin) dashed var(--border); }
.sample-card .row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-3); border-bottom: var(--stroke-thin) solid var(--hairline); }
.sample-card .row:last-child { border-bottom: 0; }
.sample-card .row { padding-inline: 0; }
.sample-card dt { font-size: var(--text-sm); font-weight: 700; color: var(--muted-fg); flex: none; }
.sample-card dd { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.sample-card dd.plain { font-family: var(--font-body); font-weight: 500; }
.sample-card dd.pt { font-weight: 600; }
.sample-note { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--muted-fg); }
.cell-sample .link-arrow { margin-top: auto; padding-top: var(--space-2); align-self: flex-start; }
@media (min-width: 720px) {
  .ledger-grid { grid-template-columns: 1fr 1fr; }
  .cell-title, .cell-sample { grid-column: 1 / -1; }
  .cell-title { padding: var(--space-6) var(--space-5); container-type: normal; }
  .cell-title .h1 { font-size: var(--text-display); }
  .hero-cta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
  .cell { padding: var(--space-5); }
}
@media (min-width: 1120px) {
  .ledger-grid { grid-template-columns: 5fr 3fr 4fr; grid-template-rows: auto auto; }
  .cell-title { grid-column: 1; grid-row: 1 / span 2; container-type: inline-size; padding: var(--space-5); }
  .cell-title .h1 { font-size: clamp(40px, 21cqi, 88px); }
  .cell-sample { grid-column: 3; grid-row: 1 / span 2; }
  .hero-cta { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: var(--space-2); }
  .sample-card { max-width: none; }
}
@media (min-width: 1120px) and (prefers-reduced-motion: no-preference) {
  .ledger-grid .cell { animation: cell-in var(--dur-enter) var(--ease) both; }
  .ledger-grid .cell:nth-child(2) { animation-delay: 80ms; }
  .ledger-grid .cell:nth-child(3) { animation-delay: 160ms; }
  .ledger-grid .cell:nth-child(4) { animation-delay: 240ms; }
}
@keyframes cell-in { from { transform: translateY(var(--space-2)); } to { transform: none; } }

@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding-block: var(--space-3) var(--space-5); }
  .cell-title { padding-block: var(--space-4); }
  .cell-title .h1 { font-size: clamp(32px, 9vh, 48px); }
  .slogan { margin-top: var(--space-2); }
  .hero-cta { padding-top: var(--space-3); }
}

/* ---------- 5 目錄＋步驟 ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-5); }
.toc .toc-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.toc a { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: var(--space-1) var(--space-3); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--fg); font-weight: 700; font-size: var(--text-sm); line-height: var(--leading-snug); text-decoration: none; }
.toc a:hover { background: var(--highlight); }
.toc a:active { background: var(--bg-alt); }
.toc a[aria-current="true"] { background: var(--fg); color: var(--bg); }
.toc a[aria-current="true"]:hover { background: var(--accent-ink); }
.toc .n { font-family: var(--font-mono); font-weight: 600; flex: none; }
.steps { display: grid; gap: var(--space-4); min-width: 0; }
.step { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-3); align-content: start; }
.step-head { display: flex; align-items: center; gap: var(--space-3); }
.step-no { display: inline-flex; align-items: center; justify-content: center; min-width: var(--space-6); min-height: var(--space-6); padding: 0 var(--space-2); flex: none; background: var(--fg); color: var(--bg); border-radius: var(--radius-pill); font-family: var(--font-mono); font-weight: 600; font-size: var(--text-md); }
.step h3 { font-size: var(--text-xl); }
.step p { font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
.who { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.step-hint { border-top: var(--stroke-thin) solid var(--hairline); padding-top: var(--space-3); display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-sm); color: var(--muted-fg); }
.step-hint .icon { color: var(--fg); }
.step-final { background: var(--bg-alt); }
@media (min-width: 1120px) {
  .step { grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); grid-template-areas: "head hint" "text hint" "who hint"; column-gap: var(--space-5); }
  .step-head { grid-area: head; } .step > p { grid-area: text; } .step .who { grid-area: who; }
  .step-hint { grid-area: hint; border-top: 0; padding-top: 0; border-left: var(--stroke-thin) solid var(--hairline); padding-left: var(--space-4); flex-direction: column; font-size: var(--text-md); color: var(--fg); }
}
@media (min-width: 720px) { .step { padding: var(--space-5); } .step h3 { font-size: var(--text-2xl); } }
@media (min-width: 960px) {
  .doc-layout { grid-template-columns: 1fr 3fr; gap: var(--space-6); align-items: start; }
  .toc { position: sticky; top: var(--space-4); background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
  .toc .toc-title { position: static; width: auto; height: auto; clip-path: none; overflow: visible; font-family: var(--font-body); font-size: var(--text-md); font-weight: 700; margin-bottom: var(--space-3); line-height: var(--leading-snug); }
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .toc a { font-size: var(--text-base); }
}

/* ---------- 6 對照表 ---------- */
.compare-wrap { margin-top: var(--space-4); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.compare { width: 100%; border-collapse: collapse; text-align: left; }
.compare th, .compare td { padding: var(--space-3) var(--space-4); vertical-align: top; border-bottom: var(--stroke-thin) solid var(--hairline); }
.compare thead th { background: var(--band); color: var(--band-fg); font-size: var(--text-md); border-bottom: 0; }
.compare tbody th { width: 20%; background: var(--bg-alt); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare td { font-size: var(--text-md); line-height: var(--leading-snug); }
.compare td.same { text-align: center; color: var(--muted-fg); }
.compare td strong { display: block; font-size: var(--text-xl); margin-bottom: var(--space-1); }
@media (max-width: 719px) {
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare tbody th { width: auto; border-bottom: var(--stroke) solid var(--border); }
  .compare tbody tr { border-bottom: var(--stroke) solid var(--border); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare td::before { content: attr(data-label); display: block; font-size: var(--text-sm); font-weight: 700; color: var(--muted-fg); margin-bottom: var(--space-1); }
}

/* ---------- 7 寬帶：合規聲明、名言 ---------- */
.band { background: var(--bg-alt); color: var(--fg); padding-block: var(--space-6); }
@media (min-width: 720px) { .band { padding-block: var(--space-7); } }
.band .lead { color: var(--muted-fg); }
.rules { margin-top: var(--space-5); display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.rule { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); padding-top: var(--space-3); }
.rule b { display: block; font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); line-height: var(--leading-tight); word-break: keep-all; text-wrap: balance; }
.rule p { margin-top: var(--space-2); color: var(--muted-fg); font-size: var(--text-md); line-height: var(--leading-snug); }
.rule p.rule-p { margin: 0; color: var(--fg); line-height: var(--leading-loose); }
@media (min-width: 840px) { .rules { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); } .rule b { font-size: var(--text-2xl); min-height: calc(2em * var(--leading-tight)); } }
.quotes { margin-top: var(--space-5); display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.quote { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.quote blockquote { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); line-height: var(--leading-snug); text-wrap: pretty; }
.quote-lead blockquote { font-size: var(--text-2xl); line-height: var(--leading-tight); }
@media (min-width: 720px) { .quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); } .quote-lead { grid-column: 1 / -1; } .quote-lead blockquote { font-size: var(--text-3xl); } }
@media (min-width: 1120px) { .quotes { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- 8 最新消息、招募、夥伴磚牆、彩方圖帶 ---------- */
.news { border: var(--stroke) solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.news li + li { border-top: var(--stroke-thin) solid var(--hairline); }
.news a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-4); min-height: 48px; color: var(--fg); text-decoration: none; align-items: center; }
.news time { grid-column: 1; font-family: var(--font-mono); font-weight: 500; font-size: var(--text-sm); color: var(--subtle-fg); font-variant-numeric: tabular-nums; }
.news .t { grid-column: 1; font-weight: 700; font-size: var(--text-md); line-height: var(--leading-snug); }
.news .go { grid-column: 2; grid-row: 1 / span 2; }
.news a:hover { background: var(--highlight); }
.news a:hover .t { text-decoration: underline; text-decoration-thickness: var(--stroke-thin); text-underline-offset: var(--space-1); }
.news a:active { background: var(--bg-alt); }
@media (min-width: 560px) { .news a { grid-template-columns: 8rem minmax(0, 1fr) auto; } .news time { grid-column: 1; } .news .t { grid-column: 2; } .news .go { grid-column: 3; grid-row: 1; } }
.news-full a { padding: var(--space-4); align-items: start; grid-template-columns: minmax(0, 1fr) auto; }
.news-full a .news-cover { grid-column: 1 / -1; width: 100%; border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-sm); }
.news-full .news-body { grid-column: 1; display: grid; gap: var(--space-1); }
.news-full time { grid-column: auto; }
.news-full .t { grid-column: auto; font-size: var(--text-lg); }
.news-full .s { color: var(--muted-fg); line-height: var(--leading-snug); max-width: var(--measure); }
.news-full .go { grid-column: 2; grid-row: auto; align-self: center; }
@media (min-width: 720px) { .news-full a { grid-template-columns: 14rem minmax(0, 1fr) auto; } .news-full a:not(:has(.news-cover)) { grid-template-columns: minmax(0, 1fr) auto; } .news-full a .news-cover { grid-column: 1; } .news-full .news-body { grid-column: 2; } .news-full .go { grid-column: 3; } .news-full a:not(:has(.news-cover)) .news-body { grid-column: 1; } .news-full a:not(:has(.news-cover)) .go { grid-column: 2; } }

.recruit { margin-top: var(--space-5); background: var(--accent-soft); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-4); }
.recruit-head { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.recruit .count { display: flex; align-items: baseline; gap: var(--space-2); }
.recruit .count .num { font-size: var(--text-4xl); line-height: 1; }
.recruit .count span:last-child { font-size: var(--text-md); font-weight: 700; }
.recruit h3 { margin-bottom: var(--space-1); font-size: var(--text-xl); }
.recruit .rtext p { font-size: var(--text-md); line-height: var(--leading-snug); max-width: var(--measure); }
.recruit-solo { margin-top: var(--space-6); }
@media (min-width: 960px) { .recruit { padding: var(--space-5); } .recruit-head { flex-direction: row; align-items: center; gap: var(--space-5); } .recruit .rtext { flex: 1; } .recruit .btn { flex: none; } .recruit h3 { font-size: var(--text-2xl); } }
.brick-wall { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .brick-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } .brick { aspect-ratio: 2 / 1; min-height: 0; } }
.brick { min-height: 6.5rem; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); padding: var(--space-2); text-align: center; background: var(--surface); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-sm); }
.brick img { max-height: 50%; width: auto; }
.brick .logo-text { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-md); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.brick-type { font-size: var(--text-xs); color: var(--muted-fg); font-weight: 700; }
.brick-empty { background: transparent; border-style: dashed; padding: 0; }
.brick-empty a { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); color: var(--fg); text-decoration: none; border-radius: var(--radius-sm); }
.brick-empty a b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); line-height: 1; }
.brick-empty a span { font-size: var(--text-sm); font-weight: 700; color: var(--accent-ink); }
.brick-empty a:hover { background: var(--highlight); }
.brick-empty a:hover span { color: var(--fg); }
.brick-empty a:active { background: var(--bg-alt); }
.brick-ghost { border-color: var(--subtle-fg); font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-md); color: var(--subtle-fg); }
@media (max-width: 719px) { .brick-ghost { display: none; } }
@media (min-width: 720px) and (max-width: 1023px) { .brick-ghost:nth-child(n+3) { display: none; } }
.brick-empty a:focus-visible { outline-offset: calc(var(--stroke) * -2); }

.gallery { border-block: var(--stroke) solid var(--border); background: var(--bg-alt); padding-block: var(--space-4); }
.gallery-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.gallery-head h2 { font-family: var(--font-body); font-size: var(--text-lg); font-weight: 700; }
.strip { display: flex; gap: var(--space-3); overflow-x: auto; padding: var(--space-1) var(--space-1) var(--space-3); scroll-snap-type: x proximity; scrollbar-color: var(--fg) var(--bg-alt); }
.strip li { flex: 0 0 10rem; scroll-snap-align: start; }
.strip a { display: block; border: var(--stroke) solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: var(--space-1); overflow: hidden; }
.strip img { display: block; width: 100%; height: auto; }
.strip a:hover { transform: translate(-1px, -1px); }
.strip a:active { transform: none; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) { .strip a { transition: transform var(--dur-state) var(--ease), box-shadow var(--dur-state) var(--ease); } }
@media (min-width: 1120px) { .strip { overflow: visible; padding-inline: 0; } .strip li { flex: 1 1 0; min-width: 0; } }

/* ---------- 9 頁尾 ---------- */
.site-footer { position: relative; background: var(--band); color: var(--band-fg); border-top: var(--space-1) solid var(--gold); padding-block: var(--space-6) var(--space-5); margin-top: var(--space-6); }
.site-footer a, .site-footer .brand { color: var(--band-fg); }
.site-footer .brand:hover b { color: var(--highlight); }
.site-footer :focus-visible { outline-color: var(--highlight); }
.footer-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
.footer-grid > * { border-top: var(--stroke-thin) solid var(--band-dim); padding-top: var(--space-3); min-width: 0; }
.footer-grid h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.footer-brand p { margin-top: var(--space-3); color: var(--band-dim); max-width: var(--measure); }
.footer-contact dt { font-size: var(--text-sm); font-weight: 700; color: var(--band-dim); margin-top: var(--space-2); }
.footer-contact dd { font-size: var(--text-md); overflow-wrap: anywhere; }
.footer-contact a { display: flex; align-items: center; min-height: 44px; font-family: var(--font-mono); font-weight: 500; color: var(--band-fg); }
.footer-contact .addr { padding-block: var(--space-1); }
.footer-links { display: flex; flex-direction: column; }
.footer-links a { display: flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--band-fg); }
.footer-links a:hover { color: var(--highlight); text-decoration-thickness: var(--stroke); }
.footer-links h2 { margin-bottom: var(--space-1); }
.copy { margin-top: var(--space-5); padding-top: var(--space-3); border-top: var(--stroke-thin) solid var(--band-dim); font-size: var(--text-sm); color: var(--band-dim); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .footer-grid { grid-template-columns: 1.5fr 1.5fr 1fr 1fr; gap: var(--space-5); } }
body.is-app .site-footer { margin-top: var(--space-5); }
main:has(> .gallery:last-child) + .site-footer { margin-top: 0; }

/* ---------- 10 內頁 ---------- */
/* 關於 */
.ledger-3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 840px) { .ledger-3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); } }
.facts .cell, .contact-grid .cell { padding: var(--space-5) var(--space-4); }
.fact-big { margin-top: var(--space-3); font-size: var(--text-3xl); line-height: var(--leading-tight); word-break: keep-all; text-wrap: balance; }
.fact-big.serif { font-size: var(--text-2xl); }
/* 日期這類數字不能在連字號斷行：窄螢幕跟著視窗縮字（加大字距時 320 寬也不溢出） */
.fact-big.num { font-size: clamp(var(--text-2xl), 10vw, var(--text-3xl)); }
.fact-text { margin-top: var(--space-3); font-size: var(--text-md); line-height: var(--leading-snug); font-weight: 500; text-wrap: pretty; }
.prose-card p { font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
.intro-list { margin-top: var(--space-4); display: grid; gap: var(--space-3); }
.intro-list p { border-top: var(--stroke) solid var(--border); padding-top: var(--space-3); font-size: var(--text-md); line-height: var(--leading-loose); }
@media (min-width: 840px) { .intro-list { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); } }
.gallery-teaser { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); color: var(--fg); text-decoration: none; min-height: 48px; }
.gallery-teaser span:first-child { display: grid; gap: var(--space-1); }
.gallery-teaser b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); }
.gallery-teaser:hover { background: var(--highlight); }
.gallery-teaser:active { box-shadow: none; }
@media (prefers-reduced-motion: no-preference) { .gallery-teaser { transition: box-shadow var(--dur-state) var(--ease), background-color var(--dur-state) var(--ease); } }

/* 公益點數 */
.doc-points .doc { min-width: 0; }
.doc-block .card p { font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
.doc-block > .lead-p { font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
.rule-statement { margin-top: var(--space-4); background: var(--highlight); color: var(--highlight-fg); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); line-height: var(--leading-snug); }
.kinds { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rule-statement { font-size: var(--text-2xl); } }
.kinds p { font-size: var(--text-md); line-height: var(--leading-loose); }
.kinds + .compare-wrap { margin-top: var(--space-5); }
.order-list { display: grid; gap: var(--space-3); }
.order-list li, .flow li { display: flex; gap: var(--space-3); align-items: flex-start; }
.order-list li { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
.order-list b, .flow b { display: block; font-size: var(--text-md); }
.order-list p, .flow p { margin-top: var(--space-1); color: var(--muted-fg); line-height: var(--leading-snug); }
.flow { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .order-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check-list { display: grid; gap: var(--space-3); }
.check-list li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
.check-list .icon { margin-top: var(--space-1); color: var(--success); }
.ledger-explain { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.ledger-explain p { font-size: var(--text-md); line-height: var(--leading-loose); }
.sample-wrap { background: var(--bg-alt); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
@media (min-width: 840px) { .ledger-explain { grid-template-columns: 1fr 1fr; align-items: start; } }
.faq { display: grid; gap: var(--space-3); }
.faq details { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-4); cursor: pointer; font-weight: 700; font-size: var(--text-md); line-height: var(--leading-snug); list-style: none; border-radius: var(--radius-md); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--highlight); }
.faq summary:active { background: var(--bg-alt); }
.faq details[open] summary { border-bottom: var(--stroke-thin) solid var(--hairline); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding: var(--space-3) var(--space-4) var(--space-4); font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
@media (prefers-reduced-motion: no-preference) { .faq summary .icon { transition: transform var(--dur-state) var(--ease); } }

/* 合作夥伴 */
.partner-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.partner-card { display: grid; gap: var(--space-2); align-content: start; }
.partner-card .meta { display: flex; gap: var(--space-1); align-items: flex-start; }
.partner-logo { max-height: 4rem; width: auto; }
.partner-slot { min-height: 12rem; border: var(--stroke-thin) dashed var(--border); border-radius: var(--radius-md); }
.partner-slot a { height: 100%; min-height: 12rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-4); text-align: center; color: var(--fg); text-decoration: none; border-radius: var(--radius-md); }
.partner-slot b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); }
.partner-slot span { color: var(--accent-ink); font-weight: 700; }
.partner-slot a:hover { background: var(--highlight); }
.partner-slot a:hover span { color: var(--fg); }
.partner-slot a:active { background: var(--bg-alt); }

/* 登入／加入／加盟 */
.auth-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.auth-solo .form-card { margin-inline: auto; }
.form-card { max-width: 40rem; width: 100%; }
.auth-grid .form-card { max-width: none; }
.mall-rule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4); background: var(--cream); border: var(--stroke) solid var(--gold); border-radius: var(--radius-md); }
.mall-rule .icon { width: var(--space-5); height: var(--space-5); margin-top: 2px; }
.mall-rule strong { display: block; font-size: var(--text-md); word-break: keep-all; overflow-wrap: anywhere; }
.mall-rule p { margin-top: var(--space-1); }
.reg-notes { border-block: var(--stroke) solid var(--gold); padding-block: var(--space-4); } /* 在表單卡片裡，用上下金線分隔、不再套一層卡片 */
.reg-notes .h3s { margin-bottom: var(--space-3); font-size: var(--text-lg); }
.reg-notes ol { display: grid; gap: var(--space-3); list-style: none; counter-reset: reg-note; }
.reg-notes li { counter-increment: reg-note; display: grid; grid-template-columns: var(--space-5) minmax(0, 1fr); column-gap: var(--space-3); line-height: var(--leading-normal); }
.reg-notes li::before { content: counter(reg-note); grid-row: span 2; display: grid; place-items: center; width: var(--space-5); height: var(--space-5); border-radius: var(--radius-pill); background: var(--fg); color: var(--surface); font: 600 var(--text-sm)/1 var(--font-mono); }
.reg-notes b { display: block; word-break: keep-all; overflow-wrap: anywhere; }
.aside-panel { background: var(--bg-alt); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
.aside-panel .h3s { margin-bottom: var(--space-4); font-size: var(--text-xl); }
.aside-links { display: grid; gap: var(--space-3); }
.aside-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-3); min-height: 48px; background: var(--surface); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-md); color: var(--fg); text-decoration: none; }
.aside-links a b { font-size: var(--text-md); }
.aside-links a span { grid-column: 1; color: var(--muted-fg); font-size: var(--text-sm); line-height: var(--leading-snug); }
.aside-links a .icon { grid-column: 2; grid-row: 1 / span 2; }
.aside-links a:hover { background: var(--highlight); }
.aside-links a:active { background: var(--bg-alt); }
@media (min-width: 960px) { .auth-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--space-6); } .aside-panel { padding: var(--space-5); } }
.seg { border: 0; padding: 0; margin: 0 0 var(--space-3); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.seg legend { font-weight: 700; margin-bottom: var(--space-1); padding: 0; }
.seg label { position: relative; display: block; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg label > span { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--space-2); align-items: center; min-height: 64px; padding: var(--space-2) var(--space-3); background: var(--surface); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-md); font-weight: 700; }
.seg label > span .icon { grid-row: 1 / span 2; }
.seg small { grid-column: 2; font-weight: 400; font-size: var(--text-sm); color: var(--muted-fg); }
.seg label:hover span { background: var(--highlight); }
.seg input:checked + span { background: var(--fg); color: var(--bg); }
.seg input:checked + span small { color: var(--band-dim); }
.seg input:focus-visible + span { outline: var(--space-1) solid var(--focus-ring); outline-offset: var(--space-1); }

/* 聯絡 */
.contact-grid .cell { gap: var(--space-2); }
.cell-ico { width: var(--space-6); height: var(--space-6); display: grid; place-items: center; background: var(--bg-alt); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-pill); }
.big-link { display: inline-flex; align-items: center; min-height: 48px; font-size: var(--text-lg); font-weight: 700; color: var(--fg); overflow-wrap: anywhere; }
.addr-text { font-size: var(--text-lg); font-weight: 700; line-height: var(--leading-snug); }

/* 條款、最新消息內文 */
.prose { max-width: var(--measure); }
.container.prose { margin-inline: auto; }
.prose h2 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-3); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: var(--space-5) 0 var(--space-2); }
.prose p, .prose li { font-size: var(--text-md); line-height: var(--leading-loose); }
.prose p + p, .prose ul { margin-top: var(--space-3); }
.prose ul { padding-left: var(--space-4); list-style: disc; }
.prose-cover { width: 100%; border: var(--stroke) solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-4); }
.container.prose-doc { max-width: var(--container-wide); } /* 左緣跟頁首標題同一條線 */
.prose-doc > * { max-width: var(--measure-wide); }
@media (min-width: 720px) { .prose h2 { font-size: var(--text-2xl); } }

/* 兌換商城 */
.product-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.product-card { padding: 0; overflow: hidden; display: grid; align-content: start; }
.product-thumb { display: block; aspect-ratio: 4 / 3; background: var(--bg-alt); border-bottom: var(--stroke) solid var(--border); overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-info { padding: var(--space-3) var(--space-4) var(--space-4); display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
.product-info h2 { font-size: var(--text-lg); margin: 0; overflow-wrap: break-word; } /* 只在標點處換行（keep-all），括號段整段不拆；真的放不下才硬斷 */
.product-info h2 .nw { display: inline-block; max-width: 100%; } /* Safari 在 keep-all 下不會在「（」前斷行，靠 <wbr>＋inline-block 讓括號段整段換到下一行 */
.product-info h2 a { color: var(--fg); }
.product-info .pill { justify-self: start; }
.product-points .points { font-size: var(--text-2xl); }
.thumb-empty { display: block; width: 100%; height: 100%; min-height: 8rem; aspect-ratio: 4 / 3; background: var(--bg-alt) url(/img/step-gift-480.webp) no-repeat center 70% / cover; border-radius: var(--radius-md); } /* 沒有商品照片：用油畫禮物盒 */
.product-thumb .thumb-empty { border: 0; border-radius: 0; }
.thumb-empty.large { min-height: 16rem; }
.product-image { width: 100%; border: var(--stroke) solid var(--border); border-radius: var(--radius-md); display: block; }

/* 彩方圖 */
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.filter { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-pill); text-decoration: none; color: var(--fg); background: var(--surface); font-weight: 700; font-size: var(--text-sm); }
.filter:hover { background: var(--highlight); }
.filter:active { background: var(--bg-alt); }
.filter.is-on { background: var(--fg); color: var(--bg); }
.gallery-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); align-items: start; }
.artwork-card { display: grid; gap: var(--space-1); color: var(--fg); text-decoration: none; background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-2); }
.artwork-card img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
.artwork-card .artwork-title { font-weight: 700; padding-inline: var(--space-1); }
.artwork-card .meta { padding: 0 var(--space-1) var(--space-1); font-family: var(--font-mono); }
.artwork-card:hover { transform: translate(-1px, -1px); }
.artwork-card:active { box-shadow: none; transform: none; }
@media (prefers-reduced-motion: no-preference) { .artwork-card { transition: transform var(--dur-state) var(--ease), box-shadow var(--dur-state) var(--ease); } }
.copyright { max-width: var(--measure); }
.lightbox-frame { position: relative; margin: 0; background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.lightbox-frame img { display: block; width: 100%; max-height: 70vh; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.artwork-hero { }
.artwork-hero img { max-height: 80vh; }
.watermark { position: absolute; right: var(--space-3); bottom: var(--space-2); background: var(--surface); color: var(--fg); padding: 0 var(--space-2); border-radius: var(--radius-sm); font-weight: 700; font-size: var(--text-xs); line-height: var(--leading-loose); pointer-events: none; opacity: 0.85; }
.artwork-info { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.artwork-facts { display: grid; gap: 0; border: var(--stroke) solid var(--border); border-radius: var(--radius-md); background: var(--bg-alt); }
.artwork-facts div { padding: var(--space-3) var(--space-4); border-bottom: var(--stroke-thin) solid var(--hairline); }
.artwork-facts div:last-child { border-bottom: 0; }
.artwork-facts dt { font-size: var(--text-sm); font-weight: 700; color: var(--muted-fg); }
.artwork-facts dd { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); margin-top: var(--space-1); overflow-wrap: anywhere; }
.guide p { font-size: var(--text-md); line-height: var(--leading-loose); max-width: var(--measure); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.pager .btn { flex: 1 1 auto; }
@media (min-width: 960px) { .artwork-info { grid-template-columns: 1fr 2fr; } .pager .btn { flex: 0 0 auto; } }
.lightbox { position: fixed; inset: 0; background: color-mix(in srgb, var(--fg) 55%, transparent); display: grid; place-items: center; z-index: var(--z-modal); padding: var(--space-3); overflow: auto; }
.lightbox-inner { background: var(--bg); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); max-width: 60rem; width: 100%; padding: var(--space-4); display: grid; gap: var(--space-4); max-height: 100%; overflow: auto; }
.lightbox-info { display: grid; gap: var(--space-3); justify-items: start; }
.lightbox-info h2 { margin: 0; font-size: var(--text-xl); }
.lightbox-info p { line-height: var(--leading-loose); }

/* 404／500 */
.error-page { display: grid; gap: var(--space-4); align-items: center; }
.error-code { font-size: var(--text-display); line-height: 1; color: var(--fg); padding-bottom: var(--space-3); border-bottom: var(--stroke) solid var(--border); }
@media (min-width: 840px) { .error-page { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-6); } .error-code { border-bottom: 0; padding: 0 var(--space-6) 0 0; border-right: var(--stroke) solid var(--border); } }

/* ---------- 11 表單、卡片、表格、提示（會員／廠商／後台共用） ---------- */
.card { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.form-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; margin-top: var(--space-4); }
.form-narrow { max-width: 36rem; }
.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.field label { font-weight: 700; }
.req { font-weight: 400; color: var(--subtle-fg); font-size: var(--text-sm); }
.field input, .field select, .field textarea { font: inherit; min-height: 48px; padding: var(--space-2) var(--space-3); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--fg); width: 100%; }
.field textarea { min-height: 7rem; line-height: var(--leading-snug); }
.field input:hover, .field select:hover, .field textarea:hover { border-width: var(--stroke); padding: calc(var(--space-2) - 1px) calc(var(--space-3) - 1px); }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--bg-alt); color: var(--subtle-fg); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.hint { color: var(--muted-fg); font-size: var(--text-sm); line-height: var(--leading-snug); }
.error { color: var(--danger); font-size: var(--text-sm); font-weight: 700; }
.field .hint, .field .error { margin: 0; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; min-height: 44px; line-height: var(--leading-snug); }
.check input { width: var(--space-4); height: var(--space-4); margin: var(--space-1) 0 0; flex: none; }
.inline-filter { display: flex; gap: var(--space-3); align-items: end; flex-wrap: wrap; margin-bottom: var(--space-3); }
.inline-filter .field { margin: 0; }
.memo-input, .num-input { min-height: 44px; border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-md); padding: 0 var(--space-2); font: inherit; max-width: 10rem; background: var(--surface); color: var(--fg); }
.otp-row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: end; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th { background: var(--band); color: var(--band-fg); text-align: left; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
.table td { padding: var(--space-2) var(--space-3); border-bottom: var(--stroke-thin) solid var(--hairline); vertical-align: top; font-size: var(--text-sm); }
.table .num, .num { font-variant-numeric: tabular-nums; }
.table .num { text-align: right; font-weight: 500; }
.is-reversal td { background: var(--danger-soft); }
.points { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); font-size: var(--text-2xl); }
.points-unit { margin-left: var(--space-1); font-weight: 700; }
.stat { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
.stat > .stat-value { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-3xl); font-variant-numeric: tabular-nums; }
.stat > .stat-label { color: var(--muted-fg); }
.alert { border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); margin-block: var(--space-3); background: var(--surface); line-height: var(--leading-snug); }
.alert-ok { background: var(--success-soft); }
.alert-warn { background: var(--warning); color: var(--warning-fg); }
.alert-error { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.alert-info { background: var(--bg-alt); }
.flash { padding-top: var(--space-3); }
.empty { padding: var(--space-6) var(--space-4); text-align: center; border: var(--stroke-thin) dashed var(--subtle-fg); border-radius: var(--radius-md); background: var(--surface); display: grid; gap: var(--space-3); justify-items: center; font-weight: 500; }
.pagination { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); align-items: center; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 var(--space-3); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-md); text-decoration: none; color: var(--fg); background: var(--surface); font-weight: 700; font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--highlight); }
.pagination a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.pagination .gap { padding-inline: var(--space-1); }
.ledger-note { color: var(--muted-fg); font-size: var(--text-sm); border-left: 1px solid var(--border); padding-left: var(--space-3); margin-top: var(--space-3); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-4); }
.kv dt { color: var(--muted-fg); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.thumb-sm { vertical-align: middle; max-height: var(--space-6); }

/* 會員／廠商／後台外框 */
.app-shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: var(--space-5); padding-block: var(--space-4); align-items: start; }
.app-side ul { display: grid; gap: var(--space-1); }
.app-side a { display: flex; align-items: center; min-height: 44px; padding: var(--space-1) var(--space-3); border: var(--stroke-thin) solid transparent; border-radius: var(--radius-md); color: var(--fg); text-decoration: none; font-weight: 700; }
.app-side a:hover { background: var(--bg-alt); }
.app-side a[aria-current="page"] { background: var(--sky); border-color: var(--border); }
.app-main { display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.app-main .page-head h1 { font-size: var(--text-2xl); margin: 0; }
.app-main .page-head .lede { margin-top: var(--space-2); }
@media (max-width: 800px) { .app-shell { grid-template-columns: minmax(0, 1fr); } .app-side ul { display: flex; overflow-x: auto; gap: var(--space-2); } .app-side a { white-space: nowrap; } }
.qr-card { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); max-width: 24rem; text-align: center; }
.qr-box svg { width: 100%; height: auto; }
.qr-timer { height: var(--space-3); border: var(--stroke-thin) solid var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.qr-bar { height: 100%; background: var(--accent); width: 100%; }
.scan-video-wrap video { width: 100%; max-height: 50vh; background: var(--fg); border-radius: var(--radius-md); }
.scan-name { font-family: var(--font-display); font-size: var(--text-4xl); margin: 0; }
.scan-confirm-text { font-size: var(--text-lg); font-weight: 700; }

@media (max-width: 700px) {
  .ledger-table thead, .table-wrap .table thead { position: absolute; left: -999px; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-3); padding: var(--space-2); }
  .table td { border: 0; display: flex; justify-content: space-between; gap: var(--space-3); text-align: right; }
  .table td::before { content: attr(data-label); font-weight: 700; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .btn, .strip a, .artwork-card, .gallery-teaser { transition: none; } .btn:hover, .artwork-card:hover, .strip a:hover { transform: none; } }
.stack > input[type="hidden"] + * { margin-top: 0; }
