/* TRY赛事联盟 · 赛事后台 —— 深色控制台（单一主题） */
:root {
  --bg: #0f1417;
  --panel: #161d21;
  --panel-2: #1b2429;
  --line: #263139;
  --ink: #e7edf0;
  --muted: #8ea0a8;
  --accent: #35c4d6;
  --accent-ink: #06161a;
  --accent-bg: #12343b;
  --ok: #4fd18a;
  --ok-bg: #123526;
  --warn: #f0b64a;
  --warn-bg: #3a2c0f;
  --crit: #ff6b5e;
  --crit-bg: #3d1a17;
  --review: #c58bff;
  --review-bg: #2d1f45;
  --zebra: #131a1e;
  --checker: #e7edf0;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -18px rgba(0,0,0,.9);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px; line-height: 1.6;
}
.dim { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace; font-size: .93em; }
a { color: var(--accent); }

/* 顶栏 */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.flag {
  width: 36px; height: 26px; border-radius: 4px; flex: none;
  background: repeating-conic-gradient(var(--checker) 0% 25%, var(--bg) 0% 50%) 0 0 / 12px 13px;
  border: 1px solid var(--line);
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.brand-sub { font-weight: 500; color: var(--muted); }
.brand-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tag { color: var(--accent); background: var(--accent-bg); border-radius: 999px; padding: 1px 8px; font-weight: 600; font-size: 11px; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .who { font-size: 13px; color: var(--muted); }
.checker-band { height: 6px; background: repeating-linear-gradient(90deg, var(--checker) 0 12px, transparent 12px 24px); opacity: .12; }

button { font: inherit; cursor: pointer; border-radius: 9px; border: 0; }
button:disabled { opacity: .45; cursor: default; }
button.primary { color: var(--accent-ink); background: var(--accent); font-weight: 700; padding: 8px 18px; }
button.primary:not(:disabled):hover { filter: brightness(1.08); }
button.secondary { color: var(--accent); background: var(--accent-bg); font-weight: 600; padding: 8px 14px; }
button.ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 7px 13px; }
button.ghost:hover { color: var(--ink); border-color: var(--muted); }
button.small { font-size: 12.5px; padding: 6px 12px; }
button.danger { color: #fff; background: var(--crit); font-weight: 700; padding: 8px 18px; }
.auth-msg { color: var(--crit); font-size: 13.5px; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 布局 */
.shell { max-width: 1280px; margin: 0 auto; padding: 22px 28px 90px; display: grid; gap: 22px; }
#layout { display: grid; gap: 22px; }
.block-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px 2px; }
.block-head h2 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 700; }

/* 比赛总览 */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--panel) 0%, #10262b 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px; box-shadow: var(--shadow);
}
.hero::after {
  content: ''; position: absolute; inset: 0 0 auto auto; width: 260px; height: 100%;
  background: repeating-conic-gradient(rgba(231,237,240,.06) 0% 25%, transparent 0% 50%) 0 0 / 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000);
  pointer-events: none;
}
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: relative; }
.hero-title { font-size: 22px; font-weight: 800; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.hero-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 18px; position: relative; }
.stat { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat.hot .v { color: var(--crit); }
.new-match { display: grid; gap: 8px; max-width: 520px; margin-top: 12px; position: relative; }
.new-match textarea { min-height: 84px; resize: vertical; }
.status-pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 10px; letter-spacing: .06em; }
.status-pill.pending { background: var(--warn-bg); color: var(--warn); }
.status-pill.running { background: var(--ok-bg); color: var(--ok); }
.status-pill.ended { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

/* 选手卡片 */
.players { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1080px) { .players { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .players { grid-template-columns: 1fr; } }
.pcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; position: relative; overflow: hidden;
}
.pcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--swatch, var(--line)); }
.pcard:hover { border-color: var(--muted); transform: translateY(-1px); }
.pcard.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.pcard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard .name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pcard .name .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--swatch, var(--line)); flex: none; border: 1px solid rgba(255,255,255,.15); }
.pcard .name .cn { color: var(--muted); font-size: 12px; font-weight: 500; }
.pcard .risk { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.pcard .score { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.pcard .reasons { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.pcard .stats-line { margin-top: 10px; display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pcard .stats-line b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard.empty { opacity: .6; cursor: default; }

/* 标签 */
.pill, .live-pill, .ok-pill, .warn-pill, .hard-pill, .src-pill, .lv, .risk-pill, .chip, .decision-pill {
  display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px;
  white-space: nowrap; vertical-align: middle; margin-left: 4px;
}
.live-pill { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); margin-left: 0; }
.live-pill.on { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.ok-pill { background: var(--ok-bg); color: var(--ok); }
.warn-pill { background: var(--warn-bg); color: var(--warn); }
.hard-pill { background: var(--crit); color: #fff; }
.src-pill { background: var(--crit-bg); color: var(--crit); }
.risk-pill { margin-left: 0; font-weight: 800; letter-spacing: .06em; }
.risk-LOW { background: var(--ok-bg); color: var(--ok); }
.risk-MEDIUM { background: var(--warn-bg); color: var(--warn); }
.risk-HIGH { background: var(--crit-bg); color: var(--crit); }
.risk-REVIEW { background: var(--review-bg); color: var(--review); }
.decision-pill { background: var(--accent-bg); color: var(--accent); }
.chip { margin: 0; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.l0 { color: var(--crit); border-color: var(--crit-bg); background: var(--crit-bg); }
.chip.rule { color: var(--accent); border-color: var(--accent-bg); background: var(--accent-bg); }
.chip.l2 { color: var(--warn); border-color: var(--warn-bg); background: var(--warn-bg); }
.lv { margin-left: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.lv-l0 { background: var(--crit); color: #fff; }
.lv-l1 { background: var(--warn-bg); color: var(--warn); }
.lv-rule { background: var(--accent-bg); color: var(--accent); }
.lv-l2 { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.lv-obs, .lv-aux { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

/* 复核队列 */
.review-list { display: grid; gap: 10px; }
.rcard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--review); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.rcard .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rcard .top b { font-size: 15px; }
.rcard ul { margin: 6px 0 8px; padding-left: 1.2em; font-size: 13px; }
.rcard li { margin: 2px 0; }
.decide { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.decide input { width: 260px; }
.empty-note { color: var(--muted); font-size: 13px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; }

/* 面板 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { margin-bottom: 10px; }
.eyebrow { display: block; font-size: 13.5px; font-weight: 700; letter-spacing: .02em; }
.desc { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.note { margin: 6px 0 10px; font-size: 13px; }
.history { margin-top: 8px; line-height: 1.9; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.detail { display: grid; gap: 16px; }
.detail .empty { padding: 26px 0; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head h2 { margin: 0; font-size: 18px; }

/* 风险卡（六要素） */
.risk { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .risk { grid-template-columns: 1fr; } }
.gauge { text-align: center; padding: 10px 0; }
.gauge .num { font-size: 56px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge .lbl { margin-top: 6px; }
.gauge .bar { height: 8px; border-radius: 999px; background: var(--panel-2); margin: 12px 10px 0; overflow: hidden; }
.gauge .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--warn) 45%, var(--crit)); }
.gauge .formula { font-size: 11px; color: var(--muted); margin-top: 8px; }
.six { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .six { grid-template-columns: 1fr; } }
.six .cell { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.six .cell h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.six .cell ul { margin: 0; padding-left: 1.1em; }
.six .cell li { margin: 2px 0; }
.six .cell.wide { grid-column: 1 / -1; }
.contrib { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.contrib:first-child { border-top: 0; }
.contrib .pts { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--warn); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.card .k { font-size: 11.5px; color: var(--muted); }
.card .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.card .u { font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* 表格 */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; color: var(--muted); font-size: 11.5px; letter-spacing: .04em; background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; }
tbody tr:nth-child(even) { background: var(--zebra); }
td.peak-hot { color: var(--crit); font-weight: 700; }
canvas { width: 100%; display: block; }

/* 表单与局 */
.round-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
#roundMap { width: 120px; }
#roundEnd { width: 250px; }
#roundDur { width: 74px; }
.bind-input { width: 150px; padding: 3px 8px; }
.round-block { margin-top: 14px; }
.round-block h4 { font-size: 13.5px; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.round-block h4 .dim { font-weight: 400; }

.raw { font-size: 13px; }
.raw summary { cursor: pointer; color: var(--muted); }
.raw pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 11.5px; line-height: 1.6; font-family: ui-monospace, Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[hidden] { display: none !important; }

/* 登录卡 */
.login-card { max-width: 420px; margin: 60px auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px 22px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 6px; font-size: 18px; }
.login-card form { display: grid; gap: 10px; margin-top: 16px; }
.login-card input { padding: 10px 12px; font-size: 14px; }
.login-card button { padding: 10px; }

/* 账号管理 */
.acct-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
@media (max-width: 900px) { .acct-grid { grid-template-columns: 1fr; } }
.acct-col h3 { margin: 6px 0 8px; font-size: 15px; }
.acct-col textarea { width: 100%; resize: vertical; font-family: inherit; }
.acct-col .tbl { margin-top: 10px; }
.acct-ops { white-space: nowrap; }
.acct-ops button { padding: 3px 8px; }
.check { display: inline-flex; align-items: center; gap: 4px; }
.pw { color: var(--warn); font-weight: 700; letter-spacing: .04em; user-select: all; }
.danger-text { color: var(--crit); }
