/* 滑雪赛事管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --side-bg: #0f1c2e;
  --side-hover: #1b2f4a;
  --brand: #0ea5e9;
  --brand-d: #0284c7;
  --txt: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --bg: #f1f5f9;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }

/* ============ 登录 ============ */
/* 背景：雪道实景照片 + 半透明深色渐变压暗，保证白卡片与文字可读；
   图片加载失败时回退到原深蓝渐变 */
.login-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, rgba(15,28,46,.55) 0%, rgba(27,58,92,.35) 55%, rgba(14,165,233,.25) 140%),
    url('login-bg.jpg') center / cover no-repeat,
    linear-gradient(135deg, #0f1c2e 0%, #1b3a5c 60%, #0ea5e9 140%);
}
.login-card {
  width: 360px; padding: 40px 34px 30px; border-radius: 16px; text-align: center;
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-card .logo { font-size: 46px; line-height: 1; }
.login-card h1 { font-size: 21px; margin: 14px 0 6px; letter-spacing: 1px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
/* 副标题两行（对应后台「标题第一行 / 标题第二行」）：行为空时整行隐藏，不留空隙 */
.login-card .sub .sub-line { display: block; line-height: 1.5; }
.login-card .sub .sub-line:empty { display: none; }
.login-card .sub .sub-line + .sub-line:not(:empty) { margin-top: 2px; }
.login-card input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 9px; background: #f8fafc; margin-bottom: 14px;
}
.login-card input:focus { border-color: var(--brand); background: #fff; }
.login-card button {
  width: 100%; height: 44px; border-radius: 9px; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-d));
  transition: opacity .15s;
}
.login-card button:hover { opacity: .9; }
.login-card .err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-card .hint { color: #94a3b8; font-size: 12px; margin-top: 6px; }
/* ICP 备案号：法规要求对外展示，样式压低存在感，不干扰登录操作 */
.login-card .icp { margin: 18px 0 0; font-size: 11px; color: #a8b3c2; letter-spacing: .3px; }
.login-card .icp a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.login-card .icp a:hover { color: #7c8ba1; border-bottom-color: #cbd5e1; }

/* ============ 主布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; background: var(--side-bg); color: #cbd5e1;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar .brand {
  padding: 20px 20px 18px; font-size: 16px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 9px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand span { font-size: 20px; }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; margin-bottom: 3px;
  border-radius: 9px; color: #cbd5e1; text-decoration: none; font-size: 14px; transition: .15s;
}
.nav a .ic { width: 18px; text-align: center; font-size: 15px; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar .foot { padding: 14px 18px; font-size: 12px; color: #64748b; border-top: 1px solid rgba(255,255,255,.08); }
/* 侧边栏底部：滑雪计时布点原图 + 技术支持 */
.sidebar .side-art { padding: 10px 14px 2px; }
.sidebar .side-art img { width: 100%; height: auto; display: block; border-radius: 6px; }
.sidebar .support {
  padding: 4px 16px 12px; font-size: 11px; line-height: 1.6;
  color: #64748b; text-align: center; letter-spacing: .5px;
}
.sidebar .support b { color: #94a3b8; font-weight: 600; }
/* ICP 备案号：法规要求对外展示，放在技术支持下方、版本号上方 */
.sidebar .icp { padding: 0 16px 10px; font-size: 11px; text-align: center; letter-spacing: .3px; }
.sidebar .icp a { color: #64748b; text-decoration: none; border-bottom: 1px solid transparent; }
.sidebar .icp a:hover { color: #94a3b8; border-bottom-color: #475569; }

/* 持久化未启用告警条 */
.persist-warn {
  margin: 12px 18px 0; padding: 10px 14px; font-size: 12.5px; line-height: 1.7;
  color: #7c2d12; background: #fff7ed; border: 1px solid #fed7aa; border-left: 4px solid #f97316;
  border-radius: 8px;
}
.persist-warn b { color: #9a3412; }
.persist-warn code {
  background: #ffedd5; border-radius: 4px; padding: 0 4px;
  font-family: Consolas, Menlo, monospace; font-size: 12px;
}
.persist-warn .persist-diag {
  display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #fdba74;
  color: #9a3412;
}

.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; }
.topbar .who { color: var(--muted); font-size: 13px; }
.btn-logout {
  padding: 7px 14px; border-radius: 8px; background: #f1f5f9; color: #334155; font-size: 13px;
}
.btn-logout:hover { background: #e2e8f0; }
/* 顶栏全局大赛选择器（多站赛事） */
.comp-switch { display: flex; align-items: center; gap: 6px; }
.comp-switch-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.comp-switch select {
  max-width: 300px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #f8fafc; color: #0f172a; font-size: 13px;
}
.comp-switch select:focus { outline: 2px solid rgba(37,99,235,.35); border-color: #2563eb; }
.content { padding: 22px 24px 40px; }

/* ============ 卡片 / 统计 ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: #fff; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
}
.card .k { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card .v { font-size: 27px; font-weight: 700; line-height: 1.1; }
.card .v small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.card.accent { background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; }
.card.accent .k { color: rgba(255,255,255,.85); }
.card.accent .v { color: #fff; }

.panel { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(15,23,42,.06); margin-bottom: 18px; }
.panel h3 { font-size: 15px; margin-bottom: 14px; font-weight: 600; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.btn {
  height: 34px; padding: 0 15px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: #f1f5f9; color: #334155;
}
.btn:hover { background: #e2e8f0; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { background: #fef2f2; color: var(--bad); }
.btn.danger:hover { background: #fee2e2; }
.btn.ok { background: #f0fdf4; color: var(--ok); }
.btn.ok:hover { background: #dcfce7; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }

/* ============ 表格 ============ */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fafc; }
tbody tr:hover { background: #f8fafc; }
td.wrap { white-space: normal; max-width: 320px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 标签 */
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; line-height: 1.5; }
.tag.upcoming { background: #e0f2fe; color: #0369a1; }
.tag.closed { background: #ffedd5; color: #c2410c; }
.tag.live { background: #fee2e2; color: #b91c1c; }
.tag.finished { background: #e5e7eb; color: #4b5563; }
.tag.pending { background: #fef3c7; color: #b45309; }
.tag.confirmed { background: #dcfce7; color: #15803d; }
.tag.cancelled { background: #f1f5f9; color: #64748b; }
.tag.ok { background: #dcfce7; color: #15803d; }
.tag.alpine { background: #ede9fe; color: #6d28d9; }
.tag.snowboard { background: #ccfbf1; color: #0f766e; }

/* ============ 公告图片 ============ */
.ann-img-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============ 模态框 ============ */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
/* 标题行：标题在左、关闭按钮在右 */
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { padding: 0; border: none; font-size: 16px; flex: 1; min-width: 0; }
/* 关闭按钮：hover 才显出红色，视觉上不喧宾夺主 */
.modal-close {
  flex: none; width: 30px; height: 30px; padding: 0; border: none; border-radius: 8px;
  background: transparent; color: #94a3b8; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.modal-close:hover { background: #fef2f2; color: #dc2626; }
.modal-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc;
}
.field textarea { height: 74px; padding: 9px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }

/* 赛事表单：开放组别 / 开放性别 多选（chip 样式）——顺手覆盖 .field input 的 100% 宽度 */
.chk-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chk-row .chk {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #f8fafc; font-size: 13px; color: var(--txt); cursor: pointer; user-select: none;
}
.chk-row .chk:hover { border-color: var(--brand); background: #f0f9ff; }
.chk-row .chk input[type="checkbox"] {
  width: 15px; height: 15px; min-width: 15px; padding: 0; margin: 0; flex: none;
  accent-color: var(--brand);
}
.chk-row .chk:has(input:checked) { border-color: var(--brand); background: #e0f2fe; color: var(--brand-d); font-weight: 600; }

/* toast */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px); background: #0f172a; color: #fff; padding: 11px 20px; border-radius: 9px; font-size: 13px; z-index: 200; opacity: 0; transition: .25s; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.err { background: var(--bad); }
#toast.ok { background: var(--ok); }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-row .lbl { width: 72px; color: var(--muted); font-size: 13px; }
.bar-track { flex: 1; height: 9px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-d)); }
.bar-row .num { width: 46px; text-align: right; font-weight: 600; font-size: 13px; }

/* 成绩管理：resMeta 专用（不用 bar-row 的固定宽度） */
#resMeta { display: block; margin-bottom: 10px; }
#resMeta .lbl { width: auto; font-weight: 600; font-size: 15px; color: var(--txt); margin-bottom: 4px; }

/* 成绩上传入口工具栏 */
.upload-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 6px; border-radius: 10px;
  background: linear-gradient(90deg, #f0f9ff, #f8fafc);
  border: 1px solid #e0f2fe;
}
.upload-bar .ub-label { font-weight: 600; font-size: 13px; color: #0369a1; margin-right: 4px; }
.upload-bar .ub-status { font-size: 12px; color: var(--muted); margin-left: 6px; }
.upload-bar .ub-status.ok { color: var(--ok); }
.upload-bar .ub-status.err { color: var(--bad); }
.ub-tip { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.err-list { max-height: 260px; overflow-y: auto; font-size: 13px; line-height: 1.9; }
.err-list div { padding: 5px 9px; border-radius: 6px; background: #fef2f2; color: var(--bad); margin-bottom: 5px; }

/* === Logo 上传 === */
.logo-uploader { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview {
  width: 96px; height: 96px; border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-preview .hint { color: var(--muted); font-size: 12px; }

/* 成绩单表头 Logo（多张）缩略图网格：每行 4 张，超出换行 */
.pp-logo-grid {
  display: grid; grid-template-columns: repeat(4, 96px);
  gap: 10px;
}
.pp-logo-item {
  position: relative; width: 96px; border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: visible; padding-bottom: 26px;
}
.pp-logo-item .img-box {
  width: 96px; height: 72px; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pp-logo-item .img-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pp-logo-item .del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(228, 87, 46, .92); color: #fff; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.pp-logo-item .del:hover { background: #c73e20; }
.pp-logo-item .size-row {
  position: absolute; left: 0; right: 0; bottom: 0; height: 24px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  background: rgba(255,255,255,.85); border-top: 1px solid var(--line);
}
.pp-logo-item .size-row label { font-size: 10px; color: var(--muted); }
.pp-logo-item .size-row input {
  width: 40px; height: 18px; font-size: 11px; padding: 0 2px;
  border: 1px solid var(--line); border-radius: 4px; text-align: center;
}
.pp-logo-empty { color: var(--muted); font-size: 12px; }

/* 表单字段下方的辅助说明（如「来自报名选项」） */
.form-grid .field .hint,
.field .hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

/* 报名选项配置区的多行文本框 */
#regOptEventTypes,
#regOptGroups { width: 100%; min-height: 110px; font-family: inherit; line-height: 1.6; }

/* 组别年龄要求一览 */
.age-chip {
  display: inline-block;
  margin: 0 8px 6px 0;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.age-chip.on { background: var(--color-info, #e6f1fb); color: #185fa5; }
.age-chip.off { background: var(--color-background-secondary, #f1efe8); color: var(--muted); }

/* 组别年龄段设置弹窗内的表格 */
.age-tbl { width: 100%; }
.age-tbl td, .age-tbl th { padding: 8px 10px; }
.age-in {
  width: 100px;
  padding: 6px 8px;
  border: 1px solid var(--color-border-secondary, #d3d1c7);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
}
.age-preview { color: var(--muted); font-size: 13px; white-space: nowrap; }
.logo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 赛事信息（view-info）分区标题 */
.info-h4 { font-size: 14px; font-weight: 600; color: var(--muted); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.info-h4:first-of-type { margin-top: 0; }

/* ===== 证书管理 ===== */
.cert-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cert-upload-row input[type=file] { font-size: 13px; }
.cert-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.cert-switch input { width: auto; }

/* 小程序端实际状态条：把 /api/cert-settings 的判定结论摆在最显眼处，
   让「后台配了、小程序却看不到」这种静默不一致一眼可见 */
.cert-effective {
  display: block; margin: 0 0 16px; padding: 11px 14px;
  border-radius: 8px; border-left: 4px solid var(--muted);
  background: #f8fafc; color: var(--txt); font-size: 13px; line-height: 1.7;
}
.cert-effective b { font-weight: 700; }
.cert-effective.ok { border-left-color: var(--ok); background: #f0fdf4; }
.cert-effective.bad { border-left-color: var(--bad); background: #fef2f2; }
.cert-effective.warn { border-left-color: var(--warn); background: #fffbeb; }
.cert-effective .ce-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.cert-editor { display: grid; grid-template-columns: minmax(420px, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cert-editor { grid-template-columns: 1fr; } }

.cert-anchor-list { display: flex; flex-direction: column; gap: 10px; }
.cert-anchor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--color-background-secondary, #faf9f5);
}
.cert-anchor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cert-anchor-name { font-size: 13px; font-weight: 600; }
.cert-anchor-del { font-size: 12px; color: #c0392b; cursor: pointer; }
.cert-anchor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cert-anchor-grid label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.cert-anchor-grid input[type=text],
.cert-anchor-grid input[type=number],
.cert-anchor-grid select {
  width: 100%; padding: 6px 8px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--color-border-secondary, #d3d1c7); border-radius: 6px;
}
.cert-anchor-text { grid-column: 1 / -1; }
.cert-anchor-text textarea {
  width: 100%; min-height: 56px; padding: 7px 9px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--color-border-secondary, #d3d1c7); border-radius: 6px; resize: vertical;
}
.cert-anchor-color { height: 32px; padding: 2px; }

.cert-preview-wrap { position: sticky; top: 16px; }
.cert-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;      /* A4 竖版 */
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.cert-preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: none; }
.cert-preview-img.on { display: block; }
.cert-preview-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}
.cert-preview-empty.hide { display: none; }
.cert-ov {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: pre-wrap;
  text-align: center;
  pointer-events: none;
  line-height: 1.35;
  max-width: 92%;
}

/* 证书「可用占位符」提示：一行长文本，允许换行，避免撑破面板 */
.cert-ph-hint {
  display: block;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--bg-soft, #f6f7f9);
  border-radius: 8px;
  line-height: 1.7;
  word-break: break-word;
}

/* ============ 平行项目决赛：决赛排序 + PK 晋级图 ============ */
.bracket-panel {
  margin: 14px 0 18px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}
.bracket-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 8px;
}
.bracket-head b { font-size: 15px; }
.bracket-badge {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #e0f2fe; color: #0369a1; font-size: 12px; font-weight: 600;
}
.bk-title {
  margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--txt);
  display: flex; align-items: baseline; gap: 10px;
}
.bk-title-sub { font-weight: 400; font-size: 12px; color: var(--muted); }

/* 决赛排序（配对表） */
.bk-pairs {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.bk-pair {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
/* 选道控件独占第二行，不与选手信息抢宽度 */
.bk-pair > .bk-lane-pick { flex: 1 1 100%; order: 9; margin-top: 4px; }
.bk-pair-no {
  flex: 0 0 74px; font-size: 12px; font-weight: 700; color: var(--brand-d);
  display: flex; flex-direction: column;
}
.bk-pair-no span { font-weight: 400; color: var(--muted); font-size: 11px; white-space: nowrap; }
.bk-side { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.bk-side .bk-name, .bk-name {
  font-weight: 600; font-size: 13px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bk-sub {
  color: var(--muted); font-size: 11px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bk-empty { color: #94a3b8; font-style: italic; font-size: 12px; }
.bk-track { font-style: normal; font-size: 11px; margin-top: 2px; white-space: nowrap; }
.bk-track.red { color: #dc2626; }
.bk-track.blue { color: #2563eb; }
.bk-vs { flex: 0 0 auto; color: #94a3b8; font-size: 11px; font-weight: 700; }
/* 单轮赛制选道：选道权持有者标记 + 选道下拉 */
.bk-holder {
  font-style: normal; font-size: 10px; margin-top: 2px; align-self: flex-start;
  color: #0369a1; background: #e0f2fe; border-radius: 4px; padding: 0 5px; white-space: nowrap;
}
.bk-lane-pick {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 8px; background: #f8fafc; border: 1px dashed var(--line); border-radius: 6px;
  font-size: 11px; color: var(--muted);
}
.bk-lane-pick b { color: #1e293b; }
.bk-lane-pick select { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; }
.bk-lane-hint { color: #94a3b8; }
.bk-heat-sides { display: flex; flex-direction: column; gap: 4px; margin-bottom: 5px; }
.bk-heat-side { display: flex; flex-direction: column; }

/* PK 晋级图 */
.bk-rounds-wrap { overflow-x: auto; padding-bottom: 6px; }
.bk-rounds { display: flex; gap: 12px; align-items: flex-start; min-width: max-content; }
.bk-col { display: flex; flex-direction: column; gap: 8px; min-width: 190px; }
.bk-col-head {
  text-align: center; font-size: 12px; font-weight: 700; color: #0369a1;
  background: #e0f2fe; border-radius: 6px; padding: 4px 0;
}
.bk-heat {
  border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 7px 8px;
}
.bk-heat.done { border-color: #bbf7d0; background: #f6fef9; }
.bk-heat.sealed { opacity: .72; }
.bk-heat-id { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.bk-heat select { width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.bk-win { margin-top: 4px; font-size: 11px; color: var(--ok); }
.bk-3rd { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }

/* 最终名次 */
.bk-podium { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.bk-pod {
  flex: 1 1 140px; padding: 10px 12px; border-radius: 8px; font-weight: 700;
  border: 1px solid var(--line); background: #fff;
}
.bk-pod .bk-medal { margin-right: 6px; }
.bk-pod.gold { border-color: #fcd34d; background: #fffbeb; }
.bk-pod.silver { border-color: #cbd5e1; background: #f8fafc; }
.bk-pod.bronze { border-color: #fdba74; background: #fff7ed; }

/* ===== 页面装饰图（首页 / 成绩查询 / 报名页） ===== */
.decor-card {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 14px; background: var(--card, #fff);
}
.decor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px dashed var(--line);
}
.decor-head b { font-size: 15px; }
.decor-switch { margin: 0; }
.decor-body { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .decor-body { grid-template-columns: 1fr; } }
.decor-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px; }
.decor-nums label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.decor-nums input {
  width: 100%; padding: 6px 8px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--color-border-secondary, #d3d1c7); border-radius: 6px;
}
.decor-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;         /* 模拟手机竖屏视口 */
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 40%, #f8fafc 100%);
  touch-action: none;
}
.decor-preview.dragging { cursor: grabbing; }
.decor-ov {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: move;
  user-select: none;
  -webkit-user-drag: none;
  max-width: none;              /* 宽度由百分比控制 */
}
.decor-handle {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  margin-left: 0;               /* 位置由 JS 按 x%/y% + 图片半宽近似摆放 */
  border-radius: 50%;
  background: #1a6fa0;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  cursor: nwse-resize;
  z-index: 3;
}
.decor-preview-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 0 12px;
}
