/* ==========================================================================
   评分台 MVP · 管理端 / 评委端样式（浅色，深蓝 + 青绿点缀）
   零依赖、无外部字体/图片；中文优先字体栈。
   ========================================================================== */

:root {
  --bg: #f3f6fb;
  --bg-deep: #e8eef7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --primary: #123c69;
  --primary-strong: #0d2f52;
  --primary-soft: #e8f0f9;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #e6f7f5;
  --on-primary: #fff;
  --on-accent: #fff;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --info-soft: #eff6ff;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 2px 8px -4px rgba(15, 23, 42, .12);
  --shadow: 0 14px 34px -20px rgba(15, 23, 42, .38);
  --shadow-lg: 0 30px 70px -34px rgba(15, 23, 42, .5);

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);

  /* Themeable surfaces (overridden by data-theme in themes.css) */
  --base-font-size: 15px;
  --body-glow-a: #dbeee9;
  --body-glow-b: #dde9f7;
  --topbar-bg: rgba(255, 255, 255, .86);
  --topbar-border: rgba(226, 232, 240, .9);
  --tab-hover-bg: rgba(255, 255, 255, .7);
  --hover-border: #c9d6e8;
  --primary-border: #d5e3f3;
  --focus-ring: rgba(13, 148, 136, .14);
  --switch-knob: #fff;
  --sticky-surface: rgba(255, 255, 255, .92);
  --login-side-bg: rgba(255, 255, 255, .55);
  --login-hero-glow-a: rgba(13, 148, 136, .28);
  --login-hero-glow-b: rgba(58, 122, 180, .35);
  --login-hero-1: #0e2c4d;
  --login-hero-2: #123c69;
  --login-hero-3: #0f5c63;
  --info-fg: #1d4ed8;
  --info-bg: #eff6ff;
  --info-border: #dbeafe;
  --danger-border: #fecaca;
  --warn-border: #fde68a;
  --ok-border: #bbf7d0;
  --danger-fg-strong: #991b1b;
  --warn-fg-strong: #92400e;
  --ok-fg-strong: #065f46;
  --setup-bg: #eef2ff;
  --setup-fg: #4338ca;
  --setup-border: #e0e7ff;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(1200px 600px at 85% -10%, var(--body-glow-a) 0%, transparent 55%),
    radial-gradient(1000px 500px at -10% 0%, var(--body-glow-b) 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--base-font-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: .01em; line-height: 1.3; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
code, .mono { font-family: var(--font-mono); font-size: .88em; }

.app-root { min-height: 100vh; display: flex; flex-direction: column; }

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.row.nowrap { flex-wrap: nowrap; }
.hidden, [hidden] { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.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;
}

/* ---------- 启动占位 ---------- */
.boot-loading {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 12px; color: var(--text-muted); min-height: 100vh;
}
.noscript-note {
  position: fixed; inset: auto 16px 16px 16px; padding: 14px 18px;
  background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--radius);
  color: var(--warn); z-index: 9999;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--topbar-border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; border: 0; background: none; padding: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  overflow: hidden; background: transparent;
  box-shadow: 0 2px 8px -4px rgba(15, 23, 42, .35);
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-text { text-align: left; line-height: 1.25; display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; color: var(--text-muted); }
.tenant-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--primary-soft); color: var(--primary); font-weight: 550;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-chip { font-size: 13px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--primary); font-size: 12.5px; font-weight: 650;
  border: 1px solid var(--border);
}
.role-chip {
  font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-border, var(--accent-soft));
}
.role-chip.is-judge { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-border); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 26px 22px 72px; flex: 1; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-title { font-size: 25px; letter-spacing: -.01em; }
.page-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-muted); background: none; border: 0; padding: 0; cursor: pointer; margin-bottom: 6px;
}
.back-link:hover { color: var(--primary); }

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text-soft);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-size: 13.5px; font-weight: 550; line-height: 1.2; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .14s var(--ease-out), box-shadow .16s ease;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { box-shadow: var(--shadow-xs); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .tab:focus-visible,
.criterion-remove:focus-visible, .step-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary, #fff); --btn-bd: var(--primary); }
.btn-primary:hover:not(:disabled) { --btn-bg: var(--primary-strong); --btn-bd: var(--primary-strong); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--on-accent, #fff); --btn-bd: var(--accent); }
.btn-accent:hover:not(:disabled) { --btn-bg: var(--accent-strong); --btn-bd: var(--accent-strong); }
.btn-soft { --btn-bg: var(--primary-soft); --btn-fg: var(--primary); --btn-bd: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-muted); --btn-bd: transparent; }
.btn-ghost:hover:not(:disabled) { --btn-bg: var(--surface-3); --btn-fg: var(--text); }
.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: var(--danger-border); }
.btn-danger:hover:not(:disabled) { --btn-bg: var(--danger-soft); }
.btn-sm { min-height: 30px; padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 5px 9px; min-height: 30px; }
/* Destructive row actions stay quiet until hover/focus: tables should not be a wall of red. */
.row-danger { --btn-bg: transparent; --btn-fg: var(--text-faint); --btn-bd: transparent; }
.row-danger:hover:not(:disabled) { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: var(--danger-border); }
.row-danger:focus-visible { color: var(--danger); }

