/* QCC 品牌色（取自 Instagram @qccbaked）：海军蓝 #121A6B、洋红 #C946AB、浅粉 #F7D3EA、浅薰衣草 #F3EDFC */
/* 字体：Oswald（SIL OFL 免费授权），接近 QCC 标志的粗体窄字；客户给正式字体后再换。中文用系统字体。 */
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("/assets/fonts/oswald-500.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("/assets/fonts/oswald-700.woff2") format("woff2"); }
:root {
  --navy: #121A6B; --navy-2: #1E1453; --magenta: #C946AB; --pink: #F7D3EA; --lav: #F3EDFC;
  --ink: #1B1D2E; --ink-2: #555a73; --line: #E3E0EE; --surface: #ffffff; --bg: #F7F5FC;
  --ok: #1F7A4D; --ok-bg: #E4F4EC; --warn: #8A5A00; --warn-bg: #FFF3D6; --err: #B42318; --err-bg: #FDECEA;
  --r: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: .25rem 0 .75rem; line-height: 1.55; }
a { color: var(--navy); }
small, .muted { color: var(--ink-2); }
.hidden { display: none !important; }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; position: sticky; top: 0; z-index: 5; }
.top .grow { flex: 1; }
.top .who { font-size: .85rem; opacity: .85; }
.wordmark { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 1.05rem; }
.brand img { height: 34px; display: block; }
.stripe { height: 6px; background: repeating-linear-gradient(90deg, var(--navy) 0 18px, var(--magenta) 18px 36px); }

