/* ============================================================
   84452cup 设计语言 —— 「赛场转播 MATCHDAY」
   暗色 = 夜场转播（泛光灯 + 草皮夜色）
   亮色 = 日场转播（白昼球场 + 草皮条纹）
   所有既有变量名保持兼容：--lime/--paper/--muted/--line 等
   ============================================================ */

:root {
  color-scheme: dark;

  /* —— 夜场转播：赛场夜空底色 —— */
  --ink: #05090f;
  --ink-2: #0a1220;
  --panel: #0d1a2b;
  --panel-2: #102236;
  --panel-3: #14304a;

  /* —— 品牌色：韭菜绿（仅此一档高亮，绿色即品牌） —— */
  --lime: #b7f34a;
  --lime-strong: #d4ff81;
  --lime-deep: #8fc82e;
  --lime-ink: #0c1a04;          /* 亮绿之上的文字色 */
  --lime-wash: rgba(183, 243, 74, .1);
  --lime-line: rgba(183, 243, 74, .42);

  /* —— 阵容能力值徽标：在草皮和头像卡面上保持独立高对比 —— */
  --lineup-rating-bg: var(--lime);
  --lineup-rating-ink: var(--lime-ink);
  --lineup-rating-border: #efffd2;
  --lineup-rating-shadow: 0 0 0 1px rgba(4, 13, 19, .72), 0 4px 10px rgba(0, 0, 0, .42);

  /* —— 语义色 —— */
  --mint: #5de0a2;
  --blue: #57a8ff;
  --coral: #ff6658;
  --gold: #f2b94b;
  --paper: #edf3f5;
  --muted: #8294a8;

  /* —— 表面与线条 —— */
  --line: rgba(186, 216, 235, .14);
  --line-strong: rgba(186, 216, 235, .26);
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .22);

  /* —— 文字层级 —— */
  --text-1: #f2f7f9;            /* 主文字 */
  --text-2: #b7c7d4;            /* 次级文字 */
  --text-3: #8294a8;            /* 辅助文字 */

  /* —— 表面层级 —— */
  --surface-0: #070d17;         /* 页面底 */
  --surface-1: #0c1828;         /* 卡片 */
  --surface-2: #11233a;         /* 浮层/弹窗 */
  --surface-input: #081221;     /* 输入框 */
  --surface-hover: rgba(183, 243, 74, .07);
  --surface-success: color-mix(in srgb, var(--mint) 10%, var(--surface-1));
  --surface-danger: color-mix(in srgb, var(--coral) 10%, var(--surface-1));
  --surface-sealed: color-mix(in srgb, var(--blue) 10%, var(--surface-1));
  --header-bg: rgba(6, 13, 23, .88);
  --header-line: rgba(186, 216, 235, .13);
  --scrim: rgba(3, 8, 15, .68);
  --backdrop-tint: rgba(7, 19, 30, .72);

  /* —— 面板渐变与内嵌面（v3 token 化新增） —— */
  --panel-grad-1: rgba(13, 32, 50, .96);   /* 深面板渐变起点 / 不透明深面板 */
  --surface-inset: rgba(4, 14, 23, .55);   /* 卡片内嵌的半透明深色面 */

  /* —— 玻璃与光效（2026-08 premium layer） —— */
  --glass-bg: rgba(12, 27, 43, .55);       /* 玻璃浮层底色 */
  --glass-bg-strong: rgba(9, 21, 35, .74); /* 玻璃浮层强底色（抽屉/菜单） */
  --glass-border: rgba(186, 216, 235, .18);
  --glass-blur: 20px;
  --glass-highlight: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 38%);
  --glow-lime: rgba(183, 243, 74, .16);

  /* —— 主题画布 —— */
  --bg-body:
    radial-gradient(120% 62% at 50% -12%, #1c3c60 0%, rgba(29, 60, 96, .35) 32%, rgba(10, 18, 32, 0) 62%),
    radial-gradient(90% 46% at 88% -6%, rgba(183, 243, 74, .05) 0%, rgba(183, 243, 74, 0) 46%),
    linear-gradient(180deg, #0a1424 0%, #081020 46%, #060b14 100%);
  --grid-line: rgba(255, 255, 255, .02);

  /* —— 运动曲线 —— */
  --ease-out: cubic-bezier(.22, .9, .28, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .44, 1);

  /* —— 圆角与签名斜切 —— */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --cut-angle: 9px;             /* 球衣剪裁斜切角 */

  /* —— 兼容别名（历史引用） —— */
  --accent: var(--lime);
  --green: var(--mint);
  --red: var(--coral);
  --amber: var(--gold);
  --bg: var(--ink-2);
  --card: var(--panel);
  --border: var(--line);
  --text: var(--paper);

  scrollbar-color: #2a4258 transparent;
}

/* —— 日场 3.0：Apple 风格浅色主题 ——
   中性浅灰画布（#f5f5f7）+ 纯白面板 + 苹果系灰阶文字 + 品牌青柠绿 accent。
   借鉴 macOS/iOS 的气质：大留白、细发丝线、柔和弥散阴影、毛玻璃导航；
   比赛元素（草皮、计分、泛光）保留品牌绿。 */
html[data-theme="light"] {
  color-scheme: light;

  --ink: #f5f5f7;
  --ink-2: #ececee;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --panel-3: #f0f0f3;

  --lime: #0b7927;              /* 日间文字与白底主操作保持可读对比 */
  --lime-strong: #0b7024;
  --lime-deep: #09571d;
  --lime-ink: #ffffff;
  --lime-wash: rgba(14, 138, 44, .09);
  --lime-line: rgba(14, 138, 44, .32);

  --lineup-rating-bg: var(--lime-strong);
  --lineup-rating-ink: var(--lime-ink);
  --lineup-rating-border: #ffffff;
  --lineup-rating-shadow: 0 0 0 1px rgba(9, 87, 29, .48), 0 4px 10px rgba(0, 0, 0, .22);

  --mint: #0b713f;
  --blue: #095bb8;
  --coral: #d8453a;
  --gold: #8b560c;
  --paper: #1d1d1f;             /* 主文字：Apple 近黑 */
  --muted: #5d6772;

  --line: rgba(0, 0, 0, .09);
  --line-strong: rgba(0, 0, 0, .17);
  --shadow: 0 16px 40px rgba(0, 0, 0, .08);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, .05);

  --text-1: #1d1d1f;
  --text-2: #48484d;
  --text-3: #5d6772;

  --surface-0: #f5f5f7;
  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --surface-input: #f5f5f7;
  --surface-hover: rgba(0, 0, 0, .045);
  --header-bg: rgba(251, 251, 253, .78);
  --header-line: rgba(0, 0, 0, .08);
  --scrim: rgba(0, 0, 0, .38);
  --backdrop-tint: rgba(255, 255, 255, .8);

  /* —— 面板渐变与内嵌面（浅色：白面板 + 浅灰内嵌） —— */
  --panel-grad-1: #ffffff;
  --surface-inset: rgba(0, 0, 0, .04);

  /* —— 玻璃与光效（浅色：白玻璃） —— */
  --glass-bg: rgba(255, 255, 255, .66);
  --glass-bg-strong: rgba(255, 255, 255, .86);
  --glass-border: rgba(0, 0, 0, .09);
  --glass-blur: 20px;
  --glass-highlight: linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 45%);
  --glow-lime: rgba(14, 138, 44, .12);

  --bg-body: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  --grid-line: rgba(0, 0, 0, .035);

  scrollbar-color: #c7c7cd transparent;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--surface-0); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-size: 16px;
  color: var(--paper);
  background: var(--bg-body);
  background-attachment: fixed;
  font-family: Bahnschrift, "Microsoft YaHei UI", "PingFang SC", Arial, sans-serif;
  transition: background-color .35s ease, color .35s ease;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border: 2px solid var(--lime);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-1);
  font-weight: 800;
  transform: translateY(calc(-100% - 16px));
  transition: transform .16s var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
}
/* 草皮条纹：极细的水平修剪纹，呼应球场草坪 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 88%);
}

a { color: var(--lime); text-decoration: none; }
a:hover { color: var(--lime-strong); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* ============ 顶栏：转播台 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--header-line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background-color .3s ease, border-color .3s ease;
}
.topbar {
  min-height: 80px;
  padding: 0 clamp(16px, 2.4vw, 42px);
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-1);
  min-width: max-content;
}
.brand:hover { color: var(--text-1); }
.brand-mark {
  width: 50px;
  height: 50px;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .28));
}
html[data-theme="light"] .brand-mark { filter: drop-shadow(0 3px 8px rgba(31, 48, 36, .18)); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy strong { display: block; color: var(--text-1); font-size: 20px; letter-spacing: .06em; }
.brand-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
}
.main-nav { display: flex; align-self: stretch; align-items: stretch; gap: 4px; }
.mobile-nav-toggle {
  position: relative;
  z-index: 51;
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.mobile-nav-bar { display: block; width: 22px; height: 2px; background: var(--text-1); border-radius: 2px; transition: transform .22s var(--ease-out), opacity .18s ease; }
.mobile-nav-toggle.is-open .mobile-nav-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.is-open .mobile-nav-bar:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.is-open .mobile-nav-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav-backdrop { position: fixed; inset: 0; z-index: 48; background: var(--scrim); backdrop-filter: blur(3px); }
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(300px, 82vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 80px 16px 24px;
  background: linear-gradient(180deg, var(--panel-2), var(--surface-0));
  border-left: 1px solid var(--line-strong);
  box-shadow: -16px 0 50px rgba(0, 0, 0, .4);
  transform: translateX(100%);
  transition: transform .24s var(--ease-out);
  overflow-y: auto;
}
.mobile-nav-drawer.is-open { transform: translateX(0); }
.mobile-nav-drawer a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 18px;
  font-weight: 700;
  border-left: 3px solid transparent;
}
.mobile-nav-drawer a:hover { background: var(--surface-hover); color: var(--text-1); }
.mobile-nav-drawer a.active { border-left-color: var(--lime); background: var(--lime-wash); color: var(--lime); }
.mobile-nav-logout {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mobile-nav-logout button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(217, 56, 44, .38);
  border-radius: var(--radius-sm);
  background: rgba(217, 56, 44, .08);
  color: var(--coral);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.mobile-nav-logout button:hover {
  border-color: rgba(217, 56, 44, .68);
  background: rgba(217, 56, 44, .14);
}
.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--muted);
  font-size: 18px;
  white-space: nowrap;
  transition: color .16s ease;
}
/* 转播下划线：当前赛段高亮 */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease-out);
}
.main-nav a:hover,
.main-nav a.active { color: var(--text-1); }
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }
.database-nav {
  position: relative;
  display: flex;
  align-items: stretch;
}
.database-nav > a {
  padding-right: 4px;
}
.database-nav > button {
  width: 28px;
  padding: 0 8px 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.database-nav:hover > a,
.database-nav:focus-within > a,
.database-nav.active > a,
.database-nav:hover > button,
.database-nav:focus-within > button,
.database-nav.active > button {
  color: var(--text-1);
}
.database-nav.active > a::after { transform: scaleX(1); }
.database-nav-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 70;
  display: none;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--lime);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--backdrop-tint);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.database-nav:hover .database-nav-menu,