/* ---------- 卡片 / 栅格 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 15.5px; font-weight: 650; }
.card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 12px 20px; }
.card-footer {
  padding: 13px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }

/* ---------- 统计块 ---------- */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: .55;
}
.stat-label { font-size: 12px; color: var(--text-muted); letter-spacing: .03em; }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650;
  padding: 2.5px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
  line-height: 1.5;
}
.badge-neutral { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.badge-setup { background: var(--setup-bg); color: var(--setup-fg); border-color: var(--setup-border); }
.badge-scoring { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-border, var(--accent-soft)); }
.badge-sealed { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-published { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-border); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- 进度条 ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress.sm { height: 5px; }
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.progress-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-muted);
  padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap; letter-spacing: .02em;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; }
.rank-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface-3); color: var(--text-soft); font-weight: 700; font-size: 12.5px;
}
.rank-num.r1 { background: linear-gradient(145deg, #fbbf24, #d97706); color: #fff; }
.rank-num.r2 { background: linear-gradient(145deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-num.r3 { background: linear-gradient(145deg, #d8a47f, #b27346); color: #fff; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
  min-width: 0;
}
.input:hover:not(:disabled), .select:hover:not(:disabled), .textarea:hover:not(:disabled) { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-faint); cursor: not-allowed; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .1); }
.textarea { min-height: 76px; resize: vertical; }
.input-sm { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.input-lg { min-height: 48px; font-size: 16px; padding: 10px 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 110px; min-width: 100px; }
.inline-form .btn { flex: none; }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1; }
.field-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-inline > label { font-size: 13px; color: var(--text-soft); font-weight: 550; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 550; color: var(--text-soft); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .18s ease; flex: none;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--switch-knob); box-shadow: 0 1px 3px rgba(15,23,42,.25);
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .45; }

/* ---------- 提示条 ---------- */
.alert {
  display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; line-height: 1.55;
  align-items: flex-start;
}
.alert-icon { flex: none; font-size: 14px; line-height: 1.4; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 650; font-size: 13px; }
.alert-error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-fg-strong); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-fg-strong); }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok-fg-strong); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-fg); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert li + li { margin-top: 2px; }

/* ---------- 空态 / 加载 ---------- */
.empty-state {
  padding: 44px 20px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
}
.empty-state .empty-icon { font-size: 30px; margin-bottom: 8px; opacity: .8; }
.empty-state .empty-title { font-size: var(--base-font-size); font-weight: 650; color: var(--text-soft); }
.empty-state .empty-desc { font-size: 13px; margin-top: 4px; }
.empty-state .empty-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(18, 60, 105, .18); border-top-color: var(--primary);
  animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { padding: 40px 20px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); font-size: 13.5px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, #eef2f7 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px; padding: 5px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; color: var(--text-muted);
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
  display: inline-flex; align-items: center; gap: 6px; scroll-snap-align: start;
}
.tab:hover { color: var(--text); background: var(--tab-hover-bg); }
.tab[aria-selected="true"] {
  background: var(--surface); color: var(--primary); font-weight: 650;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
}

