/* 主场白 + 深海军蓝墨色；绿色只给“进行中/胜”，玫红只给无畏契约和警示 */
:root {
  --paper: #ffffff;
  --surface: #f1f4f9;
  --ink: #15203b;
  --muted: #69718a;
  --line: #e2e6ee;
  --pitch: #1d7a4c;
  --rose: #e24a57;
  --gold: #b88a1b;
  --num: "Barlow Condensed", "DIN Condensed", "PingFang SC", system-ui, sans-serif;
  --body: -apple-system, "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1830; --surface: #172243; --ink: #eef1f7; --muted: #95a1bb;
    --line: #243154; --pitch: #3fb47a; --rose: #ff6b77; --gold: #e0b54a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); -webkit-text-size-adjust: 100%; touch-action: manipulation; }
.statusbar-cover { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--paper); z-index: 50; }
body { padding: env(safe-area-inset-top) 0 calc(84px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pitch); outline-offset: 2px; }

main { max-width: 640px; margin: 0 auto; padding: 0 18px; }

.top { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 0 10px; }
.top h1 { margin: 0; font: 700 30px/1.1 var(--body); letter-spacing: -0.01em; }
.top .date { color: var(--muted); font-size: 14px; }

h2 { font: 600 15px/1.3 var(--body); color: var(--muted); margin: 28px 0 8px; }

/* ---------- 比分牌：页面上唯一“大声”的元素 ---------- */
.hero { display: block; margin: 8px -18px 0; padding: 22px 18px 20px; background: var(--ink); color: var(--paper); }
.hero .comp { font-size: 13px; opacity: .7; }
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 14px 0 10px; }
.board .team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-weight: 600; font-size: 15px; line-height: 1.25; }
.board .team img { width: 44px; height: 44px; object-fit: contain; }
.board .team .crest { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); }
.score { font: 700 64px/1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.score .sep { opacity: .45; margin: 0 .12em; }
.kick { text-align: center; font: 700 44px/1 var(--num); }
.kick small { display: block; font: 500 13px/1.6 var(--body); opacity: .7; }
.hero .state { text-align: center; font-size: 14px; opacity: .85; }
.hero .state.live { color: #7fe0ae; opacity: 1; }
@media (prefers-color-scheme: dark) { .hero { background: #e9edf5; color: #15203b; } .hero .state.live { color: #1d7a4c; } .board .team .crest { background: rgba(0,0,0,.08); } }

/* ---------- 比赛行 ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .when { font: 600 17px/1.15 var(--num); }
.row .when small { display: block; font: 400 12px/1.4 var(--body); color: var(--muted); }
.row .teams div { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.5; }
.row .teams img { width: 18px; height: 18px; object-fit: contain; }
.row .teams .win { font-weight: 600; }
.row .comp { font-size: 12px; color: var(--muted); }
.row .sc { text-align: right; font: 600 19px/1.5 var(--num); font-variant-numeric: tabular-nums; }
.row.fav .teams div:not(.comp) { font-weight: 600; }
.tag-live { color: var(--pitch); font-weight: 600; }
.tag-warn { color: var(--rose); }

.seg { display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px; margin: 4px 0 8px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(21,32,59,.12); }

/* ---------- 新闻 ---------- */
.news { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
.news:last-child { border-bottom: 0; }
.news { display: grid; grid-template-columns: 28px 1fr; gap: 0 12px; }
.news .ico { width: 28px; height: 28px; margin-top: 2px; border-radius: 6px; object-fit: contain; }
.news .ico.blank { display: flex; align-items: center; justify-content: center; background: var(--surface); font-size: 15px; }
.news .body { min-width: 0; }
.news h3 { margin: 0; font: 600 16px/1.45 var(--body); }
.news p { margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.news .meta { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.news .meta .ent { color: var(--ink); }
.news.big { padding-left: 12px; border-left: 3px solid var(--gold); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 0 -18px; padding-left: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 13px; font-size: 14px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 比赛详情 ---------- */
.back { display: inline-block; padding: 16px 0 4px; color: var(--muted); font-size: 15px; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: grid; grid-template-columns: 1fr 52px 1fr; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.events .min { text-align: center; font: 600 16px/1.5 var(--num); color: var(--muted); }
.events .home { text-align: right; }
.events small { color: var(--muted); display: block; font-size: 12px; }
.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats th, .stats td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.stats th { color: var(--muted); font-weight: 500; }
.stats td:first-child, .stats th:first-child { text-align: left; }
.stats .rating { font: 700 17px/1 var(--num); }

/* ---------- 游戏 ---------- */
.patch-head { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; }
.patch-head .ver { font: 700 52px/1 var(--num); color: var(--rose); }
.patch-head .d { color: var(--muted); font-size: 14px; }
.summary { white-space: pre-line; font-size: 15px; line-height: 1.7; }
.changes { list-style: none; margin: 0; padding: 0; }
.changes li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.55; }
.ct { display: inline-block; min-width: 38px; font-size: 12px; font-weight: 600; margin-right: 6px; }
.ct.buff { color: var(--pitch); } .ct.nerf { color: var(--rose); } .ct.rework, .ct.new { color: var(--gold); } .ct.bugfix, .ct.other { color: var(--muted); }
.older a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.older .v { font: 600 18px/1.3 var(--num); }

/* ---------- 电竞 ---------- */
.event-banner { margin: 8px -18px 0; padding: 20px 18px; background: var(--ink); color: var(--paper); }
.event-banner .label { font-size: 13px; opacity: .7; }
.event-banner .name { font: 700 30px/1.15 var(--num); margin-top: 4px; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.event-banner .name img { width: 36px; height: 36px; object-fit: contain; }
.event-banner .sub { font-size: 14px; opacity: .85; margin-top: 6px; }
.event-banner .name em { font-style: normal; color: var(--rose); }
@media (prefers-color-scheme: dark) { .event-banner { background: #e9edf5; color: #15203b; } }
.row.esport .when { font-size: 16px; }
.row .stage { font-size: 12px; color: var(--muted); }
.patch-link { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.patch-link .v { font: 600 18px/1.3 var(--num); color: var(--rose); }

/* ---------- 设置 ---------- */
.field { margin: 12px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.inline { display: flex; gap: 12px; } .inline .field { flex: 1; }
.btn { display: block; width: 100%; margin-top: 10px; padding: 13px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 600; background: var(--ink); color: var(--paper); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn:disabled { opacity: .5; }
.note { font-size: 14px; color: var(--muted); line-height: 1.6; }
.msg { margin-top: 10px; font-size: 14px; white-space: pre-line; }
.job { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.job .err { color: var(--rose); }
.job { align-items: center; }
button.link { flex: none; border: 0; background: none; padding: 4px 0 4px 10px; font-size: 14px; font-weight: 600; color: var(--pitch); }

.empty { padding: 28px 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.empty a { color: var(--ink); text-decoration: underline; }

/* ---------- 底部导航 ---------- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: space-around; padding: 8px 4px calc(6px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line); }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); padding: 2px 0; }
nav.tabs svg { width: 30px; height: 30px; }
nav.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .hero .score, .hero .kick { animation: pop .35s ease-out; }
  @keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
}
