/* ============================================================
   WIXOSS 群内人气榜 · 样式
   暗色卡片风，移动端优先
   ============================================================ */

:root {
  --bg: #0b0d13;
  --bg-2: #0f121a;
  --surface: #141821;
  --surface-2: #1b1f2b;
  --surface-3: #232937;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf5;
  --text-2: #a6adc1;
  --text-3: #6e768b;
  --accent: #ff5c7a;
  --accent-2: #7c9cff;
  --accent-3: #59d0b0;
  --gold: #ffd166;
  --silver: #c9d1e3;
  --bronze: #e0915f;
  --good: #34d399;
  --bad: #ff6b6b;
  --warn: #f7b955;
  --radius: 16px;
  --shadow: 0 18px 44px -28px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(255, 92, 122, 0.16), transparent 62%),
    radial-gradient(980px 560px at 96% -8%, rgba(124, 156, 255, 0.14), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }
::selection { background: rgba(255, 92, 122, 0.32); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.13); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 19, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; min-width: 0; }
.logo { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 5px 14px rgba(255, 92, 122, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand-text em { font-style: normal; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.month-nav {
  display: flex; align-items: center; height: 34px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.nav-btn {
  width: 27px; height: 100%; border: 0; background: transparent; color: var(--text-2);
  font-size: 17px; line-height: 1; cursor: pointer; transition: 0.15s;
}
.nav-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-btn:disabled { opacity: 0.25; cursor: default; }
#monthSelect {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  color: var(--text); font-size: 12.5px; height: 100%; width: 104px; text-align: center;
  cursor: pointer; outline: none;
}
#monthSelect option { background: #171b25; color: var(--text); }

.segmented {
  display: flex; align-items: center; gap: 2px; height: 34px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.segmented button {
  border: 0; background: transparent; color: var(--text-2); font-size: 12.5px;
  padding: 0 12px; height: 100%; border-radius: 7px; cursor: pointer; transition: 0.15s;
}
.segmented button:hover { color: #fff; }
.segmented button.on {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-2); cursor: pointer; transition: 0.15s;
}
.icon-btn:hover { color: #fff; border-color: var(--line-strong); }
.icon-btn.accent {
  color: #ffd8df; border-color: rgba(255, 92, 122, 0.34);
  background: linear-gradient(180deg, rgba(255, 92, 122, 0.22), rgba(255, 92, 122, 0.09));
}
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }

.tabs { max-width: 1240px; margin: 0 auto; padding: 0 20px 10px; display: flex; gap: 4px; }
.tabs button {
  border: 0; background: transparent; color: var(--text-3); font-size: 13px;
  padding: 7px 13px; border-radius: 8px; cursor: pointer; transition: 0.15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: #fff; background: rgba(255, 255, 255, 0.075); }

/* ---------------- 布局 ---------------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 20px 20px 56px; }
.tab[hidden] { display: none; }
.boot { padding: 70px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.boards { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); margin-bottom: 16px; }
.charts2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); margin-bottom: 16px; }
.manage2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 16px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card > header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card h2 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: 0.01em; }
.card-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.pill {
  flex: none; font-size: 10.5px; color: var(--text-2); padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.045);
  white-space: nowrap;
}
.pill.soft { color: #c9d4ff; border-color: rgba(124, 156, 255, 0.28); background: rgba(124, 156, 255, 0.1); }

/* ---------------- KPI ---------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  position: relative; overflow: hidden; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)), var(--surface);
  border: 1px solid var(--line);
}
.kpi::after {
  content: ""; position: absolute; right: -34%; bottom: -78%; width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(255, 92, 122, 0.2), transparent 66%); pointer-events: none;
}
.kpi:nth-child(2)::after { background: radial-gradient(circle, rgba(124, 156, 255, 0.2), transparent 66%); }
.kpi:nth-child(3)::after { background: radial-gradient(circle, rgba(255, 209, 102, 0.18), transparent 66%); }
.kpi:nth-child(4)::after { background: radial-gradient(circle, rgba(89, 208, 176, 0.18), transparent 66%); }
.k-label { font-size: 11px; color: var(--text-3); letter-spacing: 0.03em; }
.k-value {
  display: flex; align-items: baseline; gap: 6px; margin-top: 3px;
  font-size: 25px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.k-value small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.k-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-sub b { color: #fff; font-weight: 600; }

/* ---------------- 榜单表格 ---------------- */
.board-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.board-table th {
  font-size: 10.5px; font-weight: 500; color: var(--text-3); text-align: right;
  padding: 0 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.board-table th:first-child { width: 34px; text-align: left; padding-left: 2px; }
.board-table th.tl { text-align: left; }
.board-table td { text-align: right; padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.board-table td:first-child { text-align: left; padding-left: 2px; }
.board-table td.tl { text-align: left; }
.board-table tbody tr { cursor: pointer; transition: background 0.12s; }
.board-table tbody tr:hover { background: rgba(255, 255, 255, 0.038); }
.board-table tbody tr:last-child td { border-bottom: 0; }

.rank {
  display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 8px;
  font-size: 11.5px; font-weight: 650; color: var(--text-2);
  background: rgba(255, 255, 255, 0.055); font-variant-numeric: tabular-nums;
}
.r1 { background: linear-gradient(160deg, #ffe29a, #ffb347); color: #3a2500; box-shadow: 0 5px 16px -6px rgba(255, 190, 80, 0.75); }
.r2 { background: linear-gradient(160deg, #eef2fa, #a9b4c9); color: #232a36; }
.r3 { background: linear-gradient(160deg, #f2b992, #c47a4e); color: #2a1508; }

.deck-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dot { width: 7px; height: 7px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.dname { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score { font-weight: 700; font-size: 14px; color: #fff; }
.muted { color: var(--text-3); }
.delta { font-size: 11px; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: #ff7b7b; }
.delta.new { color: #8fb0ff; font-size: 10px; }
.delta.flat { color: var(--text-3); }

.more-btn {
  display: block; width: 100%; margin-top: 8px; border: 1px dashed var(--line); border-radius: 9px;
  background: transparent; color: var(--text-3); font-size: 11.5px; padding: 7px; cursor: pointer; transition: 0.15s;
}
.more-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.03); }

.below { margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); }
.below-title { display: block; font-size: 10.5px; color: var(--text-3); margin-bottom: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 5px 5px 0;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
  font-size: 11px; padding: 3px 9px; border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.chip b { color: var(--text); font-weight: 600; }
.chip:hover { color: #fff; border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: inherit; }
.chart-empty { padding: 34px 10px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.chart-note { margin: 10px 2px 0; font-size: 10.5px; color: var(--text-3); line-height: 1.6; }
.legend-inline { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-3); flex-wrap: wrap; }
.lg { padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.lg-low { background: rgba(255, 107, 107, 0.16); color: #ffb0b0; }
.lg-mid { background: rgba(247, 185, 85, 0.16); color: #ffd79a; }
.lg-high { background: rgba(52, 211, 153, 0.16); color: #8ff0c8; }

/* ---------------- 月度热度 ---------------- */
.heat-wrap { overflow-x: auto; }
.heat { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 4px; font-size: 12px; }
.heat th { font-size: 10.5px; font-weight: 500; color: var(--text-3); text-align: center; padding: 2px 4px; white-space: nowrap; }
.heat th.hdeck { text-align: left; }
.heat td { padding: 0; text-align: center; }
.heat .deck-head {
  display: flex; align-items: center; gap: 7px; padding: 0 6px 0 2px; cursor: pointer;
  font-size: 12.5px; color: var(--text-2); white-space: nowrap; text-align: left;
}
.heat tr:hover .deck-head { color: #fff; }
.hcell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 8px; padding: 5px 2px; min-height: 38px;
}
.hcell .hs { font-size: 13px; font-weight: 650; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hcell .hg { font-size: 9px; color: rgba(255, 255, 255, 0.6); line-height: 1; }
.hcell.empty { background: rgba(255, 255, 255, 0.025); color: var(--text-3); }
.hcell.empty .hs { color: var(--text-3); font-weight: 400; font-size: 11px; }
.heat .total-cell { font-variant-numeric: tabular-nums; }
.heat .total-cell b { display: block; font-size: 13px; color: #fff; font-weight: 700; }
.heat .total-cell small { display: block; font-size: 9px; color: var(--text-3); font-weight: 400; }
.heat tr.group-total td { border-top: 1px solid var(--line); padding-top: 6px; font-size: 11px; color: var(--text-3); }

/* ---------------- 对战矩阵 ---------------- */
.matrix-wrap { overflow-x: auto; text-align: center; }
.matrix { margin: 0 auto; border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.matrix th { font-weight: 500; color: var(--text-3); font-size: 10.5px; padding: 3px; text-align: center; white-space: nowrap; }
.matrix th.mhead {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  text-align: left; padding: 0 10px 0 2px; font-size: 12px; color: var(--text-2);
  display: table-cell;
}
.matrix td.mhead {
  position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left;
  font-size: 12px; color: var(--text-2); white-space: nowrap; padding: 0 10px 0 2px;
}
.matrix td.mhead:hover { color: #fff; cursor: pointer; }
.matrix .mcell { width: 46px; height: 40px; border-radius: 7px; cursor: default; }
.mcell .mp { display: block; font-size: 12px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mcell .mn { display: block; font-size: 8.5px; opacity: 0.6; line-height: 1; }
.mcell.zero { background: rgba(255, 255, 255, 0.028); }
.mcell.zero .mp { color: var(--text-3); font-weight: 400; font-size: 10px; }
.mcell.thin .mp { opacity: 0.62; }
.mcell.thin .mn { opacity: 0.4; }
.mcell.diag { background: transparent; }

/* ---------------- 分身详情抽屉 ---------------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(5, 7, 11, 0.62);
  backdrop-filter: blur(4px); animation: fade 0.18s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(600px, 100%);
  overflow-y: auto; padding: 20px 22px 48px;
  background: linear-gradient(180deg, #12151e, #0d1017);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px -30px #000;
  animation: slideIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.drawer-title { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-title .dot { width: 10px; height: 10px; border-radius: 3px; }
.drawer-sub { margin: 4px 0 0 20px; font-size: 11.5px; color: var(--text-3); }
.dstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.dstat { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.035); }
.dstat span { display: block; font-size: 10px; color: var(--text-3); margin-bottom: 2px; white-space: nowrap; }
.dstat b { font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dsec { margin-top: 22px; }
.dsec-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.dsec-title small { font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.drow {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px;
  font-size: 12.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.drow:last-child { border-bottom: 0; }
.drow .rdate { font-size: 10.5px; color: var(--text-3); width: 42px; flex: none; font-variant-numeric: tabular-nums; }
.drow .grow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.drow .res { font-size: 9.5px; font-weight: 650; padding: 1px 6px; border-radius: 4px; flex: none; }
.res.win { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.res.lose { background: rgba(255, 107, 107, 0.14); color: #ffa3a3; }
.mu-row { display: flex; align-items: center; gap: 10px; padding: 5px 2px; font-size: 12px; }
.mu-name { width: 92px; flex: none; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-bar { flex: 1; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.mu-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ff5c7a, #ffb26b); }
.mu-val { width: 82px; flex: none; text-align: right; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mu-val small { color: var(--text-3); }

/* ---------------- 管理 ---------------- */
.gate { max-width: 520px; margin: 26px auto; }
.gate-inner { text-align: center; padding: 14px 6px 10px; }
.gate-icon {
  width: 46px; height: 46px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px;
  color: #ffd8df; background: linear-gradient(180deg, rgba(255, 92, 122, 0.24), rgba(255, 92, 122, 0.08));
  border: 1px solid rgba(255, 92, 122, 0.3);
}
.gate h2 { font-size: 17px; margin: 0 0 6px; }
.gate .card-sub { max-width: 320px; margin: 0 auto; }
.gate-row { display: flex; gap: 8px; max-width: 340px; margin: 18px auto 6px; }
.gate-row input { flex: 1; }
.gate-err { min-height: 16px; margin: 4px 0 0; font-size: 11.5px; color: #ff8a8a; }
.gate-hint { margin: 10px 0 0; font-size: 10.5px; color: var(--text-3); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], select.select {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; font-size: 13px; outline: none; min-width: 0; transition: 0.15s;
}
input:focus { border-color: rgba(255, 92, 122, 0.55); box-shadow: 0 0 0 3px rgba(255, 92, 122, 0.13); }
input::placeholder { color: var(--text-3); }

.primary-btn {
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 9px; padding: 9px 16px;
  background: linear-gradient(180deg, #ff6d88, #ff4d6d); color: #fff;
  font-size: 13px; font-weight: 650; cursor: pointer;
  box-shadow: 0 12px 26px -14px rgba(255, 92, 122, 0.9); transition: 0.15s;
}
.primary-btn:hover { filter: brightness(1.07); }
.primary-btn.sm { padding: 8px 13px; font-size: 12.5px; }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px;
  background: rgba(255, 255, 255, 0.045); color: var(--text); font-size: 12.5px;
  cursor: pointer; transition: 0.15s; text-decoration: none;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); }
.ghost-btn.sm { padding: 5px 10px; font-size: 11.5px; }
.danger-btn {
  border: 1px solid rgba(255, 107, 107, 0.32); border-radius: 9px; padding: 8px 13px;
  background: rgba(255, 107, 107, 0.1); color: #ffa3a3; font-size: 12.5px; cursor: pointer; transition: 0.15s;
}
.danger-btn:hover { background: rgba(255, 107, 107, 0.18); color: #ffc0c0; }

.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; margin: 4px 0 16px; }
.picker { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.picker > label { font-size: 11px; color: var(--text-3); }
.pick-btn {
  height: 54px; padding: 0 14px; display: flex; align-items: center; gap: 9px;
  border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface-2);
  color: var(--text-2); font-size: 14.5px; cursor: pointer; text-align: left; transition: 0.15s;
}
.pick-btn:hover { border-color: rgba(255, 92, 122, 0.5); background: #1d2230; }
.pick-btn.filled {
  border-style: solid; border-color: rgba(255, 255, 255, 0.16); color: #fff;
  background: linear-gradient(180deg, #1f2431, #171b25);
}
.pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-pop {
  position: fixed; top: 0; left: 0; z-index: 150;
  padding: 8px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #171b25; box-shadow: 0 30px 60px -20px #000;
}
.pick-search { width: 100%; margin-bottom: 6px; }
.pick-opts { max-height: 236px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.opt:hover, .opt.hl { background: rgba(255, 92, 122, 0.15); }
.opt small { margin-left: auto; color: var(--text-3); font-size: 10.5px; }
.opt-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 12px; }
.vs { padding-bottom: 20px; font-size: 10.5px; font-weight: 650; color: var(--text-3); letter-spacing: 0.08em; }

.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.win-btn {
  flex: 1; min-width: 148px; height: 52px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  color: var(--text-3); font-size: 14px; font-weight: 650; transition: 0.15s;
}
.win-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.win-btn:not(:disabled) { color: #fff; }
.win-a:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 92, 122, 0.3), rgba(255, 92, 122, 0.14));
  border-color: rgba(255, 92, 122, 0.45);
}
.win-b:not(:disabled) {
  background: linear-gradient(180deg, rgba(124, 156, 255, 0.3), rgba(124, 156, 255, 0.14));
  border-color: rgba(124, 156, 255, 0.45);
}
.win-btn:not(:disabled):hover { filter: brightness(1.12); }
.win-btn kbd {
  font-size: 10px; padding: 1px 5px; border-radius: 5px; color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.18);
}
.rec-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.note-row summary { font-size: 11px; color: var(--text-3); cursor: pointer; }
.note-row summary:hover { color: var(--text-2); }
.note-row input { margin-top: 8px; width: min(340px, 100%); }
.quick-decks { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.qlabel { font-size: 10.5px; color: var(--text-3); margin-right: 2px; }
.qchip {
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.03);
  color: var(--text-2); font-size: 11px; padding: 3px 9px; cursor: pointer; transition: 0.15s;
}
.qchip:hover { color: #fff; border-color: var(--line-strong); background: rgba(255, 92, 122, 0.14); }
.date-field { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-3); flex: none; }
.date-field input { padding: 6px 8px; font-size: 12px; }

.recent-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.rrow {
  display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 8px;
  font-size: 12.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.rrow:hover { background: rgba(255, 255, 255, 0.03); }
.rrow .rdate { width: 42px; flex: none; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rrow .rpair { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.rrow .winname { color: #fff; font-weight: 600; }
.rrow .losename { color: var(--text-3); }
.rrow .badge { flex: none; font-size: 9px; padding: 1px 5px; border-radius: 4px; background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.rrow .del { flex: none; border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 1px 7px; border-radius: 6px; }
.rrow .del:hover { color: #ff8a8a; background: rgba(255, 90, 90, 0.12); }
.empty-note { padding: 22px 6px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.8; }
.empty-hint { font-size: 11px; color: var(--text-3); opacity: 0.85; }

.tools { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.field input { width: 72px; text-align: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tools-hint { margin: 0; font-size: 10.5px; color: var(--text-3); line-height: 1.5; }

.deck-tools { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.deck-tools input { flex: 1; min-width: 130px; }
.deck-tools .deck-filter { max-width: 170px; flex: 0 1 170px; }
.deck-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; }
.deck-row {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.02);
}
.deck-row .dn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-row .gn { font-size: 10px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.deck-row input { flex: 1; min-width: 0; padding: 4px 6px; font-size: 12.5px; }
.deck-row button { flex: none; border: 0; background: transparent; color: var(--text-3); font-size: 10.5px; padding: 2px 4px; border-radius: 5px; cursor: pointer; }
.deck-row button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.deck-row.archived { opacity: 0.48; }
.deck-row.archived .dn { text-decoration: line-through; }

/* ---------------- 页脚 / 提示 ---------------- */
.footnote { margin: 16px 2px 0; font-size: 11px; color: var(--text-3); line-height: 1.7; }
.footnote b { color: var(--text-2); font-weight: 600; }
.page-foot {
  max-width: 1240px; margin: 0 auto; padding: 0 20px 28px;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 10.5px; color: var(--text-3);
}

.tooltip {
  position: fixed; z-index: 200; pointer-events: none; max-width: 280px;
  background: rgba(12, 15, 22, 0.97); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 9px; font-size: 11.5px; line-height: 1.55; color: var(--text);
  box-shadow: 0 16px 34px -12px #000; white-space: pre-line;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 28px);
  padding: 11px 16px; border-radius: 12px; font-size: 13px;
  background: #1b2130; border: 1px solid var(--line-strong);
  box-shadow: 0 26px 60px -20px #000; animation: toastIn 0.2s ease;
}
.toast .undo { border: 0; background: transparent; color: #8fb0ff; font-size: 13px; font-weight: 600; cursor: pointer; }
.toast .undo:hover { text-decoration: underline; }
.toast .close { border: 0; background: transparent; color: var(--text-3); font-size: 15px; cursor: pointer; padding: 0 2px; }
.toast .close:hover { color: var(--text); }

/* ---------------- 动画 ---------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes barIn { from { transform: scaleX(0.02); opacity: 0.3; } to { transform: scaleX(1); opacity: 1; } }
.bar-rect { animation: barIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left center; transform-box: fill-box; }
.bubble { animation: pop 0.35s ease both; }
.bar-row:hover .bar-track { fill: rgba(255, 255, 255, 0.075); }
.bar-row:hover .bar-label { fill: #ffffff; }
.bubble:hover circle { opacity: 1; }
.bubble:hover text { fill: #ffffff; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1040px) {
  .boards, .charts2, .manage2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .col-wl, .col-avg { display: none; }
  .dstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .wrap { padding: 14px 12px 44px; }
  .topbar-inner { padding: 10px 12px; gap: 10px; }
  .brand-text strong { font-size: 14px; }
  .brand-text em { font-size: 10.5px; }
  .logo { width: 28px; height: 28px; }
  .topbar-actions { gap: 6px; }
  .month-nav { height: 32px; }
  #monthSelect { width: 92px; font-size: 11.5px; }
  .segmented { height: 32px; }
  .segmented button { padding: 0 9px; font-size: 11.5px; }
  .icon-btn { width: 32px; height: 32px; }
  .tabs { padding: 0 12px 8px; }
  .tabs button { font-size: 12.5px; padding: 6px 11px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .k-value { font-size: 21px; }
  .card { padding: 14px; border-radius: 14px; }
  .grid { gap: 12px; }
  .board-table td, .board-table th { padding-left: 5px; padding-right: 5px; }
  .rec-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .vs { display: none; }
  .win-btn { min-width: 0; }
  .gate { margin: 8px auto; }
  .drawer { padding: 16px 14px 40px; border-left: 0; }
  .drawer-title { font-size: 18px; }
  .heat { min-width: 0; border-spacing: 3px; }
  .heat .deck-head { font-size: 11.5px; gap: 5px; }
  .hcell { padding: 4px 1px; min-height: 34px; }
  .hcell .hs { font-size: 12px; }
  .hcell .hg { font-size: 8px; }
  .heat .total-cell b { font-size: 12px; }
  .deck-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 560px) {
  .col-delta { display: none; }
  .topbar-inner { flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .brand { width: 100%; }
  .brand-text strong { font-size: 15px; }
  .month-nav { flex: 1; }
  #monthSelect { width: 100%; }
  .segmented { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   周期制新增组件：状态胶囊 / 锁定页 / 历史排名 / 周期管理
   ============================================================ */

.status-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 10px;
  font-size: 11.5px; white-space: nowrap; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045); color: var(--text-2);
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.status-pill.active { color: #8ff0c8; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.1); }
.status-pill.done { color: #c9d4ff; border-color: rgba(124, 156, 255, 0.3); background: rgba(124, 156, 255, 0.1); }
.status-pill.locked { color: #ffd79a; border-color: rgba(247, 185, 85, 0.35); background: rgba(247, 185, 85, 0.12); }
.status-pill.locked::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.period-pick {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  font-size: 11px; color: var(--text-3);
}
.period-pick label { flex: none; }
#periodSelect {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  color: var(--text); font-size: 12.5px; height: 100%; padding: 0 18px 0 2px;
  cursor: pointer; outline: none; max-width: 168px;
}
#periodSelect option { background: #171b25; color: var(--text); }

/* ---- 结算中锁定页 ---- */
.lock-card { text-align: center; padding: 46px 22px 40px; margin: 6px 0 18px; }
.lock-icon {
  width: 58px; height: 58px; margin: 0 auto 16px; display: grid; place-items: center;
  border-radius: 18px; color: #ffd79a;
  background: linear-gradient(180deg, rgba(247, 185, 85, 0.22), rgba(247, 185, 85, 0.07));
  border: 1px solid rgba(247, 185, 85, 0.3);
}
.lock-card h2 { font-size: 21px; margin: 0 0 10px; letter-spacing: -0.01em; }
.lock-text { margin: 0 auto; max-width: 460px; font-size: 13px; color: var(--text-2); line-height: 1.75; }
.lock-text b { color: #fff; }
.countdown {
  display: inline-block; margin: 18px auto 6px; padding: 10px 22px; border-radius: 12px;
  font-size: 26px; font-weight: 700; letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
  color: #fff; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong);
}
.lock-hint { margin: 8px 0 18px; font-size: 11.5px; color: var(--text-3); }

/* ---- 历史排名 ---- */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.hist-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}
.hist-card > header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.hist-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; flex-wrap: wrap; }
.hist-range { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.hist-meta { font-size: 11px; color: var(--text-3); }
.hist-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-top3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hist-top3 li {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.025); font-size: 13px;
}
.hist-top3 .rank { width: 23px; height: 23px; font-size: 11px; }
.hist-top3 .hn { font-weight: 600; }
.hist-top3 .hs { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.hist-top3 .hg { width: 108px; text-align: right; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.badge {
  font-size: 9.5px; padding: 1px 6px; border-radius: 5px; font-weight: 600;
  background: rgba(52, 211, 153, 0.15); color: #6ee7b7; white-space: nowrap;
}
.badge-live { background: rgba(124, 156, 255, 0.16); color: #a9bfff; }
.badge-done { background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
.badge-warn { background: rgba(247, 185, 85, 0.16); color: #ffd79a; }
.board-table.compact { font-size: 12.5px; margin-top: 4px; }
.board-table.compact td { padding: 6px 8px; }
.board-table.compact tbody tr { cursor: default; }
.board-table.no-delta .col-delta { display: none; }
.hist-details { margin-top: 2px; }
.hist-details > summary {
  cursor: pointer; list-style: none; font-size: 11.5px; color: var(--text-3);
  padding: 6px 2px; border-radius: 6px; user-select: none;
}
.hist-details > summary:hover { color: var(--text); }
.hist-details > summary::-webkit-details-marker { display: none; }
.hist-details > summary::before { content: "▸ "; color: var(--text-3); }
.hist-details[open] > summary::before { content: "▾ "; }
.hist-details[open] > summary { margin-bottom: 4px; }

/* ---- 周期管理（管理员） ---- */
.now-grid { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-bottom: 10px; }
.now-grid > div { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.now-label { font-size: 10.5px; color: var(--text-3); }
.now-grid b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.period-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; border-top: 1px solid var(--line); }
.period-row {
  display: grid; grid-template-columns: 142px 108px 68px 62px 104px 1fr;
  align-items: center; gap: 8px; padding: 8px 6px; font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-variant-numeric: tabular-nums;
}
.period-row.current { background: rgba(124, 156, 255, 0.05); }
.pr-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pr-range, .pr-time { color: var(--text-3); font-size: 11px; }
.pr-state { font-size: 10.5px; color: var(--text-2); }
.pr-state.settled { color: #a9bfff; }
.pr-state.active { color: #6ee7b7; }
.pr-state.draft { color: #ffd79a; }
.pr-matches { color: var(--text-2); }
.pr-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pr-actions button {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.045); color: var(--text-2);
  font-size: 10.5px; padding: 3px 8px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.pr-actions button:hover { color: #fff; border-color: var(--line-strong); background: rgba(255, 255, 255, 0.09); }

/* ---- 录入日期提示 ---- */
.date-hint { min-height: 17px; margin: -2px 0 10px; font-size: 11.5px; line-height: 1.5; }
.date-hint.ok { color: var(--text-3); }
.date-hint.warn { color: #ffd79a; }
.date-hint:empty { display: none; }

@media (max-width: 760px) {
  .status-pill { height: 32px; font-size: 10.5px; padding: 0 10px; }
  .period-pick { height: 32px; }
  #periodSelect { font-size: 11.5px; max-width: 130px; }
  .lock-card { padding: 34px 16px 30px; }
  .lock-card h2 { font-size: 18px; }
  .countdown { font-size: 21px; padding: 8px 16px; }
  .hist-card { padding: 12px; }
  .hist-title { font-size: 14.5px; }
  .hist-top3 .hg { width: 92px; font-size: 10.5px; }
  .now-grid { gap: 14px; }
  .period-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name state" "range matches" "time actions";
    row-gap: 3px; padding: 9px 4px;
  }
  .pr-name { grid-area: name; }
  .pr-state { grid-area: state; justify-self: end; }
  .pr-range { grid-area: range; }
  .pr-matches { grid-area: matches; justify-self: end; }
  .pr-time { grid-area: time; }
  .pr-actions { grid-area: actions; }
}
@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .brand { width: 100%; }
  .period-pick { flex: 1; }
  #periodSelect { max-width: none; }
  .lock-text { font-size: 12.5px; }
}


/* ============================================================
   战报图弹层
   ============================================================ */
#cardModalRoot[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(5px); animation: fade 0.18s ease;
}
.card-modal {
  position: fixed; z-index: 201; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(600px, 94vw); max-height: 94vh; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 16px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #151925, #0f121a); box-shadow: 0 44px 100px -30px #000;
  animation: pop 0.16s ease;
}
.card-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.card-modal-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-modal-img {
  flex: 1; min-height: 0; display: flex; justify-content: center; overflow: auto;
  border-radius: 12px; background: #0b0d13;
}
.card-modal-img img {
  display: block; max-width: 100%; max-height: calc(94vh - 170px); width: auto; height: auto;
  border-radius: 12px;
}
.card-modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex: none; }

@media (max-width: 760px) {
  .card-modal { padding: 10px; gap: 8px; }
  .card-modal-img img { max-height: calc(94vh - 150px); }
}


/* ============================================================
   人气榜标语 / 单榜布局
   ============================================================ */
.slogan {
  margin: 2px 2px 14px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffd8df;
  display: flex;
  align-items: center;
  gap: 8px;
}
.slogan-mark {
  color: var(--accent);
  font-size: 12px;
  filter: drop-shadow(0 0 8px rgba(255, 92, 122, 0.6));
}
.board-card { margin-bottom: 16px; }