/* ---------- 办赛流程 + 评审聚合 ---------- */
.workflow-stepper {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 13px; margin-bottom: 12px; box-shadow: var(--shadow-xs);
}
.workflow-kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  color: var(--text-faint); text-transform: uppercase; margin: 0 2px 7px;
}
.workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.workflow-step {
  appearance: none; display: flex; align-items: flex-start; gap: 9px; min-width: 0;
  padding: 9px 10px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text-soft); text-align: left; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s var(--ease-out);
}
.workflow-step:hover { border-color: var(--hover-border); background: var(--surface-3); }
.workflow-step:active { transform: scale(.99); }
.workflow-step-index {
  flex: none; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--surface-3); color: var(--text-muted);
}
.workflow-step-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.workflow-step-text b { font-size: 12.5px; font-weight: 650; color: var(--text-soft); }
.workflow-step-text small { font-size: 10.5px; color: var(--text-faint); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-step.is-done .workflow-step-index { background: var(--ok-soft); color: var(--ok); }
.workflow-step.is-current { background: var(--primary-soft); border-color: var(--primary); }
.workflow-step.is-current .workflow-step-index { background: var(--primary); color: var(--on-primary, #fff); }
.workflow-step.is-current .workflow-step-text b { color: var(--text); }

.review-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); padding: 12px 14px;
}
.review-bar-text { min-width: 0; }
.review-bar-title { font-size: 14px; font-weight: 650; margin-bottom: 2px; }
.review-tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 11px; overflow-x: auto; flex: none;
  scrollbar-width: none;
}
.review-tabs::-webkit-scrollbar { display: none; }
.review-tab {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--text-muted);
  padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.review-tab:hover { color: var(--text); background: var(--surface); }
.review-tab.is-active { background: var(--surface); color: var(--primary); border-color: var(--border); box-shadow: var(--shadow-xs); }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed; bottom: 22px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start; pointer-events: auto;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); padding: 11px 14px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; color: var(--text-soft);
  opacity: 1; transform: translateY(0) scale(1);
  transition: opacity .2s var(--ease-out), transform .22s var(--ease-out);
}
@starting-style {
  .toast {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px) scale(.98);
  transition-duration: .16s;
}
.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--primary); }
.toast-warn { border-left-color: var(--warn); }
.toast-msg { flex: 1; min-width: 0; word-break: break-word; }
.toast-close { border: 0; background: none; color: var(--text-faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }

/* ---------- Dialog ---------- */
html.modal-open, body.modal-open { overflow: hidden; }
.modal-root { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center;
  padding: 20px; pointer-events: auto;
  animation: fadeIn .15s ease-out;
  overflow-y: auto;
}
.dialog {
  width: 100%; max-width: 470px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: dialogIn .22s var(--ease-out);
  transform-origin: center;
  margin: auto;
}
.dialog.wide { max-width: 620px; }
.dialog-head {
  padding: 18px 22px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.dialog-title { font-size: 17px; font-weight: 680; }
.dialog-close { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--text-faint); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.dialog-close:hover { background: var(--surface-3); color: var(--text); }
.dialog-body { padding: 0 22px 4px; font-size: 13.5px; color: var(--text-soft); max-height: min(60vh, 520px); overflow-y: auto; }
.dialog-body .form-grid { margin-top: 14px; }
.dialog-actions { padding: 16px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: stretch;
}
.login-hero {
  padding: 54px 6vw; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background:
    radial-gradient(760px 420px at 8% 8%, var(--login-hero-glow-a), transparent 60%),
    radial-gradient(820px 520px at 100% 100%, var(--login-hero-glow-b), transparent 55%),
    linear-gradient(150deg, var(--login-hero-1) 0%, var(--login-hero-2) 46%, var(--login-hero-3) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.login-hero::after {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12); right: -130px; top: -120px;
  box-shadow: 0 0 0 60px rgba(255, 255, 255, .035), 0 0 0 130px rgba(255, 255, 255, .022);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-brand .brand-mark { width: 42px; height: 42px; font-size: 19px; background: transparent; box-shadow: 0 2px 12px -4px rgba(0,0,0,.35); }
.login-brand-name { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.login-brand-sub { font-size: 12px; color: rgba(255,255,255,.65); }
.login-hero-main { position: relative; z-index: 1; max-width: 520px; }
.login-hero h1 { font-size: clamp(26px, 3.1vw, 40px); line-height: 1.25; letter-spacing: -.01em; }
.login-hero p { margin-top: 14px; color: rgba(255, 255, 255, .74); font-size: 14px; line-height: 1.8; max-width: 460px; }
.login-points { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.login-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.86); }
.login-point .lp-ico {
  flex: none; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,.12); font-size: 13px;
}
.login-hero-foot { position: relative; z-index: 1; font-size: 11.5px; color: rgba(255,255,255,.45); }
.login-side {
  display: flex; align-items: center; justify-content: center; padding: 40px 5vw;
  background: var(--login-side-bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 30px 30px 26px;
}
.login-card h2 { font-size: 21px; }
.login-card .login-sub { color: var(--text-muted); font-size: 13px; margin-top: 5px; }
.login-form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.demo-box { margin-top: 20px; border-top: 1px dashed var(--border-strong); padding-top: 15px; }
.demo-box-head { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.demo-tenant { margin-bottom: 10px; }
.demo-tenant-name { font-size: 12px; color: var(--text-soft); font-weight: 600; margin-bottom: 5px; }
.demo-accounts { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-account {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.demo-account:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.demo-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }

/* ---------- 赛事列表 ---------- */
.event-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.event-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 19px; box-shadow: var(--shadow-xs); cursor: pointer;
  transition: transform .18s var(--ease-out), box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column; gap: 13px; text-align: left; width: 100%;
  font: inherit; color: inherit;
}
@media (hover: hover) and (pointer: fine) {
  .event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--hover-border); }
}
.event-card:active { transform: scale(.997); }
.event-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.event-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.event-card-name { font-size: 16px; font-weight: 650; line-height: 1.4; }
.event-card-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.event-card-meta b { color: var(--text-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.event-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-faint); }
.event-card .progress { margin-top: 2px; }
.event-card-cta { color: var(--primary); font-weight: 600; font-size: 12.5px; }

/* ---------- 工作台 ---------- */
.workbench-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.workbench-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.workbench-title { font-size: 22px; letter-spacing: -.01em; }
.workbench-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.status-explain { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 规则编排 ---------- */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; position: sticky; top: 76px; }
.section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.section-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--surface); }
.section-title { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.section-num {
  width: 20px; height: 20px; border-radius: 6px; background: var(--primary-soft); color: var(--primary);
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none;
}
.section-hint { font-size: 11.5px; color: var(--text-muted); }
.section-body { padding: 16px 18px; }
.section-body + .section-body { border-top: 1px dashed var(--border); }

.plan-guide {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow-xs);
}
.plan-guide-steps { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 7px; }
.plan-guide-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.plan-guide-step b {
  width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 11px;
}
.plan-guide-arrow { color: var(--text-faint); font-size: 12px; }
.plan-guide p { font-size: 12px; color: var(--text-muted); line-height: 1.65; }
.plan-guide-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.advanced-settings {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  overflow: hidden;
}
.advanced-settings > summary {
  cursor: pointer; list-style: none; padding: 13px 16px; display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap; user-select: none;
}
.advanced-settings > summary::-webkit-details-marker { display: none; }
.advanced-settings > summary:hover { background: var(--surface-2); }
.advanced-title { font-size: 14px; font-weight: 650; }
.advanced-hint { font-size: 11.5px; color: var(--text-muted); flex: 1; min-width: 160px; }
.advanced-toggle::after { content: "展开"; font-size: 11.5px; color: var(--primary); font-weight: 600; }
.advanced-settings[open] .advanced-toggle::after { content: "收起"; }
.advanced-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--border); padding-top: 14px; }

