:root {
  --bg: #080b12;
  --bg-2: #0d121c;
  --card: #111826;
  --card-2: #151e2f;
  --line: #1f2b3f;
  --line-2: #2a3a55;
  --text: #e9eff9;
  --muted: #8697b2;
  --muted-2: #61718c;
  --orange: #ff6a3d;
  --orange-2: #ff8f5e;
  --green: #2ee6a8;
  --blue: #5b8cff;
  --violet: #b07cff;
  --gold: #ffc857;
  --red: #ff5470;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(255, 106, 61, 0.13), transparent 62%),
    radial-gradient(900px 520px at 92% 0%, rgba(91, 140, 255, 0.14), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
u { text-decoration-color: var(--orange); text-underline-offset: 3px; }
b, strong { font-weight: 650; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 22px;
  background: rgba(8, 11, 18, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-ball {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffb089, transparent 48%),
    linear-gradient(140deg, var(--orange), #d94a20);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 18px rgba(255, 106, 61, 0.35);
  position: relative;
  overflow: hidden;
}
.brand-ball::before,
.brand-ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.6px solid rgba(10, 12, 18, 0.55);
  border-radius: 50%;
}
.brand-ball::before { inset: -6px 10px; }
.brand-ball::after { inset: 10px -6px; border-radius: 50%; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: 0.3px; white-space: nowrap; }
.brand-text small { color: var(--muted-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0e1522;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(134, 151, 178, 0.12);
}
.pill.ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(46, 230, 168, 0.16); }
.pill.bad .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 84, 112, 0.16); }

/* ---------- 按钮 ---------- */
.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #162032;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: #1b2840; border-color: #34506f; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--orange), #e34a1e);
  border-color: transparent;
  color: #160a05;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(255, 106, 61, 0.28);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }

/* ---------- 布局 ---------- */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.rail {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 18, 28, 0.9), rgba(8, 11, 18, 0.6));
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.nav-item svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item span { display: flex; flex-direction: column; line-height: 1.3; }
.nav-item b { font-size: 13.5px; color: inherit; }
.nav-item em { font-style: normal; font-size: 11.5px; color: var(--muted-2); }
.nav-item:hover { background: #121a29; color: var(--text); }
.nav-item.active {
  background: linear-gradient(120deg, rgba(255, 106, 61, 0.18), rgba(255, 106, 61, 0.04));
  border-color: rgba(255, 106, 61, 0.4);
  color: #fff;
}
.nav-item.active em { color: var(--orange-2); }
.nav-item.active svg { stroke: var(--orange-2); }

.rail-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px dashed var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.7;
}
.rail-foot b { color: var(--muted); }

.main {
  padding: 22px clamp(16px, 3vw, 34px) 46px;
  max-width: 1320px;
  width: 100%;
}

.view { display: none; animation: viewIn 0.28s ease both; }
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.view-head h1 { font-size: 22px; letter-spacing: 0.2px; }
.view-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #0f1724;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.live-tag { color: var(--green); border-color: rgba(46, 230, 168, 0.35); background: rgba(46, 230, 168, 0.07); }
.warn-tag { color: var(--gold); border-color: rgba(255, 200, 87, 0.35); background: rgba(255, 200, 87, 0.07); }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(160deg, rgba(21, 30, 47, 0.92), rgba(15, 21, 33, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.card-head h3 { font-size: 14px; letter-spacing: 0.2px; }
.fine { color: var(--muted-2); font-size: 11.5px; line-height: 1.6; margin-top: 10px; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 118px; }
.field span { color: var(--muted-2); font-size: 11.5px; }
.field input, .field select {
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0c1320;
  color: var(--text);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.14); }

.search { position: relative; margin-left: auto; min-width: 240px; }
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0c1320;
  outline: none;
}
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.14); }

