:root {
  --bg: #080b14;
  --panel: rgba(17, 23, 39, 0.92);
  --panel-2: rgba(28, 38, 62, 0.9);
  --border: rgba(120, 140, 190, 0.22);
  --text: #eaf0ff;
  --muted: #8b96ad;
  --accent: #5b8cff;
  --accent-2: #8fb0ff;
  --gold: #f5c451;
  --ok: #35d07f;
  --bubble-user: #2f5fd0;
  --bubble-bot: rgba(28, 38, 62, 0.85);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1000px 600px at 85% -5%, rgba(91, 140, 255, 0.14), transparent 60%),
    radial-gradient(900px 600px at -5% 105%, rgba(168, 85, 247, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
}

/* ---------- 顶部 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; backdrop-filter: blur(12px);
  background: rgba(8, 11, 20, 0.85); border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand-logo { font-size: 26px; }
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mode-badge {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); color: var(--gold); border: 1px solid var(--border);
}
.hud-btn {
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  transition: border-color .15s;
}
.hud-btn:hover { border-color: var(--accent); }
.hud-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 醒目的提问按钮 */
.hud-btn.ask-big {
  padding: 10px 24px; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #5b8cff, #9b5bff);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 16px rgba(91, 140, 255, 0.6);
  animation: pulse-glow 2s infinite;
}
.ask-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 44;
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 27px; color: #fff; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5b8cff, #9b5bff);
  box-shadow: 0 8px 24px rgba(91, 140, 255, 0.55);
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(91, 140, 255, 0.45); transform: scale(1); }
  50% { box-shadow: 0 0 28px rgba(155, 91, 255, 0.85); transform: scale(1.06); }
}

/* ---------- 筛选 ---------- */
.filters {
  position: sticky; top: 60px; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  padding: 10px 20px; background: rgba(8, 11, 20, 0.7); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip {
  padding: 4px 11px; border-radius: 999px; cursor: pointer; font-size: 12px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#winRange { width: 110px; accent-color: var(--accent); }
#heroSearch {
  width: 220px; padding: 6px 11px; border-radius: 10px; font-size: 13px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); outline: none;
}
#heroSearch:focus { border-color: var(--accent); }

/* ---------- 阵容板 ---------- */
.team-board {
  max-width: 1200px; margin: 16px auto 0; padding: 0 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
}
.team-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.team-title { font-weight: 700; flex: 1; font-size: 14px; }
.team-stat { font-size: 12px; color: var(--muted); }
.team-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 14px 14px; }
.team-slot {
  background: var(--panel-2); border: 1px dashed var(--border); border-radius: 10px;
  padding: 8px 6px; min-height: 84px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; text-align: center;
}
.team-slot.filled { border-style: solid; }
.ts-lane { font-size: 11px; color: var(--muted); }
.ts-avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.ts-name { font-size: 12px; font-weight: 600; }
.ts-meta { font-size: 10px; color: var(--muted); }
.ts-empty { font-size: 12px; color: var(--muted); opacity: .6; }

