/* =============================================================
   言锋杯线上辩论平台 · 视觉系统
   -------------------------------------------------------------
   版面语言对齐「辩场 DebateHall」：Inter Variable 字体栈、
   #1456f0 主色、#ebebeb 细边、双层柔和投影、12px 卡片圆角、
   侧栏 + 顶栏工作台骨架、深色主题同构。
   ============================================================= */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-var.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-ext-var.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------- 设计变量 ------------------------------- */
:root {
  color-scheme: light;

  --font-sans: "Inter Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
    "Noto Sans SC", system-ui, sans-serif;
  --font: var(--font-sans);
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Consolas, "Courier New", monospace;

  /* 中性色：与辩场一致的近黑 / 暖灰阶层 */
  --background: #ffffff;
  --foreground: #252525;
  --muted: #8a8a8a; /* 次要文字 */
  --muted-2: #f5f6f7; /* 页面底色 */
  --border: #ebebeb;
  --border-strong: #d5d6d7;

  /* 语义别名：页面按既有类名取色 */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #f0f0f1;
  --text: #252525;
  --text-2: #464649;

  --primary: #1456f0;
  --primary-hover: #3b72f3;
  --primary-foreground: #f7fbfd;
  --primary-soft: rgba(20, 86, 240, 0.08);
  --primary-text: #1240b8;

  --ok: #16a34a;
  --ok-soft: rgba(34, 197, 94, 0.1);
  --warn: #b45309;
  --warn-raw: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.1);

  --pro: #1456f0;
  --pro-soft: rgba(20, 86, 240, 0.09);
  --con: #d97706;
  --con-soft: rgba(217, 119, 6, 0.1);

  /* 投影：辩场式双层（贴边 1px + 长距柔光） */
  --shadow-flat: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -10px rgba(99, 102, 241, 0.12);
  --shadow-card-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 40px -8px rgba(99, 102, 241, 0.16);
  --shadow-sm: var(--shadow-flat);
  --shadow-md: var(--shadow-card);
  --shadow-lg: 0 16px 48px 0 rgba(17, 24, 39, 0.06), 0 12px 24px 0 rgba(17, 24, 39, 0.05),
    0 6px 8px 0 rgba(17, 24, 39, 0.02);

  --radius: 12px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);

  /* 工作台骨架 */
  --shell-bg: #f5f6f7;
  --sidebar-width: 16rem;
  --sidebar-collapsed: 4.25rem;
  --sidebar-bg: rgba(248, 248, 248, 0.5);
  --sidebar-fg: #8a8f96;
  --sidebar-accent-fg: #1a1a1a;
  --sb-accent: rgba(20, 86, 240, 0.1);
  --sb-accent-text: #3b72f3;
  --topbar-h: 3.25rem;

  --fs-hero: clamp(30px, 5.2vw, 46px);
  --fs-h2: 20px;
  --fs-lead: 14px;
  --fs-body: 14px;
  --wrap: 1240px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #111111;
  --foreground: #f5f5f5;
  --muted: #a3a3a8;
  --muted-2: #17171a;
  --border: #2d2d2f;
  --border-strong: #464649;

  --bg: #111111;
  --surface: #161618;
  --surface-2: #1c1c1f;
  --surface-3: #232327;
  --text: #f5f5f5;
  --text-2: #c9c9cf;

  --primary: #4d82ff;
  --primary-hover: #6b97ff;
  --primary-foreground: #0b1220;
  --primary-soft: rgba(77, 130, 255, 0.14);
  --primary-text: #94b4ff;

  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);

  --pro: #4d82ff;
  --pro-soft: rgba(77, 130, 255, 0.14);
  --con: #f0a13a;
  --con-soft: rgba(240, 161, 58, 0.14);

  --shadow-flat: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -10px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px -8px rgba(0, 0, 0, 0.55);
  --shadow-sm: var(--shadow-flat);
  --shadow-md: var(--shadow-card);
  --shadow-lg: 0 16px 48px 0 rgba(0, 0, 0, 0.45);

  --shell-bg: #0e0e0e;
  --sidebar-bg: rgba(24, 24, 26, 0.6);
  --sidebar-fg: #a3a3a8;
  --sidebar-accent-fg: #f5f5f5;
  --sb-accent: rgba(77, 130, 255, 0.16);
  --sb-accent-text: #6b97ff;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --background: #111111;
    --foreground: #f5f5f5;
    --muted: #a3a3a8;
    --muted-2: #17171a;
    --border: #2d2d2f;
    --border-strong: #464649;
    --bg: #111111;
    --surface: #161618;
    --surface-2: #1c1c1f;
    --surface-3: #232327;
    --text: #f5f5f5;
    --text-2: #c9c9cf;
    --primary: #4d82ff;
    --primary-hover: #6b97ff;
    --primary-foreground: #0b1220;
    --primary-soft: rgba(77, 130, 255, 0.14);
    --primary-text: #94b4ff;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --pro: #4d82ff;
    --pro-soft: rgba(77, 130, 255, 0.14);
    --con: #f0a13a;
    --con-soft: rgba(240, 161, 58, 0.14);
    --shadow-flat: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -10px rgba(0, 0, 0, 0.5);
    --shadow-sm: var(--shadow-flat);
    --shadow-md: var(--shadow-card);
    --shadow-lg: 0 16px 48px 0 rgba(0, 0, 0, 0.45);
    --shell-bg: #0e0e0e;
    --sidebar-bg: rgba(24, 24, 26, 0.6);
    --sidebar-fg: #a3a3a8;
    --sidebar-accent-fg: #f5f5f5;
    --sb-accent: rgba(77, 130, 255, 0.16);
    --sb-accent-text: #6b97ff;
  }
}