.hints {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #0e1625;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5);
}
.hints button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.hints button:hover { background: #162234; color: var(--text); }
.hints .abbr { font-size: 11px; color: var(--orange-2); }

.status-line {
  margin: 12px 2px;
  color: var(--muted-2);
  font-size: 12px;
  min-height: 18px;
}
.status-line.error { color: #ffb0be; }

/* ---------- 比赛卡片 ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.game-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #16203a, #101725);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  animation: cardIn 0.32s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 106, 61, 0.45);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.45);
}
.game-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.game-card.is-live::after { background: linear-gradient(90deg, transparent, var(--red), transparent); }

.gc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: #0d1421;
}
.badge.live { color: #ffd7de; border-color: rgba(255, 84, 112, 0.5); background: rgba(255, 84, 112, 0.12); }
.badge.live::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 84, 112, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(255, 84, 112, 0); }
}
.badge.final { color: #bff3e0; border-color: rgba(46, 230, 168, 0.35); background: rgba(46, 230, 168, 0.08); }
.gc-time { color: var(--muted-2); font-size: 11px; }

.gc-team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.gc-team + .gc-team { border-top: 1px dashed rgba(42, 58, 85, 0.55); }

.team-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #0c1017;
  background: var(--c, #5b8cff);
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.18);
}
.gc-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.gc-name b { font-size: 13.5px; }
.gc-name small { color: var(--muted-2); font-size: 11px; }
.gc-score {
  margin-left: auto;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.gc-score.dim { color: var(--muted-2); }

.gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(31, 43, 63, 0.85);
  color: var(--muted-2);
  font-size: 11px;
}
.gc-foot .dot-sep { opacity: 0.5; }

.placeholder {
  grid-column: 1 / -1;
  padding: 34px 18px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ---------- 术语 ---------- */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.terms details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1623;
  padding: 0 12px;
  transition: border-color 0.15s ease;
}
.terms details[open] { border-color: rgba(255, 106, 61, 0.4); }
.terms summary {
  padding: 10px 0;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.terms summary::-webkit-details-marker { display: none; }
.terms summary::after { content: "+"; color: var(--orange-2); font-weight: 400; }
.terms details[open] summary::after { content: "–"; }
.terms p { padding: 0 0 11px; color: var(--muted); font-size: 12px; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 6, 10, 0.6);
  backdrop-filter: blur(2px);
  animation: fade 0.2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  z-index: 51;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 94vw);
  overflow-y: auto;
  padding: 26px 22px 40px;
  background: linear-gradient(180deg, #131c2c, #0b111c);
  border-left: 1px solid var(--line-2);
  box-shadow: -24px 0 50px rgba(0, 0, 0, 0.5);
  animation: drawerIn 0.26s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #121b2a;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.drawer-close:hover { color: #fff; border-color: var(--orange); }

.d-head { margin-bottom: 16px; }
.d-head small { color: var(--orange-2); font-size: 11px; letter-spacing: 1px; }
.d-head h2 { font-size: 18px; margin-top: 4px; }

.d-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 12px;
  background: #0d1523;
  border: 1px solid var(--line);
}
.d-side { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.d-side b { font-size: 12.5px; }
.d-side .team-logo { width: 44px; height: 44px; border-radius: 13px; font-size: 13px; }
.d-score { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.d-vs { color: var(--muted-2); font-size: 10px; letter-spacing: 1px; }

.d-block { margin-top: 18px; }
.d-block h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.d-block h4::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--orange); }

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(42, 58, 85, 0.55);
  font-size: 12.5px;
}
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted-2); }
.kv b { font-variant-numeric: tabular-nums; text-align: right; }

.q-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.q-table th, .q-table td { padding: 7px 6px; text-align: center; border-bottom: 1px solid rgba(31, 43, 63, 0.9); }
.q-table th { color: var(--muted-2); font-weight: 500; font-size: 11px; }
.q-table td:first-child, .q-table th:first-child { text-align: left; }
.q-table td b { font-variant-numeric: tabular-nums; }
.q-table tr.total td { border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 700; }

.event {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px dashed rgba(42, 58, 85, 0.45);
}
.event:last-child { border-bottom: 0; }
.event i {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: center;
  font-style: normal;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(91, 140, 255, 0.14);
  color: #a9c1ff;
  height: 18px;
  line-height: 16px;
}
.event b { color: var(--text); font-weight: 600; }

.summary-box {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 106, 61, 0.28);
  background: rgba(255, 106, 61, 0.06);
  font-size: 12.5px;
  line-height: 1.75;
  color: #f3e6e0;
  min-height: 62px;
}
.summary-box.loading { color: var(--muted); }

.missing {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px dashed var(--line-2);
  color: var(--muted-2);
  font-size: 12px;
}

