/* ============================================================
   闪投 · 匿名互动投票
   学生端 / 大屏 / 后台统一视觉
   ============================================================ */

:root {
  --bg: #080a16;
  --bg-2: #0d1022;
  --text: #f3f4ff;
  --muted: #9ba2c4;
  --muted-2: #6f7697;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.09);
  --accent: #7c5cff;
  --accent-2: #ff5ea8;
  --mint: #38e8c6;
  --gold: #ffd166;
  --danger: #ff5d6c;
  --grad: linear-gradient(120deg, #7c5cff, #ff5ea8 55%, #ffb84d);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }
.center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 背景装饰 ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(760px 560px at 100% 0%, rgba(255, 94, 168, 0.16), transparent 62%),
    radial-gradient(700px 520px at 50% 110%, rgba(56, 232, 198, 0.12), transparent 60%);
}
.bg-blobs i {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: floatBlob 18s ease-in-out infinite;
}
.bg-blobs i:nth-child(1) { width: 320px; height: 320px; background: rgba(124, 92, 255, 0.5); top: -80px; left: -60px; }
.bg-blobs i:nth-child(2) { width: 260px; height: 260px; background: rgba(255, 94, 168, 0.42); bottom: 4%; right: -70px; animation-delay: -6s; }
.bg-blobs i:nth-child(3) { width: 220px; height: 220px; background: rgba(56, 232, 198, 0.32); top: 42%; left: 60%; animation-delay: -11s; }

@keyframes floatBlob {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -26px, 0) scale(1.08); }
}

/* ---------- 通用组件 ---------- */
.card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.primary-btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--grad);
  background-size: 160% 160%;
  box-shadow: 0 10px 26px rgba(124, 92, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background-position 0.4s ease;
}
.primary-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(255, 94, 168, 0.35); background-position: 100% 50%; }
.primary-btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.primary-btn.big { padding: 15px 34px; font-size: 16px; }
.primary-btn.block { width: 100%; }

.ghost-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.3); }
.ghost-btn.small { padding: 7px 14px; font-size: 12px; }

.danger-btn {
  border: 1px solid rgba(255, 93, 108, 0.5);
  background: rgba(255, 93, 108, 0.12);
  color: #ffb3ba;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  transition: background 0.18s ease;
}
.danger-btn:hover { background: rgba(255, 93, 108, 0.24); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }

.input, .textarea, select.input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(8, 10, 22, 0.55);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus { border-color: rgba(124, 92, 255, 0.65); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.textarea.tall { min-height: 210px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.3);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }
.pill.pill-ghost { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); box-shadow: none; color: var(--muted); }
.pill.pill-ghost::before { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.pill.ended { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.pill.ended::before { background: var(--muted-2); box-shadow: none; }

.toast-wrap {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  max-width: 100%;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(20, 23, 44, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 14px;
  animation: toastIn 0.26s ease;
  backdrop-filter: blur(10px);
}
.toast.ok { border-color: rgba(56, 232, 198, 0.45); box-shadow: 0 14px 40px rgba(56, 232, 198, 0.16); }
.toast.err { border-color: rgba(255, 93, 108, 0.5); }
.toast.out { animation: toastOut 0.24s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(0.98); } }

/* ============================================================
   学生端
   ============================================================ */
[data-page="student"] { padding-bottom: 120px; }
[data-page="student"] .topbar {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.4);
  flex: none;
}
.brand-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 10px; }

.page { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 6px 20px 30px; }