.weight-sum {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650;
  padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.weight-sum.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.weight-sum.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.weight-sum.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }

.criteria-head, .criterion-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(72px, .62fr) minmax(72px, .62fr) 34px;
  gap: 8px; align-items: center;
}
.criteria-head {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted); padding: 0 2px 7px;
  letter-spacing: .02em;
}
.criterion-row { padding: 5px 0; }
.criterion-row .input, .criterion-row .select { min-height: 34px; font-size: 13.5px; }
.criterion-remove {
  border: 1px solid transparent; background: transparent; color: var(--text-faint);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1;
  display: grid; place-items: center; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.criterion-remove:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.criterion-weight, .criterion-max { font-variant-numeric: tabular-nums; }
.code-input { font-family: var(--font-mono); font-size: 12.5px !important; }
.check-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-actions .btn { flex: 1 1 auto; }

.template-select { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.template-select .field { flex: 1 1 220px; }

.version-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: 12.5px; color: var(--text-muted);
}
.version-strip .v-tag { font-weight: 650; color: var(--text-soft); }

/* 校验面板 */
.validation-panel { display: flex; flex-direction: column; gap: 10px; }
.validation-item {
  display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.55;
  padding: 8px 11px; border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--surface-2);
}
.validation-item.err { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-fg-strong); }
.validation-item.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-fg-strong); }
.validation-item.ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok-fg-strong); }
.validation-item .vi-code { font-family: var(--font-mono); font-size: 10.5px; opacity: .7; margin-left: 4px; }
.validation-item .vi-field { font-family: var(--font-mono); font-size: 10.5px; display: block; opacity: .65; }

