* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}
body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(99,102,241,0.25), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(236,72,153,0.18), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(16,185,129,0.12), transparent 60%),
    #0b1220;
}

.hidden { display: none !important; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 36px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,18,32,0.6);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.brand-title { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: #fff; }
.brand-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; letter-spacing: 1px; }

.actions { display: flex; gap: 10px; }
.btn {
  appearance: none; border: none; cursor: pointer;
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.btn.ghost { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.btn.ghost:hover { background: rgba(255,255,255,0.14); }
.btn.danger { background: linear-gradient(90deg,#ef4444,#f43f5e); color: #fff; }
.btn.danger:hover { filter: brightness(1.1); }
.btn.primary { background: linear-gradient(90deg,#6366f1,#8b5cf6); color: #fff; }

.container {
  max-width: 1320px;
  margin: 0 auto; padding: 32px 36px 64px;
}

.section-title {
  font-size: 18px; color: #cbd5e1; margin: 28px 0 16px;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; display: inline-block; width: 4px; height: 18px;
  background: linear-gradient(180deg,#6366f1,#ec4899); border-radius: 2px;
}

/* 评委进度 */
.progress-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.judge-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative; overflow: hidden;
}
.judge-card.done {
  background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(6,182,212,0.15));
  border-color: rgba(16,185,129,0.4);
}
.judge-name { font-size: 16px; font-weight: 700; color: #fff; }
.judge-status { font-size: 12px; color: #94a3b8; margin-top: 4px; letter-spacing: 1px; }
.judge-card.done .judge-status { color: #6ee7b7; }
.judge-bar { margin-top: 10px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.judge-bar-inner { height: 100%; background: linear-gradient(90deg,#6366f1,#ec4899); transition: width 0.4s; }
.judge-card.done .judge-bar-inner { background: linear-gradient(90deg,#10b981,#06b6d4); }
.judge-count { position: absolute; top: 16px; right: 18px; font-size: 13px; font-weight: 700; color: #c7d2fe; }
.judge-card.done .judge-count { color: #6ee7b7; }

/* banner */
.final-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, rgba(99,102,241,0.25), rgba(236,72,153,0.2));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 28px 36px;
  margin-top: 8px;
}
.banner-badge {
  display: inline-block; padding: 4px 12px; background: rgba(16,185,129,0.25);
  color: #6ee7b7; border-radius: 999px; font-size: 12px; letter-spacing: 1px;
  margin-bottom: 10px;
}
.banner-left h1 { margin: 0; font-size: 34px; color: #fff; letter-spacing: 2px; }
.banner-left p { margin: 8px 0 0; color: #cbd5e1; font-size: 14px; }
.trophy { font-size: 80px; filter: drop-shadow(0 8px 20px rgba(236,72,153,0.3)); }

/* 领奖台 */
.podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;
  margin: 20px 0 28px;
  align-items: end;
}
.podium-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  position: relative;
}
.podium-card.p1 {
  background: linear-gradient(145deg, rgba(250,204,21,0.22), rgba(234,179,8,0.1));
  border-color: rgba(250,204,21,0.5);
  padding-top: 32px; padding-bottom: 30px;
  transform: translateY(-10px);
  box-shadow: 0 10px 40px rgba(250,204,21,0.2);
}
.podium-card.p2 {
  background: linear-gradient(145deg, rgba(203,213,225,0.18), rgba(148,163,184,0.08));
  border-color: rgba(203,213,225,0.35);
}
.podium-card.p3 {
  background: linear-gradient(145deg, rgba(251,146,60,0.18), rgba(234,88,12,0.08));
  border-color: rgba(251,146,60,0.35);
}
.podium-rank {
  font-size: 44px; font-weight: 800; line-height: 1;
  background: linear-gradient(180deg,#fff,#c7d2fe);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.podium-card.p1 .podium-rank { background: linear-gradient(180deg,#fde68a,#f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.podium-card.p2 .podium-rank { background: linear-gradient(180deg,#f1f5f9,#cbd5e1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.podium-card.p3 .podium-rank { background: linear-gradient(180deg,#fed7aa,#f97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.podium-medal { font-size: 28px; margin-bottom: 4px; }
.podium-title { font-size: 20px; font-weight: 800; color: #fff; margin-top: 10px; }
.podium-members { font-size: 12px; color: #94a3b8; margin-top: 6px; line-height: 1.5; min-height: 36px; }
.podium-score { font-size: 32px; font-weight: 800; color: #fff; margin-top: 12px; }
.podium-score small { font-size: 13px; color: #94a3b8; font-weight: 500; margin-left: 4px; }

/* 表格 */
.table-wrap {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; overflow: hidden;
}
.rank-table {
  width: 100%; border-collapse: collapse;
}
.rank-table th, .rank-table td {
  padding: 14px 14px;
  text-align: left;
  font-size: 14px;
}
.rank-table th {
  background: rgba(255,255,255,0.05);
  color: #94a3b8; font-weight: 600; letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rank-table td { border-bottom: 1px solid rgba(255,255,255,0.05); }
.rank-table tr:last-child td { border-bottom: none; }
.rank-table tr:hover td { background: rgba(255,255,255,0.03); }

.scores-head { text-align: center; }

.rk-rank { font-weight: 800; font-size: 20px; color: #c7d2fe; }
.rk-rank.top1 { color: #fbbf24; }
.rk-rank.top2 { color: #e5e7eb; }
.rk-rank.top3 { color: #fb923c; }
.rk-order {
  display: inline-block; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(99,102,241,0.2); color: #c7d2fe;
  text-align: center; line-height: 34px; font-weight: 800;
}
.rk-title { font-size: 16px; font-weight: 700; color: #f1f5f9; }
.rk-form { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; font-size: 11px; background: rgba(99,102,241,0.18); color: #a5b4fc; vertical-align: middle; }
.rk-members { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.rk-score-cell { text-align: center; font-size: 15px; font-weight: 600; color: #e2e8f0; }
.rk-score-cell.pending { color: #475569; }
.rk-avg { text-align: right; font-size: 22px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.rk-avg.pending { color: #475569; font-size: 14px; font-weight: 500; }

.legend { margin-top: 12px; font-size: 12px; color: #64748b; line-height: 1.7; }
.legend code { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; color: #c7d2fe; }

/* mask/modal */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(4px);
}
.modal {
  background: #1e293b; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 24px; width: 380px; max-width: 90vw;
}
.modal h3 { margin: 0 0 8px; color: #fff; }
.modal p { color: #94a3b8; font-size: 13px; line-height: 1.6; }
.modal code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; }
.modal input {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; font-size: 14px; color: #fff; outline: none;
  margin-top: 10px;
}
.modal input:focus { border-color: #6366f1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-msg { margin-top: 10px; font-size: 13px; color: #f87171; min-height: 18px; }

.toast {
  position: fixed; left: 50%; top: 100px; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; z-index: 200;
}

@media (max-width: 860px) {
  .container { padding: 20px 14px 60px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .podium { grid-template-columns: 1fr; }
  .podium-card.p1 { transform: none; }
  .final-banner { flex-direction: column; gap: 16px; text-align: center; padding: 24px; }
  .trophy { font-size: 56px; }
  .rank-table th, .rank-table td { padding: 10px 8px; font-size: 12px; }
  .rk-title { font-size: 14px; }
}