/* ---------- 英雄卡片墙 ---------- */
.grid-area { max-width: 1200px; margin: 0 auto; padding: 16px; }
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px;
}
.hero-card2 {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; border-top: 3px solid var(--lane-color, var(--accent));
  padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s, opacity .2s;
}
.hero-card2:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.hero-card2.dim { opacity: .22; }
.hc2-avatar { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.hc2-name { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; }
.hc2-win { font-size: 11px; color: var(--muted); }
.hc2-tier { position: absolute; top: 6px; right: 6px; font-size: 10px; padding: 1px 6px; border-radius: 999px; color: #fff; }
.hc2-add {
  position: absolute; top: 6px; left: 6px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer;
  font-size: 15px; line-height: 1; display: none; align-items: center; justify-content: center;
}
.hero-card2:hover .hc2-add { display: flex; }
.hc2-add.added { background: var(--ok); }

.tier-t0 { background: #e34d4d; } .tier-t05 { background: #e9823c; }
.tier-t1 { background: #d9a63a; } .tier-t2 { background: #5b8cff; }
.tier-t3 { background: #6b7a94; } .tier-t4 { background: #5a6575; }
.tier-null { background: #5a6575; }

/* ---------- 聊天面板 ---------- */
.chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45;
  width: 400px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.chat-panel[hidden] { display: none; }
.chat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; border-bottom: 1px solid var(--border); font-weight: 700;
}
.chat { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg.user { flex-direction: row-reverse; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--panel-2); border: 1px solid var(--border);
}
.msg.user .avatar { background: var(--accent); }
.bubble {
  background: var(--bubble-bot); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; line-height: 1.65; font-size: 14px;
  max-width: 100%; overflow-wrap: break-word; min-width: 0;
}
.msg.user .bubble { background: var(--bubble-user); border-color: transparent; }
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: 4px 0 6px; padding-left: 18px; }
.bubble strong { color: var(--gold); }

.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--border); }
.input-bar { display: flex; gap: 8px; padding: 10px 14px 14px; }
.input-bar textarea {
  flex: 1; resize: none; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  outline: none; max-height: 120px; font-family: inherit; line-height: 1.5;
}
.input-bar textarea:focus { border-color: var(--accent); }
.input-bar button {
  padding: 0 18px; border: none; border-radius: 12px; cursor: pointer; font-size: 14px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.input-bar button:disabled { opacity: .5; cursor: not-allowed; }

.sources { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.sources summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.src-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 6px; font-size: 12px; }
.src-card .src-title { font-weight: 600; color: var(--accent-2); margin-bottom: 3px; }
.src-card .src-meta { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.src-card pre { white-space: pre-wrap; font-family: inherit; margin: 0; color: var(--text); }

.table-wrap { overflow-x: auto; margin: 6px 0; }
.table-wrap table { border-collapse: collapse; font-size: 13px; width: 100%; }
.table-wrap th, .table-wrap td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.table-wrap th { background: var(--panel-2); color: var(--accent-2); }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* ---------- 英雄卡片（详情） ---------- */
.hero-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.hero-card .hc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hc-avatar { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--border); }
.hero-card .hc-name { font-size: 20px; font-weight: 700; }
.hero-card .hc-alias { color: var(--muted); font-size: 13px; margin-left: 6px; }
.hero-card .hc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.hero-card .hc-tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); }
.hero-card .hc-section { margin-top: 12px; }
.hero-card .hc-section h4 { margin: 0 0 6px; color: var(--gold); font-size: 14px; }

/* ---------- 视频 ---------- */
.videos { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.videos-title { font-size: 14px; font-weight: 600; color: var(--gold); margin-bottom: 8px; }
.video-card { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 8px; transition: border-color .15s; }
.video-card:hover { border-color: var(--accent); }
.video-cover { width: 96px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--panel-2); flex-shrink: 0; }
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 13px; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.video-link { display: inline-block; font-size: 13px; color: var(--accent-2); text-decoration: none; margin-top: 4px; }
.video-link:hover { text-decoration: underline; }
.muted-note { color: var(--muted); font-size: 13px; }

/* ---------- 对比 ---------- */
.modal-title { margin: 0 0 14px; font-size: 18px; }
.cmp-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cmp-pick select { flex: 1; min-width: 130px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 14px; }
.cmp-pick button { padding: 9px 18px; border: none; border-radius: 10px; cursor: pointer; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
.cmp-vs { color: var(--gold); font-weight: 700; }
#cmpResult { margin-top: 14px; }
.cmp-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.cmp-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cmp-hero { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.cmp-hero img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.cmp-name { font-size: 16px; font-weight: 700; }
.cmp-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cmp-table { width: 100%; }
.cmp-table th, .cmp-table td { text-align: center; }
.cmp-seg { color: var(--accent-2); font-weight: 600; }
.cmp-dim { font-size: 11px; color: var(--muted); margin-top: 2px; }
.win-high { color: var(--ok); font-weight: 700; }
.win-low { color: #e9823c; }
.cmp-note { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

/* ---------- 弹层 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.62); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  width: min(760px, 100%); max-height: 86vh; overflow-y: auto; position: relative; padding: 20px; backdrop-filter: blur(14px);
}
.modal-close { position: sticky; top: 0; float: right; margin: -8px -8px 0 0; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 15px; }
.about-body { line-height: 1.8; font-size: 14px; }
.about-body ul { padding-left: 20px; }

/* ---------- 引导页 ---------- */
.onboard {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 600px at 50% 40%, rgba(91, 140, 255, 0.2), transparent 60%), rgba(3, 5, 10, 0.9);
  transition: opacity .3s;
}
.onboard.hidden { opacity: 0; pointer-events: none; }
.onboard-card { text-align: center; max-width: 460px; padding: 30px 34px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; backdrop-filter: blur(16px); }
.onboard-title { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.onboard-sub { font-size: 14px; color: var(--muted); margin-top: 8px; }
.onboard-steps { margin: 22px 0 8px; color: var(--accent-2); font-size: 13px; }
.onboard-text { font-size: 15px; line-height: 1.7; min-height: 52px; }
.onboard-actions { margin-top: 22px; display: flex; justify-content: center; gap: 10px; }
.onboard-actions .hud-btn { padding: 9px 22px; font-size: 14px; }

@media (max-width: 760px) {
  .filters { top: 56px; }
  .chat-panel { width: 100vw; max-width: 100vw; }
  .team-slots { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- BP 模拟 ---------- */
.bp-screen {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(5, 7, 14, 0.97);
  display: flex; flex-direction: column;
  padding: 14px 18px; overflow-y: auto;
}
.bp-screen[hidden] { display: none; }
.bp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bp-title { font-size: 18px; font-weight: 800; flex: 1; }
.bp-status { font-size: 14px; color: var(--gold); font-weight: 600; }
.bp-timer {
  font-size: 22px; font-weight: 800; color: #fff;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px 14px; min-width: 54px; text-align: center;
}
.bp-timer.urgent { color: #ff6a6a; }
.bp-teams { display: flex; gap: 14px; align-items: stretch; margin: 14px 0; }
.bp-team { flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.bp-team-name { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.bp-team-name.blue { color: #6aa4ff; }
.bp-team-name.red { color: #ff7a7a; }
.bp-vs { align-self: center; color: var(--gold); font-weight: 800; font-size: 18px; }
.bp-bans { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.bp-ban-slot {
  width: 34px; height: 34px; border-radius: 8px; background: var(--panel-2);
  border: 1px dashed var(--border); overflow: hidden; position: relative;
}
.bp-ban-slot img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.55); }
.bp-ban-slot .x { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ff6a6a; font-weight: 800; font-size: 18px; }
.bp-picks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bp-pick-slot {
  background: var(--panel-2); border: 1px dashed var(--border); border-radius: 8px;
  min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.bp-pick-slot img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }
.bp-pick-slot .n { font-size: 11px; font-weight: 600; }
.bp-pick-slot .l { font-size: 9px; color: var(--muted); }
.bp-hint { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.bp-grid-card {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 3px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  transition: transform .1s;
}
.bp-grid-card:hover { transform: translateY(-2px); }
.bp-grid-card img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.bp-grid-card .n { font-size: 10px; font-weight: 600; }
.bp-grid-card .l { font-size: 9px; color: var(--muted); }
.bp-grid-card.banned { opacity: .28; pointer-events: none; }
.bp-grid-card.picked-blue { border-color: #6aa4ff; box-shadow: 0 0 8px rgba(106,164,255,.4); }
.bp-grid-card.picked-red { border-color: #ff7a7a; box-shadow: 0 0 8px rgba(255,122,122,.4); }
.bp-result { margin-top: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
