/* ==================================================================
   F1毒奶大奖赛 2026Season — 样式
   深色 + 速度感 + F1 红。适配手机 / 平板 / 电脑。
   ================================================================== */

:root {
  --red: #e10600;
  --red-2: #ff2d20;
  --bg: #080a0e;
  --panel: rgba(20, 24, 32, .82);
  --panel-solid: #14181f;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f2f4f8;
  --text-dim: #98a2b3;
  --text-mute: #6b7480;
  --ok: #23c07a;
  --warn: #f0a020;
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 58px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景图（admin 可设置） ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--hero-img, none);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: .38;
  transition: opacity .4s ease;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 12% 12%, rgba(225, 6, 0, .20), transparent 62%),
    radial-gradient(900px 520px at 92% 88%, rgba(40, 90, 220, .14), transparent 60%),
    linear-gradient(180deg, rgba(8, 10, 14, .62) 0%, rgba(8, 10, 14, .88) 55%, rgba(8, 10, 14, .97) 100%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--red); color: #fff; }

/* ==================================================================
   顶栏
   ================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 15, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  height: var(--topbar-h);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), rgba(225, 6, 0, 0) 55%);
}
.tb-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tb-left { display: flex; align-items: center; gap: 18px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 26px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-style: italic;
  letter-spacing: -.5px;
  border-radius: 6px;
  transform: skewX(-8deg);
  box-shadow: 0 0 18px rgba(225, 6, 0, .55);
}
.brand-text {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-nav { display: flex; align-items: center; gap: 4px; }
.tb-link {
  position: relative;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color .16s, background .16s;
}
.tb-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.tb-link.active { color: #fff; }
.tb-link.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}
.tb-link-admin {
  color: #ffd8d5;
  background: rgba(225, 6, 0, .16);
  border: 1px solid rgba(225, 6, 0, .38);
}
.tb-link-admin:hover { background: rgba(225, 6, 0, .3); color: #fff; }

.tb-right { display: flex; align-items: center; gap: 8px; position: relative; flex: none; }

/* ---------- 头像 ---------- */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(255, 255, 255, .22);
  background: #222;
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  text-transform: uppercase;
}
.avatar-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transition: transform .15s;
}
.avatar-btn:hover { transform: scale(1.06); }
.avatar-btn .avatar { border-color: rgba(225, 6, 0, .7); }

.avatar-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 178px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 120;
  animation: pop .14s ease-out;
}
.avatar-menu::before {
  content: "";
  position: absolute;
  top: -6px; right: 14px;
  width: 10px; height: 10px;
  background: var(--panel-solid);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.avatar-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.avatar-menu-head .name { font-weight: 700; font-size: 14px; }
.avatar-menu-head .role { font-size: 12px; color: var(--red-2); font-weight: 600; }
.avatar-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background .14s;
}
.avatar-menu button:hover { background: rgba(255, 255, 255, .08); }
.avatar-menu button.danger { color: #ff8b85; }
.avatar-menu button.danger:hover { background: rgba(225, 6, 0, .18); }

@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ==================================================================
   通用组件
   ================================================================== */
.view { max-width: 1240px; margin: 0 auto; padding: 0 18px 64px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .13s, background .16s, border-color .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--red-2), var(--red));
  color: #fff;
  box-shadow: 0 8px 26px rgba(225, 6, 0, .36);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 32px rgba(225, 6, 0, .55); }

.btn-ghost {
  background: rgba(255, 255, 255, .06);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }

.btn-danger { background: rgba(225, 6, 0, .18); border-color: rgba(225, 6, 0, .5); color: #ff9d97; }
.btn-danger:hover:not(:disabled) { background: rgba(225, 6, 0, .32); color: #fff; }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 15px 34px; font-size: 17px; border-radius: 12px; letter-spacing: .5px; }
.btn-block { width: 100%; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  margin: 30px 0 14px;
  letter-spacing: .3px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--red);
  transform: skewX(-10deg);
}

.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  background: rgba(0, 0, 0, .38);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(225, 6, 0, .75);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, .16);
}
.textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
.select { appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2398a2b3' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px; }
.select option { background: #171b22; color: #fff; }
.input[type="datetime-local"] { color-scheme: dark; }

.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, .08);
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.chip-red { background: rgba(225, 6, 0, .18); color: #ff9d97; border-color: rgba(225, 6, 0, .4); }
.chip-ok { background: rgba(35, 192, 122, .16); color: #6fe0ab; border-color: rgba(35, 192, 122, .38); }
.chip-warn { background: rgba(240, 160, 32, .16); color: #f6c473; border-color: rgba(240, 160, 32, .38); }

.loading, .empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 15px;
}

/* ==================================================================
   首页 Hero
   ================================================================== */
.hero {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 0 80px;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-kicker {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-kicker::before {
  content: "";
  width: 34px; height: 3px;
  background: var(--red);
  transform: skewX(-25deg);
}
.hero-title {
  font-size: clamp(38px, 7.5vw, 82px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -1.5px;
  margin: 0 0 8px;
  background: linear-gradient(100deg, #fff 20%, #ffd2cf 60%, var(--red-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px rgba(225, 6, 0, .25);
}
.hero-sub {
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--text-dim);
  margin: 6px 0 30px;
  max-width: 620px;
}
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-countdown {
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.hero-countdown b { color: var(--red-2); font-size: 16px; }

@media (max-width: 820px) {
  .hero { align-items: center; text-align: center; justify-content: center; padding: 30px 4px 70px; }
  .hero-kicker { justify-content: center; font-size: 12px; letter-spacing: 2.4px; }
  .hero-kicker::before { width: 20px; }
  .hero-title { letter-spacing: -1px; }
  .hero-actions { justify-content: center; width: 100%; }
  .hero-actions .btn { width: 100%; max-width: 340px; }
  .hero-meta { justify-content: center; }
}

/* ==================================================================
   答题页
   ================================================================== */
.quiz-head {
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.quiz-head h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4.4vw, 40px);
  font-weight: 900;
  letter-spacing: -.6px;
}
.quiz-head-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.q-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color .18s;
}
.q-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--red), rgba(225, 6, 0, .05));
}
.q-card:hover { border-color: var(--line-strong); }
.q-no {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--red-2);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.q-text {
  font-size: clamp(17px, 2.6vw, 22px);
  font-weight: 800;
  line-height: 1.38;
  margin: 0 0 10px;
  letter-spacing: -.2px;
}
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.opts { display: grid; gap: 9px; }
.opts-multi { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.opts-single { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  user-select: none;
  min-height: 48px;
}
.opt:hover { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .05); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .tick {
  flex: none;
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3);
  position: relative;
  transition: border-color .15s, background .15s;
}
.opts-multi .opt .tick { border-radius: 5px; }
.opt .tick::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px; height: 9px;
  border-radius: inherit;
  background: var(--red);
  transform: scale(0);
  transition: transform .14s;
}
.opt input:checked ~ .tick { border-color: var(--red); }
.opt input:checked ~ .tick::after { transform: scale(1); }
.opt:has(input:checked) {
  border-color: var(--red);
  background: rgba(225, 6, 0, .14);
  box-shadow: 0 0 0 1px rgba(225, 6, 0, .35) inset;
}
.opt .opt-main { min-width: 0; flex: 1; }
.opt .opt-label { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.opt .opt-sub { font-size: 12px; color: var(--text-mute); line-height: 1.3; }
.opt.is-correct { border-color: var(--ok); background: rgba(35, 192, 122, .14); }
.opt.is-wrong { border-color: rgba(225, 6, 0, .6); background: rgba(225, 6, 0, .1); }

.gap-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap-input {
  width: 190px;
  padding: 13px 15px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: #fff;
  outline: none;
}
.gap-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 6, 0, .16); }
.gap-unit { font-size: 18px; font-weight: 800; color: var(--text-dim); }
.tier-hint { font-size: 12.5px; color: var(--text-mute); margin-top: 9px; }

