/* ============================================================
   OW守望小助手 Web 版 — 全站样式
   移动优先，≥1024px 桌面布局（侧边栏），暗色主题跟随系统/手动切换
   ============================================================ */

:root {
  --bg: #f4f5fa;
  --bg-card: #ffffff;
  --bg-soft: #eef0f6;
  --bg-hover: #e8ebf3;
  --text: #1c1f26;
  --text-2: #5b6270;
  --text-3: #9097a5;
  --line: #e4e7ee;
  --brand: #f97316;
  --brand-2: #facc15;
  --accent: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --radius: 14px;
  --topbar-h: 52px;
}
html[data-theme="dark"] {
  --bg: #0f0f1a;
  --bg-card: #17172a;
  --bg-soft: #1d1d33;
  --bg-hover: #232341;
  --text: #eceef4;
  --text-2: #a6adc0;
  --text-3: #6f7690;
  --line: #26263f;
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── 自定义滚动条 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--text-3) transparent; }

/* ── 布局骨架 ─────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 12px) 14px 24px;
}

/* ── 顶栏 ─────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 16px; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-card);
  color: var(--text); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-hover); }
.avatar-link { display: inline-flex; }
.avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--bg-soft); font-size: 17px; }

/* ── 侧边栏 ───────────────────────────────── */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 99;
  width: 220px; overflow-y: auto;
  background: var(--bg-card); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .25s ease;
  padding: 10px 8px calc(70px + env(safe-area-inset-bottom));
}
.sidebar.open { transform: translateX(0); }
.sidebar-mask { position: fixed; inset: 0; top: var(--topbar-h); z-index: 98; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sidebar-mask.show { opacity: 1; pointer-events: auto; }
.sidebar-nav { display: flex; flex-direction: column; }
.nav-group-title { font-size: 12px; color: var(--text-3); padding: 14px 10px 4px; letter-spacing: .05em; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-size: 14.5px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(250,115,22,.14), rgba(59,130,246,.10)); color: var(--text); font-weight: 600; }
.nav-emoji { width: 22px; text-align: center; }

/* ── 底部移动快捷导航 ─────────────────────── */
.bottom-nav {
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 7px 0 6px; font-size: 11px; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a.active { color: var(--brand); }
.bottom-nav .bn-icon { font-size: 19px; }

.app-footer {
  max-width: 1080px; margin: 0 auto; padding: 18px 14px calc(74px + env(safe-area-inset-bottom));
  color: var(--text-3); font-size: 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.footer-divider { height: 1px; background: var(--line); margin-bottom: 12px; align-self: stretch; }
.footer-ver { color: var(--text-3); margin-left: 6px; }
.footer-disclaimer { margin-top: 4px; }
.footer-qr { margin-top: 10px; display: inline-block; }
.footer-qr-label { font-size: 12px; color: var(--text-3); cursor: pointer; border-bottom: 1px dashed var(--text-3); }
.footer-beian { margin-top: 8px; font-size: 12px; }
.footer-beian a { color: var(--text-3); text-decoration: none; }
.footer-beian a:hover { color: var(--text-2); }
.footer-beian-sep { margin: 0 8px; opacity: 0.4; }
.gongan-icon { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }

/* ≥1024px：桌面侧边栏常驻 */
@media (min-width: 1024px) {
  .main-content { margin-left: max(220px, calc((100vw - 1080px) / 2)); max-width: 1080px; padding-left: 24px; padding-right: 24px; }
  .app-footer { width: 100%; margin-left: max(220px, calc((100vw - 1080px) / 2)); max-width: 1080px; padding-bottom: 28px; }
  #menuBtn { display: none; }
  .sidebar { transform: translateX(0); }
  .bottom-nav { display: none; }
}

/* ── 卡片 / 区块 ──────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.section-header { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; }
.section-accent { width: 4px; height: 18px; border-radius: 2px; background: var(--brand); }
.section-title { font-size: 17px; font-weight: 700; }
.section-count { color: var(--text-3); font-size: 12px; margin-left: auto; }

.page-head { margin: 4px 0 14px; }
.page-head h1 { font-size: 21px; font-weight: 800; }
.page-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* ── 按钮 ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--text); font-size: 14px;
  transition: filter .15s, background .15s;
}
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #facc15, #f97316); border: none; color: #1c1400; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #facc15, #f97316); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: var(--err); filter: brightness(1.08); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--text-2);
  font-size: 13px; white-space: nowrap; cursor: pointer;
}
.chip.active { background: linear-gradient(135deg, #facc15, #f97316); border-color: transparent; color: #1c1400; font-weight: 600; }
.chip-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.chip-bar::-webkit-scrollbar { display: none; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }

/* ── 表单 ─────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field input[type="url"], .field input:not([type]), .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-size: 14.5px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid rgba(249,115,22,.4); border-color: transparent; }

.search-box { display: flex; gap: 8px; margin-bottom: 12px; }
.search-box input { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-card); color: var(--text); }

/* ── 提示 / 状态 ──────────────────────────── */
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.alert-ok { background: rgba(34,197,94,.12); color: var(--ok); }
.alert-err { background: rgba(239,68,68,.12); color: var(--err); }
.alert-warn { background: rgba(245,158,11,.14); color: var(--warn); }

.empty-state, .state-wrap { text-align: center; color: var(--text-3); padding: 40px 10px; font-size: 14px; }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty-state .btn { margin-top: 14px; }

.loading-spinner {
  width: 28px; height: 28px; margin: 0 auto 10px;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }

.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-hover) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; }