/* ------------------------------- 基础 ------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--shell-bg);
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  overflow-wrap: break-word;
  max-width: 100%;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.35;
  font-weight: 640;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

h1 {
  font-size: clamp(21px, 3.4vw, 26px);
  letter-spacing: -0.03em;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 15px;
  letter-spacing: -0.01em;
}
p {
  margin: 0.35em 0;
}
a {
  color: var(--primary-text);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}
a:hover {
  color: var(--primary);
  text-decoration: none;
}
small {
  color: var(--muted);
  font-size: 12.5px;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}
b,
strong {
  font-weight: 640;
}
::selection {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  left: -999px;
  top: 0;
  z-index: 120;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-size: 13px;
}
.skip-link:focus {
  left: 0;
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.muted {
  color: var(--muted);
}
.hint {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.mono-sm {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.meta-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  display: inline-block;
  flex: none;
  font-size: 0;
  line-height: 0;
  color: transparent;
  overflow: hidden;
}
.eyebrow {
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
  max-width: 62ch;
  margin: 0;
}
.nowrap {
  white-space: nowrap;
}
.spacer {
  flex: 1 1 auto;
}
.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  font-size: 13px;
}
.kv b {
  color: var(--text-2);
}

/* ------------------------------- 启动骨架 ------------------------------- */
.boot {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.boot-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-foreground);
  background: linear-gradient(150deg, var(--primary-hover), var(--primary));
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary) 70%, transparent);
}
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  height: 14px;
}
.skeleton.w40 { width: 40%; }
.skeleton.w60 { width: 60%; }
.skeleton.w80 { width: 80%; }
@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ------------------------------- 工作台骨架 ------------------------------- */
.shell-body {
  display: flex;
  min-height: 100dvh;
  background: var(--shell-bg);
}

.sb {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100dvh;
  flex: none;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  transition: width 0.2s linear, transform 0.22s var(--ease);
}

.sb__head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 12px 0 14px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--foreground);
  flex: 1 1 auto;
}
.brand:hover {
  color: var(--foreground);
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 80%, transparent);
}
.brand__mark svg {
  width: 17px;
  height: 17px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.brand-text b {
  font-size: 14px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.brand-text span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sb__icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.sb__icon-btn:hover {
  background: var(--surface-3);
  color: var(--foreground);
}
.sb__icon-btn svg {
  width: 16px;
  height: 16px;
}

.sb__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px 14px;
  scrollbar-width: thin;
}
.sb__scroll::-webkit-scrollbar {
  width: 6px;
}
.sb__scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  opacity: 0.4;
}

