:root {
  --bg: #0d1117;
  --panel: #161d27;
  --panel2: #1c2532;
  --line: #2a3444;
  --text: #e6edf7;
  --muted: #8b98ab;
  --accent: #ff7a1a;
  --accent2: #ffb020;
  --green: #35c46b;
  --red: #ff5d5d;
  --blue: #4a9eff;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #1b2433 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 22px;
  background: linear-gradient(180deg, rgba(22,29,39,.98), rgba(22,29,39,.82));
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.ball {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb84d, #e2571a 60%, #8a2b09);
  box-shadow: inset -3px -3px 6px rgba(0,0,0,.5), 0 0 12px rgba(255,122,26,.35);
  position: relative; flex: none;
}
.ball::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.35);
}
.spacer { flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; border: 1px solid var(--line);
  background: var(--panel2); white-space: nowrap;
}
.badge.ok { color: var(--green); border-color: rgba(53,196,107,.4); background: rgba(53,196,107,.08); }
.badge.bad { color: var(--red); border-color: rgba(255,93,93,.4); background: rgba(255,93,93,.08); }
.badge.warn { color: var(--accent2); border-color: rgba(255,176,32,.4); background: rgba(255,176,32,.08); }

/* ---------- 布局 ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px; }
.grid { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 10px 28px rgba(0,0,0,.25);
}
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.card h2 .dot { width: 6px; height: 16px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { color: var(--muted); font-size: 12px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; background: #0f1520; border: 1px solid var(--line);
  border-radius: 8px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }

.btn {
  border: 1px solid var(--line); background: #222d3d; color: var(--text);
  padding: 9px 16px; border-radius: 8px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #3b4a61; background: #283547; }
.btn.primary { background: linear-gradient(180deg, #ff8a30, #e5600c); border-color: #ff9a4d; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255,93,93,.45); color: #ff9b9b; }
.btn.ok { border-color: rgba(53,196,107,.45); color: #8ee7b2; }
.btn.tab { border: none; border-radius: 0; background: transparent; padding: 8px 16px; margin-right: 4px; color: var(--text-muted); border-bottom: 2px solid transparent; }
.btn.tab:hover { background: transparent; color: var(--text); }
.btn.tab.active { color: #ff9a4d; border-bottom-color: #ff8a30; font-weight: 600; background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ---------- 会员 ---------- */
.member-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.member-state { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.member-state.active { color: var(--green); }
.member-state.none { color: var(--muted); }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 12px; margin-top: 12px; font-size: 13px; }
.kv .k { color: var(--muted); }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.plan {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #101722;
  cursor: pointer; transition: .15s; position: relative; overflow: hidden;
}
.plan:hover { border-color: var(--accent); transform: translateY(-1px); }
.plan .p-name { font-weight: 700; }
.plan .p-price { color: var(--accent2); font-size: 20px; font-weight: 800; margin-top: 4px; }
.plan .p-price span { font-size: 12px; color: var(--muted); font-weight: 400; }