.loader { padding: 90px 0; display: flex; flex-direction: column; align-items: center; gap: 18px; color: var(--muted); }
.loader-ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-card { padding: 46px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-emoji { font-size: 42px; }
.error-card h2 { font-size: 22px; }
.error-card p { color: var(--muted); line-height: 1.7; max-width: 400px; }

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  gap: 22px;
  padding: 26px 26px 24px;
  margin-top: 10px;
}
.hero-glow {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(255, 94, 168, 0.36), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-body { position: relative; flex: 1; min-width: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 94, 168, 0.35);
  background: rgba(255, 94, 168, 0.1);
}
.hero h1 { font-size: clamp(26px, 5.4vw, 38px); line-height: 1.18; margin: 14px 0 8px; letter-spacing: -0.01em; }
.hero-sub { color: var(--muted); font-size: 14px; line-height: 1.6; min-height: 1em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.meta-chip {
  font-size: 12px;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.hero-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  flex: none;
}
.hero-stat { display: flex; flex-direction: column; align-items: flex-end; }
.hero-stat b {
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #fff, #b9b0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stat span { font-size: 12px; color: var(--muted); margin-top: 6px; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.08);
  color: #ffe4a3;
  font-size: 14px;
  line-height: 1.6;
}
.notice b { display: block; margin-bottom: 2px; }
.notice-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex: none; box-shadow: 0 0 12px var(--gold); }

.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  margin: 20px 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.seg-btn {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 0;
  border-radius: 999px;
  transition: color 0.2s ease;
}
.seg-btn.active { color: #fff; }
.seg-glider {
  position: absolute;
  z-index: 1;
  top: 5px;
  bottom: 5px;
  border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.36);
  transition: left 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 660px) { .vote-grid { grid-template-columns: repeat(3, 1fr); } }

.cand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 22px 14px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  color: var(--text);
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}
.cand:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.cand.selected {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--c, var(--accent)), 0 16px 34px rgba(0, 0, 0, 0.4);
  background: linear-gradient(165deg, rgba(124, 92, 255, 0.2), rgba(255, 94, 168, 0.08));
}
.cand.locked { cursor: default; }
.cand.locked:hover { transform: none; }
.cand-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.3), transparent 58%),
    var(--c, var(--accent));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.cand-name { font-weight: 700; font-size: 15px; line-height: 1.35; word-break: break-word; }
.cand-votes { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cand-bar { width: 100%; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.cand-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c, var(--accent)), #fff3); width: 0; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.cand-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
  background: var(--c, var(--accent));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cand.selected .cand-check { opacity: 1; transform: scale(1); }

.option-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}
.option:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.option.selected { box-shadow: 0 0 0 2px var(--c, var(--accent)); border-color: transparent; }
.option .dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  flex: none; position: relative;
}
.option.selected .dot { border-color: var(--c, var(--accent)); }
.option.selected .dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--c, var(--accent));
}
.option-emoji { font-size: 24px; flex: none; }
.option-main { flex: 1; min-width: 0; }
.option-name { font-weight: 600; font-size: 15px; }
.option-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); margin-top: 8px; overflow: hidden; }
.option-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c, var(--accent)); transition: width 0.6s ease; }
.option-count { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }

.score-list { display: flex; flex-direction: column; gap: 10px; }
.score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}
.score-emoji {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.25), transparent 60%), var(--c, var(--accent));
}
.score-name { flex: 1; font-weight: 600; font-size: 15px; min-width: 0; }
.stepper { display: flex; align-items: center; gap: 4px; background: rgba(8, 10, 22, 0.6); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.stepper button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.stepper b { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-size: 16px; }
.stepper .max { color: var(--muted-2); font-size: 11px; }

.vote-empty { padding: 30px 16px; text-align: center; color: var(--muted); }

.sticky-bar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  width: min(92vw, 840px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 12px 20px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 17, 36, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.sticky-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sticky-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.composer { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-head h3 { font-size: 17px; }
.nick-row { display: flex; gap: 8px; }
.nick-row .input { flex: 1; }
.composer-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-foot .primary-btn { margin-left: auto; }
#dmCount { margin-left: auto; }
#dmHint { margin-right: auto; }

.dm-feed { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.dm-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  animation: fadeUp 0.3s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dm-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), transparent 60%), var(--c, var(--accent));
}
.dm-body { flex: 1; min-width: 0; }
.dm-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.dm-top b { font-size: 13px; font-weight: 600; color: var(--c, var(--accent)); }
.dm-top span { font-size: 11px; color: var(--muted-2); }
.dm-body p { font-size: 14px; line-height: 1.6; color: #e9eaff; word-break: break-word; white-space: pre-wrap; }
.dm-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.rank-card { padding: 20px; }
.rank-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.rank-head h3 { font-size: 17px; }
.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-row { display: flex; align-items: center; gap: 12px; }
.rank-no {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-variant-numeric: tabular-nums;
}
.rank-no.top1 { background: linear-gradient(140deg, #ffd166, #ff9f43); color: #3a2400; box-shadow: 0 6px 16px rgba(255, 209, 102, 0.3); }
.rank-no.top2 { background: linear-gradient(140deg, #dfe6f5, #9aa8c7); color: #212738; }
.rank-no.top3 { background: linear-gradient(140deg, #ffb27a, #d97a3c); color: #331a05; }
.rank-emoji { font-size: 22px; flex: none; width: 28px; text-align: center; }
.rank-mid { flex: 1; min-width: 0; }
.rank-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rank-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.rank-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.rank-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c, var(--accent)), rgba(255, 255, 255, 0.75)); transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.rank-empty { padding: 30px 10px; text-align: center; color: var(--muted); }

.page-foot { text-align: center; color: var(--muted-2); font-size: 12px; padding: 26px 0 10px; letter-spacing: 0.08em; }

/* ============================================================
   大屏
   ============================================================ */
[data-page="screen"] {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 2.2vh 2.4vw 1.8vh;
  gap: 1.8vh;
  background: #05060f;
}
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; animation: auroraMove 22s ease-in-out infinite; }
.aurora i:nth-child(1) { width: 48vw; height: 48vw; background: rgba(124, 92, 255, 0.4); top: -16vw; left: -10vw; }
.aurora i:nth-child(2) { width: 40vw; height: 40vw; background: rgba(255, 94, 168, 0.32); bottom: -18vw; right: -8vw; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 30vw; height: 30vw; background: rgba(56, 232, 198, 0.22); top: 36%; left: 46%; animation-delay: -14s; }
@keyframes auroraMove {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2vw, -2vh, 0) scale(1.1); }
}
.starfield {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.2px 1.2px at 78% 14%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.6px 1.6px at 34% 76%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 62% 58%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 88% 82%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 48% 36%, rgba(255, 255, 255, 0.4), transparent);
}

.scr-error {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(5, 6, 15, 0.92); text-align: center; padding: 30px;
}
.scr-error h2 { font-size: 28px; }
.scr-error p { color: var(--muted); }

.scr-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3vw;
  min-height: 11vh;
}
.scr-brand { display: flex; align-items: center; gap: 1vw; flex: 0 0 auto; }
.scr-brand .brand-mark { width: 4.2vh; height: 4.2vh; border-radius: 1.4vh; font-size: 2.1vh; }
.scr-brand-text { display: flex; flex-direction: column; gap: 0.4vh; }
.scr-site { font-size: 1.55vh; color: var(--muted); letter-spacing: 0.16em; }
.scr-sub { font-size: 1.5vh; color: var(--muted-2); letter-spacing: 0.12em; }
.scr-title-wrap { flex: 1; text-align: center; min-width: 0; }
.scr-title-wrap h1 {
  font-size: clamp(22px, 3.2vw, 50px);
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 34px rgba(124, 92, 255, 0.4);
}
.scr-title-meta { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 0.8vh; }
.scr-side { display: flex; align-items: center; gap: 1.4vw; flex: 0 0 auto; }
.live-pill {
  display: flex; align-items: center; gap: 0.5vw;
  font-size: 1.4vh; color: #ffb3c9;
  padding: 0.7vh 1.1vw; border-radius: 999px;
  border: 1px solid rgba(255, 94, 168, 0.35);
  background: rgba(255, 94, 168, 0.1);
}
.live-pill i { width: 0.8vh; height: 0.8vh; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); animation: pulse 1.4s infinite; }
.live-pill b { color: #fff; font-variant-numeric: tabular-nums; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.qr-card {
  display: flex; align-items: center; gap: 1vw;
  padding: 0.9vh 1.2vw;
  border-radius: 1.6vh;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}