.sb__group {
  padding: 6px 0 2px;
}
.sb__group + .sb__group {
  margin-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.sb__label {
  margin: 6px 0 5px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 85%, transparent);
}
.sb__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
}
.sb__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--sidebar-fg);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sb__item svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.9;
}
.sb__item:hover {
  background: var(--surface-2);
  color: var(--foreground);
}
.sb__item.is-active {
  background: var(--sb-accent);
  color: var(--sidebar-accent-fg);
  font-weight: 600;
}
.sb__item.is-active svg {
  color: var(--sb-accent-text);
  opacity: 1;
}
.sb__text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb__count {
  flex: none;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 640;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sb__count--muted {
  background: var(--surface-3);
  color: var(--muted);
}

.sb__foot {
  flex: none;
  padding: 8px 10px 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.sb__user {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease);
}
.sb__user:hover {
  background: var(--surface-2);
}
.sb__avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sb__user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  flex: 1 1 auto;
}
.sb__user-meta b {
  font-size: 12.5px;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb__user-meta small {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb__user-more {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted);
}
.sb__signout {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sb__signout:hover {
  background: var(--surface-2);
  color: var(--danger);
}

.sb[data-state="collapsed"] {
  width: var(--sidebar-collapsed);
}
.sb[data-state="collapsed"] .brand-text,
.sb[data-state="collapsed"] .sb__label,
.sb[data-state="collapsed"] .sb__text,
.sb[data-state="collapsed"] .sb__count,
.sb[data-state="collapsed"] .sb__user-meta,
.sb[data-state="collapsed"] .sb__user-more {
  display: none;
}
.sb[data-state="collapsed"] .sb__head {
  padding: 0 8px;
  justify-content: center;
}
.sb[data-state="collapsed"] .sb__head .brand {
  flex: none;
}
.sb[data-state="collapsed"] .sb__scroll {
  padding: 6px;
}
.sb[data-state="collapsed"] .sb__group + .sb__group {
  border: 0;
  margin-top: 2px;
}
.sb[data-state="collapsed"] .sb__item,
.sb[data-state="collapsed"] .sb__user {
  justify-content: center;
  padding: 8px;
}
.sb[data-state="collapsed"] .sb__foot {
  padding: 8px 6px 12px;
}

.sb__scrim {
  display: none;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--background);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 86%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  flex: none;
}
.topbar__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: -4px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}
.topbar__burger svg {
  width: 18px;
  height: 18px;
}
.topbar__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--foreground);
}
.topbar__date {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.topbar-actions,
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
}
.topbar__icon,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  min-width: 30px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.topbar__icon svg,
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.topbar__icon:hover,
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--foreground);
}
.icon-btn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}
.topbar .btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
}
.topbar__login {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12.5px;
  font-weight: 600;
}
.topbar__login:hover {
  background: var(--primary-hover);
  color: var(--primary-foreground);
}

.nav {
  display: none;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.role-chip--admin {
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  background: var(--primary-soft);
  color: var(--primary-text);
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--background);
}

.app-view {
  display: block;
  min-height: calc(100dvh - var(--topbar-h));
}