.qrbox { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.qrbox img { width: 150px; height: 150px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; }
@media (max-width: 520px) { .qrbox { flex-direction: column; align-items: flex-start; } }

.hint {
  border-left: 3px solid var(--accent); background: rgba(255,122,26,.07);
  padding: 10px 12px; border-radius: 6px; font-size: 12px; color: #d7c1a8; word-break: break-all;
}
.hint b { color: var(--accent2); }

/* ---------- 任务 ---------- */
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #111926;
}
.task.checked { border-color: rgba(255,122,26,.55); background: rgba(255,122,26,.06); }
.task input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.task .t-name { flex: 1; font-weight: 600; }
.task .t-opts { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.task select { width: auto; padding: 4px 8px; }
.task .t-note { font-size: 11px; color: var(--muted); border: 1px dashed var(--line); padding: 2px 6px; border-radius: 4px; }
.task .tag { font-size: 11px; color: var(--muted); border: 1px dashed var(--line); padding: 1px 6px; border-radius: 5px; }

.progress {
  height: 8px; background: #0c121c; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; margin: 12px 0 8px;
}
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.stat { display: flex; gap: 18px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.stat b { color: var(--text); font-size: 15px; }

.logbox {
  height: 320px; overflow: auto; background: #0a0f16; border: 1px solid var(--line);
  border-radius: 9px; padding: 10px; font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; line-height: 1.7;
}
.logbox .l { white-space: pre-wrap; word-break: break-all; }
.logbox .t { color: #5b6b82; margin-right: 8px; }
.logbox .info { color: #c8d4e5; }
.logbox .ok { color: #6fe0a1; }
.logbox .warn { color: #ffc861; }
.logbox .error { color: #ff8080; }
.logbox .win { color: #35c46b; font-weight: 700; }
.logbox .loss { color: #ff5d5d; font-weight: 700; }

/* ---------- 表格 ---------- */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
th, td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #101722; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: rgba(255,255,255,.02); }
td.wrapcell { white-space: normal; max-width: 300px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #131b26; color: var(--muted); cursor: pointer;
}
.tab.active { color: var(--text); border-color: var(--accent); background: rgba(255,122,26,.1); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 120px; }

.empty { text-align: center; color: var(--muted); padding: 26px; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(10px);
  background: #202b3c; border: 1px solid var(--line); padding: 10px 18px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: rgba(255,93,93,.5); color: #ffb0b0; }
.toast.good { border-color: rgba(53,196,107,.5); color: #a8f0c4; }

.login-wrap { max-width: 430px; margin: 8vh auto 0; }
.login-wrap .card { padding: 26px; }
.login-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.profiles { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.profile {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #111926; cursor: pointer;
}
.profile:hover { border-color: var(--accent); }
.profile .p-name { flex: 1; }
.profile .x { color: var(--muted); }

/* ---------- 多账号窗口 ---------- */
#multiView.wrap { max-width: none; padding: 12px 14px; }
.multi-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.multi-wrap {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(420px, 1fr);
  gap: 12px; height: calc(100vh - 122px); overflow-x: auto; align-items: stretch;
}
.multi-pane {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel);
}
.multi-pane-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 5px 10px; font-size: 12px; color: var(--muted);
  background: var(--panel2); border-bottom: 1px solid var(--line);
}
.multi-pane iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* 多开窗口：球队信息 / 充值会员 收进底部小窗，点按钮弹出 */
.slot-dock { display: none; }
body.slot-mode .slot-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: rgba(22,29,39,.97); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
body.slot-mode #mainView { padding-bottom: 58px; }
body.slot-mode #infoCol {
  position: fixed; left: 0; right: 0; bottom: 44px; z-index: 65;
  max-height: 66vh; overflow-y: auto; padding: 12px;
  background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: 0 -12px 28px rgba(0,0,0,.4);
  transform: translateY(130%); transition: transform .25s ease;
}
body.slot-mode #infoCol.open { transform: translateY(0); }
body.slot-mode #multiEntry { display: none; }
body.slot-mode .login-wrap { margin-top: 4vh; }

/* ---------- 站长端 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.statcards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .statcards { grid-template-columns: 1fr 1fr; } }
.statcard {
  border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, var(--panel), var(--panel2));
  padding: 14px 16px;
}
.statcard .sc-k { color: var(--muted); font-size: 12px; }
.statcard .sc-v { font-size: 26px; font-weight: 800; margin-top: 2px; }
.statcard .sc-v.ok { color: var(--green); }
.statcard .sc-v.warn { color: var(--accent2); }
td .btn + .btn { margin-left: 4px; }
table input[type=text], table input[type=number] { padding: 6px 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 8, 14, .72); display: flex;
  align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; width: min(860px, 96vw); max-height: 86vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* 今日比赛场次 */
.matchstats { display: flex; flex-wrap: wrap; gap: 8px; }
.matchchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line);
  font-size: 12px; color: var(--text);
}
.matchchip b { font-size: 15px; color: var(--accent2); margin-right: 2px; }
.matchchip .win { color: var(--green); }
.matchchip .loss { color: var(--red); }
