/* ============================================================
   打洲社高校自办赛 · 百川杯 —— 赛事抽签与晋级管理系统
   主题：黑色 / 白色 / 荧光绿 · 电竞军事战术风
   ============================================================ */

:root {
  --bg-0: #060807;
  --bg-1: #0b0f0d;
  --bg-2: #111714;
  --bg-3: #18211c;
  --panel: rgba(18, 26, 22, 0.72);
  --panel-solid: #121a16;
  --line: rgba(120, 255, 180, 0.14);
  --line-strong: rgba(120, 255, 180, 0.35);
  --green: #35ff97;
  --green-dim: #1cbf6d;
  --green-dark: #0f7a48;
  --neon-glow: 0 0 12px rgba(53, 255, 151, 0.45);
  --text: #eafff2;
  --text-dim: #8ea89a;
  --text-faint: #5f7469;
  --red: #ff4d5e;
  --red-dim: #c23747;
  --amber: #ffb020;
  --blue: #4da3ff;
  --radius: 14px;
  --radius-sm: 9px;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(53,255,151,0.06), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(53,255,151,0.04), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
}

/* 战术网格底纹 */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(53,255,151,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53,255,151,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 50% 0%, black, transparent 75%);
  z-index: 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1f2c26; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2a3b33; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 布局骨架 ============ */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky; top: 0; height: 100vh;
}

.brand { padding: 4px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand .logo {
  font-weight: 800; font-size: 17px; letter-spacing: 1px;
  color: var(--text);
  display: flex; align-items: center; gap: 9px;
}
.brand .logo .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  display: grid; place-items: center;
  color: #04100a; font-weight: 900; font-size: 14px;
  box-shadow: var(--neon-glow);
}
.brand .sub { font-size: 11px; color: var(--text-faint); margin-top: 7px; line-height: 1.6; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer; font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.nav-item:hover { color: var(--text); background: var(--bg-3); }
.nav-item.active {
  color: var(--green); background: rgba(53,255,151,0.07);
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(53,255,151,0.12);
}
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; }

.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--text-faint); padding: 10px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }

/* ============ 顶部标题 ============ */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.topbar .title { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.topbar .title .accent { color: var(--green); }
.topbar .subtitle { color: var(--text-dim); font-size: 13px; margin-top: 5px; font-family: var(--font-mono); }
.topbar .subtitle .num { color: var(--green); font-weight: 700; }

/* ============ 面板 / 卡片 ============ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 20px;
}
.panel + .panel { margin-top: 18px; }
.panel-title {
  font-size: 15px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 9px;
}
.panel-title .bar { width: 4px; height: 16px; background: var(--green); border-radius: 2px; box-shadow: var(--neon-glow); }

/* 数据卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green), transparent);
  opacity: .6;
}
.card .label { font-size: 12px; color: var(--text-dim); letter-spacing: .5px; }
.card .value { font-size: 32px; font-weight: 800; margin-top: 6px; font-family: var(--font-mono); }
.card .value.green { color: var(--green); text-shadow: var(--neon-glow); }
.card .value.red { color: var(--red); }
.card .value.amber { color: var(--amber); }
.card .hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--bg-3); color: var(--text);
  transition: all .15s ease; user-select: none;
  font-family: var(--font-sans);
}
.btn:hover { background: #1e2b24; border-color: var(--green); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--green); color: #04100a; border-color: var(--green);
  box-shadow: var(--neon-glow);
}
.btn-primary:hover { background: #57ffa8; }
.btn-primary.btn-huge { padding: 20px 42px; font-size: 22px; border-radius: 16px; letter-spacing: 3px; }

.btn-danger { background: transparent; color: var(--red); border-color: rgba(255,77,94,.4); }
.btn-danger:hover { background: rgba(255,77,94,.12); border-color: var(--red); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* ============ 表单 ============ */
label.fld { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 9px 12px;
  background: var(--bg-1); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-sans);
  outline: none; transition: border .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53,255,151,.12); }
input::placeholder { color: var(--text-faint); }
select option { background: var(--bg-2); }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 150px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: var(--bg-2); color: var(--text-dim);
  text-align: left; padding: 11px 14px; font-size: 12px;
  letter-spacing: .5px; font-weight: 700; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
tbody td { padding: 11px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: rgba(53,255,151,0.04); }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .5px;
}
.tag.ok { background: rgba(53,255,151,.12); color: var(--green); border: 1px solid rgba(53,255,151,.3); }
.tag.warn { background: rgba(255,176,32,.12); color: var(--amber); border: 1px solid rgba(255,176,32,.3); }
.tag.bad { background: rgba(255,77,94,.12); color: var(--red); border: 1px solid rgba(255,77,94,.3); }
.tag.dim { background: rgba(143,168,154,.1); color: var(--text-dim); border: 1px solid var(--line); }