summary.breakdown-toggle { cursor: pointer; color: var(--primary); font-size: 12.5px; font-weight: 550; list-style: none; }
summary.breakdown-toggle::-webkit-details-marker { display: none; }
summary.breakdown-toggle::before { content: "▸"; display: inline-block; margin-right: 4px; transition: transform .15s ease; }
details[open] > summary.breakdown-toggle::before { transform: rotate(90deg); }
.judge-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.judge-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.judge-chip.trimmed { opacity: .55; text-decoration: line-through; }
.judge-chip.head { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.component-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.component-chip { font-size: 11px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.breakdown-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; }
.breakdown-row + .breakdown-row { margin-top: 8px; }
.breakdown-label { font-size: 11px; color: var(--text-faint); font-weight: 600; letter-spacing: .03em; }

/* ---------- 评分页 ---------- */
.score-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.judge-context {
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); border: 1px solid var(--primary-border);
  border-radius: var(--radius); padding: 13px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.judge-context .jc-main { flex: 1; min-width: 170px; }
.judge-context .jc-name { font-weight: 650; font-size: 14.5px; color: var(--primary); }
.judge-context .jc-sub { font-size: 12px; color: var(--text-muted); }
.contestant-list { display: flex; flex-direction: column; gap: 8px; }
.contestant-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .12s ease;
  text-align: left; width: 100%; font: inherit; color: inherit;
}
.contestant-row:hover { border-color: var(--hover-border); background: var(--surface-2); }
.contestant-row.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(13,148,136,.08); }
.contestant-row.is-submitted .cr-bib { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.cr-bib {
  flex: none; min-width: 48px; text-align: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 3px 7px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border);
}
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cr-name { font-weight: 600; font-size: 14px; }
.cr-sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-state { flex: none; }
.score-panel { display: flex; flex-direction: column; gap: 14px; }
.score-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.score-panel-title { font-size: 17px; font-weight: 680; }
.score-items { display: flex; flex-direction: column; gap: 12px; }
.score-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.score-item-label { flex: 1; min-width: 120px; }
.score-item-name { font-weight: 600; font-size: 13.5px; }
.score-item-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.score-input-wrap { display: flex; align-items: center; gap: 6px; flex: none; }
.score-input {
  width: 84px; text-align: center; font-size: 20px; font-weight: 650; min-height: 46px;
  font-variant-numeric: tabular-nums; border-radius: 10px; padding: 4px 6px;
}
.step-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-soft); font-size: var(--base-font-size); font-weight: 600; cursor: pointer; display: grid; place-items: center;
  transition: background .13s ease, border-color .13s ease, transform .13s var(--ease-out); user-select: none; -webkit-tap-highlight-color: transparent;
}
.step-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.step-btn:active { transform: scale(.94); }
.score-submit-bar {
  position: sticky; bottom: 12px; background: var(--sticky-surface); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.score-total { font-variant-numeric: tabular-nums; }
.score-total b { font-size: 18px; }
.progress-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.progress-strip .progress { flex: 1; min-width: 120px; }
.judge-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.judge-pick .select { width: auto; min-width: 170px; }

/* ---------- 投票页 ---------- */
.vote-layout { display: flex; flex-direction: column; gap: 16px; }
.voter-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.voter-bar .field { flex: 1 1 240px; }
.vote-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); margin-left: auto; }
.vote-stats b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.vote-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.vote-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; display: flex; flex-direction: column; gap: 11px;
  box-shadow: var(--shadow-xs); transition: border-color .15s ease, box-shadow .15s ease;
}
.vote-card:hover { border-color: var(--hover-border); box-shadow: var(--shadow-sm); }
.vote-card-top { display: flex; align-items: center; gap: 9px; }
.vote-card .cr-bib { min-width: 42px; }
.vote-card-name { font-weight: 650; font-size: var(--base-font-size); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-count-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.vote-count { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.vote-count small { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 3px; letter-spacing: 0; }
.vote-bar { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.vote-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .4s ease; }

/* ---------- 结果与审计 ---------- */
.results-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result-summary {
  display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted);
  padding: 13px 16px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.result-summary b { color: var(--text); font-weight: 650; }
.hash {
  font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-3); color: var(--text-soft);
  padding: 1.5px 6px; border-radius: 5px; border: 1px solid var(--border); word-break: break-all;
}
.hash-chain { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-faint); }
.audit-list { display: flex; flex-direction: column; gap: 9px; }
.audit-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--surface);
  display: flex; flex-direction: column; gap: 7px;
}
.audit-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13px; }
.audit-action { font-weight: 650; color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.audit-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.audit-payload summary { font-size: 11.5px; color: var(--text-muted); cursor: pointer; }
.audit-payload pre {
  margin: 7px 0 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-soft);
  overflow-x: auto; max-height: 220px;
}
.hash-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--text-faint); }