/* ---------- 足球 ---------- */
.notice {
  padding: 12px 15px;
  margin-bottom: 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 200, 87, 0.3);
  background: rgba(255, 200, 87, 0.07);
  color: #f0dfb7;
  font-size: 12.5px;
}
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rule h4 { font-size: 13.5px; margin-bottom: 6px; color: #fff; }
.rule p { color: var(--muted); font-size: 12.5px; }

/* ---------- 质检 ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 14px; margin-bottom: 14px; }
.split.bottom { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }

.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 172px;
  border-radius: 12px;
  border: 1.5px dashed var(--line-2);
  background: #0c1320;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  padding: 14px;
}
.drop:hover, .drop.over { border-color: var(--orange); background: rgba(255, 106, 61, 0.05); }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.drop-inner svg { width: 30px; height: 30px; fill: none; stroke: var(--orange-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-inner b { font-size: 13px; }
.drop-inner small { color: var(--muted-2); font-size: 11px; }
#previewCanvas { border-radius: 10px; image-rendering: auto; }

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
  padding: 0;
  list-style: none;
}
.pipeline li {
  position: relative;
  padding: 5px 10px 5px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  transition: all 0.2s ease;
}
.pipeline li::before {
  content: attr(data-idx);
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: inherit;
  opacity: 0.7;
}
.pipeline li.done { color: #bff3e0; border-color: rgba(46, 230, 168, 0.4); background: rgba(46, 230, 168, 0.07); }
.pipeline li.active { color: #ffe3d8; border-color: var(--orange); background: rgba(255, 106, 61, 0.1); }

.qc-result { margin-top: 12px; animation: viewIn 0.3s ease both; }
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 650;
  margin-bottom: 10px;
  border: 1px solid var(--line-2);
}
.verdict.pass { color: #bff3e0; border-color: rgba(46, 230, 168, 0.45); background: rgba(46, 230, 168, 0.1); }
.verdict.fail { color: #ffd0d8; border-color: rgba(255, 84, 112, 0.45); background: rgba(255, 84, 112, 0.1); }

.bar-row { display: grid; grid-template-columns: 40px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.bar-row > span { color: var(--muted); }
.bar-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: #0a111c; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #22c99a, var(--green)); transition: width 0.75s cubic-bezier(0.22, 0.8, 0.3, 1); }
.bar.bad i { background: linear-gradient(90deg, #ff5470, #ff8a5c); }

.trouble-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.trouble-grid > div { padding: 11px 12px; border-radius: 10px; background: #0e1623; border: 1px solid var(--line); }
.trouble-grid b { font-size: 12.5px; color: #ffd9cc; }
.trouble-grid p { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- 答疑控制台 ---------- */
.qa { display: flex; flex-direction: column; min-height: 340px; }
.qa-log {
  flex: 1;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-right: 4px;
  margin-bottom: 10px;
}
.msg { max-width: 92%; padding: 9px 12px; border-radius: 11px; font-size: 12.5px; line-height: 1.65; animation: viewIn 0.24s ease both; }
.msg.bot { align-self: flex-start; background: #0e1725; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: rgba(255, 106, 61, 0.14); border: 1px solid rgba(255, 106, 61, 0.32); border-bottom-right-radius: 4px; }
.msg.bot b { color: var(--orange-2); }
.msg.bot .line { display: block; color: var(--muted); }
.msg.bot .line.head { color: var(--text); font-weight: 600; }

.qa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #0e1623;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--orange); background: rgba(255, 106, 61, 0.08); }

.qa-form { display: flex; gap: 8px; }
.qa-form input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0b1220;
  outline: none;
}
.qa-form input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.12); }

