/* ====================================================
   台球比赛系统 · 现代化 Fluent Design 极简高质感样式
==================================================== */
:root {
  --primary: #4353c8;
  --primary-hover: #3442a8;
  --bg: #f8fafc;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --ink: #0f172a;
  --ink2: #475569;
  --ink3: #94a3b8;
  --gold: #d4a843;
  --green: #10b981;
  --red: #ef4444;
  --radius-card: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  height: 100vh;
  user-select: none;
}

/* ── 左右分栏主框架 ─────────────────────────────────── */
.fluent-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ── 左侧边栏 (Macaron 侧边导航) ─────────────────────── */
.fluent-sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex: none;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex: none;
  box-shadow: 0 4px 12px rgba(67, 83, 200, 0.28);
}
.brand-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-text b {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text small {
  font-size: 10.5px;
  color: var(--ink3);
  margin-top: 2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 当前选中的赛事工作空间徽章 */
.current-act-badge {
  background: #f8fafc;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.current-act-badge:hover { background: #e0e5ff; border-color: rgba(67,83,200,0.3); }
.current-act-badge small { display: block; font-size: 10px; color: var(--primary); font-weight: 700; letter-spacing: 0.5px; }
.current-act-badge b { display: block; font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nav-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink2);
  cursor: pointer;
  font-weight: 500;
  transition: all .18s;
}
.nav-menu li svg { width: 16px; height: 16px; color: var(--ink3); flex: none; }
.nav-menu li:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.nav-menu li.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(67, 83, 200, 0.28);
}
.nav-menu li.active svg { color: #fff; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink3);
}

/* ── 右侧主工作区 (SPA 内容容器) ─────────────────────── */
.fluent-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  background: #f8fafc;
}

.top-bar {
  min-height: 54px;
  height: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  flex: none;
  position: relative;
  z-index: 50;
  gap: 12px;
}
.top-title { font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex: none; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 51; }
.page-action-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: relative; z-index: 52; }

.content-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* SPA 视图容器 */
.view-pane { display: none; }
.view-pane.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── 现代马卡龙卡片网格 (活动列表) ─────────────────────── */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.act-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-card);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 6px 18px rgba(0,0,0,0.02);
  cursor: pointer;
  transition: all .22s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}