/* ---------- 大屏入口 ---------- */
.screen-link-box { display: flex; flex-direction: column; gap: 12px; }
.url-box {
  display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; font-family: var(--font-mono); font-size: 12px;
  color: var(--text-soft); overflow-x: auto; white-space: nowrap;
}
.screen-tips { font-size: 12.5px; color: var(--text-muted); line-height: 1.7; }

/* ---------- 排序评审页 ---------- */
.ranking-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ranking-side { display: flex; flex-direction: column; min-width: 0; }
.ranking-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ranking-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s ease, background .15s ease;
}
.ranking-row:hover { border-color: var(--hover-border); background: var(--surface-2); }
.ranking-pos {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border);
}
.ranking-list > .ranking-row:first-child .ranking-pos {
  background: linear-gradient(145deg, #fbbf24, #d97706); color: #fff; border-color: transparent;
}
.ranking-list > .ranking-row:nth-child(2) .ranking-pos { background: var(--surface-3); color: var(--text-soft); }
.ranking-row .cr-main { flex: 1; min-width: 0; }
.ranking-move { display: flex; gap: 6px; flex: none; }
.judge-ranking-list { display: flex; flex-direction: column; gap: 10px; }
.judge-ranking-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface);
}
.judge-ranking-item.is-missing { border-style: dashed; background: var(--surface-2); }
.order-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.order-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.order-chip.is-first { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); font-weight: 600; }