.database-nav:focus-within .database-nav-menu,
.database-nav.is-open .database-nav-menu {
  display: grid;
}
.database-nav-menu a {
  display: grid;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.database-nav-menu a::after { display: none; }
.database-nav-menu a:hover,
.database-nav-menu a.active {
  background: var(--lime-wash);
  color: var(--lime);
}
.database-nav-menu small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.mobile-nav-group-label {
  padding: 14px 18px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}
.room-badge {
  min-height: 40px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 112, 55, .38);
  border-radius: 5px;
  background: linear-gradient(110deg, rgba(255, 103, 48, .16), rgba(255, 103, 48, .035));
}
.room-badge i {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff6b35;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(255, 107, 53, .28);
}
.room-badge b,
.room-badge small { display: block; line-height: 1.1; }
.room-badge b { color: var(--text-1); font-size: 12px; letter-spacing: .06em; }
.room-badge small { margin-top: 3px; color: #ffb08f; font-size: 11px; letter-spacing: .08em; }
html[data-theme="light"] .room-badge b { color: #7c2d0c; }
html[data-theme="light"] .room-badge small { color: #a04a16; }
.account-cluster { display: flex; align-items: center; gap: 11px; color: var(--text-2); font-size: 15px; }
.account-display-name { display: block; flex: 0 0 auto; max-width: clamp(180px, 18vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar {
  position: relative;
  overflow: hidden;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 900;
  text-decoration: none;
  transition: transform .16s var(--ease-out), box-shadow .16s ease, filter .16s ease;
}
.account-avatar > span { position: relative; z-index: 0; }
.account-avatar > img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-avatar.has-image { background: var(--panel-3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
html[data-theme="light"] .account-avatar.has-image { box-shadow: inset 0 0 0 1px rgba(27, 39, 30, .18); }
.account-avatar:hover,
.account-avatar:focus-visible {
  color: var(--lime-ink);
  filter: brightness(1.06);
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--lime-wash);
}
.account-cluster form { display: inline; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--lime);
  cursor: pointer;
  font-size: 15px;
}
.status-rail {
  min-height: 34px;
  padding: 0 clamp(16px, 2.4vw, 42px);
  display: flex;
  align-items: center;
  gap: 22px;
  border-top: 1px solid var(--line);
  background: var(--backdrop-tint);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.status-rail strong { color: var(--text-1); }
.status-rail b { color: var(--lime); font-weight: 700; margin-right: auto; }
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(217, 56, 44, .14);
  animation: pulse 1.8s infinite;
}

.site-main {
  width: min(1880px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 3.2vw, 48px) clamp(14px, 3.2vw, 48px) 72px;
}
.panel,
.card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--panel-2), var(--surface-1) 70%);
  box-shadow: var(--shadow);
}
html[data-theme="light"] .panel,
html[data-theme="light"] .card {
  background: var(--surface-1);
}
.card { padding: 24px; margin-bottom: 18px; }
.panel-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
/* 转播条 kicker：绿色竖条 + 大间距字母 */
.eyebrow {
  display: block;
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.page-heading h1 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 4vw, 58px);
  letter-spacing: -.035em;
  color: var(--text-1);
}
.page-heading p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.75; }
.muted { color: var(--muted); }
.numeric { font-variant-numeric: tabular-nums; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0;
}
.metric {
  min-height: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--backdrop-tint);
}
.metric span { color: var(--text-3); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { display: block; margin: 8px 0 3px; font-size: 28px; color: var(--text-1); }
.metric small { color: var(--text-3); font-size: 13px; }
.metric.live strong { color: var(--lime); }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
}
.pill.open { color: var(--mint); border-color: rgba(15, 138, 86, .5); background: rgba(15, 138, 86, .08); }
html[data-theme="light"] .pill.open { color: #0c6e43; }
.pill.sold { color: var(--lime); border-color: var(--lime-line); background: var(--lime-wash); }
.pill.unsold,
.pill.cancelled { color: var(--text-3); }
.pill.draft { color: var(--gold); border-color: rgba(176, 124, 10, .45); background: rgba(176, 124, 10, .08); }
.pill.sealed { color: var(--gold); }
.pill.sealed-tie { color: #b07c0a; border-color: rgba(176, 124, 10, .5); background: rgba(176, 124, 10, .1); }
html:not([data-theme="light"]) .pill.sealed-tie { color: #ffb454; border-color: rgba(255, 180, 84, .5); background: rgba(255, 180, 84, .1); }
.pill.legend { color: #7a5605; border-color: rgba(176, 124, 10, .45); }
html:not([data-theme="light"]) .pill.legend { color: #fff1ba; border-color: rgba(242, 185, 75, .45); }

/* ============ 控件：转播操作台 ============ */
button.primary,
button.secondary,
button.danger,
button.ghost,
a.button-link {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .16s var(--ease-out), background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}
/* 主操作：亮绿底 + 泛光 + 球衣斜切角 */
button.primary,
a.button-link.primary {
  background: linear-gradient(180deg, var(--lime-strong), var(--lime));
  color: var(--lime-ink);
  box-shadow: 0 6px 18px var(--lime-wash), inset 0 1px 0 rgba(255, 255, 255, .28);
}
html[data-theme="light"] button.primary,
html[data-theme="light"] a.button-link.primary {
  background: linear-gradient(180deg, #2c9e10, #1c7509);
  color: #fff;
  box-shadow: 0 4px 14px rgba(35, 137, 12, .22), inset 0 1px 0 rgba(255, 255, 255, .32);
}
button.primary:hover,
a.button-link.primary:hover { filter: brightness(1.07); color: var(--lime-ink); transform: translateY(-1px); box-shadow: 0 10px 26px var(--lime-wash); }
html[data-theme="light"] button.primary:hover,
html[data-theme="light"] a.button-link.primary:hover { color: #fff; background: linear-gradient(180deg, #26900c, #196408); }
button.primary:active { transform: translateY(0); }
button.secondary,
a.button-link.secondary { border-color: var(--line-strong); background: var(--panel-2); color: var(--text-1); }
button.secondary:hover,
a.button-link.secondary:hover { border-color: var(--lime-line); background: var(--panel-3); transform: translateY(-1px); }
button.danger { border-color: rgba(217, 56, 44, .32); background: rgba(217, 56, 44, .12); color: var(--coral); }
button.ghost { border-color: var(--line); background: transparent; color: var(--text-2); }
button.ghost:hover { border-color: var(--line-strong); color: var(--text-1); }
button:disabled { opacity: .42; cursor: not-allowed; transform: none !important; }

input[type="number"],
input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-input);
  color: var(--text-1);
  padding: 10px 13px;
  font-size: 16px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--lime-line);
  box-shadow: 0 0 0 3px var(--lime-wash);
  outline: none;
}
input::placeholder { color: var(--text-3); opacity: 1; }
label > span,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--text-3); font-size: 13px; font-weight: 700; letter-spacing: .05em; }
td { color: var(--text-1); }
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: var(--surface-hover); }
tr:last-child td { border-bottom: 0; }

.flash-stack {
  position: fixed;
  top: 92px;
  left: 50%;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(560px, calc(100vw - 28px));
  pointer-events: none;
  transform: translateX(-50%);
}
.flash-message {
  padding: 12px 16px;
  border: 1px solid rgba(176, 124, 10, .56);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-xs);
  background: var(--backdrop-tint);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  color: #8a6310;
  font-size: 15px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}