.act-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(40,50,90,0.09);
  border-color: rgba(67,83,200,0.25);
}
.act-card.current {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.act-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.act-icon-tile {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.act-title-box { min-width: 0; flex: 1; }
.act-title-box h3 { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-title-box p { font-size: 11px; color: var(--ink3); margin-top: 2px; }

.act-status-pill {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px;
}
.status-draft { background: #f1f5f9; color: #64748b; }
.status-signup { background: #dbeafe; color: #1e40af; }
.status-in_progress { background: #d1fae5; color: #065f46; }
.status-ended { background: #fee2e2; color: #991b1b; }

.act-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--ink2);
}

/* ── 选手库标准扑克牌黄金比例卡片 (高大于宽 1:1.38 舒适尺寸) ── */
.players-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 14px;
}

.poker-card {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  padding: 10px 8px;
  height: 195px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
  user-select: none;
}
.poker-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(67,83,200,0.12);
}

.poker-corner {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 12px; font-weight: 900;
  line-height: 1.1;
  display: flex; flex-direction: column; align-items: center;
}
.poker-corner.red { color: #dc2626; }
.poker-corner.black { color: #0f172a; }

.poker-index {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 10.5px; font-weight: 800; color: var(--ink3);
}

.poker-avatar-wrap {
  margin-top: 14px;
  width: 48px; height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.poker-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.poker-avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.poker-name {
  font-size: 13px; font-weight: 800; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; text-align: center; margin-top: 2px;
}

.poker-phone {
  font-size: 10px; color: var(--ink3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; text-align: center; margin-top: -2px;
}

.poker-card-badge {
  font-size: 10.5px; font-weight: 800;
  padding: 2px 8px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.poker-card-badge.red { color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; }
.poker-card-badge.black { color: #0f172a; background: #f1f5f9; border: 1px solid var(--border); }
.poker-card-badge.empty { color: var(--ink3); background: #f8fafc; border: 1px solid var(--border); }

.poker-actions {
  display: flex; gap: 4px; width: 100%; justify-content: center;
}
.btn-poker-mini {
  padding: 3px 8px; font-size: 10.5px; font-weight: 700;
  border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--ink2); cursor: pointer;
  transition: all .15s;
}
.btn-poker-mini:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.stepper-btn {
  width: 24px; height: 24px; border-radius: 4px;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 900; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  transition: all 0.15s;
}
.stepper-btn:hover { background: #f1f5f9; border-color: var(--primary); color: var(--primary); }

.btn-poker-micro {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; background: #fff; border: 1px solid var(--border);
  color: var(--ink2); cursor: pointer; transition: all 0.15s;
}
.btn-poker-micro:hover { background: #f1f5f9; color: var(--ink); border-color: var(--primary); }
.btn-poker-micro.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 按钮与表单 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all .15s; font-family: var(--font);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(67,83,200,0.25); }
.btn-default { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-default:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.btn-danger:hover { background: #fecaca; }

/* 模态弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .15s ease; }
.modal-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  padding: 22px 24px; position: relative;
}

/* ── 大屏视觉与播控中心横向 Tab 样式 ── */
.studio-tab-btn {
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  color: var(--ink2); background: transparent; border: none;
  border-bottom: 2.5px solid transparent; cursor: pointer;
  border-radius: 8px 8px 0 0; transition: all .15s ease;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.studio-tab-btn:hover {
  color: var(--primary); background: rgba(79, 70, 229, 0.05);
}
.studio-tab-btn.active {
  color: var(--primary); border-bottom-color: var(--primary);
  background: rgba(79, 70, 229, 0.08); font-weight: 800;
}
.studio-tab-pane {
  animation: fadeIn .15s ease;
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.modal-close { cursor: pointer; color: var(--ink3); font-size: 18px; border: none; background: none; }
.modal-close:hover { color: var(--ink); }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 10px; font-size: 12.5px; font-family: var(--font);
  border: 1px solid var(--border); border-radius: 6px; outline: none; transition: all .15s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,83,200,0.12);
}

/* ── 全局精致极细滚动条 (统一后台与各端质感) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.75);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

/* ── 🎯 比赛对战执裁与选手微调精致卡片样式 ── */
.referee-slot-box {
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.2s ease;
}
.referee-slot-box.blue {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.8), rgba(248, 250, 252, 0.95));
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.04);
}
.referee-slot-box.red {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.8), rgba(248, 250, 252, 0.95));
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.04);
}
.referee-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.referee-slot-badge {
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.referee-slot-badge.blue { color: #4338ca; }
.referee-slot-badge.red { color: #b91c1c; }

.referee-tag-btn {
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.referee-tag-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}
.referee-tag-btn.danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.referee-input-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.referee-name-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: all 0.15s ease;
}
.referee-name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 83, 200, 0.15);
}

.referee-select-dropdown {
  width: 100%;
  padding: 7px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.referee-select-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 83, 200, 0.15);
}

/* 🎴 选手卡牌高亮色标与快捷候选人芯片 */
.referee-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.referee-card-pill.red {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}
.referee-card-pill.black {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.referee-card-pill.joker {
  background: #fefce8;
  color: #854d0e;
  border-color: #fde047;
}

.referee-candidate-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  transition: all 0.15s ease;
}
.referee-candidate-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}
.referee-candidate-chip.red {
  border-color: #fca5a5;
  background: #fff5f5;
  color: #b91c1c;
}
.referee-candidate-chip.red:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.referee-candidate-chip.black {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
}
.referee-candidate-chip.black:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}
.referee-candidate-chip.joker {
  border-color: #fde047;
  background: #fefce8;
  color: #854d0e;
}
.referee-candidate-chip.joker:hover {
  background: #eab308;
  color: #ffffff;
  border-color: #eab308;
}

/* ── 🎴 Fluent 自定义彩色选手下拉选择器 ── */
.custom-referee-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  padding: 6.5px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.custom-select-trigger:hover {
  border-color: var(--primary);
  background: #f8fafc;
}
.custom-referee-select.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 83, 200, 0.15);
}
.custom-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.custom-select-arrow {
  font-size: 11px;
  color: #64748b;
  margin-left: 6px;
  transition: transform 0.2s ease;
}
.custom-referee-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: max(100%, 380px);
  max-width: 480px;
  max-height: 310px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.25);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: customDropFade 0.15s ease;
}
@media (max-width: 520px) {
  .custom-select-menu {
    width: 92vw;
    right: -10px;
  }
}
@keyframes customDropFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-select-search-box {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.custom-select-search-box input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
}
.custom-select-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 83, 200, 0.12);
}

