/* KL8 V6 研选通用基线。基础变量仅在此定义。 */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --card: #fff;
  --text: #202b35;
  --muted: #727c88;
  --line: #e7eaf0;
  /* 分隔线：卡片之间要看得见的界限，白卡在浅灰底上才不会连成一片 */
  --line-strong: #ccd4de;
  /* 卡片投影：让卡片从背景里立起来，而不是浮着 */
  --shadow-card: 0 2px 8px #263b5018;
  --accent: #c43c35;
  --accent-light: #fff0ed;
  --green: #287666;
  --green-light: #edf6f2;
  --blue: #507bac;
  --shadow: 0 5px 22px #263b5010;
  --shadow-bar: inset 3px 0 0 var(--accent);
  --shadow-bar-thin: inset 0 0 0 1px var(--accent);
  --shadow-none: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.65; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p + p, details p, details h3 { margin-top: 8px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select { max-width: 100%; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
input { min-width: 0; }
.muted, .tiny { color: var(--muted); font-size: 12px; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }
.skip-link { position: fixed; top: -80px; left: 14px; z-index: 40; padding: 8px; background: var(--card); }
.skip-link:focus { top: 8px; }
.topbar { height: 48px; position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--line); z-index: 10; }
.top-inner { max-width: 1100px; height: 100%; margin: auto; padding: 0 14px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--card); font-weight: 700; }
.brand-name { font-size: 15px; font-weight: 700; }
.brand small { display: block; font-size: 9px; color: var(--muted); line-height: 1.2; }
.tabs { display: flex; gap: 4px; margin: auto; }
.tabs button { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.tabs button.active { color: var(--accent); background: var(--accent-light); }
.header-member, .subtle { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 12px; }
.container { max-width: 1100px; margin: auto; padding: 14px; }
.page-head, .section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-label { display: flex; align-items: center; gap: 6px; }
.section-icon, .eyebrow { color: var(--accent); }
.page-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.eyebrow { font-size: 10px; }
.card { padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.pill, .tags > span { display: inline-flex; padding: 2px 6px; border-radius: 6px; background: var(--green-light); color: var(--green); font-size: 11px; }
.pill.neutral, .pill.replay, .tags > span { background: var(--bg); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.primary, .secondary { min-height: 32px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; font-weight: 600; }
.primary { background: var(--accent); color: var(--card); border-color: var(--accent); }
.secondary { background: var(--bg); color: var(--text); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); }
.actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 10px; }
.actions label { max-width: 100%; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.segmented button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted); }
.segmented button.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.info-note { padding-left: 8px; border-left: 2px solid var(--line); margin-top: 10px; color: var(--muted); font-size: 12px; }
.table-scroll { max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 6px; border-bottom: 1px solid var(--line); }
/* 紧凑:第二列(对阵)允许换行并限制宽度,免得队名长的表格撑出可视区 */
.data-table th:nth-child(2), .data-table td:nth-child(2) { max-width: 120px; word-break: keep-all; overflow-wrap: anywhere; white-space: normal; line-height: 1.25; font-size: 11px; }
.data-table th:nth-child(2) .teams { font-size: 12px; }
th { color: var(--muted); background: var(--bg); font-weight: 500; }
th:first-child, td:first-child { text-align: left; }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); margin-top: 10px; font-size: 11px; }
.empty { padding: 14px; text-align: center; color: var(--muted); }
summary { cursor: pointer; padding: 4px 0; font-weight: 600; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px; border-radius: 6px; background: var(--bg); max-height: 200px; overflow: auto; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 14px; color: var(--muted); font-size: 11px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 8px; background: var(--text); color: var(--card); max-width: 90vw; z-index: 40; box-shadow: var(--shadow); }

@media (max-width: 700px) {
  .top-inner { gap: 8px; }
  .header-member > span { display: none; }
  .tabs { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); z-index: 20; }
  .tabs button { flex-direction: column; gap: 4px; padding: 7px 4px; font-size: 10px; border-radius: 8px; }
  .container { padding: 14px 10px calc(95px + env(safe-area-inset-bottom)); }
  .actions input { width: 100%; }
  #toast { bottom: calc(85px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