.wrap { max-width: 560px; margin: 0 auto; padding: 1rem; }
.wrap.wide { max-width: 1100px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

label { display: block; font-size: .9rem; font-weight: 600; margin: .75rem 0 .3rem; }
input, select { font: inherit; width: 100%; padding: .65rem .75rem; border: 1px solid #cfcbe0; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(201, 70, 171, .35); outline-offset: 1px; border-color: var(--magenta); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .88rem; line-height: 1.5; background: var(--lav); border-radius: 10px; padding: .7rem; margin: .5rem 0; }
.check input { width: 20px; height: 20px; margin-top: .1rem; flex: none; accent-color: var(--magenta); }

button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: .7rem 1rem; cursor: pointer; background: var(--navy); color: #fff; text-decoration: none; display: inline-block; text-align: center; }
button:disabled { opacity: .5; cursor: default; }
.btn-alt { background: var(--magenta); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.top .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); padding: .4rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 1rem; }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-confirm { background: var(--err); }

.msg { border-radius: 10px; padding: .7rem .85rem; margin: .75rem 0; font-size: .92rem; line-height: 1.5; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.msg.err { background: var(--err-bg); color: var(--err); }
.msg.info { background: var(--lav); color: var(--navy); }

/* 集章卡 */
.card-hero { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 20px; padding: 1.2rem; margin-bottom: 1rem; }
.card-hero .hello { font-size: .95rem; opacity: .9; }
.card-hero .big { font-size: 2rem; font-weight: 800; margin: .3rem 0 .6rem; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .55rem; margin: .4rem 0; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255,255,255,.45); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: rgba(255,255,255,.4); }
.stamp.on { border: 0; background: var(--magenta); color: #fff; box-shadow: 0 0 0 3px rgba(247, 211, 234, .35); }
.stamps.mini { grid-template-columns: repeat(10, 1fr); gap: .3rem; }
.stamps.mini .stamp { border-color: #cfcbe0; color: transparent; font-size: .7rem; }
.stamps.mini .stamp.on { box-shadow: none; color: #fff; }
.banner { background: var(--pink); color: var(--navy); border-radius: 12px; padding: .75rem .9rem; margin-top: .75rem; font-weight: 600; line-height: 1.45; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.4rem; font-weight: 800; letter-spacing: .15em; color: var(--navy); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.list li:last-child { border-bottom: 0; }
.plus { color: var(--ok); font-weight: 700; } .minus { color: var(--ink-2); font-weight: 700; }
.lang { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: .3rem .6rem; font-size: .8rem; }

/* 员工柜台 */
.results button { display: flex; justify-content: space-between; width: 100%; margin: .35rem 0; background: var(--lav); color: var(--ink); text-align: left; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .45rem; margin: .4rem 0 .8rem; }
.pbtn { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: .55rem .5rem; font-weight: 500; font-size: .85rem; line-height: 1.3; position: relative; }
.pbtn b { display: block; color: var(--navy); }
.pbtn .q { position: absolute; top: -7px; right: -7px; background: var(--magenta); color: #fff; border-radius: 99px; min-width: 22px; height: 22px; font-size: .75rem; display: grid; place-items: center; padding: 0 .3rem; }
.cart li span:first-child { flex: 1; }
.total { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.pill { display: inline-block; border-radius: 99px; padding: .15rem .6rem; font-size: .78rem; font-weight: 600; background: var(--lav); color: var(--navy); }
.pill.hot { background: var(--pink); }
.modal { position: fixed; inset: 0; background: rgba(18, 26, 107, .55); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.modal .box { max-width: 380px; width: 100%; text-align: center; }
.modal .box.notice { max-width: 520px; max-height: 85vh; overflow-y: auto; text-align: left; }
.notice h2 { margin-bottom: .4rem; }
.notice h3 { font-size: .92rem; margin: .8rem 0 .15rem; }
.notice p { font-size: .85rem; margin: 0; line-height: 1.55; }
.notice .ver { color: #888; font-size: .75rem; margin-top: .8rem; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; }
.qr svg { width: 100%; max-width: 280px; height: auto; }
.url { word-break: break-all; font-size: .78rem; color: var(--ink-2); }

/* 后台 */
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; }
.kpi .k { font-size: .82rem; color: var(--ink-2); }
.kpi .v { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin-top: .15rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: .78rem; color: var(--ink-2); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; font-size: .8rem; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #ECEAF3; stroke-width: 1; }
.chart .axis { fill: var(--ink-2); font-size: 11px; }
.chart .bar { fill: var(--magenta); pointer-events: none; }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar.hl { fill: #A8338D; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: .8rem; padding: .35rem .55rem; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); }
.qrcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.qrcards .box { text-align: center; }
details summary { cursor: pointer; color: var(--navy); font-size: .88rem; margin-top: .6rem; }

@media print {
  .top, .tabs, .noprint, .stripe { display: none !important; }
  body, .box { background: #fff; border: 0; }
}

/* ---------- 品牌细节：标志、字体、标语、薰衣草滴落、产品照片 ---------- */
.brand img { height: 44px; width: 44px; border-radius: 8px; object-fit: cover; }
.wordmark, h1, h2, .card-hero .big, .kpi .v, .total, .tagline { font-family: "Oswald", system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
h1, h2 { font-weight: 700; letter-spacing: .01em; }
.card-hero .big, .kpi .v, .total { font-weight: 700; letter-spacing: .02em; }
.tagline { text-align: center; color: var(--navy); font-weight: 500; letter-spacing: .32em; font-size: .78rem; padding: .55rem 0 0; text-transform: uppercase; }
/* 薰衣草滴落（自己画的简单图形，呼应 QCC 贴文风格） */
.drip { height: 26px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='26' viewBox='0 0 160 26'%3E%3Cpath fill='%23E4D5F6' d='M0 0h160v7c-6 0-8 3-9 8-1 6-3 9-7 9s-6-3-6-8c0-4-2-9-8-9-7 0-8 2-10 5-1 3-3 4-5 4s-4-2-5-5c-2-3-4-4-9-4s-8 3-9 9c-1 7-3 10-7 10s-6-4-7-10c-1-5-3-9-8-9-4 0-7 2-8 5s-3 4-5 4-4-1-5-4-4-5-9-5c-6 0-8 2-9 6-1 3-2 5-5 5s-4-3-5-7c-1-3-2-4-5-4z'/%3E%3C/svg%3E") repeat-x top / 160px 26px; }
.hero-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; margin-bottom: .9rem; }
.hero-img.wide { aspect-ratio: 3 / 2; }
.photo-credit { font-size: .72rem; color: var(--ink-2); margin-top: -.5rem; margin-bottom: .6rem; }

/* ---------- 网页版 App ---------- */
.top { padding-top: max(.7rem, env(safe-area-inset-top)); }
.wrap { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
.steps { text-align: left; padding-left: 1.3rem; line-height: 1.75; margin: .5rem 0 .75rem; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