/* ============ 分组网格 ============ */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.group-card {
  background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border .2s ease, box-shadow .2s ease;
}
.group-card.highlight { border-color: var(--green); box-shadow: var(--neon-glow); }
.group-card .g-head {
  padding: 12px 15px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.group-card .g-name { font-weight: 800; font-size: 15px; color: var(--green); font-family: var(--font-mono); }
.group-card .g-meta { font-size: 11px; color: var(--text-dim); }
.group-card .g-body { padding: 8px 6px; }
.team-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px; margin: 2px 3px;
  font-size: 13px;
}
.team-row .rank { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--bg-3); color: var(--text-dim); flex-shrink: 0; }
.team-row.adv .rank { background: rgba(53,255,151,.15); color: var(--green); }
.team-row.elim .rank { background: rgba(255,77,94,.12); color: var(--red); }
.team-row.adv { background: rgba(53,255,151,.05); }
.team-row .t-name { font-weight: 600; }
.team-row .t-id { color: var(--text-faint); font-size: 11px; font-family: var(--font-mono); }
.team-row .badge { margin-left: auto; }

/* ============ 抽签舞台 ============ */
.draw-stage { text-align: center; padding: 30px 20px; }
.draw-stage .stage-title { font-size: 20px; font-weight: 800; color: var(--green); letter-spacing: 2px; }
.draw-stage .stage-sub { color: var(--text-dim); margin-top: 6px; font-size: 13px; }

.rolling-name {
  font-family: var(--font-mono); font-size: 56px; font-weight: 900;
  letter-spacing: 2px; color: var(--text); min-height: 80px;
  display: flex; align-items: center; justify-content: center;
  text-shadow: var(--neon-glow);
}
.rolling-name.rolling { color: var(--green); animation: flicker .08s infinite alternate; }

@keyframes flicker { from { opacity: 1; } to { opacity: .82; } }

.draw-progress { width: 100%; max-width: 420px; margin: 18px auto; }
.progress-bar { height: 8px; background: var(--bg-3); border-radius: 6px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-dark), var(--green)); transition: width .4s ease; }

.reveal-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 24px; text-align: left; }
.reveal-group { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; animation: pop .5s ease both; }
.reveal-group.revealed { border-color: var(--green); box-shadow: var(--neon-glow); }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 徽章 / 提示 ============ */
.badge-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 13px 18px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-strong);
  box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 14px; font-weight: 600;
  animation: slidein .3s ease; max-width: 360px;
}
.toast.success { border-color: rgba(53,255,151,.5); }
.toast.error { border-color: rgba(255,77,94,.5); }
.toast.warn { border-color: rgba(255,176,32,.5); }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 24px; width: 100%; max-width: 620px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: pop .25s ease;
}
.modal h3 { font-size: 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.modal .m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ============ 晋级流程图 ============ */
.flow { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.flow-stage {
  flex: 1; min-width: 160px; background: var(--panel-solid);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.flow-stage .fs-title { font-weight: 800; color: var(--green); margin-bottom: 8px; }
.flow-stage .fs-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.flow-arrow { display: grid; place-items: center; color: var(--green); font-size: 22px; }
.flow-stage.done { border-color: var(--line-strong); }
.flow-stage.current { border-color: var(--green); box-shadow: var(--neon-glow); }

/* ============ 进度列表 ============ */
.prog-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prog-item:last-child { border-bottom: none; }
.prog-item .p-name { font-weight: 600; min-width: 90px; }
.prog-item .p-bar { flex: 1; height: 8px; background: var(--bg-3); border-radius: 6px; overflow: hidden; }
.prog-item .p-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-dark), var(--green)); transition: width .4s; }
.prog-item .p-txt { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); min-width: 90px; text-align: right; }

/* ============ 投屏模式 ============ */
.stage-mode {
  position: fixed; inset: 0; z-index: 800;
  background: var(--bg-0);
  display: flex; flex-direction: column;
}
.stage-mode .stage-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px; border-bottom: 1px solid var(--line);
}
.stage-mode .stage-head h1 { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.stage-mode .stage-head h1 .accent { color: var(--green); }
.stage-mode .stage-body { flex: 1; overflow: auto; padding: 30px 36px; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .brand { width: 100%; padding-bottom: 10px; }
  .sidebar-foot { display: none; }
  .main { padding: 18px 14px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  .rolling-name { font-size: 34px; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .topbar .title { font-size: 19px; }
  .btn-primary.btn-huge { font-size: 17px; padding: 15px 26px; }
}

/* ============ 工具类 ============ */
.mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-14 { margin-bottom: 14px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--text-dim); } .faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-amber { color: var(--amber); }
.empty {
  text-align: center; padding: 40px 20px; color: var(--text-faint);
}
.empty .big { font-size: 40px; margin-bottom: 10px; }
.section-hide { display: none; }