/* ── Toast ────────────────────────────────── */
#toastRoot { position: fixed; top: calc(var(--topbar-h) + 12px); left: 0; right: 0; z-index: 4000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(30,30,46,.92); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; max-width: 86vw; box-shadow: var(--shadow);
  animation: toastIn .25s ease; word-break: break-all;
}
.toast.toast-err { background: rgba(190,38,38,.95); }
.toast.toast-ok { background: rgba(21,128,61,.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── Modal ────────────────────────────────── */
.modal-mask {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(10, 10, 20, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .18s ease;
}
.modal-box {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px;
  width: 100%; max-width: 420px; max-height: 82vh; overflow-y: auto;
  padding: 20px; animation: popIn .2s ease;
}
.modal-box.modal-lg { max-width: 620px; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; padding-right: 30px; }
.modal-close {
  position: absolute; right: 14px; top: 12px; width: 30px; height: 30px; border-radius: 8px;
  border: none; background: var(--bg-soft); color: var(--text-2); font-size: 15px;
}
.modal-box { position: relative; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }

.action-sheet-list { display: flex; flex-direction: column; gap: 8px; }
.action-sheet-list button {
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text); font-size: 14.5px;
}
.action-sheet-list button:hover { background: var(--bg-hover); }

/* ── 首页 ─────────────────────────────────── */
.hero-banner {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 26px 20px; margin-bottom: 14px;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f0f1a 55%, #312e81 100%);
  color: #fff;
}
.hero-orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5; }
.hero-orb-1 { width: 180px; height: 180px; background: #f97316; top: -60px; right: -30px; }
.hero-orb-2 { width: 150px; height: 150px; background: #3b82f6; bottom: -60px; left: 10%; }
.hero-orb-3 { width: 120px; height: 120px; background: #facc15; top: 20%; left: 45%; opacity: .25; }
.hero-inner { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-logo-lg { width: 58px; height: 58px; object-fit: contain; }
.hero-titles h1 { font-size: 22px; }
.hero-sub-row { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); font-size: 13px; margin-top: 2px; }
.hero-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.14); padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.hero-actions { margin-left: auto; display: flex; gap: 8px; }
.hero-actions button {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10); color: #fff; font-size: 18px;
}
.hero-actions button:hover { background: rgba(255,255,255,.2); }

.season-banner, .comp-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 10px; font-size: 13.5px; cursor: pointer;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 6px rgba(34,197,94,.8); }
.banner-name { font-weight: 600; }
.banner-date { color: var(--text-3); font-size: 12.5px; }
.banner-tag { margin-left: auto; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(34,197,94,.14); color: var(--ok); font-weight: 600; }
.banner-tag.upcoming { background: rgba(59,130,246,.14); color: var(--accent); }
.banner-tag.ended { background: var(--bg-soft); color: var(--text-3); }

.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rec-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 4px 0; }
.rec-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 25px; box-shadow: var(--shadow); }
.rec-name { font-size: 12px; color: var(--text-2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }

.tool-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: var(--shadow);
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,0,0,.12); }
.tool-card-inner { display: flex; align-items: center; gap: 12px; }
.tool-icon-box { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.tool-text { flex: 1; min-width: 0; }
.tool-name-row { display: flex; align-items: center; gap: 6px; }
.tool-name { font-weight: 700; font-size: 14.5px; }
.tool-badge { font-size: 10px; color: #fff; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.tool-desc { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-arrow { color: var(--text-3); }

/* ── 比赛卡片 ─────────────────────────────── */
.match-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.match-card.live { border-color: rgba(239,68,68,.55); }
.match-card.stale { opacity: .75; }
.match-card.waiting { border-style: dashed; }
.match-row { display: flex; align-items: center; gap: 10px; }
.match-team { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.match-team.right { justify-content: flex-end; }
.team-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: var(--bg-soft); flex-shrink: 0; }
.team-logo-ph { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-soft); flex-shrink: 0; display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--text-3);}
.team-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-center { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 74px; }
.score { font-size: 19px; font-weight: 800; }
.score-win { color: var(--ok); }
.score-lose { color: var(--text-3); }
.vs-label { color: var(--text-3); font-size: 13px; font-weight: 600; }
.score-row { display: inline-flex; align-items: center; gap: 3px; }
.live-label { color: var(--err); font-weight: 800; font-size: 13px; animation: pulse 1.2s infinite; }
.waiting-label { color: var(--warn); font-weight: 700; font-size: 12px; }
@keyframes pulse { 50% { opacity: .45; } }
.match-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.region-tag { background: var(--bg-soft); border-radius: 6px; padding: 1px 7px; font-weight: 700; font-size: 11px; color: var(--text-2); }
.countdown-tag { border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: 11px; background: rgba(59,130,246,.13); color: var(--accent); }
.countdown-minutes { background: rgba(239,68,68,.13); color: var(--err); }
.countdown-days { background: rgba(148,163,184,.16); color: var(--text-2); }
.sub-btn { border: 1px solid var(--line); background: var(--bg-soft); color: var(--text-2); border-radius: 999px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; }
.sub-btn.subscribed { background: rgba(34,197,94,.14); color: var(--ok); border-color: transparent; }
.replay-chip { background: rgba(168,85,247,.14); color: #a855f7; border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: 11px; }

.group-head { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12.5px; margin: 18px 0 8px; }
.group-line { flex: 1; height: 1px; background: var(--line); }

/* 排名表 */
.rank-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rank-table th, .rank-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.rank-table th { color: var(--text-3); font-weight: 600; font-size: 12px; }
.rank-table td:first-child, .rank-table th:first-child { width: 40px; }
.rank-team-cell { display: flex; align-items: center; gap: 8px; text-align: left; }
.rank-team-cell img { width: 22px; height: 22px; object-fit: contain; }

/* 数据条形 */
.bar-track { background: var(--bg-soft); border-radius: 999px; height: 6px; overflow: hidden; min-width: 56px; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.delta-up { color: var(--ok); font-size: 11px; }
.delta-down { color: var(--err); font-size: 11px; }
.delta-flat { color: var(--text-3); font-size: 11px; }

/* 英雄榜表格 */
.lb-table-wrap { overflow-x: auto; }
.lb-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.lb-table th { color: var(--text-3); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
.lb-table th.sorted { color: var(--brand); }
.lb-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lb-hero { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.lb-hero img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.lb-num { font-weight: 600; white-space: nowrap; }

/* ── Tier List（拖拽）─────────────────────── */
.tier-board { display: flex; flex-direction: column; gap: 10px; }
.tier-row {
  display: flex; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-card); min-height: 86px;
  transition: outline .1s;
}
.tier-row.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.tier-label-col {
  width: 84px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #1c1400; font-weight: 800; padding: 8px 4px; cursor: default;
}
.tier-label-actions { display: flex; gap: 4px; }
.tier-label-actions button { border: none; background: rgba(0,0,0,.18); color: inherit; border-radius: 6px; width: 22px; height: 20px; font-size: 11px; }
.tier-cards { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; align-content: flex-start; }
.tier-insert-marker { width: 3px; background: var(--brand); border-radius: 2px; align-self: stretch; }
.tier-item {
  width: 62px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: grab;
  touch-action: none; user-select: none; position: relative;
}
.tier-item img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg-soft); pointer-events: none; }
.tier-item span { font-size: 10.5px; color: var(--text-2); max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.tier-item.selected { outline: 2px solid var(--brand); border-radius: 12px; }
.drag-ghost { position: fixed; z-index: 5000; pointer-events: none; opacity: .9; transform: translate(-50%, -50%); }
.drag-ghost img { width: 64px; height: 64px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.pool-section { margin-top: 14px; }
.pool-cards { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.pool-note { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.tier-note-text { font-size: 11px; color: var(--text-3); padding: 0 10px 6px; }

/* ── 新闻 / 文案列表 ──────────────────────── */
.post-card { display: flex; gap: 12px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow); }
.post-thumb { width: 108px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--bg-soft); flex-shrink: 0; }
.post-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-title { font-weight: 700; font-size: 14.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-excerpt { font-size: 12.5px; color: var(--text-3); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { margin-top: auto; padding-top: 4px; font-size: 11.5px; color: var(--text-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-chip { background: var(--bg-soft); padding: 1px 8px; border-radius: 999px; }

.article-body { font-size: 15.5px; line-height: 1.85; word-break: break-word; }
.article-body img { border-radius: 12px; margin: 10px auto; display: block; cursor: zoom-in; }
.article-body p { margin: 10px 0; }
.article-body h1, .article-body h2, .article-body h3 { margin: 18px 0 8px; }
.article-body blockquote { border-left: 3px solid var(--brand); padding-left: 12px; color: var(--text-2); margin: 12px 0; }
.article-body table { width: 100%; border-collapse: collapse; }
.article-body td, .article-body th { border: 1px solid var(--line); padding: 6px 8px; }
.article-body pre { background: var(--bg-soft); padding: 12px; border-radius: 10px; overflow-x: auto; }

#lightbox { position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }

/* ── 图表（Steam）────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-cell { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat-cell .num { font-size: 21px; font-weight: 800; }
.stat-cell .lbl { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.chart-canvas-wrap { width: 100%; height: 280px; position: relative; }
.chart-canvas-wrap canvas { width: 100%; height: 100%; display: block; }

/* ── 直播 ─────────────────────────────────── */
.streamer-card { display: flex; gap: 10px; align-items: center; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.streamer-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg-soft); }
.streamer-avatar-ph { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;}
.streamer-info { flex: 1; min-width: 0; }
.streamer-name { font-weight: 700; font-size: 14px; }
.streamer-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.status-live { color: #fff; background: var(--err); }
.status-offline { background: var(--bg-soft); color: var(--text-3); }
.status-rotate { color: #fff; background: var(--warn); }
.group-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 2px; font-weight: 700; }

/* ── 选手百科 ─────────────────────────────── */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kv-cell { background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; }
.kv-k { font-size: 11.5px; color: var(--text-3); }
.kv-v { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-all; }
.hot-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-card); cursor: pointer; font-size: 13px; }
.hot-chip .team { font-size: 11px; color: var(--text-3); }
.cand-list button { width: 100%; text-align: left; margin-bottom: 6px; }

/* 滑块验证码 */
.slider-captcha { background: var(--bg-soft); border-radius: 12px; padding: 16px; text-align: center; }
.sc-track { position: relative; height: 40px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.sc-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(250,204,21,.35), rgba(249,115,22,.35)); }
.sc-tip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; user-select: none; }
.sc-handle { position: absolute; top: 3px; left: 3px; width: 54px; height: 32px; border-radius: 999px; background: linear-gradient(135deg, #facc15, #f97316); color: #1c1400; display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: grab; touch-action: none; z-index: 2; }
.sc-handle.ok { background: linear-gradient(135deg, #4ade80, #22c55e); }

/* ── 活动（卡片交换）──────────────────────── */
.act-post { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.act-post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.type-give { background: rgba(34,197,94,.14); color: var(--ok); }
.type-exchange { background: rgba(59,130,246,.14); color: var(--accent); }
.type-request { background: rgba(245,158,11,.16); color: var(--warn); }
.fulfilled-tag { background: var(--bg-soft); color: var(--text-3); }
.post-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.pcard-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border-radius: 10px; padding: 4px 10px 4px 4px; font-size: 12.5px; cursor: pointer; border: 1px solid var(--line); }
.pcard-chip img, .pcard-img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.pcard-emoji { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-hover); display:inline-flex;align-items:center;justify-content:center;font-size:15px; }
.post-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.post-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.card-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px; }
.card-pick-item { border: 2px solid var(--line); border-radius: 12px; padding: 6px; text-align: center; cursor: pointer; background: var(--bg-card); }
.card-pick-item.selected { border-color: var(--brand); background: rgba(249,115,22,.08); }
.card-pick-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.card-pick-item .nm { font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item { display: flex; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-card); margin-bottom: 8px; cursor: pointer; }
.notif-item.unread { border-left: 3px solid var(--brand); }

/* 视图切换 tab 条 */
.view-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tab { flex-shrink: 0; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-card); color: var(--text-2); font-size: 13.5px; cursor: pointer; }
.view-tab.active { background: linear-gradient(135deg, #facc15, #f97316); border-color: transparent; color: #1c1400; font-weight: 700; }

/* ── EDPI ─────────────────────────────────── */
.edpi-result { text-align: center; padding: 18px 0 8px; }
.edpi-value { font-size: 46px; font-weight: 900; background: linear-gradient(135deg, #facc15, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.edpi-bar { height: 12px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin: 14px 0 6px; position: relative; }
.edpi-bar-fill { height: 100%; border-radius: 999px; transition: width .3s ease; background: linear-gradient(90deg, #22c55e, #eab308, #f97316, #ef4444); }
.pros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
.pro-card { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 10px; padding: 8px; text-align: center; cursor: pointer; font-size: 12px; }
.pro-card b { display: block; font-size: 13.5px; }

input[type="range"].slider { width: 100%; accent-color: var(--brand); }

/* ── 尺子 ─────────────────────────────────── */
.ruler-stage { position: relative; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 480px; touch-action: none; }
.ruler-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }

/* ── 设置 / 个人中心 ──────────────────────── */
.setting-row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-main { flex: 1; }
.setting-title { font-size: 14.5px; font-weight: 600; }
.setting-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.profile-hero { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.profile-avatar { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--bg-soft); display:flex;align-items:center;justify-content:center;font-size:30px;}

/* 认证页 */
.auth-wrap { max-width: 400px; margin: 4vh auto 0; }
.auth-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px; box-shadow: var(--shadow); }
.auth-title { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 18px; }
.auth-alt { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--text-2); }

/* 赛程筛选行 */
.filter-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.filter-label { font-size: 12.5px; color: var(--text-3); flex-shrink: 0; width: 34px; }

/* 详情弹窗内代码行 */
.code-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-soft); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.code-row .g { font-size: 12px; color: var(--text-3); width: 30px; }
.code-row .c { font-weight: 700; letter-spacing: .08em; flex: 1; }

@media (max-width: 380px) {
  .tier-label-col { width: 64px; font-size: 14px; }
  .post-thumb { width: 86px; height: 64px; }
}

@media print { .topbar, .sidebar, .bottom-nav { display: none !important; } }

/* ── 小游戏（大厅 + 梗测试）───────────────── */
.gp-hero { text-align: center; padding: 26px 16px; }
.gp-hero-icon { font-size: 44px; line-height: 1; }
.gp-hero-title { font-size: 19px; font-weight: 800; margin-top: 10px; }
.gp-hero-desc { font-size: 13px; color: var(--text-2); margin: 8px auto 0; max-width: 420px; }
.gp-diff-bar { justify-content: center; margin: 14px 0 2px; flex-wrap: wrap; }
.gp-stats { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.gp-start { margin: 14px auto 0; max-width: 320px; width: 100%; }
.gp-rule { font-size: 13px; color: var(--text-2); padding: 4px 0; }
.gp-round-bar { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; flex-wrap: wrap; }
.gp-round-pool { font-size: 12px; color: var(--text-3); }
.gp-article { font-size: 15px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.gp-guess-title { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }
.gp-guess-row { display: flex; gap: 8px; }
.gp-guess-input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-size: 14px; }
.gp-id-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gp-id-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 13px; font-weight: 600; cursor: pointer; }
.gp-id-tag:hover { border-color: var(--err); color: var(--err); }
.gp-hint { margin-top: 10px; font-size: 12.5px; color: var(--warn); }
.gp-guess-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gp-guess-tip { font-size: 12px; color: var(--text-3); }
.gp-result-ok { border-color: rgba(34, 197, 94, .45); }
.gp-result-bad { border-color: rgba(239, 68, 68, .4); }
.gp-result-icon { font-size: 40px; }
.gp-result-title { font-size: 19px; font-weight: 800; margin-top: 6px; }
.gp-result-title-ok { color: var(--ok); }
.gp-result-title-bad { color: var(--err); }
.gp-result-line { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.gp-result-num { color: var(--text); font-weight: 700; }
.gp-words-title { font-size: 13px; font-weight: 700; margin: 14px 0 6px; color: var(--text-2); text-align: left; }
.gp-words { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gp-word-chip { padding: 2px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 12.5px; }
.gp-word-chip-bad { border-color: rgba(239, 68, 68, .5); color: var(--err); }
.gp-word-none { font-size: 12.5px; color: var(--text-3); }
.gp-result-stats { margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.gp-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.gp-result-actions .btn { min-width: 120px; }

@media (max-width: 420px) {
  .gp-guess-row { flex-direction: column; }
}
