:root {
  --accent: #e60012;
  --accent-soft: #fff0f1;
  --ink: #1c1416;
  --muted: #6e6062;
  --line: #ece4e5;
  --paper: #ffffff;
  --bg: #f7f4f4;
  --ok: #0a7d3c;
  --ok-soft: #e8f6ee;
  --warn: #b25b00;
  --warn-soft: #fff4e5;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; line-height: 1.6; }
.wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 980px; }
h1 { font-size: 24px; margin: 8px 0 4px; line-height: 1.3; }
h2 { font-size: 18px; margin: 0 0 12px; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .08em; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--paper); border-radius: var(--radius); padding: 20px; margin: 16px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); }
.hidden { display: none !important; }

input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,0,18,.12); }
label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 12px; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.dark { background: var(--ink); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: wait; }
.spinner { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.row > .none { flex: none; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.notice.err { background: var(--accent-soft); color: var(--accent); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

.who { display: flex; gap: 14px; align-items: center; }
.who img { width: 56px; height: 56px; border-radius: 50%; background: var(--line); object-fit: cover; flex: none; }
.who .name { font-weight: 800; font-size: 18px; line-height: 1.3; word-break: break-all; }

.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 40px; font-weight: 800; letter-spacing: .12em;
  text-align: center; padding: 14px; border: 2px dashed var(--accent); border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; }
.steps li { counter-increment: s; position: relative; padding: 6px 0 6px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.qr { display: block; width: 100%; max-width: 320px; margin: 8px auto; border-radius: 12px; }
.serial { font-family: ui-monospace, Consolas, monospace; font-size: 22px; font-weight: 800; text-align: center; padding: 12px;
  background: var(--bg); border-radius: 12px; word-break: break-all; }

/* admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { flex: none; border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 700;
  color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--ink); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border-radius: 14px; padding: 14px 16px; }
.stat .v { font-size: 28px; font-weight: 800; }
.stat .k { font-size: 13px; color: var(--muted); }
.card .stats { margin: 4px 0 14px; }
.card .stat { background: var(--bg); }

.code-meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink); }
.countdown.low { color: var(--accent); }
.code.renewing { opacity: .4; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.scan-result { text-align: center; }
.scan-result img { width: 96px; height: 96px; border-radius: 50%; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--accent-soft); color: var(--accent); }
.pass-card { margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 120px;
  display: flex; align-items: center; justify-content: center; background: #fff; color: var(--muted); }
.pass-card img { display: block; width: 100%; height: auto; }
.pass-card img[hidden], .pass-card .spinner[hidden] { display: none; }

/* SaaS 後台 */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.topbar a.eyebrow { text-decoration: none; }
.who-am-i { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-am-i span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.camp-list .card { margin: 0; }
a.camp { display: block; color: inherit; text-decoration: none; border: 1.5px solid transparent; transition: border-color .15s; }
a.camp:hover { border-color: var(--accent); }
a.camp .t { font-weight: 800; font-size: 17px; margin-bottom: 6px; word-break: break-all; }
details.danger { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; }
details.danger summary { cursor: pointer; }
.spinner.dark { color: var(--muted); vertical-align: -3px; }
.powered { text-align: center; font-size: 12px; color: var(--muted); margin-top: 28px; }
.powered a { color: inherit; }

/* 首頁 */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 34px; letter-spacing: -.01em; }
.hero p { font-size: 17px; color: var(--muted); max-width: 520px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.features .card { margin: 0; }
.features h3 { margin: 0 0 6px; font-size: 16px; }

/* 品牌 / 語言 */
.brand { font-weight: 900; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand small { font-weight: 600; font-size: 12px; color: var(--muted); margin-left: 4px; }
.lang-select { width: auto; padding: 4px 8px; font-size: 13px; border-radius: 8px; }
.hero .price { font-weight: 800; color: var(--accent); font-size: 18px; margin: 4px 0 14px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* 方案 */
.plan-bar .row { align-items: flex-start; }
.meter { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.meter span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 999px; }
.meter span.full { background: var(--accent); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan-grid .card { margin: 0; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.plan .q { font-weight: 800; font-size: 16px; }
.plan .p { font-size: 18px; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.camp .tier { color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.table-wrap { overflow-x: auto; }
.scan-result .name { font-weight: 800; font-size: 20px; margin-top: 8px; }

/* 頁尾 / 法律與教學頁 */
/* 與 rnao studio 其他產品相同格式：置中、連結列、© 產品、技術支持、其他作品 */
.site-footer { margin-top: 48px; padding: 20px 0 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: inherit; }
.site-footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 13px; }
.site-footer__credit { opacity: .8; }
.site-footer__more { opacity: .8; }
.doc { max-width: 760px; }
.doc h1 { font-size: 28px; margin-bottom: 4px; }
.doc .updated { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc h3 { font-size: 16px; margin: 18px 0 6px; }
.doc p, .doc li { line-height: 1.75; }
.doc ol, .doc ul { padding-left: 22px; }
.doc .callout { background: var(--paper); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.doc [data-lang] { display: none; }
.doc [data-lang].on { display: block; }
.steps-big { counter-reset: s; list-style: none; padding: 0; }
.steps-big > li { counter-increment: s; position: relative; padding: 4px 0 14px 46px; }
.steps-big > li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; }
.steps-big b.t { display: block; font-size: 16px; margin-bottom: 2px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 10px; }
.consent input { width: auto; margin-top: 3px; }

/* 經營報表：每日驗證長條圖（單一系列，軸線淡化） */
.bars svg { width: 100%; height: auto; display: block; }
.bars .bar { fill: var(--accent); }
.bars g:hover .bar { opacity: .75; }
.bars .axis { font-size: 10px; fill: var(--muted); }
.report-table td, .report-table th { vertical-align: top; }
.report-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