/* ---------- 训练 ---------- */
.train-top { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 14px; margin-bottom: 14px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cfg-actions { display: flex; gap: 8px; margin-top: 13px; }

.split-bar { display: flex; height: 22px; margin-top: 13px; border-radius: 7px; overflow: hidden; font-size: 10px; border: 1px solid var(--line); }
.split-bar span { display: grid; place-items: center; color: #08110e; font-weight: 700; }
.split-bar span:nth-child(1) { background: linear-gradient(90deg, #1fd39b, #2ee6a8); }
.split-bar span:nth-child(2) { background: #ffc857; }
.split-bar span:nth-child(3) { background: #5b8cff; color: #f2f6ff; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 13px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat small { color: var(--muted-2); font-size: 11px; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.stat.wide { grid-column: 1 / -1; }
.stat.wide b { font-size: 14px; }
.stat b.ok { color: var(--green); }
.stat b.warn { color: var(--gold); }
.stat b.stop { color: var(--red); }

.chart-card { margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.lg.tl { background: var(--orange); }
.lg.vl { background: var(--violet); }
.lg.va { background: var(--green); }
.lg.best { background: var(--gold); width: 6px; height: 6px; border-radius: 50%; }

.chart-wrap { position: relative; width: 100%; height: auto; }
#trainChart { width: 100%; height: auto; display: block; }
#trainChart .grid-line { stroke: rgba(42, 58, 85, 0.5); stroke-width: 1; }
#trainChart .axis-text { fill: #61718c; font-size: 10px; }
#trainChart .axis-line { stroke: #2a3a55; stroke-width: 1.2; }
#trainChart .seg { stroke-linecap: round; }
#trainChart .seg.draw { animation: segIn 0.45s ease-out both; }
@keyframes segIn { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
#trainChart .pt { opacity: 1; }
#trainChart .best-line { stroke: rgba(255, 200, 87, 0.45); stroke-width: 1; stroke-dasharray: 3 4; }
#trainChart .stop-line { stroke: rgba(255, 84, 112, 0.5); stroke-width: 1; stroke-dasharray: 3 4; }
#trainChart .point { opacity: 0; animation: popIn 0.3s ease forwards; }
@keyframes popIn { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
#trainChart .best-dot { fill: var(--red); stroke: #1a0d12; stroke-width: 2; }
#trainChart .replay-line { stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 4 3; }

.chart-tip {
  position: absolute;
  z-index: 8;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(10, 16, 26, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
  font-size: 11.5px;
  pointer-events: none;
}
.chart-tip b { display: block; margin-bottom: 4px; color: var(--text); }
.chart-tip i { display: block; font-style: normal; color: var(--muted); }
.chart-tip i span { float: right; color: var(--text); font-variant-numeric: tabular-nums; }

.replay { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.replay > span { color: var(--muted-2); font-size: 11.5px; }
.replay input[type="range"] {
  flex: 1;
  min-width: 140px;
  accent-color: var(--orange);
  height: 4px;
}
.replay b { font-size: 12px; color: var(--orange-2); font-variant-numeric: tabular-nums; min-width: 76px; }

.table-wrap { max-height: 290px; overflow: auto; border-radius: 9px; border: 1px solid var(--line); }
.epoch-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.epoch-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  text-align: right;
  color: var(--muted-2);
  font-weight: 500;
  font-size: 11px;
  background: #0d1522;
  border-bottom: 1px solid var(--line);
}
.epoch-table th:first-child, .epoch-table td:first-child { text-align: left; }
.epoch-table td {
  padding: 7px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(31, 43, 63, 0.7);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.epoch-table td:first-child { color: var(--text); }
.epoch-table tr.best td { background: rgba(255, 200, 87, 0.07); color: #ffe6b0; }
.epoch-table tr.replay-row td { box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.45); }
.epoch-table tr.stop td { color: #ffc2cc; }
.epoch-table td.empty { text-align: center; color: var(--muted-2); padding: 22px 10px; }

.mini-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; border: 1px solid var(--line-2); color: var(--muted-2); }
.mini-tag.best { color: var(--gold); border-color: rgba(255, 200, 87, 0.4); background: rgba(255, 200, 87, 0.08); }
.mini-tag.up { color: #ff9db0; border-color: rgba(255, 84, 112, 0.35); background: rgba(255, 84, 112, 0.08); }
.mini-tag.stop { color: #ffb3c0; border-color: rgba(255, 84, 112, 0.5); background: rgba(255, 84, 112, 0.12); }

.readout {
  padding: 12px;
  border-radius: 10px;
  background: #0d1523;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  min-height: 96px;
  margin-bottom: 12px;
}

.pkg { display: flex; flex-direction: column; gap: 7px; margin-bottom: 13px; }
.pkg > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1523;
}
.pkg b { font-size: 12px; color: #ffd9cc; white-space: nowrap; }
.pkg span { color: var(--muted-2); font-size: 11.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(15, 22, 35, 0.97);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .split, .split.bottom, .train-top { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .topbar { padding: 0 14px; }
  .brand-text small { display: none; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: sticky;
    top: 64px;
    z-index: 30;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 11, 18, 0.95);
    backdrop-filter: blur(10px);
  }
  .nav-item { width: auto; flex: 0 0 auto; padding: 8px 12px; }
  .nav-item em { display: none; }
  .rail-foot { display: none; }
  .main { padding: 16px 14px 40px; }
  .search { margin-left: 0; width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: auto; }
  .drawer { width: 100%; }
}

/* =========================================================
   刷新按钮 / AI 搜索栏 / 足球赛事 / AI 面板
   ========================================================= */

.btn.refresh {
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.24), rgba(46, 230, 168, 0.14));
  border-color: rgba(91, 140, 255, 0.45);
  color: #cfe0ff;
}
.btn.refresh:hover {
  border-color: rgba(91, 140, 255, 0.85);
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.34), rgba(46, 230, 168, 0.2));
}

/* ---------- 顶部 AI 搜索栏 ---------- */
.ai-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 300px;
  max-width: 560px;
  padding: 4px 5px 4px 10px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #0c1320;
}
.ai-search:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(176, 124, 255, 0.15); }
.ai-search input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 0;
  background: transparent;
  outline: none;
}
.ai-search input::placeholder { color: var(--muted-2); }
.ai-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #120a18;
  background: linear-gradient(135deg, #c79bff, #8f6bff);
}

/* ---------- 足球赛事 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #0d1421;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.chip b { color: inherit; font-weight: 600; }
.chip em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted-2);
  border-left: 1px solid var(--line);
  padding-left: 6px;
}
.chip i { font-style: normal; font-size: 10px; color: var(--orange-2); }
.chip:hover { border-color: #3a5878; color: var(--text); }
.chip.active {
  color: #160a05;
  background: linear-gradient(135deg, var(--orange), #e34a1e);
  border-color: transparent;
}
.chip.active em, .chip.active i { color: rgba(22, 10, 5, 0.72); }
.chip.active em { border-color: rgba(22, 10, 5, 0.25); }

.matches { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.league-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; flex-wrap: wrap; }
.league-head small { color: var(--muted-2); font-size: 11.5px; }
.league-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 106, 61, 0.35);
  background: rgba(255, 106, 61, 0.08);
}
.league-tag b { font-size: 12.5px; color: #ffd3c4; }
.league-tag em { font-style: normal; font-size: 10px; color: var(--orange-2); }

.match-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
}
.match-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #16203a, #101725);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.match-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 140, 255, 0.5);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.45);
}
.match-card.is-live::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.mc-meta {
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-team { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.mc-team + .mc-team { border-top: 1px dashed rgba(42, 58, 85, 0.55); }
.mc-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mc-name b { font-size: 13.5px; }
.mc-name small { color: var(--muted-2); font-size: 10.5px; }
.mc-score { margin-left: auto; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mc-score.dim { color: var(--muted-2); }
.mc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(31, 43, 63, 0.85);
  color: var(--muted-2);
  font-size: 11px;
}
.team-logo.fb { border-radius: 50%; font-size: 9.5px; }

.player-table td:first-child { text-align: left; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-list { display: flex; flex-direction: column; }

/* ---------- AI 面板 ---------- */
.drawer.ai-panel {
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  padding: 0;
}
#aiPanel[hidden] { display: none; }
.ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.ai-head small { color: var(--violet); font-size: 11px; letter-spacing: 0.5px; }
.ai-head h3 { font-size: 16px; margin-top: 3px; }
.drawer-close.inline { position: static; }
.ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-empty { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.ai-suggests { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ai-suggests button {
  text-align: left;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0e1522;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ai-suggests button:hover { border-color: var(--violet); color: var(--text); }
.ai-msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }
.ai-msg.user { align-self: flex-end; align-items: flex-end; }
.ai-msg small { color: var(--muted-2); font-size: 10px; }
.ai-bubble {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  border: 1px solid var(--line);
  background: #101827;
  word-break: break-word;
}
.ai-msg.user .ai-bubble {
  background: linear-gradient(135deg, rgba(255, 106, 61, 0.92), rgba(227, 74, 30, 0.92));
  border-color: transparent;
  color: #1a0c05;
}
.ai-bubble.typing { color: var(--muted); }
.ai-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.ai-input input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0c1320;
  outline: none;
}
.ai-input input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(176, 124, 255, 0.15); }

@media (max-width: 900px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .ai-search { order: 3; flex-basis: 100%; max-width: none; }
  .rail { position: static; height: auto; }
}