.pick-counter { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.pick-counter.full { color: var(--red-2); }

.quiz-submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 0 10px;
  margin-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.notice {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice-warn { background: rgba(240, 160, 32, .12); border-color: rgba(240, 160, 32, .4); color: #f6c473; }
.notice-info { background: rgba(90, 140, 255, .1); border-color: rgba(90, 140, 255, .34); color: #a8c0ff; }
.notice-ok { background: rgba(35, 192, 122, .12); border-color: rgba(35, 192, 122, .4); color: #7fe3b3; }
.notice-red { background: rgba(225, 6, 0, .12); border-color: rgba(225, 6, 0, .42); color: #ff9d97; }

/* ---------- 成绩明细 ---------- */
.score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.score-line:last-child { border-bottom: 0; }
.score-line .pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.score-line .pts.zero { color: var(--text-mute); }
.score-line .pts.plus { color: var(--ok); }

/* ==================================================================
   积分榜
   ================================================================== */
.standings-head { padding: 34px 0 6px; }
.standings-head h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 900;
  letter-spacing: -1.4px;
  background: linear-gradient(100deg, #fff 25%, #ffc9c5 70%, var(--red-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
table.standings { width: 100%; border-collapse: collapse; }
table.standings th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, .28);
}
table.standings td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  vertical-align: middle;
}
table.standings tr:last-child td { border-bottom: 0; }
table.standings tbody tr { transition: background .15s; }
table.standings tbody tr:hover { background: rgba(255, 255, 255, .045); }

.rank {
  width: 52px;
  font-weight: 900;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.rank-1 { color: #ffd447; }
.rank-2 { color: #d8dde6; }
.rank-3 { color: #d9955c; }
tr.top1 { background: linear-gradient(90deg, rgba(255, 212, 71, .1), transparent 60%); }
tr.top2 { background: linear-gradient(90deg, rgba(216, 221, 230, .07), transparent 60%); }
tr.top3 { background: linear-gradient(90deg, rgba(217, 149, 92, .07), transparent 60%); }
tr.me { box-shadow: inset 3px 0 0 var(--red); }

.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who .avatar { width: 36px; height: 36px; flex: none; }
.who .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .badge-admin { font-size: 11px; color: var(--red-2); font-weight: 700; }

.pts-cell {
  text-align: right;
  font-weight: 900;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.pts-cell .adj { display: block; font-size: 11px; font-weight: 600; color: var(--text-mute); }

.adjust-box { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.adjust-box .input { width: 88px; padding: 6px 9px; font-size: 13px; text-align: right; }

@media (max-width: 700px) {
  table.standings th, table.standings td { padding: 11px 10px; }
  table.standings .col-gps { display: none; }
  .who .avatar { width: 30px; height: 30px; }
  .who .nm { font-size: 14px; }
  .pts-cell { font-size: 17px; }
  .rank { width: 34px; font-size: 15px; }
}

/* ==================================================================
   规则页
   ================================================================== */
.rules { max-width: 880px; margin: 0 auto; padding: 34px 0 20px; }
.rules h1 {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 900;
  letter-spacing: -1.2px;
  margin: 0 0 8px;
  background: linear-gradient(100deg, #fff 25%, #ffc9c5 70%, var(--red-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.rule-list { list-style: none; padding: 0; margin: 26px 0 0; counter-reset: r; }
.rule-list li {
  counter-increment: r;
  position: relative;
  padding: 17px 20px 17px 66px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.65;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rule-list li::before {
  content: counter(r);
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%) skewX(-9deg);
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red-2), var(--red));
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(225, 6, 0, .4);
}
.rule-list li b { color: #fff; }
.rule-list li em { color: var(--red-2); font-style: normal; font-weight: 700; }

/* ==================================================================
   出题端
   ================================================================== */
.admin-head { padding: 30px 0 4px; }
.admin-head h1 { font-size: clamp(26px, 5vw, 44px); font-weight: 900; letter-spacing: -1px; margin: 0 0 6px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 18px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab {
  padding: 10px 16px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--red); }

.q-builder { display: flex; flex-direction: column; gap: 14px; }
.qb-card {
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
}
.qb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.qb-title { font-weight: 800; font-size: 14px; color: var(--red-2); letter-spacing: .6px; }
.qb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.tier-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tier-row .input { flex: 1; min-width: 0; }
.tier-row .tier-x { flex: none; font-size: 12px; color: var(--text-mute); }
.tier-row .btn { flex: none; }

.answer-grid { display: grid; gap: 10px; }
.ans-row {
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.ans-row .ans-q { font-weight: 700; margin-bottom: 10px; font-size: 14.5px; }
.ans-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ans-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  background: rgba(0, 0, 0, .3);
  transition: border-color .15s, background .15s;
  user-select: none;
}
.ans-opt:hover { border-color: rgba(255, 255, 255, .35); }
.ans-opt input { accent-color: var(--red); margin: 0; }
.ans-opt:has(input:checked) { border-color: var(--red); background: rgba(225, 6, 0, .16); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat .k { font-size: 12px; color: var(--text-mute); letter-spacing: .6px; text-transform: uppercase; font-weight: 700; }
.stat .v { font-size: 21px; font-weight: 900; margin-top: 4px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.user-row:last-child { border-bottom: 0; }
.user-row .grow { flex: 1; min-width: 0; }

/* ==================================================================
   弹窗 / 提示
   ================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 9, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fade .16s ease-out;
  overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: pop .18s ease-out;
  margin: auto;
}
.modal.wide { max-width: 720px; }
.modal h3 { margin: 0 0 16px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: 0; color: var(--text-dim);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 6px 10px; border-radius: 8px;
}
.modal-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.modal-inner-rel { position: relative; }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: rgba(0,0,0,.35); padding: 4px; border-radius: 10px; }
.auth-tabs button {
  flex: 1; padding: 9px; border: 0; border-radius: 8px; background: none;
  color: var(--text-dim); font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s;
}
.auth-tabs button.active { background: var(--red); color: #fff; }

.toast-root {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 460px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: #1b2029;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: toastIn .2s ease-out;
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}
.toast.ok { border-color: rgba(35, 192, 122, .55); color: #8ae7bb; }
.toast.err { border-color: rgba(225, 6, 0, .6); color: #ff9d97; }
.toast.info { border-color: rgba(120, 160, 255, .5); color: #b6c9ff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 手机端顶栏 ---------- */
@media (max-width: 720px) {
  :root { --topbar-h: 54px; }
  .tb-inner { padding: 0 12px; gap: 8px; }
  .brand-text { font-size: 13.5px; max-width: 34vw; }
  .brand-mark { width: 26px; height: 23px; font-size: 12px; }
  .tb-left { gap: 8px; }
  .tb-nav { gap: 0; }
  .tb-link { padding: 6px 8px; font-size: 12.5px; }
  .tb-link-admin { padding: 6px 9px; }
  .tb-right .btn { padding: 7px 12px; font-size: 13px; }
  .view { padding: 0 12px 56px; }
  .card { padding: 16px; }
  .opts-multi, .opts-single { grid-template-columns: 1fr; }
  .gap-input { width: 100%; }
  .gap-wrap { width: 100%; }
}
@media (max-width: 420px) {
  .brand-text { display: none; }
  .tb-link { padding: 6px 7px; font-size: 12px; }
}
