/* ==========================================================================
   星韵动漫社团 · 活动签到系统
   配色取自社团素材：奶油底 + 深棕墨 + 砖红 / 豆绿
   ========================================================================== */
:root {
  --cream: #fbf5ec;
  --cream-2: #f5ead9;
  --cream-3: #efe1cd;
  --card: #ffffff;
  --ink: #4a3b35;
  --ink-2: #7d6a5e;
  --ink-3: #a9988b;
  --line: #eadcc9;
  --line-2: #f2e8db;
  --red: #b5615a;
  --red-2: #9c4b45;
  --red-soft: #f7e6e3;
  --green: #7e9e76;
  --green-2: #63845c;
  --green-soft: #e8f0e5;
  --gold: #f2d68c;
  --gold-soft: #fdf3da;
  --shadow-sm: 0 1px 2px rgba(74, 59, 53, .05), 0 2px 8px rgba(74, 59, 53, .05);
  --shadow: 0 2px 4px rgba(74, 59, 53, .04), 0 10px 28px rgba(74, 59, 53, .09);
  --shadow-lg: 0 8px 24px rgba(74, 59, 53, .1), 0 24px 60px rgba(74, 59, 53, .14);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei",
          system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(242, 214, 140, .22), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(181, 97, 90, .10), transparent 38%),
    radial-gradient(circle at 78% 92%, rgba(126, 158, 118, .13), transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 15px;
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0 !important; }