.qr-box { width: 8.6vh; height: 8.6vh; border-radius: 1vh; overflow: hidden; background: #fff; padding: 0.7vh; }
.qr-box img, .qr-box canvas { width: 100% !important; height: 100% !important; display: block; border-radius: 0.5vh; }
.qr-text { display: flex; flex-direction: column; gap: 0.4vh; max-width: 16vw; }
.qr-text b { font-size: 1.4vh; }
.qr-text span { font-size: 1.1vh; color: var(--muted-2); word-break: break-all; line-height: 1.35; }

.scr-main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 1.8vw;
}
.dm-stage {
  position: relative;
  flex: 1 1 auto;
  border-radius: 2.2vh;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(160deg, rgba(124, 92, 255, 0.09), rgba(255, 255, 255, 0.015) 45%, rgba(255, 94, 168, 0.06)),
    rgba(255, 255, 255, 0.015);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.stage-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted-2);
  font-size: 1.6vh;
  letter-spacing: 0.2em;
}
.dm-chip {
  position: absolute;
  left: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.7vw;
  padding: 0.9vh 1.4vw;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--c, var(--accent));
  background: rgba(8, 10, 22, 0.55);
  color: #fff;
  font-size: clamp(13px, 1.55vh + 0.25vw, 26px);
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.18);
  animation: dmFlow var(--dur, 13s) linear forwards;
  will-change: transform;
}
.dm-chip .nick { color: var(--c, var(--accent)); font-weight: 700; font-size: 0.82em; }
.dm-chip .emoji { font-size: 1.05em; }
.dm-chip .text { color: #f4f5ff; }
@keyframes dmFlow {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 100%)); }
}