.custom-select-list {
  overflow-y: auto;
  max-height: 240px;
  padding: 4px 0;
}

.custom-optgroup-header {
  padding: 6px 10px 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.custom-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6.5px 10px;
  cursor: pointer;
  transition: all 0.12s ease;
  font-size: 12px;
  border-bottom: 1px solid #f8fafc;
}
.custom-option-item:hover {
  background: #f1f5f9;
}
.custom-option-item.smart-item {
  background: rgba(238, 242, 255, 0.4);
}
.custom-option-item.smart-item:hover {
  background: #e0e7ff;
}
.custom-opt-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.custom-opt-name {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.custom-opt-phone {
  font-size: 10px;
  color: #64748b;
  font-family: monospace;
  white-space: nowrap;
}
.custom-opt-role {
  font-size: 10px;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  padding: 1.5px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.custom-opt-seed {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* 卡牌标签纯 CSS 颜色渲染 */
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.card-badge.red {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
}
.card-badge.black {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}
.card-badge.joker {
  background: #fef08a !important;
  color: #854d0e !important;
  border: 1px solid #facc15 !important;
}
.card-badge.none {
  background: #f8fafc !important;
  color: #94a3b8 !important;
  border: 1px solid #e2e8f0 !important;
}

.referee-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.referee-score-stepper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.referee-score-stepper button {
  border: none;
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: background 0.15s;
}
.referee-score-stepper button:hover {
  background: #e2e8f0;
}
.referee-score-input {
  width: 48px;
  height: 28px;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  border: none;
  outline: none;
}

/* 全屏安全 Toast 悬浮轻提示 */
.app-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.92); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 18px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35); z-index: 9999;
  opacity: 0; pointer-events: none; transition: all 0.25s ease-out;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 🎴 扑克牌抽签与算法配对工作台专用样式 ── */
.poker-mode-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; transition: all 0.2s; display: block;
}
.poker-mode-card:hover {
  border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.poker-mode-card.active {
  border-color: var(--primary); background: #f0fdf4; box-shadow: 0 0 0 1px var(--primary);
}
.badge-mini-gold {
  font-size: 9px; padding: 1.5px 5px; border-radius: 4px; background: #fef3c7; color: #92400e; font-weight: 800;
}
.badge-mini-blue {
  font-size: 9px; padding: 1.5px 5px; border-radius: 4px; background: #e0f2fe; color: #0369a1; font-weight: 800;
}
.badge-mini-gray {
  font-size: 9px; padding: 1.5px 5px; border-radius: 4px; background: #f1f5f9; color: #475569; font-weight: 800;
}
.badge-status-match {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0;
}
.badge-status-bye {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
}
.badge-status-conflict {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
}
.badge-status-pending {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0;
}

/* ── 执裁台轮空与弃权不可编辑胶囊样式 ── */
.referee-bye-capsule {
  display: flex; align-items: center; justify-content: space-between;
  background: #eff6ff; border: 1.5px dashed #60a5fa; border-radius: 8px;
  padding: 6px 10px; font-size: 12px; font-weight: 800; color: #1d4ed8;
  user-select: none;
}
.referee-bye-capsule .btn-undo-bye {
  background: #fff; border: 1px solid #93c5fd; border-radius: 4px;
  color: #2563eb; font-size: 10.5px; padding: 2px 6px; cursor: pointer;
  transition: all 0.15s; font-weight: 700;
}
.referee-bye-capsule .btn-undo-bye:hover {
  background: #2563eb; color: #fff; border-color: #2563eb;
}

.referee-forfeit-capsule {
  display: flex; align-items: center; justify-content: space-between;
  background: #fef2f2; border: 1.5px dashed #f87171; border-radius: 8px;
  padding: 6px 10px; font-size: 12px; font-weight: 800; color: #b91c1c;
  user-select: none;
}
.referee-forfeit-capsule .btn-undo-forfeit {
  background: #fff; border: 1px solid #fca5a5; border-radius: 4px;
  color: #dc2626; font-size: 10.5px; padding: 2px 6px; cursor: pointer;
  transition: all 0.15s; font-weight: 700;
}
.referee-forfeit-capsule .btn-undo-forfeit:hover {
  background: #dc2626; color: #fff; border-color: #dc2626;
}

/* ── 牌池勾选与点数按钮样式 ── */
.poker-suit-btn {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 11.5px; font-weight: 800; cursor: pointer;
  transition: all 0.15s; user-select: none; text-align: center;
}
.poker-suit-btn:hover {
  border-color: var(--primary); transform: translateY(-1px);
}
.poker-suit-btn.active {
  border-color: var(--primary); background: #f0fdf4; box-shadow: 0 0 0 1px var(--primary);
}

.poker-rank-btn {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1.2px solid var(--border); border-radius: 6px;
  padding: 8px 2px; font-size: 11.5px; font-weight: 900; color: var(--ink);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.poker-rank-btn:hover {
  border-color: var(--primary);
}
.poker-rank-btn.active {
  border-color: var(--primary); background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

/* ── 选手库三合一视图切换胶囊 ── */
.btn-view-toggle {
  background: transparent; border: none; padding: 4px 8px; font-size: 11px;
  font-weight: 700; color: var(--ink2); border-radius: 4px; cursor: pointer;
  transition: all 0.15s;
}
.btn-view-toggle:hover {
  color: var(--ink);
}
.btn-view-toggle.active {
  background: #fff; color: var(--primary); font-weight: 900;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── 配对分组圆角卡片 ── */
.pairing-group-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.pairing-group-card:hover {
  border-color: var(--primary); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(39, 174, 96, 0.12);
}
.pairing-group-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary);
}
.pairing-group-card.bye::before {
  background: #2563eb;
}
.pairing-player-side {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
}
.pairing-vs-divider {
  flex: none; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 0 10px;
}

/* ── 🧮 赛事编排与时间推算计算器专用样式 ── */
.planner-container {
  display: flex; flex-direction: column; gap: 16px;
}
.planner-presets-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f8fafc;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
}
.preset-pill-btn {
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px; font-size: 11.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: all 0.2s ease;
}
.preset-pill-btn:hover {
  border-color: var(--primary); color: var(--primary); background: #f0fdf4;
}

.planner-grid-2col {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
}
@media (max-width: 900px) {
  .planner-grid-2col { grid-template-columns: 1fr; }
}

.planner-card-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.planner-plan-card {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: #fff; position: relative; margin-bottom: 12px;
  transition: all 0.2s ease;
}
.planner-plan-card.recommended {
  border-color: #3b82f6; background: #f8faff; box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}
.plan-badge-rec {
  display: inline-block; font-size: 10.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6); padding: 2px 8px; border-radius: 12px;
}
.plan-badge-sub {
  display: inline-block; font-size: 10.5px; font-weight: 700; color: #475569;
  background: #e2e8f0; padding: 2px 8px; border-radius: 12px;
}

.workload-stat-box {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.w-label { font-size: 11px; font-weight: 700; color: var(--ink2); }
.w-val { font-size: 18px; font-weight: 900; }
.w-sub { font-size: 10.5px; color: var(--ink3); }

.planner-glossary-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.planner-glossary-table th {
  background: #f8fafc; color: var(--ink2); font-weight: 700; padding: 8px 10px;
  text-align: left; border-bottom: 1px solid var(--border); font-size: 11.5px;
}
.planner-glossary-table td {
  padding: 8px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top;
}

.planner-timeline-list {
  display: flex; flex-direction: column; gap: 8px;
}
.planner-timeline-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px;
  background: #f8fafc; border-radius: 8px; border-left: 3.5px solid #3b82f6;
}
.t-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 800; color: #1e40af;
  background: #dbeafe; padding: 3px 8px; border-radius: 6px;
}
.t-content { flex: 1; font-size: 12px; }