.app-foot {
  border-top: 1px solid var(--border);
  padding: 14px 20px 20px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* ------------------------------- 版式容器 ------------------------------- */
.page,
.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px clamp(14px, 2.4vw, 28px) 56px;
  display: grid;
  gap: 14px;
  min-width: 0;
}
.page.narrow,
.container.narrow {
  max-width: 820px;
}
.page-wide {
  max-width: 1240px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  padding-bottom: 2px;
}
.page-head h1 {
  font-size: clamp(19px, 3vw, 23px);
  letter-spacing: -0.03em;
}
.sec-h .page-title {
  font-size: clamp(18px, 2.6vw, 21px);
  font-weight: 660;
  letter-spacing: -0.03em;
  line-height: 1.35;
}
.card-head .page-title {
  font-size: 17px;
  font-weight: 660;
  letter-spacing: -0.02em;
}
.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;
}
.page-head .lede {
  margin-top: 6px;
}
.stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.stack.sm {
  gap: 10px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.row.between {
  justify-content: space-between;
}
.row.end {
  justify-content: flex-end;
}
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  min-width: 0;
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.grid.kpi,
.stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(48%, 150px), 1fr));
}
.split-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
}
.section-title h2 {
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.section-title .line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

/* ------------------------------- 卡片 / 面板 ------------------------------- */
.card,
.sec,
.panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}
.card.flush,
.sec.flush {
  padding: 0;
  overflow: hidden;
}
.card.pad-lg {
  padding: 22px;
}
.card.accent,
.card-accent {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
}
.card-head,
.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head h3,
.card__h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.015em;
}
.card-sub,
.card__h + .card-sub {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}
.card-link {
  font-size: 12.5px;
  color: var(--primary-text);
  white-space: nowrap;
}
.sec-h {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 12px;
}
.sec-h h2,
.sec-h h3 {
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.015em;
}
.sec-sub {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.card__tag,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  line-height: 18px;
  white-space: nowrap;
}
.pill--live {
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}
.pill--live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.4s infinite;
}
.pill--quiet {
  color: var(--muted);
}
.panel__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.panel__hint {
  font-size: 11.5px;
  color: var(--muted);
}
.panel__title {
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.45;
}
.panel__sub {
  font-size: 12.5px;
  color: var(--muted);
}
.panel__body {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

/* KPI / 统计 */
.kpi-card,
.stat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}
.kpi-card .kpi-label,
.stat__label,
.stat .stat-label {
  display: block;
  font-size: 11.5px;
  font-weight: 520;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.kpi-card .kpi-value,
.stat__value {
  display: block;
  margin-top: 3px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.stat__unit {
  margin-left: 3px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.kpi-card .kpi-hint,
.stat__note {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
}
.stat b {
  display: block;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}


/* 现场焦点面板（首页进行中的场次） */
.stage-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-card);
}
.stage-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.stage-card__head .panel__hint {
  margin-left: auto;
}
.stage-card__title {
  font-size: clamp(16px, 2.4vw, 19px);
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.5;
}
.stage-card__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.stage-side {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.stage-side.right {
  justify-items: end;
  text-align: right;
}
.stage-side__label {
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stage-side b {
  font-size: 14.5px;
  font-weight: 660;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.stage-side small {
  font-size: 11.5px;
  color: var(--muted);
}
.stage-side__time {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.stage-side.is-speaking .stage-side__time {
  color: var(--foreground);
}
.stage-side__time.warn {
  color: var(--warn);
}
.stage-side__time.over {
  color: var(--danger);
}
.stage-side.is-speaking b {
  color: var(--primary-text);
}
.stage-card .vs {
  font-size: 10.5px;
  font-weight: 660;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.stage-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* 列表行 */
.item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  min-width: 0;
}
.item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.item:first-child {
  padding-top: 0;
}
.item-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}
.item-title {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-side {
  flex: none;
  text-align: right;
  display: grid;
  justify-items: end;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.todo-list,
.log-list,
.notify-list,
.note-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.todo-item .count {
  font-weight: 700;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}
.log-item,
.note-item,
.notify-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.65;
  min-width: 0;
}
.log-item .li-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.log-item .li-action {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 640;
  color: var(--primary-text);
}
.log-item .li-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
}
.log-item .li-diff {
  display: grid;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.log-item .li-diff .old { color: var(--danger); }
.log-item .li-diff .new { color: var(--ok); }
.notify-item.unread {
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
  background: var(--primary-soft);
}
.notify-item .ni-time {
  font-size: 11px;
  color: var(--muted);
}

/* ------------------------------- 按钮 ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease),
    box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--foreground);
  box-shadow: var(--shadow-flat);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn[disabled],
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn svg {
  width: 14px;
  height: 14px;
}
.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 20px -12px color-mix(in srgb, var(--primary) 80%, transparent);
}
.btn-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: var(--primary-foreground);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08), 0 12px 26px -12px color-mix(in srgb, var(--primary) 90%, transparent);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--foreground);
  box-shadow: none;
}
.btn-outline {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text-2);
}
.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 34%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}
.btn-ok {
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}
.btn-ok:hover {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}
.btn-sm {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-xs {
  min-height: 24px;
  padding: 1px 8px;
  font-size: 11.5px;
  border-radius: 7px;
}
.btn-block {
  width: 100%;
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn--pill {
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
}

/* 分段控件 / 标签选择 */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.segmented button {
  border: 0;
  border-radius: 7px;
  padding: 4px 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented button:hover {
  color: var(--foreground);
}
.segmented button.on,
.segmented button.is-active {
  background: var(--surface);
  color: var(--foreground);
  box-shadow: var(--shadow-flat);
}

/* 子页面切换标签（裁判端 / 后台内页） */
.tabs {
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs .tab {
  padding: 5px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tabs .tab:hover {
  color: var(--foreground);
}
.tabs .tab.is-active {
  background: var(--surface);
  color: var(--foreground);
  font-weight: 620;
  box-shadow: var(--shadow-flat);
}

/* ------------------------------- 表单 ------------------------------- */
.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.field > label,
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.field .hint {
  font-size: 11.5px;
}
.input,
.select,
.textarea,
.note-area {
  width: 100%;
  min-width: 0;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}
.input:focus,
.select:focus,
.textarea:focus,
.note-area:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.textarea,
.note-area {
  min-height: 84px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.7;
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.input-inline {
  width: auto;
  min-width: 76px;
}
.input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.input-group .input {
  flex: 1 1 150px;
}
.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}
.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}
.dev-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
}

/* ------------------------------- 徽标 / 状态 ------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  line-height: 18px;
  white-space: nowrap;
}
.badge.ok,
.badge--ok {
  border-color: color-mix(in srgb, var(--ok) 28%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn,
.badge--warn {
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.danger,
.badge--danger {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.info {
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  background: var(--primary-soft);
  color: var(--primary-text);
}
.badge.plain {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.role-pill,
.role-strip,
.perm-tags,
.perm-tag,
.stage-chip,
.chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.role-pill,
.perm-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 560;
  line-height: 18px;
}
.room-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 11.5px;
  font-weight: 600;
}
.stage-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.stage-chip.done {
  color: var(--muted);
  opacity: 0.72;
  text-decoration: line-through;
}
.stage-chip.on,
.stage-chip.now {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 620;
}
.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 5px;
}
.online-dot.off {
  background: var(--border-strong);
}

/* ------------------------------- 表格 ------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  min-width: 0;
}
table.table,
table.table-xs {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.table th,
table.table td,
table.table-xs th,
table.table-xs td {
  padding: 9px 11px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
table.table th,
table.table-xs th {
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
table.table tbody tr:hover,
table.table-xs tbody tr:hover {
  background: var(--surface-2);
}
table.table tbody tr:last-child td,
table.table-xs tbody tr:last-child td {
  border-bottom: 0;
}
table.table td.num,
table.table-xs td.num,
.cell-r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.table .wrap-cell {
  max-width: 340px;
  word-break: break-word;
}
table.table-xs {
  min-width: 0;
  font-size: 12px;
}
table.table-xs th,
table.table-xs td {
  padding: 6px 8px;
}
.matrix-table th:first-child {
  width: 42%;
}
.matrix-cell {
  text-align: center;
  font-size: 12px;
}
.matrix-cell.yes { color: var(--ok); font-weight: 640; }
.matrix-cell.ro { color: var(--warn); }
.matrix-cell.no { color: var(--muted); }

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.score-table th,
.score-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
}
.score-table th {
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}
.score-table td.score-cell {
  width: 92px;
}
.score-table .score-input {
  text-align: center;
  font-family: var(--mono);
}
.score-total {
  display: flex;
  justify-content: space-between;
  padding: 9px 3px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}
.score-row .sr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.score-row .input {
  padding: 5px 7px;
  text-align: right;
}

/* ------------------------------- 空态 / 提示 ------------------------------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 30px 18px;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius);
  background: radial-gradient(320px 160px at 50% 0%, var(--surface-2), transparent 80%);
  color: var(--muted);
  font-size: 12.5px;
}
.empty b,
.empty__title {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--text-2);
}
.empty__text {
  font-size: 12px;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.7;
}
.empty svg {
  width: 23px;
  height: 23px;
  color: var(--border-strong);
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.notice .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.notice.info {
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  background: var(--primary-soft);
  color: var(--primary-text);
}
.notice.info .ico { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-text); }
.notice.warn {
  border-color: color-mix(in srgb, var(--warn) 26%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
}
.notice.warn .ico { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.notice.danger {
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}
.notice.danger .ico { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.notice.ok {
  border-color: color-mix(in srgb, var(--ok) 26%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}

/* ------------------------------- 首页 / 赛事入口 ------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(30px, 5vw, 52px) clamp(18px, 4vw, 44px) clamp(24px, 3.4vw, 38px);
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(760px 360px at 50% -40%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 72%),
    radial-gradient(520px 280px at 88% 8%, color-mix(in srgb, var(--primary) 6%, transparent), transparent 68%),
    var(--surface);
  box-shadow: var(--shadow-card);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--primary) 11%, transparent);
  pointer-events: none;
}
.hero::before {
  width: min(520px, 80vw);
  height: min(520px, 80vw);
  left: 50%;
  top: -260px;
  transform: translateX(-50%);
  background: color-mix(in srgb, #ffffff 18%, transparent);
}
.hero::after {
  width: min(360px, 62vw);
  height: min(360px, 62vw);
  left: 50%;
  top: -180px;
  transform: translateX(-50%);
  border-color: color-mix(in srgb, var(--primary) 8%, transparent);
}
html[data-theme="dark"] .hero::before {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(77, 130, 255, 0.14);
}
.hero .eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: none;
}
.hero h1 {
  position: relative;
  z-index: 1;
  margin: 14px 0 10px;
  max-width: 22ch;
  font-size: clamp(27px, 4.6vw, 42px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.045em;
  color: var(--foreground);
}
.hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 54ch;
  color: color-mix(in srgb, var(--muted) 92%, var(--foreground));
  font-size: 13.5px;
  line-height: 1.75;
}
.hero .row {
  position: relative;
  z-index: 1;
  justify-content: center;
  margin-top: 22px;
}
.hero .btn {
  min-height: 38px;
  padding: 7px 22px;
  border-radius: 999px;
  font-size: 12.5px;
}
.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 5vw, 46px);
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  width: min(100%, 720px);
}
.hero-stats div {
  min-width: 74px;
}
.hero-stats b {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  line-height: 1.2;
}
.hero-stats span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.match-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
  transition: box-shadow 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.match-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
.match-card .mc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.match-card .mc-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.match-card .team-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card .team-name.right {
  text-align: right;
}
.match-card .vs {
  font-size: 10.5px;
  font-weight: 660;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
}
.match-card .mc-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.topic-box {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
  background: linear-gradient(180deg, var(--primary-soft), transparent 70%), var(--surface);
}
.topic-box .topic-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.topic-box .topic-text {
  font-size: clamp(15px, 2.6vw, 18px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.5;
}
.topic-list {
  display: grid;
  gap: 8px;
}
.topic-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
}
.topic-item > * {
  min-width: 0;
}
.topic-item b {
  font-size: 13px;
  font-weight: 620;
}
.rule-list {
  display: grid;
  gap: 10px;
  counter-reset: rule;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rule-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.75;
}
.rule-item::before {
  counter-increment: rule;
  content: counter(rule);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- 登录 ------------------------------- */
.auth-shell {
  min-height: calc(100dvh - var(--topbar-h) - 60px);
  display: grid;
  place-items: center;
  padding: 28px 14px 56px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 26px 26px 22px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.auth-card h1 {
  font-size: 21px;
  letter-spacing: -0.03em;
}
.auth-tabs {
  display: flex;
  gap: 3px;
  margin: 16px 0;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.auth-tabs button {
  flex: 1 1 0;
  padding: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 560;
  cursor: pointer;
}
.auth-tabs button.on {
  background: var(--surface);
  color: var(--foreground);
  box-shadow: var(--shadow-flat);
}

/* ------------------------------- 比赛房间 / 计时 ------------------------------- */
.room-page,
.room-shell,
.room-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.room-body.two {
  grid-template-columns: 1fr;
}
@media (min-width: 1040px) {
  .room-body.two {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.room-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}
.stage-strip-wrap {
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.stage-strip {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.stage-strip::-webkit-scrollbar {
  height: 4px;
}
.stage-strip::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
.timer-board {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .timer-board {
    grid-template-columns: 1fr 1fr;
  }
}
.side-panel {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.side-panel.speaking {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent), var(--shadow-flat);
}
.side-panel.overtime {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.side-panel .sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-panel .sp-name {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-panel .sp-side {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-panel.mini {
  padding: 10px 12px;
}
.side-panel.mini .time-big {
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 640;
}
.side-panel.mini .sp-name {
  font-size: 11.5px;
}
.time-big {
  font-family: var(--mono);
  font-size: clamp(38px, 9vw, 52px);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.time-big.warn,
.time-big.seg-warn {
  color: var(--warn);
}
.time-big.overtime,
.time-big.seg-over {
  color: var(--danger);
}
.time-big.seg-ok {
  color: var(--foreground);
}
.time-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meter {
  position: relative;
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.35s linear;
}
.meter.seg-warn > i { background: var(--warn-raw); }
.meter.seg-over > i { background: var(--danger); }
.side-panel.overtime .meter > i { background: var(--danger); }
.meter .mark {
  position: absolute;
  left: 70%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--border-strong);
}
.protect-bar {
  margin-top: 6px;
}
.protect-bar .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}
.protect-bar .track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.protect-bar .track i {
  display: block;
  height: 100%;
  background: var(--warn-raw);
}
.speak-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 620;
  color: var(--ok);
}
.speak-flag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.control-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
}
.control-grid .btn {
  justify-content: center;
}
.seat-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
.seat-card {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.seat-card .sc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.seat-card .sc-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.seat-card .sc-name {
  font-size: 12.5px;
  font-weight: 620;
}
.seat-card .sc-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.stage-list {
  display: grid;
  gap: 5px;
}
.sl-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
}
.sl-item.current {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  background: var(--primary-soft);
}
.sl-item.done {
  opacity: 0.6;
}
.sl-item.done .sl-name {
  text-decoration: line-through;
}
.sl-item .sl-idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.sl-item .sl-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sl-item .sl-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.presence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
}
.result-panel {
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--primary-soft), transparent 60%), var(--surface);
}
.result-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.result-vs .rv-name {
  font-size: 14px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.result-vs .rv-name.win {
  color: var(--ok);
}
.result-vs .rv-score {
  font-family: var(--mono);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.vote-bars {
  display: grid;
  gap: 7px;
}
.vote-row {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.vote-row .vb-track {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}
.vote-row .vb-a { background: var(--pro); }
.vote-row .vb-b { background: var(--con); }
.vote-row .vb-num {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.clock-pair,
.clock-vs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.two {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.side {
  min-width: 0;
}
.mark {
  font-weight: 620;
}

/* ------------------------------- 评分表 ------------------------------- */
.ballot-form {
  display: grid;
  gap: 14px;
}
.vote-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vote-pick label {
  flex: 1 1 132px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.vote-pick label:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border-strong));
}
.vote-pick label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 620;
}
.vote-pick input {
  accent-color: var(--primary);
}

/* ------------------------------- 观赛 ------------------------------- */
.watch-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 560;
}
.watch-no-voice,
.banner-no-voice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cheer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cheer-row .btn {
  flex: 1 1 140px;
}
.cheer-total {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------- 后台 ------------------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.admin-side {
  display: flex;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
  scrollbar-width: none;
}
.admin-side::-webkit-scrollbar {
  display: none;
}
.admin-side .side-label {
  display: none;
}
.admin-side a {
  flex: none;
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.admin-side a:hover {
  background: var(--surface-2);
  color: var(--foreground);
}
.admin-side a.active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 620;
}
.admin-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 620;
  color: var(--warn);
}

/* ------------------------------- 时间轴 ------------------------------- */
.timeline {
  display: grid;
}
.tl-item {
  display: grid;
  grid-template-columns: 82px 14px 1fr;
  gap: 10px;
  align-items: start;
}
.tl-item .tl-time {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.tl-item .tl-dot {
  display: grid;
  justify-items: center;
}
.tl-item .tl-dot i {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.tl-item .tl-dot::after {
  content: "";
  flex: 1;
  width: 1px;
  min-height: 18px;
  background: var(--border);
}
.tl-item:last-child .tl-dot::after {
  display: none;
}
.tl-item .tl-body {
  padding-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.7;
}

/* ------------------------------- Toast / Modal ------------------------------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 100;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(92vw, 440px);
  pointer-events: none;
}
.toast {
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--foreground);
  font-size: 12.5px;
  font-weight: 560;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s var(--ease);
}
.toast.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.modal-host {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 16px;
  background: color-mix(in srgb, #0b1220 45%, transparent);
  backdrop-filter: blur(3px);
}
.modal-host[hidden] {
  display: none;
}
.modal {
  width: min(540px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.modal h2 {
  margin-bottom: 5px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.modal .modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ------------------------------- 身份强调色 ------------------------------- */
body.role-debater { --accent: #0f766e; --accent-soft: rgba(15, 118, 110, 0.1); }
body.role-chair { --accent: #b45309; --accent-soft: rgba(180, 83, 9, 0.1); }
body.role-judge { --accent: #6d28d9; --accent-soft: rgba(109, 40, 217, 0.1); }
body.role-viewer { --accent: #475569; --accent-soft: rgba(71, 85, 105, 0.1); }
body.role-tournament_admin,
body.role-super_admin { --accent: #be123c; --accent-soft: rgba(190, 18, 60, 0.1); }

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 1024px) {
  .sb {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    background: var(--background);
  }
  .sb[data-open="true"] {
    transform: none;
  }
  .sb[data-state="collapsed"] {
    width: var(--sidebar-width);
  }
  .sb[data-state="collapsed"] .brand-text,
  .sb[data-state="collapsed"] .sb__label,
  .sb[data-state="collapsed"] .sb__text,
  .sb[data-state="collapsed"] .sb__count,
  .sb[data-state="collapsed"] .sb__user-meta {
    display: revert;
  }
  .sb[data-state="collapsed"] .sb__head,
  .sb[data-state="collapsed"] .sb__scroll,
  .sb[data-state="collapsed"] .sb__foot {
    padding: revert;
  }
  .sb[data-state="collapsed"] .sb__item {
    justify-content: flex-start;
  }
  .sb__scrim[data-open="true"] {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(12, 16, 24, 0.4);
    backdrop-filter: blur(1px);
  }
  .topbar__burger {
    display: inline-flex;
  }
  .sb__collapse {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --fs-body: 14px;
    --topbar-h: 3.25rem;
  }
  .page,
  .container {
    padding: 14px 13px 44px;
    gap: 12px;
  }
  .hero {
    padding: 22px 18px;
    border-radius: var(--radius);
  }
  .hero-stats {
    gap: 18px;
  }
  .topbar__date {
    display: none;
  }
  .topbar__nick,
  .topbar__logout,
  .topbar__admin,
  .role-chip--admin {
    display: none !important;
  }
  .card,
  .sec {
    padding: 14px;
  }
  .timer-board {
    grid-template-columns: 1fr;
  }
  .match-card .mc-teams {
    gap: 8px;
  }
  table.table {
    min-width: 100%;
  }
  table.table thead {
    display: none;
  }
  table.table,
  table.table tbody,
  table.table tr,
  table.table td {
    display: block;
    width: 100%;
  }
  table.table tr {
    margin-bottom: 8px;
    padding: 3px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  table.table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    border: 0;
    text-align: right;
  }
  table.table td::before {
    content: attr(data-label);
    flex: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
  }
  table.table td.wrap-cell {
    max-width: none;
  }
  .score-table thead {
    display: table-header-group;
  }
  .score-table,
  .score-table tbody,
  .score-table tr,
  .score-table td,
  .score-table th {
    display: revert;
  }
  .score-table tr {
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
  }
  .score-table td {
    display: table-cell;
    padding: 5px;
    text-align: left;
  }
  .score-table td::before {
    content: none;
  }
  .tl-item {
    grid-template-columns: 62px 12px 1fr;
  }
  .toast-host {
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sb,
  .topbar,
  .toast-host,
  .modal-host,
  .btn,
  .admin-side {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  .sec {
    break-inside: avoid;
    border-color: #ccc;
    box-shadow: none;
  }
}

/* =============================================================
   辩手工作台（/work/*）
   ============================================================= */
.work-page {
  gap: 12px;
}
.work-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
}
.work-head .page-title {
  font-size: clamp(19px, 3vw, 23px);
  font-weight: 680;
  letter-spacing: -0.03em;
}
.work-head .lede {
  margin-top: 5px;
}
.work-split {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .work-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* 训练 */
.train-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.train-card {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}
.train-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.train-card__head b {
  font-size: 13.5px;
  font-weight: 640;
}
.train-card .hint {
  font-size: 12px;
  min-height: 34px;
}
.train-card__form {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.train-card__form .input {
  font-size: 12.5px;
  padding: 5px 8px;
}

/* 通用列表行 */
.rows {
  display: grid;
  gap: 6px;
}
.row-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.row-item__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.row-item__main b {
  font-size: 13px;
  font-weight: 620;
}

/* 复盘 */
.review-item {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
}
.review-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.review-item__head b {
  font-size: 13.5px;
  font-weight: 640;
}
.review-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

/* 讲稿 */
.doc-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 960px) {
  .doc-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}
.doc-list {
  display: grid;
  gap: 4px;
}
.doc-group {
  display: grid;
  gap: 2px;
}
.doc-group__label {
  margin: 8px 0 2px;
  padding: 0 4px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-item {
  display: grid;
  gap: 1px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-2);
  transition: background 0.15s var(--ease);
}
.doc-item:hover {
  background: var(--surface-2);
  color: var(--foreground);
}
.doc-item.is-active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 620;
}
.doc-item__title {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-item__meta {
  font-size: 10.5px;
  color: var(--muted);
}
.doc-editor {
  display: grid;
  gap: 12px;
}
.doc-body {
  min-height: 320px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
}

/* 数据 */
.metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.metric-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.metric-card__head b {
  font-size: 12.5px;
  font-weight: 620;
}
.metric-card__value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.spark {
  display: grid;
  gap: 3px;
}
.spark svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.spark__foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 积分 */
.milestone-list {
  display: grid;
  gap: 10px;
}
.milestone {
  display: grid;
  gap: 6px;
}
.milestone__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.reward-list {
  display: grid;
  gap: 8px;
}
.reward-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.reward-item__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.reward-item__main b {
  font-size: 12.5px;
  font-weight: 620;
}
.reward-item__cost {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}
.ledger-list {
  display: grid;
  gap: 0;
}
.ledger-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  font-size: 12.5px;
}
.ledger-item:last-child {
  border-bottom: 0;
}
.ledger-item__pts {
  font-family: var(--mono);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}
.ledger-item__pts.is-plus {
  color: var(--ok);
}
.ledger-item__pts.is-minus {
  color: var(--danger);
}

/* 片段 */
.moment-list {
  display: grid;
  gap: 8px;
}
.moment-item {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.moment-item__head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.moment-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