/* ---------- 作品评审页 ---------- */
.works-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.work-list { display: flex; flex-direction: column; gap: 8px; }
.work-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.work-row:hover { border-color: var(--hover-border); background: var(--surface-2); }
.work-row.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(13, 148, 136, .08); }
.work-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.work-row .cr-main { flex: 1; min-width: 0; }
.work-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.work-row-actions { display: flex; gap: 4px; flex: none; }
.work-row-actions .btn { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.work-row-link {
  flex: none; font-size: 11.5px; color: var(--primary); background: var(--primary-soft);
  border: 1px solid var(--primary-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.work-row-link:hover { text-decoration: none; background: var(--primary-soft); }
.work-meta {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.work-link { font-size: 12.5px; font-weight: 550; word-break: break-all; }
.work-desc { margin: 0; font-size: 12.5px; color: var(--text-muted); white-space: pre-wrap; }

/* ---------- 系列 / 轮次 ---------- */
.event-card-series {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-muted); min-width: 0;
}
.event-card-series-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 550; color: var(--text-soft);
}
.round-switcher {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.round-switcher-label {
  flex: none; font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: .02em;
}
.round-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  font-size: 12.5px; font-family: inherit; transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.round-chip:hover { border-color: var(--hover-border); background: var(--surface-3); }
.round-chip.is-current {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
  font-weight: 600; box-shadow: 0 0 0 3px rgba(18, 60, 105, .08);
}
.round-chip-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.round-chip .badge { padding: 1.5px 7px; font-size: 10.5px; }

/* ---------- CSV 导入 ---------- */
.csv-import .csv-file-input { display: none; }
label.btn { cursor: pointer; }
.csv-textarea {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  min-height: 132px; white-space: pre; overflow: auto;
}
.csv-error-list {
  max-height: 240px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.csv-error-list .table { font-size: 12.5px; }
.csv-error-list .table th { position: sticky; top: 0; z-index: 1; }
.csv-error-list .table th, .csv-error-list .table td { padding: 7px 10px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr); }
  .plan-side { position: static; }
  .score-layout { grid-template-columns: minmax(0, 1fr); }
  .ranking-layout { grid-template-columns: minmax(0, 1fr); }
  .works-layout { grid-template-columns: minmax(0, 1fr); }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 34px 7vw 30px; gap: 22px; }
  .login-hero h1 { font-size: 26px; }
  .login-hero p { font-size: 13px; }
  .login-points { margin-top: 16px; gap: 9px; }
  .login-hero-foot { display: none; }
  .login-side { padding: 26px 5vw 54px; background: transparent; }
}
@media (max-width: 760px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; scroll-snap-type: none; }
  .tab { flex: 1 1 auto; justify-content: center; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 13px 14px; }
  .stat-value { font-size: 22px; }
  body { font-size: 14.5px; }
  .container { padding: 18px 14px 90px; }
  .topbar-inner { padding: 9px 14px; gap: 10px; }
  .brand-sub { display: none; }
  .tenant-chip { max-width: 100%; order: 5; flex-basis: 100%; }
  .topbar-spacer { flex: 1; }
  .page-title { font-size: 21px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .card-header { padding: 14px 16px; }
  .card-body { padding: 15px 16px; }
  .card-footer { padding: 12px 16px; }
  .event-grid { grid-template-columns: minmax(0, 1fr); }
  .criteria-head { display: none; }
  .criterion-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
    grid-template-areas: "name name remove" "code code remove" "weight max remove";
    gap: 7px; padding: 10px 0; border-bottom: 1px dashed var(--border);
  }
  .criterion-row:last-child { border-bottom: 0; }
  .criterion-row .cr-name { grid-area: name; }
  .criterion-row .cr-code { grid-area: code; }
  .criterion-row .cr-weight { grid-area: weight; }
  .criterion-row .cr-max { grid-area: max; }
  .criterion-row .criterion-remove { grid-area: remove; align-self: start; }
  .plan-actions .btn { flex: 1 1 45%; }
  .dialog { max-width: 100%; border-radius: var(--radius); }
  .modal-backdrop { padding: 12px; }
  .dialog-head { padding: 16px 18px 10px; }
  .dialog-body { padding: 0 18px 4px; }
  .dialog-actions { padding: 14px 18px 16px; }
  .dialog-actions .btn { flex: 1 1 40%; }
  .toast-root { bottom: 14px; right: 10px; left: 10px; max-width: none; }
  .score-input { width: 72px; font-size: 18px; min-height: 44px; }
  .step-btn { width: 40px; height: 40px; }
  .ranking-row { padding: 9px 10px; gap: 9px; }
  .ranking-pos { width: 28px; height: 28px; font-size: 13px; }
  .ranking-move .step-btn { width: 44px; height: 44px; font-size: 18px; }
  .work-row { flex-wrap: wrap; padding: 10px 11px; gap: 8px; }
  .work-badges { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .work-row-actions { width: 100%; justify-content: flex-end; }
  .score-submit-bar { position: sticky; bottom: 0; border-radius: 12px 12px 0 0; padding: 12px; }
  .score-submit-bar .btn { flex: 1; }
  .voter-bar { flex-direction: column; align-items: stretch; }
  .vote-stats { margin-left: 0; }
  .vote-grid { grid-template-columns: minmax(0, 1fr); }
  .template-select .field { flex-basis: 100%; }
  .results-toolbar .btn { flex: 1 1 40%; }
  .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-step-text small { white-space: normal; }
  .review-bar { flex-direction: column; align-items: stretch; gap: 9px; }
  .review-tabs { width: 100%; }
  .review-tab { flex: 1 1 auto; justify-content: center; }
  .workbench-title { font-size: 19px; }
  .round-switcher { padding: 7px 8px; gap: 6px; }
  .round-switcher-label { max-width: 130px; }
  .round-chip { padding: 5px 9px; font-size: 12px; }
  .csv-textarea { font-size: 12px; min-height: 110px; }
  .csv-error-list { max-height: 180px; }
  .page-actions .btn { flex: 1 1 auto; }
}
@media (pointer: coarse) {
  .btn-sm { min-height: 40px; padding: 8px 12px; }
  .tab { min-height: 42px; }
  .dialog-close, .toast-close { min-width: 36px; min-height: 36px; }
}
@media (max-width: 640px) {
  /* iOS zooms focused inputs below 16px; keep the layout stable on phones. */
  .input, .select, .textarea { font-size: 16px; }
  .btn { min-height: 42px; }
}
.dialog-close:focus-visible, .toast-close:focus-visible, .back-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