html:not([data-theme="light"]) .flash-message { color: #f0e0bb; background: rgba(7, 21, 33, .97); }
.flash-message.show { opacity: 1; transform: translateY(0); }
.flash-message.success { border-color: rgba(15, 138, 86, .56); border-left-color: var(--mint); color: var(--mint); }
.flash-message.error { border-color: rgba(217, 56, 44, .58); border-left-color: var(--coral); color: var(--coral); }
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 100;
  max-width: min(520px, calc(100vw - 28px));
  padding: 13px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--backdrop-tint);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  color: var(--text-1);
  font-size: 16px;
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { border-color: rgba(15, 138, 86, .58); color: var(--mint); }
.toast.warning { border-color: rgba(176, 124, 10, .58); color: var(--gold); }
.toast.danger { border-color: rgba(217, 56, 44, .58); color: var(--coral); }

.empty-state { padding: 48px 18px; text-align: center; color: var(--text-3); font-size: 15px; }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--text-2); font-size: 18px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ 动效：转播节奏 ============ */
@keyframes pulse { 50% { opacity: .32; } }
@keyframes softGlow { 50% { box-shadow: 0 0 34px var(--lime-wash); } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scorePop {
  0% { transform: scale(.82); opacity: 0; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 980px) {
  .main-nav { display: none; }
  .mobile-nav-toggle { display: flex; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Keep the full desktop navigation readable on common 1366px laptops.
   Below 1180px the drawer is more useful than shrinking Chinese labels. */
@media (min-width: 1181px) and (max-width: 1500px) {
  .topbar {
    padding-inline: 16px;
    gap: clamp(10px, 1.35vw, 20px);
  }
  .main-nav { gap: 0; }
  .main-nav a {
    padding-inline: clamp(7px, .7vw, 10px);
    font-size: clamp(14px, 1.12vw, 16px);
  }
  .database-nav > a {
    padding-right: 2px;
  }
  .database-nav > button {
    width: 22px;
    padding-inline: 2px 6px;
  }
  .main-nav a::after {
    left: 8px;
    right: 8px;
  }
  .header-actions {
    min-width: 0;
    gap: 8px;
  }
  .room-badge { padding-inline: 8px; }
  .account-cluster {
    min-width: 0;
    gap: 7px;
    font-size: 13px;
  }
  .account-display-name {
    min-width: 0;
    flex: 1 1 auto;
  }
  .account-avatar,
  .account-cluster form { flex: 0 0 auto; }
}
@media (max-width: 1180px) {
  .main-nav { display: none; }
  .mobile-nav-toggle { display: flex; }
  .topbar { gap: clamp(10px, 2vw, 20px); }
}
@media (max-width: 700px) {
  .topbar { min-height: 66px; padding: 0 10px; gap: 8px; }
  .room-badge { display: none; }
  .season-switcher { margin-left: 0 !important; }
  .season-switcher summary {
    max-width: 132px;
    padding-inline: 8px !important;
    overflow: hidden;
    font-size: 11px !important;
    text-overflow: ellipsis;
  }
  .season-switcher ul {
    right: 0;
    left: auto !important;
    min-width: 170px !important;
  }
  .header-actions { margin-left: 0; gap: 5px; }
  .account-cluster { gap: 7px; }
  .account-cluster > span:nth-child(2) { display: none; }
  .account-cluster form { display: none; }
  .status-rail { padding: 0 14px; gap: 10px; }
  .status-rail span:not(:first-child),
  .status-rail b { display: none; }
  .site-main { padding: 24px 12px 56px; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 84px; padding: 13px; }
  .metric strong { font-size: 20px; }
  .card { padding: 15px; }
}

@media (max-width: 480px) {
  .topbar { padding-inline: 8px; gap: 6px; }
  .brand { gap: 7px; }
  .brand-mark { width: 44px; height: 44px; }
  .brand-copy { display: block; min-width: 0; }
  .brand-copy strong {
    font-size: 13px;
    line-height: 1.05;
    letter-spacing: .04em;
    white-space: nowrap;
  }
  .brand-copy small {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    line-height: 1;
    letter-spacing: .04em;
    white-space: nowrap;
  }
  .season-switcher { min-width: 0; max-width: 72px; }
  .season-switcher summary {
    max-width: 72px;
    padding-inline: 5px !important;
    font-size: 10px !important;
  }
  .mobile-nav-toggle { width: 44px; height: 44px; }
  .account-avatar { width: 44px; height: 44px; }
  .header-actions .button-link { min-height: 38px; padding-inline: 9px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Treat 2K desktops as a tolerant range instead of keying the entire type
   scale to an exact 2560px viewport. Browser sidebars and classic scrollbars
   may remove a few CSS pixels even when both browsers are at 100% zoom. */
@media (min-width: 2200px) and (max-width: 2399px) {
  body { font-size: 19px; }
  .site-main { width: min(2140px, calc(100% - 64px)); }
  .topbar { min-height: 92px; }
  .brand-mark { width: 58px; height: 58px; }
  .brand-copy strong { font-size: 23px; }
  .brand-copy small { font-size: 15px; }
  .main-nav a { font-size: 19px; }
  button.primary,
  button.secondary,
  button.danger,
  button.ghost,
  a.button-link { min-height: 56px; font-size: 18px; }
  input[type="number"],
  input[type="text"],
  input[type="password"],
  input[type="search"],
  select,
  textarea { min-height: 56px; font-size: 19px; }
  label > span,
  .field-label { font-size: 16px; }
}

@media (min-width: 2400px) {
  body { font-size: 22px; }
  .site-main { width: min(2300px, 100%); }
  .topbar { min-height: 104px; }
  .brand-mark { width: 64px; height: 64px; }
  .brand-copy strong { font-size: 25px; }
  .brand-copy small { font-size: 17px; }
  .main-nav a { font-size: 21px; }
  button.primary,
  button.secondary,
  button.danger,
  button.ghost,
  a.button-link { min-height: 62px; font-size: 20px; }
  input[type="number"],
  input[type="text"],
  input[type="password"],
  input[type="search"],
  select,
  textarea { min-height: 62px; font-size: 21px; }
  label > span,
  .field-label { font-size: 18px; }
}

@media (min-width: 3000px) {
  .site-main { width: min(3000px, calc(100% - 96px)); }
  .topbar { padding-inline: 48px; gap: 80px; }
  .room-badge { min-height: 58px; padding: 9px 16px; gap: 12px; }
  .room-badge i { width: 38px; height: 38px; font-size: 17px; }
  .room-badge b { font-size: 20px; }
  .room-badge small { font-size: 17px; }
  .account-cluster { gap: 14px; font-size: 20px; }
  .account-avatar { width: 48px; height: 48px; }
  .link-button { font-size: 20px; }
  .eyebrow { font-size: 18px; }
  .metric-strip { gap: 16px; margin: 32px 0; }
  .metric { min-height: 140px; padding: 24px; }
  .metric span,
  .metric small { font-size: 18px; }
  .metric strong { margin-top: 12px; font-size: 40px; }
  .pill { min-height: 36px; padding: 6px 14px; font-size: 18px; }
  table { font-size: 20px; }
  th { font-size: 18px; }
  .toast { max-width: 760px; padding: 18px 26px; font-size: 22px; }
  .flash-stack { top: 120px; }
  .empty-state { font-size: 20px; }
  .empty-state strong { font-size: 26px; }
}

/* 主题过渡：切换时让全站颜色平滑过渡而非突变 */
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color .32s ease, color .32s ease, border-color .32s ease, fill .32s ease, stroke .32s ease, box-shadow .32s ease !important;
}