.board-wrap {
  flex: 0 0 32%;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  padding: 2vh 1.6vw;
  border-radius: 2.2vh;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  min-height: 0;
}
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.6vh; }
.board-head h2 { font-size: clamp(16px, 2.4vh, 28px); letter-spacing: 0.04em; }
.board-head h2::before { content: ""; display: inline-block; width: 0.5vh; height: 2vh; border-radius: 99px; background: var(--grad); margin-right: 0.8vw; vertical-align: -0.2vh; }
.board { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1vh; overflow: hidden; }
.board-row { display: flex; align-items: center; gap: 0.8vw; padding: 0.9vh 0.8vw; border-radius: 1.2vh; background: rgba(255, 255, 255, 0.035); transition: background 0.3s ease; }
.board-row.top1 { background: linear-gradient(90deg, rgba(255, 209, 102, 0.2), rgba(255, 209, 102, 0.03)); box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.35); }
.board-row.top2 { background: linear-gradient(90deg, rgba(214, 224, 245, 0.14), rgba(255, 255, 255, 0.02)); }
.board-row.top3 { background: linear-gradient(90deg, rgba(255, 178, 122, 0.14), rgba(255, 255, 255, 0.02)); }
.board-no {
  width: 3.6vh; height: 3.6vh; border-radius: 1vh; flex: none;
  display: grid; place-items: center;
  font-size: clamp(11px, 1.5vh, 20px); font-weight: 800;
  color: var(--muted); background: rgba(255, 255, 255, 0.07);
  font-variant-numeric: tabular-nums;
}
.board-row.top1 .board-no { background: linear-gradient(140deg, #ffd166, #ff9f43); color: #3a2400; }
.board-row.top2 .board-no { background: linear-gradient(140deg, #e6ecf9, #9aa8c7); color: #212738; }
.board-row.top3 .board-no { background: linear-gradient(140deg, #ffb27a, #d97a3c); color: #331a05; }
.board-emoji { font-size: clamp(16px, 2.2vh, 30px); flex: none; width: 2.6vw; text-align: center; }
.board-main { flex: 1; min-width: 0; }
.board-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6vw; }
.board-name { font-size: clamp(13px, 1.75vh, 24px); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-val { font-size: clamp(12px, 1.6vh, 22px); color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.board-val b { color: #fff; font-size: 1.15em; }
.board-bar { height: 0.7vh; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 0.55vh; }
.board-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c, var(--accent)), rgba(255, 255, 255, 0.8)); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.board.compact .board-row { padding: 0.5vh 0.7vw; gap: 0.6vw; }
.board.compact .board-emoji { font-size: 2vh; }
.board.compact .board-name { font-size: 1.7vh; }
.board.compact .board-bar { display: none; }
.board-empty { color: var(--muted-2); text-align: center; padding: 4vh 0; font-size: 1.5vh; }

.scr-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vw;
  min-height: 7vh;
}
.stat-strip { display: flex; align-items: center; gap: 2.6vw; }
.stat { display: flex; align-items: baseline; gap: 0.5vw; }
.stat b { font-size: clamp(15px, 2.2vh, 30px); font-variant-numeric: tabular-nums; background: linear-gradient(120deg, #fff, #b9b0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 1.2vh; color: var(--muted-2); letter-spacing: 0.1em; }
.foot-right { display: flex; align-items: center; gap: 1vw; }
.foot-url { font-size: 1.2vh; color: var(--muted-2); max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fsBtn { padding: 0.7vh 1.2vw; font-size: 1.2vh; }

/* ============================================================
   后台
   ============================================================ */
.auth-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card { width: min(100%, 430px); padding: 34px 30px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 4px; }
.auth-brand .brand-mark { width: 54px; height: 54px; border-radius: 18px; font-size: 24px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card > p { text-align: center; font-size: 13px; line-height: 1.7; }
.auth-card .field { margin-top: 4px; }

.admin-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  width: 238px;
  flex: none;
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: rgba(10, 12, 26, 0.6);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.side-brand .brand-mark { width: 42px; height: 42px; border-radius: 14px; }
.side-brand div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.side-brand b { font-size: 15px; }
.side-brand span { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.side-link svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.side-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.side-link.active {
  color: #fff;
  border-color: rgba(124, 92, 255, 0.35);
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.24), rgba(255, 94, 168, 0.14));
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.storage-chip {
  font-size: 11px;
  color: var(--muted-2);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  line-height: 1.5;
}
.side-link.danger { color: #ff9aa3; }
.side-link.danger:hover { background: rgba(255, 93, 108, 0.12); }

.admin-main { flex: 1; min-width: 0; padding: 28px 34px 50px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.dash-head h1 { font-size: 26px; letter-spacing: -0.01em; }
.dash-head p { font-size: 13px; margin-top: 4px; }
.dash-actions { display: flex; align-items: center; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { position: relative; padding: 20px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.stat-card::after {
  content: ""; position: absolute; inset: auto -20% -60% 40%;
  height: 120px; background: radial-gradient(circle, rgba(124, 92, 255, 0.35), transparent 70%);
  filter: blur(10px);
}
.stat-card span { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.stat-card b { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card i { position: absolute; right: 18px; bottom: 16px; font-size: 12px; color: var(--muted-2); font-style: normal; }

.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h3 { font-size: 17px; }
.panel p.muted { font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.guide-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; counter-reset: g; list-style: none; padding-left: 0; }
.guide-list li { position: relative; padding-left: 40px; counter-increment: g; }
.guide-list li::before {
  content: counter(g);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff;
  background: var(--grad);
}
.guide-list b { display: block; font-size: 14px; margin-bottom: 2px; }
.guide-list span { font-size: 12px; color: var(--muted); line-height: 1.55; }
.guide p.tiny { margin-top: 16px; line-height: 1.7; }

.mini-list { display: flex; flex-direction: column; gap: 10px; }
.mini-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.mini-item .mini-main { min-width: 0; }
.mini-item b { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item span { font-size: 12px; color: var(--muted); }
.mini-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

.activity-list { display: flex; flex-direction: column; gap: 14px; }
.activity-item { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.act-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.act-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.act-title h3 { font-size: 18px; }
.act-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.chip { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.live { color: #7dffe0; border-color: rgba(56, 232, 198, 0.4); background: rgba(56, 232, 198, 0.1); }
.chip.draft { color: #ffe4a3; border-color: rgba(255, 209, 102, 0.35); background: rgba(255, 209, 102, 0.08); }
.chip.ended { color: var(--muted); }
.act-stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--muted); }
.act-stats b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.act-links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-pill {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  font-size: 12px; color: var(--muted);
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.link-pill b { color: var(--text); font-weight: 600; }
.link-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.act-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px dashed var(--line); }
.act-actions .ghost-btn, .act-actions .danger-btn { padding: 8px 14px; font-size: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--muted-2); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text); }
.table td.empty { text-align: center; color: var(--muted); padding: 26px; }
.table .ghost-btn { padding: 6px 12px; font-size: 12px; }

.ban-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ban-form .field { width: 160px; }
.ban-form .field.grow { flex: 1; min-width: 160px; }

.radio-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.radio { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.radio input { accent-color: #7c5cff; width: 16px; height: 16px; }
.radio input:checked + span { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 12px; color: var(--muted); }
.two-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.form-actions .primary-btn { margin-left: auto; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 14px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); transition: background 0.2s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
.switch input:checked + i { background: linear-gradient(120deg, #7c5cff, #ff5ea8); }
.switch input:checked + i::after { transform: translateX(20px); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(4, 5, 12, 0.7);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
.modal { width: min(100%, 760px); max-height: 90vh; display: flex; flex-direction: column; animation: modalIn 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }

.act-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.act-form-grid .full { grid-column: 1 / -1; }
.item-editor { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; align-items: center; gap: 8px; }
.item-row .emoji-input { width: 58px; text-align: center; padding: 10px 6px; flex: none; }
.item-row .name-input { flex: 1; }
.item-row .color-input { width: 42px; height: 42px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 10, 22, 0.55); flex: none; }
.item-row .row-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 13px; flex: none; }
.item-row .row-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.item-row .row-btn.del:hover { color: #ff9aa3; border-color: rgba(255, 93, 108, 0.4); }
.add-item-btn { align-self: flex-start; }
.form-section { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
.form-section > h4 { font-size: 13px; color: var(--muted); margin: 0 0 12px; font-weight: 600; letter-spacing: 0.04em; }
.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 12px; font-size: 13px; color: var(--muted); }
.hint-box { font-size: 12px; color: var(--muted-2); line-height: 1.65; background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { width: 74px; padding: 20px 10px; }
  .side-brand { justify-content: center; padding: 0; }
  .side-brand div { display: none; }
  .side-link { justify-content: center; padding: 12px; }
  .side-link svg { width: 20px; height: 20px; }
  .side-link { font-size: 0; gap: 0; }
  .storage-chip { display: none; }
  .admin-main { padding: 22px 18px 44px; }
}
@media (max-width: 760px) {
  .page { padding: 4px 16px 20px; }
  .topbar { padding: 16px 16px 6px; }
  .hero { flex-direction: column; gap: 18px; padding: 22px 20px; }
  .hero-stats { flex-direction: row; justify-content: space-around; padding-left: 0; padding-top: 16px; border-left: 0; border-top: 1px solid var(--line); }
  .hero-stat { align-items: center; }
  .hero-stat b { font-size: 24px; }
  .sticky-bar { width: calc(100vw - 24px); padding: 10px 10px 10px 16px; }
  .sticky-bar .primary-btn { padding: 13px 22px; }
  .scr-head { flex-wrap: wrap; gap: 1.5vh; }
  .scr-brand, .scr-side { display: none; }
  .scr-title-wrap { flex: 1 1 100%; }
  .scr-main { flex-direction: column; }
  .board-wrap { flex: 0 0 40%; min-width: 0; }
  .dm-stage { flex: 1; }
  .foot-url { display: none; }
  .auth-card { padding: 26px 20px; }
  .act-form-grid, .three-grid { grid-template-columns: 1fr; }
  .ban-form .field { width: 100%; }
  .modal { max-height: 94vh; }
  .seg { margin-top: 16px; }
  .activity-item { padding: 18px; }
  .act-actions { gap: 6px; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 25px; }
  .hero-meta { gap: 6px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-head h1 { font-size: 22px; }
  .dash-actions { width: 100%; justify-content: space-between; }
  .cand-ring { width: 62px; height: 62px; font-size: 28px; }
  .score-row { flex-wrap: wrap; }
  .score-name { width: 100%; order: 3; }
}

/* ============================================================
   照片墙 · 学生端
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.photo-cand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  color: var(--text);
  text-align: left;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.photo-cand:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.photo-cand.selected { border-color: var(--c, var(--accent)); box-shadow: 0 0 0 2px var(--c, var(--accent)), 0 16px 34px rgba(0, 0, 0, 0.35); }
.photo-cand.locked { cursor: default; }
.photo-cand .cand-check { top: 12px; right: 12px; z-index: 2; }
.photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 13px;
  overflow: hidden;
  background: #0a0d1a;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.photo-cand:hover .photo-thumb img { transform: scale(1.04); }
.photo-meta { display: flex; flex-direction: column; gap: 2px; padding: 9px 5px 3px; min-width: 0; }
.photo-meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-votes { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.photo-status {
  padding: 16px 18px;
  margin-bottom: 14px;
  border-left: 3px solid var(--accent);
}
.photo-status b { display: block; margin-bottom: 5px; }
.photo-status-approved { border-left-color: var(--mint); }
.photo-status-rejected { border-left-color: var(--danger); }
.photo-status-pending { border-left-color: var(--gold); }

.photo-note { padding: 14px 16px; margin-bottom: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.photo-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.photo-upload-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.photo-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 104px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.photo-pick:hover { border-color: rgba(124, 92, 255, 0.65); background: rgba(124, 92, 255, 0.06); }
.photo-pick-icon { font-size: 26px; line-height: 1; color: var(--accent); }
.photo-preview { width: 100%; max-height: 300px; object-fit: contain; border-radius: 14px; background: #0a0d1a; }

.rank-thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; display: block; }
.rank-locked { padding: 30px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rank-locked p { margin: 0; }

/* ============================================================
   大屏 · 照片墙
   ============================================================ */
.photo-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 2.2vh;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(60% 70% at 50% 0%, rgba(124, 92, 255, 0.16), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}
.photo-stage-head {
  position: absolute;
  top: 1.5vh;
  left: 1.8vh;
  right: 1.8vh;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1vw;
  pointer-events: none;
}
.wall-lock {
  font-size: clamp(11px, 1.5vh, 18px);
  color: #ffe4a3;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 999px;
  padding: 0.5vh 1.2vh;
}
.wall-toggle { font-size: clamp(11px, 1.4vh, 15px); padding: 0.6vh 1.4vh; }

.ring3d-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  perspective: 1600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ring3d-wrap::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 6%;
  height: 14%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(124, 92, 255, 0.28), transparent 70%);
  filter: blur(15px);
  pointer-events: none;
}
.ring3d {
  position: relative;
  width: clamp(130px, 12vw, 220px);
  height: clamp(180px, 17vw, 300px);
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(140px, 13.5vw, 240px);
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
  padding: 0.8vh;
  border-radius: 1.6vh;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 21, 40, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%) rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(var(--r));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.ring-card.front { border-color: var(--c, var(--accent)); box-shadow: 0 0 0 2px var(--c, var(--accent)), 0 26px 60px rgba(0, 0, 0, 0.55); }
.ring-card .wall-photo, .wall-card .wall-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 1.2vh;
  overflow: hidden;
  background: #0a0d1a;
}
.ring-card .wall-photo img, .wall-card .wall-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ring-card .wall-name, .wall-card .wall-name {
  display: block;
  text-align: center;
  font-size: clamp(12px, 1.7vh, 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.4vh;
}
.ring-card .wall-votes, .wall-card .wall-votes {
  display: block;
  text-align: center;
  font-size: clamp(10px, 1.35vh, 16px);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-bottom: 0.3vh;
}

.style-cards { align-items: center; }
.wall-track-wrap { width: 100%; overflow: hidden; display: flex; align-items: center; }
.wall-track { display: flex; width: max-content; animation: wallScroll var(--dur, 30s) linear infinite; }
.wall-track:hover { animation-play-state: paused; }
@keyframes wallScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.wall-group { display: flex; gap: 1.6vw; padding-right: 1.6vw; }
.wall-card {
  flex: none;
  width: clamp(170px, 15vw, 280px);
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
  padding: 0.8vh;
  border-radius: 1.6vh;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(18, 21, 40, 0.9);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}
.style-few { flex-wrap: wrap; gap: 2vw; }
.wall-few { display: flex; gap: 2vw; flex-wrap: wrap; justify-content: center; }
.wall-few .wall-card { width: clamp(180px, 22vw, 320px); }

.wall-empty { display: flex; align-items: center; justify-content: center; }
.wall-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2vh;
  color: var(--muted);
  font-size: clamp(13px, 1.7vh, 20px);
}
.wall-empty-box b { color: var(--text); }

.board-thumb { width: clamp(24px, 3vh, 40px); height: clamp(24px, 3vh, 40px); border-radius: 0.8vh; object-fit: cover; display: block; }

.side-link .badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff5e6c, #ff8a5e);
  color: #fff;
  font-size: 11px;
  line-height: 19px;
  text-align: center;
  font-weight: 700;
}
.pill.ok, .pill-ghost.ok { color: var(--mint); border-color: rgba(80, 227, 178, 0.35); background: rgba(80, 227, 178, 0.1); }

/* ============================================================
   后台 · 审核专区 / AI
   ============================================================ */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.review-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}
.review-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 11px; background: #0a0d1a; display: block; }
.review-card .rc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-card .rc-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-card .rc-reason { font-size: 11px; color: #ffb3ba; line-height: 1.5; min-height: 16px; }
.review-actions { display: flex; gap: 6px; }
.review-actions button { flex: 1; padding: 7px 8px; font-size: 12px; border-radius: 9px; }
.review-dm-list { display: flex; flex-direction: column; gap: 10px; }
.review-dm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 93, 108, 0.07);
  border: 1px solid rgba(255, 93, 108, 0.22);
}
.review-dm-item .rdm-main { min-width: 0; }
.review-dm-item b { font-size: 13px; display: block; margin-bottom: 3px; }
.review-dm-item span { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-dm-item .rdm-actions { display: flex; gap: 6px; flex: none; }
.review-dm-item .rdm-actions button { padding: 6px 10px; font-size: 12px; }
.admin-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.admin-upload-grid .full { grid-column: 1 / -1; }
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ai-grid .full { grid-column: 1 / -1; }

/* 手机端优先：触控尺寸与安全区 */
@media (max-width: 760px) {
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .photo-cand { padding: 6px; border-radius: 15px; }
  .photo-meta b { font-size: 13px; }
  .photo-upload { padding: 15px; }
  .photo-upload .primary-btn { padding: 14px 20px; }
  .photo-pick { min-height: 96px; }
  .student-tabs { position: sticky; top: 0; z-index: 5; }
  .sticky-bar { left: 12px; right: 12px; width: auto; bottom: max(12px, env(safe-area-inset-bottom)); }
  .review-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .review-dm-item { flex-direction: column; align-items: stretch; }
  .review-dm-item .rdm-actions { justify-content: flex-end; }
  .admin-upload-grid, .ai-grid { grid-template-columns: 1fr; }
  .photo-stage { border-radius: 16px; }
  .ring3d-wrap { perspective: 1100px; }
  .ring3d { zoom: 0.72; }
  .style-few .wall-few { gap: 10px; }
  .scr-main.photo-mode .photo-stage { flex: 1 1 52%; }
  .scr-main.photo-mode .board-wrap { flex: 0 0 42%; }
}
@media (max-width: 420px) {
  .photo-grid { gap: 8px; }
  .photo-meta { padding: 7px 3px 2px; }
  .photo-votes { font-size: 11px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .dm-chip { animation-duration: var(--dur, 13s) !important; }
  .wall-track { animation: none !important; }
}
