/* ============================================================
   前十名投票 · 样式
   移动优先，兼容微信内置浏览器（iOS / Android）
   ============================================================ */

:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e6eaf1;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #eef3ff;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -18px rgba(16, 24, 40, .28);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
b, strong { font-weight: 700; }
code, .mono { font-family: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace; }
code { background: #f2f4f7; padding: 1px 6px; border-radius: 6px; font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.warn-text { color: var(--warn); }

/* ---------------- 基础控件 ---------------- */

.input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d8dee9;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.input::placeholder { color: #98a2b3; }
.textarea { height: auto; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.input-sm { height: 38px; font-size: 14px; border-radius: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .08s, background .15s, opacity .15s;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(180deg, #2f63ec, #1d4ed8); color: #fff; box-shadow: 0 6px 16px -8px rgba(29, 78, 216, .8); }
.btn-primary:disabled { background: #c7d2e8; color: #fff; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: #d8dee9; }
.btn-warn { background: #dc6803; color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.linkbtn.danger { color: var(--danger); }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(230, 234, 241, .9);
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  margin: 0 0 16px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #fecdca; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #abefc6; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: #fedf89; }
.alert-info { background: var(--brand-soft); color: #1849a9; border-color: #c7d7fe; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--brand-soft); color: #1849a9; }
.badge-muted { background: #f2f4f7; color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------- 登录页 ---------------- */

.page-login {
  background:
    radial-gradient(900px 500px at 50% -10%, #dbe6ff 0%, rgba(219, 230, 255, 0) 60%),
    var(--bg);
  min-height: 100vh;
}
.login-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 56px 20px calc(40px + var(--safe-b));
  text-align: center;
}
.brandmark {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, #3b74f5, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px -12px rgba(29, 78, 216, .7);
}
.brandmark svg { width: 30px; height: 30px; }
.login-title { margin: 0 0 6px; font-size: 25px; line-height: 1.3; letter-spacing: -.3px; }
.login-sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.login-card { padding: 22px 20px 18px; text-align: left; }
.login-hint { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-note {
  margin-top: 22px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .66);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
}
.login-note strong { display: block; margin-bottom: 4px; color: var(--ink); }
.login-note p { margin: 4px 0; }
.login-foot { margin-top: 26px; font-size: 12px; color: #98a2b3; }


/* ---------------- 投票页 ---------------- */

.page-vote { background: var(--bg); }

.vtop {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(230, 234, 241, .8);
}
.vtop-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vtop-kicker { font-size: 14px; font-weight: 700; letter-spacing: -.1px; }
.vtop-user { font-size: 12px; color: var(--muted); margin-top: 1px; }
.vtop-exit { font-size: 13px; color: var(--muted); padding: 6px 2px; }

.vwrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 14px calc(112px + var(--safe-b));
}

.intro {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(230, 234, 241, .9);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
}
.intro-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: #1849a9;
  font-size: 12px;
  font-weight: 700;
}
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.intro-end { font-size: 12px; color: var(--muted); }
.intro-title { margin: 4px 0 6px; font-size: 22px; letter-spacing: -.4px; line-height: 1.3; }
.intro-title b { color: var(--brand); }
.intro-desc { margin: 0; font-size: 13px; color: var(--muted); }

.revote-banner {
  background: linear-gradient(135deg, #fff7ed, #fffaeb);
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-bottom: 14px;
}
.rb-badge {
  display: inline-block;
  background: #dc6803;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 7px;
}
.revote-banner p { margin: 0; font-size: 13px; color: #93370d; line-height: 1.6; }
.revote-banner b { color: #7a2e0e; }

.pickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 10px;
  font-size: 13px;
  color: var(--muted);
}
.pickbar b { color: var(--brand); font-size: 18px; margin-right: 2px; }
.pickbar i { font-style: normal; }

.cand-list {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(230, 234, 241, .9);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f3f8;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.cand:last-child { border-bottom: 0; }
.cand:active { background: #fafbfe; }
.cand.is-checked { background: #f5f8ff; }
.cand-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.cand-box {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid #cfd6e4;
  border-radius: 7px;
  background: #fff;
  position: relative;
  transition: all .12s;
}
.cand-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(.4);
  opacity: 0;
  transition: all .12s;
}
.cand.is-checked .cand-box { background: var(--brand); border-color: var(--brand); }
.cand.is-checked .cand-box::after { opacity: 1; transform: rotate(45deg) scale(1); }
.cand-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cand-name { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.cand-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cand-meta i { font-style: normal; margin: 0 4px; color: #cbd2e0; }
.cand-no { flex: none; font-size: 12px; color: #b3bccd; font-variant-numeric: tabular-nums; }

.submit-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: rgba(255, 255, 255, .93);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid rgba(230, 234, 241, .9);
}
.dock-count { flex: none; min-width: 62px; font-size: 13px; color: var(--muted); line-height: 1.1; }
.dock-count b { display: block; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dock-btn { flex: 1; }
.vote-foot { text-align: center; font-size: 12px; color: #98a2b3; margin: 22px 0 0; }

/* ---------------- 完成 / 提示 ---------------- */

.done-wrap { padding-top: 56px; text-align: center; }
.done-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #abefc6;
}
.done-check svg { width: 36px; height: 36px; }
.done-title { font-size: 24px; margin: 0 0 8px; letter-spacing: -.3px; }
.done-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.done-card { padding: 6px 18px; text-align: left; margin-bottom: 20px; }
.done-note { margin: 18px 0; color: var(--muted); font-size: 14px; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f2f4f7; font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.notice-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #f2f4f7;
  color: #98a2b3;
  font-size: 28px;
  line-height: 44px;
  text-align: center;
}
.help-card { padding: 18px 20px; text-align: left; margin: 20px 0; }
.help-card p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.help-card p:last-child { margin-bottom: 0; }
.help-card b { display: block; color: var(--ink); margin-bottom: 2px; }

/* ---------------- 结果页 ---------------- */

.result-hero { text-align: center; padding: 22px 0 18px; }
.result-kicker { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.result-title { margin: 6px 0 4px; font-size: 30px; letter-spacing: 1px; }
.result-sub { margin: 0; font-size: 13px; color: var(--muted); }

.tie-note {
  background: var(--warn-soft);
  border: 1px solid #fedf89;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.tie-note-title { font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 2px; }
.tie-note p { margin: 0; font-size: 13px; color: #93370d; }

.ranklist {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(230, 234, 241, .9);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rankitem {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f3f8;
}
.rankitem:last-child { border-bottom: 0; }
.rank-no {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.rankitem.top1 .rank-no { background: linear-gradient(145deg, #fdb022, #dc6803); color: #fff; }
.rankitem.top2 .rank-no { background: linear-gradient(145deg, #cbd5e1, #94a3b8); color: #fff; }
.rankitem.top3 .rank-no { background: linear-gradient(145deg, #e8b07a, #b5763a); color: #fff; }
.rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-name { font-size: 15px; font-weight: 600; line-height: 1.4; }
.rank-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.revote-mark { color: var(--warn); font-style: normal; }
.rank-votes { flex: none; text-align: right; font-size: 18px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.rank-votes i { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.rank-votes em { display: block; font-style: normal; font-size: 10px; color: var(--warn); font-weight: 600; }

/* ---------------- 后台 ---------------- */

.page-admin { background: #f6f7fb; }

.ahead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #0f172a;
  color: #fff;
}
.ahead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.alogo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.alogo-dot { width: 9px; height: 9px; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, .22); }
.anav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.anav::-webkit-scrollbar { display: none; }
.anav a { color: #b9c0d0; padding: 7px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.anav a.active, .anav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.aexit { color: #98a2b3; font-size: 13px; white-space: nowrap; }
.aexit:hover { color: #fff; }

.awrap { max-width: 1180px; margin: 0 auto; padding: 24px 18px 64px; }

.a-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.a-title h1 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.a-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.a-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat-k { font-size: 12px; color: var(--muted); }
.stat-v { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat-sub { font-size: 11px; color: #98a2b3; margin-top: 2px; }

.agrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 16px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f0f3f8; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.qr-panel { display: flex; align-items: center; gap: 18px; }
.qr-box { width: 128px; height: 128px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-panel p { margin: 0; font-size: 12px; line-height: 1.6; }

.progress-line { height: 6px; background: #eef1f6; border-radius: 99px; overflow: hidden; margin: 14px 0 10px; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #1d4ed8); border-radius: 99px; transition: width .4s; }

.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.inline-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.round-list { display: flex; flex-direction: column; }
.round-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f2f4f7; font-size: 13px; align-items: center; }
.round-row:last-child { border-bottom: 0; }
.round-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.round-meta, .round-res { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #f4f6fa; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.w-rank { width: 58px; }
.w-state { width: 90px; }
.w-op { width: 150px; }
.cell-name { font-weight: 600; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.rank-cell { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-boundary td { border-bottom: 2px dashed #f79009; }
.row-tie td { background: #fffcf5; }
.row-revote td { background: #f7fbff; }
.op-cell { white-space: nowrap; }
.op-cell form { display: inline; margin-right: 10px; }

.block-alert { padding: 16px 18px; }
.alert-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.block-alert p { margin: 4px 0; font-size: 13px; }
.tie-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tie-chip { background: rgba(255, 255, 255, .75); border: 1px solid #fedf89; color: #93370d; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.alert-actions { margin: 10px 0; }
.manual-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #fedf89; }
.manual-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; cursor: pointer; }
.checkline input { width: 17px; height: 17px; accent-color: var(--brand); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: block; }
.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field-wide { grid-column: 1 / -1; }

.filebtn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  background: #fff;
}

.search { width: 200px; }

/* ---------------- 码卡 / 打印 ---------------- */

.page-cards { background: #eef1f6; }
.print-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
}
.print-bar b { margin-right: 10px; }
.print-bar span { font-size: 12px; color: var(--muted); }
.print-actions { display: flex; gap: 8px; }
.cards-sheet {
  max-width: 1000px;
  margin: 20px auto 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 16px;
}
.vcard {
  background: #fff;
  border: 1px solid #d9dfe9;
  border-radius: 10px;
  padding: 12px 10px 10px;
  text-align: center;
  break-inside: avoid;
  min-height: 230px;
}
.vcard-head { font-size: 10px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard-qr { width: 108px; height: 108px; margin: 8px auto 6px; }
.vcard-qr svg { width: 100%; height: 100%; display: block; }
.vcard-code { font-family: "SF Mono", Menlo, monospace; font-size: 19px; font-weight: 700; letter-spacing: .14em; }
.vcard-name { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.vcard-pw { margin-top: 7px; font-size: 11px; color: var(--muted); }
.vcard-pw b { font-family: "SF Mono", Menlo, monospace; font-size: 13px; letter-spacing: .1em; color: var(--ink); }
.vcard-tip { margin-top: 6px; font-size: 9px; color: #98a2b3; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .agrid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .round-row { grid-template-columns: 1fr; gap: 2px; }
  .ahead-inner { gap: 12px; }
  .search { width: 140px; }
}

@media (max-width: 640px) {
  .awrap { padding: 16px 12px 48px; }
  .a-title { align-items: flex-start; }
  .a-actions { width: 100%; }
  .a-actions .btn { flex: 1; }
  .ahead-inner { padding: 0 12px; }
  .panel-head { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 9px 10px; }
  .w-op { width: 110px; }
  .cards-sheet { grid-template-columns: repeat(2, 1fr); }
  .qr-panel { flex-direction: column; text-align: center; }
}

/* ---------------- 打印 ---------------- */

@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff !important; }
  .print-bar { display: none !important; }
  .cards-sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
    grid-template-columns: repeat(3, 1fr);
  }
  .vcard {
    border: 1px dashed #b9c0cc;
    border-radius: 0;
    margin: -1px 0 0 -1px;
    height: 68mm;
    min-height: 0;
    padding: 6px 6px 4px;
  }
  .vcard-qr { width: 34mm; height: 34mm; margin: 4px auto 2px; }
  .vcard-code { font-size: 16pt; }
  .vcard-pw b { font-size: 11pt; }
}

/* ---------------- 轻提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translate(-50%, 12px);
  z-index: 100;
  max-width: 88vw;
  padding: 9px 16px;
  border-radius: 99px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.linkbtn.revealed {
  color: var(--ink);
  font-family: "SF Mono", Menlo, monospace;
  letter-spacing: .08em;
  cursor: default;
  font-size: 13px;
}

.tie-chip.win { background: var(--ok-soft); border-color: #abefc6; color: var(--ok); }


/* ---------------- 页面内确认框 ---------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .46);
  animation: modal-fade .15s ease-out;
}
.modal {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px 16px;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .45);
  animation: modal-pop .16s ease-out;
}
.modal-msg {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; height: 44px; font-size: 15px; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------- 各轮计票（每一轮单独一块） ---------------- */

.round-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.rresult {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.rresult-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
}
.rresult-title { font-size: 14px; font-weight: 700; }
.rresult-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #f2f4f7;
  white-space: nowrap;
}
.mini-table td { padding: 8px 12px; border-bottom: 1px solid #f6f8fb; vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mini-table .is-win td { background: #f6fdf9; }
.mini-table .cell-name { font-size: 12px; font-weight: 600; }
.mini-table .cell-sub { font-size: 10px; }
.mini-table .w-rank { width: 44px; }
.mini-table .w-state { width: 76px; }

.public-rounds { margin-top: 28px; }
.section-title { font-size: 18px; margin: 0 0 4px; letter-spacing: -.2px; }
.section-desc { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.public-rounds .round-results { grid-template-columns: 1fr; }

@media (max-width: 640px) {
  .round-results { grid-template-columns: 1fr; }
  .mini-table th, .mini-table td { padding: 7px 9px; }
}

/* ---------------- 投票后的等待页 ---------------- */

.done-check.warn { background: var(--warn-soft); color: #dc6803; border-color: #fedf89; }

.wait-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  text-align: left;
}
.wait-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: #1849a9;
  font-size: 12px;
  font-weight: 700;
}
.wait-title { margin: 10px 0 6px; font-size: 19px; letter-spacing: -.2px; }
.wait-desc { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted); }
.wait-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.wait-meta b { color: var(--ink); }
.wait-count { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

.tie-callout {
  background: linear-gradient(135deg, #fff7ed, #fffaeb);
  border: 1px solid #fedf89;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: left;
}
.tie-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: #dc6803;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.tie-title { margin: 10px 0 6px; font-size: 20px; line-height: 1.35; color: #7a2e0e; letter-spacing: -.2px; }
.tie-desc { margin: 0 0 10px; font-size: 13px; line-height: 1.75; color: #93370d; }
.tie-callout .tie-list { margin: 10px 0 4px; }
.tie-callout .tie-chip { background: #fff; }
.tie-callout .btn { margin-top: 8px; }
.tie-callout .wait-meta { border-top-color: #fedf89; color: #b54708; }
.tie-callout .wait-count { color: #b54708; }

.final-box { text-align: left; margin-bottom: 18px; }
.final-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.final-head h2 { margin: 0; font-size: 19px; }
.final-head span { font-size: 12px; color: var(--muted); }
.final-box .ranklist { margin-bottom: 14px; }

/* 投票页实时人数 */
.live-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 4px 12px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.live-line b { color: var(--brand); font-size: 14px; font-variant-numeric: tabular-nums; }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, .16);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 设置页：一个窗口内的分组 */
.form-section {
  margin: 24px 0 12px;
  padding-top: 18px;
  border-top: 1px solid #f0f3f8;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #f0f3f8;
}
@media (max-width: 900px) {
  .check-list { grid-template-columns: 1fr; }
}

/* 投票人操作列 */
.w-op { width: 230px; }
.op-cell a.linkbtn { margin-right: 10px; }

/* 不可点击的按钮 */
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 提交前的选票核对弹窗 */
.modal.modal-review { max-width: 440px; }
.review-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.review-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.review-list {
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 12px;
  margin-bottom: 18px;
}
.review-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #f2f4f7; }
.review-item:last-child { border-bottom: 0; }
.review-no {
  flex: none;
  width: 27px;
  height: 24px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: #1849a9;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.review-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.review-name { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.review-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* 页脚备案信息 */
.beian-foot {
  padding: 20px 16px 28px;
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
  color: #94a3b8;
}
.beian-foot a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}
.beian-foot a:hover { color: #64748b; text-decoration: underline; }
.beian-sep { margin: 0 8px; opacity: 0.55; }
@media print {
  .beian-foot { display: none; }
}