/* ---------- 页眉 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 60;
  /* 刘海屏 / 灵动岛：让页眉内容避开状态栏 */
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(251, 245, 236, .86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(234, 220, 201, .85);
}
.appbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding-left: calc(20px + env(safe-area-inset-left, 0px));
  padding-right: calc(20px + env(safe-area-inset-right, 0px));
  min-height: 64px;
  display: flex; align-items: center; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  color: inherit; text-decoration: none; min-width: 0; padding: 5px 0;
}
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(160deg, #ffffff 0%, var(--cream-2) 100%);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 3px rgba(74, 59, 53, .07);
}
.brand-badge img { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.brand-name {
  font-size: 15.5px; font-weight: 800; letter-spacing: .05em;
  line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.brand-sub {
  font-size: 10.5px; font-weight: 700; letter-spacing: .17em;
  color: var(--ink-3); line-height: 1.2; margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.appbar .spacer { flex: 1; }
/* 页眉右侧动作区：窄屏时截断文案，而不是把品牌区挤爆 */
.appbar .tag { min-width: 0; }
#meTag {
  display: inline-block; max-width: 38vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#liveText { min-width: 0; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 页脚 ---------- */
.site-foot {
  margin-top: 44px; padding: 34px 20px 40px;
  border-top: 1px solid var(--line); text-align: center;
}
.site-foot .foot-logo {
  height: 58px; width: auto; max-width: 100%;
  margin: 0 auto 15px; opacity: .92;
}
.site-foot .copy {
  font-size: 12.5px; color: var(--ink-3);
  letter-spacing: .04em; line-height: 1.8;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card-pad-lg { padding: 28px; }
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-hd h2 { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.card-hd .tag { margin-left: auto; }

.hero-card {
  background: linear-gradient(160deg, #ffffff 0%, #fdf8f0 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, opacity .18s;
  white-space: nowrap;
  line-height: 1.3;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(74, 59, 53, .2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: var(--red); }
.btn-primary:hover:not(:disabled) { background: var(--red-2); box-shadow: 0 6px 20px rgba(181, 97, 90, .34); }
.btn-green { background: var(--green); }
.btn-green:hover:not(:disabled) { background: var(--green-2); box-shadow: 0 6px 20px rgba(126, 158, 118, .34); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--cream-2); box-shadow: var(--shadow-sm); }
.btn-danger { background: #fff; color: var(--red-2); border-color: #eccfcb; }
.btn-danger:hover { background: var(--red-soft); box-shadow: 0 6px 18px rgba(181, 97, 90, .18); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 15px 32px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px 10px; }

/* ---------- 表单 ---------- */
.field { display: block; }
.field > span.lbl {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 7px; letter-spacing: .02em;
}
.input, .textarea, .select {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-size: 15px;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3.5px rgba(181, 97, 90, .12);
}
.textarea { resize: vertical; min-height: 140px; line-height: 1.8; font-family: var(--font); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.select { appearance: none; background-image: none; cursor: pointer; }

.search-box { position: relative; }
.search-box .input { padding-left: 42px; }
.search-box::before {
  content: ""; position: absolute; left: 15px; top: 50%; width: 16px; height: 16px;
  transform: translateY(-50%);
  background: currentColor; color: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.search-box .clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--cream-2);
  color: var(--ink-2); cursor: pointer; font-size: 15px; line-height: 1;
}

/* ---------- 徽标 / 药丸 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.5;
  background: var(--cream-2); color: var(--ink-2);
}
.tag-red { background: var(--red-soft); color: var(--red-2); }
.tag-green { background: var(--green-soft); color: var(--green-2); }
.tag-gold { background: var(--gold-soft); color: #9a7b2c; }
.tag-ink { background: #f1ece6; color: var(--ink); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; text-align: left; position: relative; overflow: hidden;
}
.stat .k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; letter-spacing: .03em; }
.stat .v { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.total .v { color: var(--ink); }
.stat.done .v { color: var(--green-2); }
.stat.todo .v { color: var(--red-2); }
.stat::after {
  content: ""; position: absolute; right: -18px; bottom: -18px; width: 62px; height: 62px;
  border-radius: 50%; opacity: .1; background: currentColor;
}
.stat.total::after { color: var(--ink); }
.stat.done::after { color: var(--green); }
.stat.todo::after { color: var(--red); }

.progress { height: 10px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #9dba94);
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 名单 ---------- */
.name-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px;
}
.name-item {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 1px;
  padding: 10px 26px 10px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: #fff;
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .14s, background .14s, transform .12s, box-shadow .14s;
  min-height: 52px;
}
.name-item:hover { border-color: #dcc9b2; background: #fffdf9; }
.name-item.sel {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 3.5px rgba(181, 97, 90, .12);
}
.name-item .nm { font-weight: 600; font-size: 15.5px; letter-spacing: .01em; line-height: 1.35; }
.name-item .nm em { font-style: normal; color: var(--red-2); background: rgba(242, 214, 140, .5); border-radius: 3px; padding: 0 1px; }
.name-item .tg {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.3;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.name-item .ck {
  position: absolute; top: 6px; right: 7px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 10px; font-weight: 800;
  line-height: 1; display: grid; place-items: center;
}
.name-item.done { background: #f7faf6; border-color: #d8e5d3; }
.name-item.done .nm { color: var(--ink-2); }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 15px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #fff; transition: background .14s, border-color .14s;
}
.list-row:hover { background: #fffdf9; border-color: var(--line); }
.list-row .idx { width: 26px; color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; text-align: right; }
.list-row .nm { font-weight: 600; }
.list-row .sub { font-size: 12.5px; color: var(--ink-3); }
.list-row .acts { margin-left: auto; display: flex; gap: 6px; flex: none; }
.list-row.is-done { background: #f9fcf8; }
.list-row.is-done .nm { color: var(--ink-2); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--cream-2); color: var(--ink-2);
}
.avatar.ok { background: var(--green-soft); color: var(--green-2); }

/* ---------- 表格（大屏） ---------- */
.screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.screen-cell {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line-2); font-weight: 600;
}
.screen-cell.ok { background: var(--green-soft); border-color: #d5e4cf; color: var(--green-2); }
.screen-cell.ok::after { content: "✓"; margin-left: auto; font-weight: 800; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(74, 59, 53, .42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease;
}
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: 88vh; overflow: auto;
  animation: pop .22s cubic-bezier(.34, 1.4, .64, 1);
}
.modal-hd { padding: 20px 24px 0; display: flex; align-items: center; gap: 10px; }
.modal-hd h3 { font-size: 17px; }
.modal-bd { padding: 18px 24px; }
.modal-ft { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97) } }

/* ---------- 提示条 ---------- */
.toasts {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: drop .22s cubic-bezier(.34, 1.4, .64, 1);
}
.toast.ok { background: var(--green-2); }
.toast.err { background: var(--red-2); }
@keyframes drop { from { opacity: 0; transform: translateY(-12px) } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty img { width: 132px; margin: 0 auto 14px; opacity: .95; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--ink-2); font-size: 14px; }

/* ---------- 工具箱 ---------- */
.qr-card { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-preview {
  width: 190px; height: 190px; flex: none; border-radius: var(--r);
  border: 1px solid var(--line); background: #fff; padding: 9px;
}
.qr-preview img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.code-chip {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 20px; font-weight: 700; letter-spacing: .18em;
  background: var(--gold-soft); border: 1px dashed #e6cd93; color: #8a6c22;
  padding: 8px 14px; border-radius: 10px; display: inline-block;
}

.tabs { display: flex; gap: 6px; background: var(--cream-2); padding: 4px; border-radius: 999px; }
.tab {
  padding: 7px 16px; border-radius: 999px; border: none; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.tab.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.inline-note {
  background: var(--gold-soft); border: 1px solid #f0e0b8; color: #8a6c22;
  border-radius: var(--r-sm); padding: 11px 14px; font-size: 13.5px; line-height: 1.7;
}
.inline-warn {
  background: var(--red-soft); border: 1px solid #eccfcb; color: var(--red-2);
  border-radius: var(--r-sm); padding: 11px 14px; font-size: 13.5px; line-height: 1.7;
}

/* ---------- 步骤条 ---------- */
.steps { display: flex; align-items: center; gap: 6px; justify-content: center; }
.step { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.step .n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cream-2); color: var(--ink-3); font-size: 12px;
}
.step.on { color: var(--red-2); }
.step.on .n { background: var(--red); color: #fff; }
.step.done .n { background: var(--green); color: #fff; }
.step-line { width: 24px; height: 2px; background: var(--line); border-radius: 2px; }

/* ---------- 扫码 ---------- */
.scan-stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: #2b221e; aspect-ratio: 3 / 4; max-height: 62vh; margin: 0 auto; width: 100%;
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(62%, 250px); aspect-ratio: 1; pointer-events: none;
}
.scan-frame i {
  position: absolute; width: 30px; height: 30px; border: 3.5px solid #fff; border-radius: 6px;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, .4));
}
.scan-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.scan-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.scan-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.scan-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.scan-laser {
  position: absolute; left: 6%; right: 6%; height: 2.5px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #7fe08a, transparent);
  animation: scanmove 2.1s ease-in-out infinite; top: 10%;
}
@keyframes scanmove { 0%, 100% { top: 8% } 50% { top: 90% } }
.scan-tip {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); color: #fff;
  font-size: 13.5px; text-align: center;
}

/* ---------- 结果页 ---------- */
.result { text-align: center; padding: 12px 8px 4px; }
.result img { width: 168px; margin: 0 auto 10px; animation: pop .4s cubic-bezier(.34, 1.4, .64, 1); }
.result h2 { font-size: 23px; margin-bottom: 6px; }
.result.ok h2 { color: var(--green-2); }
.result.no h2 { color: var(--red-2); }
.result .who { font-size: 15.5px; color: var(--ink-2); }
.result .when { margin-top: 14px; font-size: 13px; color: var(--ink-3); }

/* ---------- 项目卡 ---------- */
.project-card { position: relative; transition: transform .16s, box-shadow .18s; cursor: pointer; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card:active { transform: translateY(0) scale(.995); }
.project-card h3 { font-size: 16.5px; font-weight: 700; }
.project-card .mini-bar { margin-top: 10px; }
.go-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.5;
  background: var(--cream-2); color: var(--ink-2);
  transition: background .16s, color .16s;
}
.go-chip i { font-style: normal; transition: transform .16s; }
.project-card:hover .go-chip { background: var(--red); color: #fff; }
.project-card:hover .go-chip i { transform: translateX(2px); }

/* 首页底部「给管理员」卡片 */
.admin-cta { display: flex; align-items: center; gap: 18px; }
.admin-cta .grow { flex: 1; min-width: 0; }
.admin-cta-btn { flex: none; }

/* ---------- 首页 ---------- */
.home-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, #fffdf9 0%, #fdf4e6 55%, #f8ecdc 100%);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow);
  padding: 42px 34px 38px;
}
.home-hero .deco {
  position: absolute; right: 6px; bottom: 0; width: 212px; opacity: .95; pointer-events: none;
}
.home-hero .content { position: relative; max-width: 520px; }
.home-hero h1 { font-size: 27px; line-height: 1.35; letter-spacing: .01em; }
.home-hero h1 em { font-style: normal; color: var(--red); }
.home-hero p.lead { color: var(--ink-2); margin-top: 10px; font-size: 14.5px; }
.home-logo { height: 46px; margin-bottom: 18px; }

.entry-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }

.feature-list { list-style: none; display: grid; gap: 9px; }
.feature-list li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.feature-list li b { color: var(--ink); font-weight: 600; }
.feature-list .bx {
  width: 19px; height: 19px; border-radius: 6px; flex: none; margin-top: 2px;
  background: var(--green-soft); color: var(--green-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}

/* ---------- 大屏 ---------- */
body.live {
  background: #2b221e; color: #fff; min-height: 100vh;
  background-image: radial-gradient(circle at 20% 0%, rgba(242, 214, 140, .16), transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(126, 158, 118, .18), transparent 45%);
}
body.live .appbar {
  background: rgba(43, 34, 30, .82);
  border-bottom-color: rgba(255, 255, 255, .1);
}
body.live .brand-badge {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: none;
}
body.live .brand-name { color: #fff; }
body.live .brand-sub { color: rgba(255, 255, 255, .45); }
body.live .stat::after { opacity: .07; }
.live-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.live-stat .stat {
  background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .13); color: #fff;
}
.live-stat .stat .k { color: rgba(255, 255, 255, .62); }
.live-stat .stat.total .v { color: #fff; }
.live-stat .stat.done .v { color: #a8d29c; }
.live-stat .stat.todo .v { color: #eda79f; }
.live-feed { display: grid; gap: 9px; }
.live-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
  animation: slidein .35s ease;
}
.live-row .nm { font-weight: 700; font-size: 17px; }
.live-row .tm { margin-left: auto; color: rgba(255, 255, 255, .5); font-size: 13px; font-variant-numeric: tabular-nums; }
body.live .live-row .tag { background: rgba(126, 158, 118, .26); color: #c2e0b8; }
@keyframes slidein { from { opacity: 0; transform: translateX(-14px) } }
body.live .progress { background: rgba(255, 255, 255, .12); }
body.live h2 { color: #fff; }

/* ==========================================================================
   响应式
   ========================================================================== */

/* 平板 / 小桌面 */
@media (max-width: 900px) {
  .entry-grid { grid-template-columns: 1fr; }
  .home-hero .deco { width: 156px; opacity: .55; }
  .tool-grid { grid-template-columns: 1fr; }
  .roster-head { flex-wrap: wrap; }
}

/* 触屏设备：去掉 hover 位移，改成按压反馈 */
@media (hover: none) {
  .btn, .tab, .name-item, .list-row { touch-action: manipulation; }
  .btn:hover, .btn-ghost:hover, .btn-danger:hover { transform: none; box-shadow: none; }
  .btn-primary:hover:not(:disabled) { background: var(--red); transform: none; box-shadow: none; }
  .btn-green:hover:not(:disabled) { background: var(--green); transform: none; box-shadow: none; }
  .btn:active { transform: scale(.97); opacity: .9; }
  .project-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .name-item:hover { background: #fff; border-color: var(--line); }
  .name-item.sel:hover { background: var(--red-soft); border-color: var(--red); }
  .name-item.done:hover { background: #f7faf6; border-color: #d8e5d3; }
  .name-item.done.sel:hover { background: var(--red-soft); border-color: var(--red); }
  .list-row:hover { background: #fff; border-color: var(--line-2); }
  .list-row.is-done:hover { background: #f9fcf8; }
}

/* 手机 */
@media (max-width: 640px) {
  body { font-size: 14.5px; }

  /* --- 到边距 + 安全区 --- */
  .wrap, .wrap-narrow { padding: 0 14px; }
  .appbar-inner {
    padding-left: calc(14px + env(safe-area-inset-left, 0px));
    padding-right: calc(14px + env(safe-area-inset-right, 0px));
    min-height: 58px; gap: 9px;
  }
  /* 移动端把毛玻璃底调实一点：部分安卓/微信内置浏览器不支持 backdrop-filter，
     半透明底会让滚动内容透过来把页眉文字糊掉 */
  .appbar { background: rgba(251, 245, 236, .96); }
  .appbar .tag { max-width: 34vw; }
  .brand { gap: 9px; }
  .brand-badge { width: 34px; height: 34px; border-radius: 10px; }
  .brand-badge img { width: 21px; height: 21px; }
  .brand-name { font-size: 14.5px; letter-spacing: .03em; }
  .brand-sub { font-size: 8.5px; letter-spacing: .15em; }

  /* --- 触控目标：一律 ≥ 44px --- */
  .btn { min-height: 44px; padding: 12px 18px; }
  .btn-sm { min-height: 40px; padding: 9px 15px; }
  .btn-xs { min-height: 34px; padding: 7px 12px; border-radius: 9px; }
  .btn-lg { min-height: 50px; }
  .btn-icon { min-width: 44px; }
  .tab { min-height: 38px; padding: 8px 14px; }

  /* --- 表单：16px 起步，避免 iOS 聚焦时自动放大 --- */
  .input, .textarea, .select { font-size: 16px; }
  .input, .select { padding: 12px 14px; }
  .textarea { min-height: 150px; }
  .search-box .input { padding-left: 40px; }
  .search-box::before { left: 13px; }

  /* --- 卡片 / 排版 --- */
  .card { padding: 17px; border-radius: var(--r); }
  .card-pad-lg { padding: 18px; }
  .card-hd { margin-bottom: 13px; }
  .card-hd h2 { font-size: 16px; }
  .site-foot { margin-top: 32px; padding: 26px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .site-foot .foot-logo { height: 54px; margin-bottom: 13px; }
  .site-foot .copy { font-size: 11.5px; }

  /* --- 首页 --- */
  .home-hero { padding: 26px 18px 104px; border-radius: var(--r-lg); }
  .home-hero h1 { font-size: 21px; }
  .home-hero p.lead { font-size: 13.5px; }
  .home-hero .deco { width: 128px; opacity: .92; right: 6px; bottom: 0; }
  .home-hero .row > .btn { flex: 1; }
  .feature-list li { font-size: 13.5px; }
  .admin-cta { flex-direction: column; align-items: stretch; gap: 14px; }
  .admin-cta > .row { gap: 12px !important; }
  .admin-cta > .row img { width: 42px !important; }
  .admin-cta-btn { width: 100%; }
  .go-chip { padding: 9px 13px; min-height: 40px; }

  /* --- 统计 --- */
  .stats { gap: 8px; }
  .stat { padding: 12px 12px; border-radius: var(--r-sm); }
  .stat .v { font-size: 23px; }
  .stat .k { font-size: 11.5px; }

  /* --- 名单网格 --- */
  .name-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .name-item { padding: 10px 24px 10px 12px; min-height: 50px; }
  .name-item .nm { font-size: 15px; }
  .name-item .ck { width: 16px; height: 16px; top: 5px; right: 6px; }

  /* --- 后台：工具栏 / 详情 --- */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .btn { width: 100%; }
  .detail-top { flex-direction: column; align-items: stretch; gap: 10px; }
  .detail-top .row { width: 100%; gap: 8px; }
  .detail-top .row .btn { flex: 1; }
  .detail-top #backBtn { width: 100%; }
  .det-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .det-head .row { justify-content: space-between; }
  .det-title { font-size: 19px; }

  .qr-card { flex-direction: column; align-items: stretch; }
  .qr-preview { width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .code-chip { font-size: 17px; letter-spacing: .12em; }
  .qr-card .row > .btn { flex: 1; min-width: 0; }
  .qr-card .row > a.btn { flex: 1; min-width: 0; }

  /* --- 后台：名单 --- */
  .roster-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .roster-head .spacer { display: none; }
  .roster-head h2 { font-size: 16px; }
  .roster-btns { display: flex; gap: 8px; }
  .roster-btns .btn { flex: 1; min-width: 0; padding-left: 6px; padding-right: 6px; }

  .roster-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .roster-toolbar .search-box { width: 100%; min-width: 0; }
  .roster-toolbar .tabs { width: 100%; }
  .roster-toolbar .tabs .tab { flex: 1; text-align: center; }
  .roster-toolbar #resetBtn { width: 100%; }

  .roster-list { max-height: 70vh; overflow: auto; -webkit-overflow-scrolling: touch; padding-right: 0; }
  .list-row { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .list-row .idx { width: 20px; font-size: 11.5px; }
  .list-row .nm { font-size: 14.5px; }
  .list-row .acts {
    flex-direction: row; width: 100%; margin-left: 0;
    padding-top: 10px; border-top: 1px dashed var(--line-2); gap: 8px;
  }
  .list-row .acts .btn { flex: 1; }

  /* --- 弹窗 --- */
  .modal { max-width: none; max-height: 86vh; }
  .modal-hd { padding: 18px 18px 0; }
  .modal-bd { padding: 16px 18px; }
  .modal-ft { padding: 0 18px 18px; flex-direction: column-reverse; }
  .modal-ft .btn { width: 100%; }
  .modal-mask { padding: 14px; align-items: flex-end; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .toast { font-size: 13.5px; padding: 10px 16px; max-width: 92vw; }

  /* --- 用户端：扫码 / 结果 --- */
  .steps { gap: 4px; }
  .step { font-size: 11.5px; gap: 5px; }
  .step .n { width: 20px; height: 20px; font-size: 11px; }
  .step-line { width: 16px; }
  .scan-stage { aspect-ratio: 3 / 4.2; max-height: 56vh; }
  .result img { width: 138px; }
  .result h2 { font-size: 20px; }
  .result .row > .btn { flex: 1; }
  .selbar .btn { min-width: 132px; }
  .scan-frame { width: min(66%, 220px); }

  /* --- 大屏（深色看板，其余尺寸在 live.html 内） --- */
  .live-stat { gap: 6px; }
  .live-stat .stat { padding: 11px 11px; }
  .live-stat .stat .v { font-size: 24px; }
}

/* 小屏手机 */
@media (max-width: 400px) {
  .step { font-size: 10.5px; }
  .step-line { width: 10px; }
  .name-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .stat .v { font-size: 20px; }
  .stat .k { font-size: 10.5px; }
  .stats { gap: 6px; }
  .roster-btns { flex-wrap: wrap; }
  .roster-btns .btn { flex: 1 1 calc(50% - 4px); }
  .qr-card .row > .btn, .qr-card .row > a.btn { flex: 1 1 calc(50% - 4px); }
}

@media (max-width: 370px) {
  .brand-sub { display: none; }
  .brand-badge { width: 32px; height: 32px; }
  .brand-badge img { width: 20px; height: 20px; }
  .brand-name { font-size: 14px; }
  .detail-top .row { flex-wrap: wrap; }
  .detail-top .row .btn { flex: 1 1 100%; }
}
