:root {
  --brand: #2b5cff;
  --brand-dark: #1b3fc4;
  --brand-soft: #eef2ff;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #f04438;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 12px 32px rgba(16, 24, 40, .10);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

button, input, select { font-family: inherit; }

/* ============ 登录页 ============ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  padding: 56px 60px;
  color: #fff;
  background: linear-gradient(150deg, #16307a 0%, #2747d8 52%, #3f7bff 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
}
.brand-panel::before { width: 520px; height: 520px; right: -170px; top: -140px; }
.brand-panel::after { width: 760px; height: 760px; right: -290px; top: -260px; }

.brand-mark { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px; letter-spacing: .5px;
}
.brand-name { font-size: 20px; font-weight: 600; letter-spacing: 1px; }
.brand-sub { font-size: 12px; opacity: .72; letter-spacing: 2px; margin-top: 2px; }

.brand-copy { position: relative; z-index: 1; max-width: 460px; }
.brand-copy h1 {
  font-size: 34px; line-height: 1.35; margin: 0 0 18px; font-weight: 600;
}
.brand-copy h1 em { font-style: normal; color: #ffd479; }
.brand-copy p { margin: 0 0 28px; font-size: 14px; line-height: 1.9; color: rgba(255, 255, 255, .78); }

.brand-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.brand-points li { display: flex; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .9); }
.brand-points .dot {
  flex: 0 0 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, .18); display: grid; place-items: center;
  font-size: 11px; margin-top: 1px;
}

.brand-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, .55); }

.form-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background:
    radial-gradient(900px 380px at 100% 0%, #e9eeff 0%, rgba(233, 238, 255, 0) 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 30px 26px;
}

.auth-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.auth-card .sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #f2f4f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}
.tabs button {
  border: 0; background: transparent; padding: 9px 0; border-radius: 8px;
  font-size: 13.5px; color: var(--muted); cursor: pointer; transition: all .16s;
}
.tabs button.active {
  background: #fff; color: var(--ink); font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 7px; font-weight: 500;
}
.field .input-wrap { position: relative; display: flex; align-items: center; }
.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  background: #fcfcfe;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: #a5adbd; }
.field input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 92, 255, .12);
}
.field input.is-error { border-color: var(--danger); }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.field .toggle-pwd {
  position: absolute; right: 8px; border: 0; background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer; padding: 6px 8px;
}

.btn-primary {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #3f7bff 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(43, 92, 255, .26);
  transition: transform .06s, box-shadow .16s, opacity .16s;
}
.btn-primary:hover { box-shadow: 0 10px 22px rgba(43, 92, 255, .32); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

.form-msg {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.55;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.form-msg.ok { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }

/* ============ 后台框架 ============ */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: #f7f9fd;
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .brand-mark { padding: 4px 8px 18px; }
.sidebar .brand-logo {
  width: 34px; height: 34px; border-radius: 9px; font-size: 14px;
  background: var(--brand); border: none; color: #fff;
  box-shadow: 0 4px 10px rgba(43, 92, 255, .28);
}
.sidebar .brand-name { font-size: 15px; color: var(--ink); }
.sidebar .brand-sub { font-size: 10px; letter-spacing: 1px; opacity: 1; color: var(--muted); }

.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; color: var(--ink-2); cursor: default; user-select: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #eef2fb; color: var(--brand-dark); }
.nav-item.active { position: relative; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 999px; background: var(--brand);
}
.nav-item .soon {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: #e8ecf6; color: var(--muted);
}
.nav-group-title {
  font-size: 11px; letter-spacing: 1px; color: #98a2b8;
  padding: 16px 12px 6px;
}
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 11px; color: #98a2b8; }

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar .page-title { font-size: 15px; font-weight: 600; }
.topbar .page-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.user-meta { font-size: 12.5px; line-height: 1.35; }
.user-meta .name { font-weight: 600; }
.user-meta .role { color: var(--muted); font-size: 11.5px; }

.btn-ghost {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 7px 13px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
}
.btn-ghost:hover { border-color: #c9d2e6; background: #fafbff; }

.content { padding: 22px 24px 36px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
/* 卡片内容兜底内边距：卡片直接子元素统一留出左右空间，防止文字贴边。
   全宽形态（表格、通栏横幅、空状态）排除，由自身样式控制。
   按钮不适用内容 padding（width:100% 的按钮会贴满卡片边缘），改用外边距缩进。 */
.card > *:not(.card-head):not(.card-body):not(.table-wrap):not(.empty-state):not(.issue-banner):not(table):not(button) {
  padding-left: 18px;
  padding-right: 18px;
}
.card > .card-head + .table-wrap { padding-left: 18px; padding-right: 18px; }
/* 卡片直接子按钮：两侧留出与内容一致的间距，全宽按钮不再贴边 */
.card > button { margin-left: 18px; }
.card > .btn-block { width: calc(100% - 36px); }
/* 卡片最后一个内容子元素统一留出底部间距，防止按钮/表格贴近底边 */
.card > *:not(.card-head):not(.table-wrap):not(.empty-state):not(.issue-banner):not(table):last-child {
  margin-bottom: 18px;
}
.card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .desc, .card-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 18px; }

.hero {
  background: linear-gradient(120deg, #16307a 0%, #2747d8 60%, #4a7dff 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 26px;
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
  box-shadow: 0 14px 30px rgba(22, 48, 122, .22);
}
.hero h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.hero p { margin: 0; font-size: 13px; color: rgba(255,255,255,.78); line-height: 1.75; max-width: 620px; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap;
}

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: .5px; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.steps li:last-child { border-bottom: 0; }
.step-no {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; background: #f2f4f9; color: var(--muted);
}
.step-main { font-size: 13px; }
.step-main .t { font-weight: 500; }
.step-main .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #f2f4f9; color: var(--muted); white-space: nowrap;
}
.badge.doing { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.badge.done { background: #ecfdf3; color: #067647; }
.steps li.current .step-no { background: var(--brand); color: #fff; }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 10px 14px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink-2); word-break: break-all; }

.empty-note {
  font-size: 12.5px; color: var(--muted); line-height: 1.8;
  background: #fafbff; border: 1px dashed var(--line);
  border-radius: 10px; padding: 14px 16px;
}
.tag-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  background: #f2f4f9; color: var(--ink-2);
}

@media (max-width: 1080px) {
  .auth-page { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; padding: 10px; }
  .sidebar .brand-mark, .sidebar .nav-group-title, .sidebar-foot { display: none; }
  .nav-item { white-space: nowrap; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ============ 数据表格 ============ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

.seg { display: inline-flex; background: #eef1f7; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.seg button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.search-box { position: relative; }
.search-box input {
  height: 36px; width: 220px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 13px; outline: none; background: #fff;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,92,255,.1); }

.btn-primary-sm {
  height: 36px; padding: 0 16px; border: 0; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer;
  box-shadow: 0 6px 14px rgba(43,92,255,.22);
}
.btn-primary-sm:hover { background: var(--brand-dark); }
.btn-primary-sm:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 10px 14px; background: #fafbfe; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid #f1f4f9; color: var(--ink-2); vertical-align: middle; }
table.data tbody tr:hover td { background: #fafcff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .strong { color: var(--ink); font-weight: 600; }
table.data .muted { color: var(--muted); font-size: 12px; }
table.data .link { color: var(--brand); cursor: pointer; font-size: 12.5px; }
table.data .link.danger { color: var(--danger); }
table.data .code {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: #f2f4f9; padding: 2px 7px; border-radius: 5px; color: #1b3fc4;
}

.badge.pill-registering { background: #eef2ff; color: #1b3fc4; }
.badge.pill-ongoing { background: #ecfdf3; color: #067647; }
.badge.pill-finished { background: #f2f4f9; color: #667085; }
.badge.role-admin { background: #eef2ff; color: #1b3fc4; }
.badge.role-score_clerk { background: #fff7e6; color: #b54708; }
.badge.role-judge { background: #f4f3ff; color: #5925dc; }

.empty-state { text-align: center; padding: 54px 20px; }
.empty-state .icon {
  width: 52px; height: 52px; border-radius: 14px; background: #eef2ff; color: var(--brand-dark);
  display: grid; place-items: center; font-size: 22px; margin: 0 auto 14px;
}
.empty-state h4 { margin: 0 0 6px; font-size: 14.5px; }
.empty-state p { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: grid; place-items: center; padding: 24px; z-index: 60;
  backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 560px; background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16,24,40,.24); max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-close { border: 0; background: transparent; font-size: 20px; line-height: 1; color: #98a2b3; cursor: pointer; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row .field { margin-bottom: 14px; }
.field textarea {
  width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 13.5px; color: var(--ink); outline: none; resize: vertical;
  background: #fcfcfe; font-family: inherit; line-height: 1.7;
}
.field textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(43,92,255,.12); }
.field select {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fcfcfe; color: var(--ink); outline: none;
}
.field input:disabled, .field textarea:disabled, .field select:disabled {
  background: #f7f8fb; color: #667085; cursor: not-allowed;
}

/* ============ 详情页 ============ */
.detail-head {
  background: linear-gradient(120deg, #16307a 0%, #2747d8 62%, #4a7dff 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
}
.detail-head h2 { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.detail-head .meta { font-size: 12.5px; color: rgba(255,255,255,.8); display: flex; flex-wrap: wrap; gap: 16px; }
.detail-head .code-chip {
  font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24);
  padding: 4px 10px; border-radius: 7px; font-size: 12px;
}

.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 0; padding: 0 6px; }
.tabs-line button {
  border: 0; background: transparent; padding: 12px 16px; font-size: 13.5px; color: var(--muted);
  cursor: pointer; position: relative;
}
.tabs-line button.active { color: var(--brand-dark); font-weight: 600; }
.tabs-line button.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--brand); border-radius: 2px;
}

.qr-panel { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }
.qr-frame {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff;
  text-align: center;
}
.qr-frame img { width: 100%; display: block; border-radius: 8px; }
.qr-frame .cap { margin-top: 10px; font-size: 12px; color: var(--muted); }
.qr-info h4 { margin: 0 0 8px; font-size: 14px; }
.qr-info p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); line-height: 1.85; }
.url-box {
  display: flex; align-items: center; gap: 8px; background: #f7f9fc; border: 1px dashed var(--line);
  border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px; color: #1b3fc4; word-break: break-all; margin-bottom: 14px;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-outline {
  height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink-2); font-size: 12.5px; cursor: pointer;
}
.btn-outline:hover { border-color: #c9d2e6; background: #fafbff; }

.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: #101828; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 12px 30px rgba(16,24,40,.28); z-index: 90;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b42318; }

@media (max-width: 900px) {
  .qr-panel { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============ 队伍管理 ============ */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-row .stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-row .stat.hl { background: linear-gradient(120deg, #16307a 0%, #2747d8 100%); border: 0; color: #fff; }
.stat-row .stat.hl .label { color: rgba(255,255,255,.72); }
.stat-row .stat.hl .value small { color: rgba(255,255,255,.6); }

.event-pick { display: flex; align-items: center; gap: 10px; }
.event-pick label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.select-sm {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; color: var(--ink); background: #fff; outline: none; max-width: 280px;
}
.select-sm:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,92,255,.1); }

.badge.pill-draft { background: #f2f4f9; color: #667085; }
.badge.pill-pending { background: #fff7e6; color: #b54708; }
.badge.pill-approved { background: #ecfdf3; color: #067647; }
.badge.pill-rejected { background: #fef3f2; color: #b42318; }

.team-cell { display: flex; align-items: center; gap: 10px; }
.team-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 70;
  display: flex; justify-content: flex-end;
}
.drawer {
  width: 100%; max-width: 560px; background: #fff; height: 100%;
  display: flex; flex-direction: column; box-shadow: -18px 0 50px rgba(16,24,40,.2);
  animation: drawer-in .22s ease-out;
}
@keyframes drawer-in { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head {
  padding: 20px 22px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-head h3 { margin: 0 0 6px; font-size: 17px; }
.drawer-head .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drawer-body { padding: 18px 22px 28px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }

.section-title {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 0; }
.section-title .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }

.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.role-box { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: #fcfcfe; }
.role-box .r { font-size: 11.5px; color: var(--muted); }
.role-box .n { font-size: 13.5px; font-weight: 600; margin-top: 4px; }
.role-box .n.empty { color: #a5adbd; font-weight: 400; }

.member-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.member-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid #f1f4f9; font-size: 13px;
}
.member-row:last-child { border-bottom: 0; }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who .n { font-weight: 500; }
.member-row .who .p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.member-row .badge { flex: 0 0 auto; }

.data-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.data-card {
  border: 1px dashed var(--line); border-radius: 11px; padding: 12px;
  font-size: 12px; color: var(--muted); text-align: center; background: #fafbff;
}
.data-card b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }

@media (max-width: 1080px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ 赛程编排 ============ */
.badge.pill-scheduled { background: #eef2ff; color: #1b3fc4; }
.badge.pill-published { background: #ecfdf3; color: #067647; }
.badge.pill-playing { background: #fef3f2; color: #b42318; }
.badge.pill-finished { background: #f2f4f9; color: #475467; }
.badge.pill-cancelled { background: #f2f4f9; color: #98a2b3; }

.config-card .card-body { padding: 18px 22px 6px; }
.config-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.config-grid .field { margin-bottom: 16px; }
.config-grid .span-2 { grid-column: span 2; }
.config-grid .span-4 { grid-column: span 4; }

.cat-chips { display: flex; gap: 8px; }
.cat-chips button {
  flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px;
  background: #fcfcfe; color: var(--ink-2); font-size: 12.5px; cursor: pointer;
  transition: all .16s;
}
.cat-chips button:hover { border-color: #c9d2e6; background: #f7f9ff; }
.cat-chips button.active {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 600; box-shadow: 0 0 0 3px rgba(43,92,255,.1);
}

.venue-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; align-items: center; }
.venue-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fcfcfe;
  font-size: 12.5px; cursor: pointer; user-select: none;
}
.venue-chip input { accent-color: var(--brand); }
.venue-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.venue-chip.disabled { opacity: .5; text-decoration: line-through; }

.config-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding: 14px 22px; background: #fafbfe;
  border-radius: 0 0 var(--radius) var(--radius);
}
.config-foot .tips { font-size: 12px; color: var(--muted); line-height: 1.7; }
.btn-group { display: flex; gap: 10px; }

.issue-banner {
  margin: 0 0 14px; border-radius: 11px; padding: 12px 14px; font-size: 12.5px;
  border: 1px solid #fecdca; background: #fef3f2; color: #912018; line-height: 1.9;
}
.issue-banner.warn { border-color: #fedf89; background: #fffaeb; color: #93370d; }
.issue-banner.ok { border-color: #a6f4c5; background: #ecfdf3; color: #067647; }
.issue-banner b { font-weight: 600; }
.issue-banner ul { margin: 6px 0 0; padding-left: 18px; }

.round-block { border-top: 1px solid var(--line); }
.round-block:first-child { border-top: 0; }
.round-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  background: #fafbfe; border-bottom: 1px solid #f1f4f9;
}
.round-head .round-name { font-size: 13.5px; font-weight: 600; }
.round-head .muted { font-size: 12px; color: var(--muted); }
.round-head .spacer { flex: 1; }
.round-head .badge { font-size: 11px; }

table.matches { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.matches th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px;
  padding: 8px 18px; border-bottom: 1px solid #f7f8fb; white-space: nowrap;
}
table.matches td { padding: 10px 18px; border-bottom: 1px solid #f7f8fb; color: var(--ink-2); vertical-align: middle; }
table.matches tbody tr:hover td { background: #fafcff; }
table.matches tbody tr:last-child td { border-bottom: 0; }
table.matches .time { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: nowrap; }
table.matches .vs { color: #98a2b3; margin: 0 6px; font-size: 11px; }
table.matches .who { font-weight: 500; color: var(--ink); }
table.matches .who.pending { color: #98a2b3; font-weight: 400; }
table.matches .venue { color: var(--muted); font-size: 12px; }
table.matches .entries { display: flex; flex-wrap: wrap; gap: 6px; }
table.matches .entry {
  background: #f4f6fb; border-radius: 6px; padding: 2px 7px; font-size: 11.5px; color: #344054;
}
table.matches .entry i { color: #98a2b3; font-style: normal; margin-right: 3px; }
table.matches .code { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #98a2b3; }

.schedule-empty { padding: 48px 20px; text-align: center; }
.schedule-empty h4 { margin: 12px 0 6px; font-size: 14.5px; }
.schedule-empty p { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }

.group-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.group-tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 7px 12px; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.group-tabs button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.group-tabs .dot { width: 6px; height: 6px; border-radius: 50%; background: #d0d5dd; }
.group-tabs .dot.done { background: #12b76a; }
.group-tabs .dot.draft { background: #f79009; }

@media (max-width: 1200px) {
  .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-grid .span-4 { grid-column: span 2; }
}

/* ============ 页面内确认弹窗（替代原生 confirm） ============ */
.swt-modal-mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .16s ease;
}
.swt-modal-mask.show { opacity: 1; }
.swt-modal {
  width: min(400px, calc(100vw - 48px));
  background: var(--card); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .22);
  padding: 26px 26px 20px;
  transform: translateY(10px) scale(.97);
  transition: transform .16s ease;
  text-align: center;
}
.swt-modal-mask.show .swt-modal { transform: none; }
.swt-modal-icon {
  width: 44px; height: 44px; border-radius: 50%;
  margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand);
}
.swt-modal.danger .swt-modal-icon { background: #fef3f2; color: var(--danger); }
.swt-modal-title { font-size: 15.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.swt-modal-body { font-size: 13px; color: var(--ink-2); line-height: 1.75; white-space: pre-line; }
.swt-modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.swt-modal-btn {
  flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.swt-modal-btn.cancel:hover { background: var(--bg); }
.swt-modal-btn.ok { background: var(--brand); border-color: var(--brand); color: #fff; }
.swt-modal-btn.ok:hover { background: var(--brand-dark); }
.swt-modal-btn.ok.danger { background: var(--danger); border-color: var(--danger); }
.swt-modal-btn.ok.danger:hover { background: #d92d20; }
.swt-modal-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ 危险操作区 ============ */
.danger-zone {
  border: 1px solid #fecdca; border-radius: var(--radius);
  background: #fffbfb; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.danger-zone .dz-main h4 { margin: 0 0 4px; font-size: 13.5px; color: #b42318; }
.danger-zone .dz-main p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.btn-danger {
  height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid #fecdca;
  background: #fff; color: #b42318; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all .15s ease;
}
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.swt-modal-btn.ok.danger:focus-visible { outline-color: var(--danger); }

/* ===== 工作台 hero 精简后的元素 ===== */
.hero .pill.arrow { background: transparent; border: none; padding: 0 2px; color: rgba(255,255,255,.55); }
.hero-cta {
  flex-shrink: 0; align-self: center;
  background: #fff; color: var(--brand-dark); border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: all .15s ease;
  white-space: nowrap;
}
.hero-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.24); }
