/* ==========================================================
   羽赛 · 赛事管理
   浅暖纸感 + 深墨绿 = 赛事手册的质感
   ========================================================== */

:root {
  --bg: #f4f1ec;
  --bg-2: #ebe6dd;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #17150f;
  --ink-2: #4b463e;
  --dim: #8d857a;
  --line: #e3ddd3;
  --line-2: #f0ebe3;
  --brand: #123f33;
  --brand-2: #1d5c49;
  --brand-soft: #e9f0ed;
  --accent: #b23c2c;
  --accent-soft: #fbeeeb;
  --gold: #a5843d;
  --gold-soft: #f8f1e1;
  /*
   * 已完赛的橙黄。和「进行中」的砖红成一对：红色=还在打，橙黄=打完了，
   * 白色中性=还没开打 —— 扫一眼就能分出三种状态，不用去读「完 / 进行中」那两个字。
   * 框用亮一档的橙黄（远看才醒目），字用深一档的琥珀（小字号也看得清）。
   */
  --done: #cf8f1c;
  --done-ink: #a2660a;
  --done-deep: #7d4f0a;
  --done-soft: #fbeacb;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 21, 15, 0.04), 0 8px 24px -16px rgba(23, 21, 15, 0.18);
  /* 五套系统的中文字体都兜住：iOS/macOS 苹方、Windows 雅黑、Android 思源/Roboto */
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans SC', 'Source Han Sans SC', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Songti SC', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', Georgia, serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/*
 * 触屏上按钮/链接一律 manipulation：
 * ① 去掉老安卓 WebView 的 300ms 点击延迟 ② 双击不再缩放页面（记分时连点很容易误触）
 */
button,
a,
label,
[role='button'],
input[type='button'],
input[type='submit'] {
  touch-action: manipulation;
}

/* 可滚动区域在 iOS 上要显式开启惯性滚动，否则长列表像卡住 */
.scroll,
.sheet-body,
.list {
  -webkit-overflow-scrolling: touch;
}

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

/* iOS 加到主屏幕后是全屏运行：禁掉下拉回弹和长按选择，避免比分/按钮被拖拽时抖动 */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  overscroll-behavior-y: contain;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; /* 老 iOS / 老安卓不认识 dvh 时的兜底 */
  min-height: 100dvh;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ---------------------------- 骨架 ---------------------------- */

.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 20px;
  background: rgba(244, 241, 236, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar .spacer {
  flex: 1;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand small {
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--dim);
  font-weight: 500;
}

/* 品牌旁的版本号小药丸 */
.brand .ver {
  align-self: center;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-2);
  background: var(--brand-soft);
  border: 1px solid rgba(29, 92, 73, 0.16);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

.brand .ver:empty {
  display: none;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-size: 14px;
  padding: 6px 10px 6px 6px;
  border-radius: 8px;
}

.back:hover {
  background: var(--bg-2);
}

/* ---------------------------- 页头 ---------------------------- */

.page-head {
  padding: 34px 0 22px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.page-head .meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--dim);
  font-size: 13px;
}

.page-head .meta b {
  color: var(--ink-2);
  font-weight: 500;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--dim);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ---------------------------- 按钮 ---------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
  border-color: #d7d0c4;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}

.btn.ghost:hover {
  background: var(--bg-2);
}

.btn.danger {
  color: var(--accent);
  border-color: #e8d2cd;
  background: var(--accent-soft);
}

.btn.sm {
  height: 30px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 8px;
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------- 卡片 ---------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card + .card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}

.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card-head .sub {
  font-size: 12px;
  color: var(--dim);
}

.card-head .spacer {
  flex: 1;
}

.card-body {
  padding: 18px 20px;
}

.card-body.tight {
  padding: 0;
}

/* ---------------------------- 赛事列表 ---------------------------- */

.grid {
  display: grid;
  gap: 14px;
}

.tour-card {
  display: block;
  position: relative;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.tour-card:hover {
  transform: translateY(-2px);
  border-color: #d6cec1;
  box-shadow: 0 2px 4px rgba(23, 21, 15, 0.05), 0 14px 32px -18px rgba(23, 21, 15, 0.28);
}

.tour-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tour-card .line2 {
  margin-top: 6px;
  font-size: 13px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.tour-card .bar {
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.pill.draft {
  background: var(--bg-2);
  color: var(--dim);
}

/* 「只看」：这台设备没有编排权限，只是看赛程和记分 */
.pill.ro {
  border-color: var(--line);
  color: var(--dim);
  background: transparent;
  font-weight: 500;
}

.pill.running {
  background: var(--brand-soft);
  color: var(--brand-2);
}

.pill.done {
  background: var(--gold-soft);
  color: var(--gold);
}

.pill.ko {
  background: var(--accent-soft);
  color: var(--accent);
}

.bar {
  height: 5px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--dim);
}

.bar-row .bar {
  flex: 1;
}

/* ---------------------------- 分段控件 / 标签 ---------------------------- */

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-2);
  border-radius: 11px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  flex: 1;
  min-width: 68px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.tabs button.on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(23, 21, 15, 0.07);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 没有项目时整行收起（.chips 的 display:flex 会盖掉 [hidden] 的默认样式） */
.chips[hidden] {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-2);
  transition: all 0.15s ease;
}

.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 500;
}

.chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}

/* ---------------------------- 表单 ---------------------------- */

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.field .hint {
  font-size: 11.5px;
  color: var(--dim);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 6px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  /* 统一各系统原生控件外观（iOS 会在 input 上叠内阴影、安卓有默认高亮） */
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}

/*
 * iOS Safari 有一条硬规则：输入框字号小于 16px 时，一旦聚焦就把整页放大，
 * 用户还得双指缩回来。WebKit 才认 -webkit-touch-callout，用它作为 iOS 判据，
 * 只有 iOS 抬到 16px，其他系统保持设计稿的 14.5px。
 */
@supports (-webkit-touch-callout: none) {
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }
}

.input[type='date'] {
  min-height: 42px; /* iOS 的日期控件比文本框矮，会显得凹陷 */
}

.input::-webkit-date-and-time-value {
  text-align: left; /* iOS 默认居中 */
}

/* 数字输入框去掉桌面浏览器的上下箭头 */
.input[type='number']::-webkit-outer-spin-button,
.input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 下拉框：iOS 默认是圆角胶囊且左右留白不同，统一成直角+自绘箭头 */
.select {
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(29, 92, 73, 0.1);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
  font-family: var(--font);
}

.row {
  display: flex;
  gap: 12px;
}

.row > * {
  flex: 1;
  min-width: 0;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form .input {
  flex: 1;
}

/* ---------------------------- 报名列表 ---------------------------- */

.entry-list {
  display: flex;
  flex-direction: column;
}

.entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}

.entry:last-child {
  border-bottom: none;
}

.entry .seed {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.entry.seeded .seed {
  background: var(--gold-soft);
  color: var(--gold);
}

.entry .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry .g {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.x {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--dim);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s ease;
}

.entry:hover .x,
.group-entry:hover .x {
  opacity: 1;
}

.x:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 触摸屏没有 hover，删除 ✕ 要一直看得见，不然点不到 */
@media (hover: none) {
  .x {
    opacity: 0.55;
  }
}

/* ---------------------------- 分组 ---------------------------- */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.group {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}

.group-head b {
  font-size: 13px;
  letter-spacing: 0.06em;
}

.group-head span {
  font-size: 11px;
  color: var(--dim);
}

.group-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line-2);
}

.group-entry:last-child {
  border-bottom: none;
}

.group-entry .i {
  width: 16px;
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.group-entry.qualify {
  background: linear-gradient(90deg, rgba(18, 63, 51, 0.045), transparent);
}

.group-entry.qualify .i {
  color: var(--brand-2);
  font-weight: 700;
}

/* ---------------------------- 赛程 ---------------------------- */

.match-list {
  display: block;
  padding-bottom: 8px;
}

/* 每一轮一块，块内三列等宽方框：同样的屏宽能多看几场，信息密度最高 */
.round-block + .round-block {
  border-top: 1px solid var(--line-2);
}

.round-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px 16px;
}

/*
 * 单场比赛 = 一个定高方框（赛程列表和「正在进行的比赛」共用同一套）：
 *
 *   ┌──────────────────────────┐
 *   │ 1 号场            进行中 │   上排小字：场地/轮次 + 状态
 *   │ 张三 / 李四          21  │   每队一行，比分靠右、比队名大一号
 *   │ 王五 / 赵六          15  │
 *   └──────────────────────────┘
 */
.match-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  height: 92px;
  padding: 8px 12px 10px;
  border: 1px solid #ded7cb;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 21, 15, 0.03);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.match-row:hover {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(29, 92, 73, 0.07);
  transform: translateY(-1px);
}

.match-row .m-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--dim);
}

.match-row .tag {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: 0.05em;
}

/* 场地号用轻一点的墨绿，序号用更淡的灰：都不抢队名的视觉重量 */
.match-row .tag.ct {
  color: var(--brand-2);
  font-weight: 600;
}

.match-row .tag.num {
  font-variant-numeric: tabular-nums;
  color: #b3aa9d;
}

.match-row .st {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* 队名 + 比分：每队一行铺满框宽，队名压左、比分靠右 */
.match-row .who {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.match-row .side {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.match-row .nm {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 比分比队名大一号，远看先看到分 */
.match-row .sc {
  flex: 0 0 auto;
  min-width: 30px;
  text-align: right;
  font-size: 17.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--ink);
  white-space: nowrap;
}

.match-row .sc i {
  font-style: normal;
  font-weight: 400;
  color: var(--line);
}

/* 还没开打：右侧留一个短横线占位，比空白好对齐 */
.match-row .sc i.idle {
  font-size: 15px;
}

.match-row .side.win .nm {
  color: var(--brand);
  font-weight: 700;
}

.match-row .side.win .sc {
  color: var(--brand);
}

.match-row .side.lose .nm {
  color: var(--dim);
}

.match-row.live {
  border-color: var(--accent);
  background: #fffdfc;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.match-row.live .st {
  color: var(--accent);
  font-weight: 700;
}

.match-row.live .sc {
  color: var(--accent);
}

/*
 * 已完赛：橙黄方框，和「进行中」（砖红）同一套画法 ——
 * 换的是颜色，不是形状，所以一眼就能对上「这是同一种卡片的不同状态」。
 * 成绩本身仍然用深色：状态靠边框和底色说，别让颜色抢了比分。
 */
.match-row.done {
  border-color: var(--done);
  background: #fffbed;
  box-shadow: 0 0 0 2px var(--done-soft);
}

.match-row.done:hover {
  border-color: var(--done-ink);
  box-shadow: 0 0 0 3px var(--done-soft);
}

.match-row.done .st {
  color: var(--done-ink);
  font-weight: 700;
}

.match-row.done .sc,
.match-row.done .side.win .sc {
  color: var(--done-ink);
}

/* 赢的一方在橙黄卡片上用更深的一档，输的一方照旧淡下去 */
.match-row.done .side.win .nm {
  color: var(--done-deep);
}

/* 平板两列，手机也保持两列（单列会让整页变得很长） */
@media (max-width: 960px) {
  .round-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    padding: 12px 16px 14px;
  }
}

@media (max-width: 560px) {
  .round-grid {
    gap: 9px;
    padding: 10px 12px 12px;
  }

  .round-head {
    padding: 10px 14px 5px;
  }

  .match-row {
    height: 86px;
    padding: 7px 10px 9px;
  }

  .match-row .nm {
    font-size: 14px;
  }

  .match-row .sc {
    font-size: 16.5px;
    min-width: 26px;
  }
}

/* 轮次标签：深墨绿药丸 + 渐隐细线，一眼看清现在打第几轮 */
.round-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 5px;
}

.round-head .rh-txt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(18, 63, 51, 0.75);
}

.round-head .rh-txt::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fd9bd;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.round-head .rh-line {
  flex: 1;
  height: 1px;
  min-width: 20px;
  background: linear-gradient(90deg, rgba(18, 63, 51, 0.24), rgba(18, 63, 51, 0));
}

/* 卡片头部的轮次小标签 */
.round-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-2);
  border: 1px solid rgba(29, 92, 73, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* 进行中提示 */
.live-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(178, 60, 44, 0.16);
  font-size: 12px;
  font-weight: 700;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(178, 60, 44, 0.14);
  animation: liveBlink 1.4s ease-in-out infinite;
}

@keyframes liveBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ---------------------------- 积分榜 ---------------------------- */

.table-wrap {
  overflow-x: auto;
}

table.stand {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.stand th {
  text-align: right;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--dim);
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.stand th:first-child,
table.stand td:first-child {
  text-align: left;
  padding-left: 20px;
}

table.stand th:nth-child(2),
table.stand td:nth-child(2) {
  text-align: left;
}

table.stand td {
  padding: 10px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}

table.stand tr:last-child td {
  border-bottom: none;
}

table.stand .rk {
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  background: var(--bg-2);
  margin-right: 9px;
}

table.stand tr.q td {
  background: rgba(18, 63, 51, 0.035);
}

table.stand tr.q .rk {
  background: var(--brand);
  color: #fff;
}

table.stand .nm {
  font-weight: 500;
}

table.stand .pts {
  font-weight: 700;
  color: var(--ink);
}

.stand-block + .stand-block {
  border-top: 1px solid var(--line);
}

.stand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stand-title .q-note {
  font-size: 10.5px;
  color: var(--brand-2);
  background: var(--brand-soft);
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ---------------------------- 淘汰赛对阵 ---------------------------- */

.bracket {
  display: flex;
  gap: 18px;
  padding: 20px;
  overflow-x: auto;
  align-items: stretch;
  min-height: 240px;
}

.bracket-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
  min-width: 210px;
  flex: 1;
}

.bracket-col-head {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--dim);
  font-weight: 600;
  text-align: center;
  margin-bottom: -6px;
}

.bo {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  font-size: 13px;
}

/* 对阵表里一场也改成一行：左队 | 比分 | 右队。
   原来上下两行，签位一多整棵树就被拉得很长，横向滚动时也不好对照 */
.bo .bline {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
}

.bo .bline .s {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo .bline .s:first-child {
  text-align: right;
}

.bo .bline .s:last-child {
  text-align: left;
}

.bo .bline .sc {
  flex: 0 0 auto;
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.bo .bline .sc i {
  font-style: normal;
  font-weight: 400;
  color: var(--dim);
  margin: 0 1px;
}

.bo .bline .sc i.idle {
  color: var(--line);
  margin: 0;
}

.bo .bline .s.win {
  color: var(--brand);
  font-weight: 700;
}

.bo .bline .s.out {
  color: var(--dim);
}

.bo .bline .s.tbd {
  color: var(--dim);
  font-style: normal;
}

.bo.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo.clickable:hover {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(29, 92, 73, 0.08);
}

.champion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px;
  min-width: 150px;
  border-radius: 13px;
  background: linear-gradient(160deg, var(--gold-soft), #fff);
  border: 1px solid #e8dcbe;
  text-align: center;
}

.champion .k {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold);
  font-weight: 700;
}

.champion .n {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

/* ---------------------------- 设置面板 ---------------------------- */

.setting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}

.setting:last-child {
  border-bottom: none;
}

.setting .lbl {
  flex: 1;
  min-width: 0;
}

.setting .lbl b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
}

.setting .lbl small {
  display: block;
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 2px;
}

.setting .ctl {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  height: 34px;
}

.stepper button {
  width: 32px;
  height: 100%;
  color: var(--ink-2);
  font-size: 15px;
}

.stepper button:hover {
  background: var(--surface-2);
}

.stepper span {
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
}

.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.18s ease;
  flex: 0 0 auto;
}

.toggle.on {
  background: var(--brand);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.toggle.on::after {
  transform: translateX(18px);
}

.select.sm {
  width: auto;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%238d857a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ---------------------------- 空状态 ---------------------------- */

.empty {
  padding: 46px 24px;
  text-align: center;
  color: var(--dim);
}

.empty .ico {
  font-size: 26px;
  opacity: 0.35;
  margin-bottom: 10px;
}

.empty p {
  margin: 0 0 4px;
  font-size: 14px;
}

.empty small {
  font-size: 12.5px;
  opacity: 0.8;
}

.empty .btn {
  margin-top: 16px;
}

/* ---------------------------- 提示条 ---------------------------- */

.notice {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--gold-soft);
  color: #7a6229;
  border: 1px solid #ece0c4;
}

.notice.info {
  background: var(--brand-soft);
  color: var(--brand-2);
  border-color: #d5e5de;
}

.notice b {
  font-weight: 700;
}

/* ---------------------------- 弹层 ---------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 21, 15, 0.42);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}

.modal[hidden] {
  display: none;
}

.modal .sheet {
  width: 100%;
  max-width: 460px;
  max-height: 86vh; /* 兜底 */
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.4);
  animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.modal .lead {
  font-size: 13px;
  color: var(--dim);
  margin: 0 0 18px;
}

.modal .actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal .actions .btn {
  flex: 1;
}

/* 编排码输入：大字号、宽字距，六位数字一眼看得清输了几位 */
.code-input {
  width: 100%;
  margin-top: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-align: center;
  text-indent: 0.34em; /* 抵消最后一字的字距，视觉居中 */
  font-variant-numeric: tabular-nums;
}

.code-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft, rgba(139, 96, 45, 0.12));
}

/* 队伍视角：整行可点，hover 有反馈，跟卡片点进去的手感一致 */
.team-table .team-row {
  cursor: pointer;
}

.team-table .team-row:hover td {
  background: var(--surface-2);
}

/* ---------------------------- 手动录入比分 ---------------------------- */

/* 赛程卡片右上角的小笔：只有编排员看得到，其他设备上不存在这个节点 */
.match-row .m-rec {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.match-row .m-rec:hover {
  color: var(--brand);
  background: var(--surface-2);
}

.match-row .m-rec i {
  font-style: normal;
}

/* 两列（手机竖屏）时卡片只有半屏宽，「1 号场 完 录入」挤在一起，
   只留笔图标；title 里还有完整说明 */
@media (max-width: 620px) {
  .match-row .m-rec span {
    display: none;
  }
}

.rec-rules {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 6px 0 14px;
}

.rec-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rec-rule > span {
  flex: 0 0 62px;
  font-size: 12px;
  color: var(--dim);
}

.seg {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.seg button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.seg button.on {
  border-color: var(--brand);
  background: var(--accent-soft);
  color: var(--brand);
  font-weight: 650;
}

.seg-num {
  width: 62px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  text-align: center;
  padding: 7px 6px;
  border-radius: 8px;
  outline: none;
}

.seg-num:focus,
.seg-num.on {
  border-color: var(--brand);
}

.seg-num.on {
  background: var(--accent-soft);
  color: var(--brand);
  font-weight: 650;
}

.rec-tip {
  margin: 0;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.6;
}

.rec-games {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/*
 * 弹窗底部那行「保存后会变成什么」。
 * 以前只有保存之后才知道自己被判定成「比赛结束」了，现在边填边说清楚：
 * 这一局还没到分就是「进行中」，赢够局数才是「比赛结束」。
 */
.rec-state {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--dim);
}

.rec-state.live {
  color: var(--ink);
}

.rec-state.ok {
  color: var(--brand-2);
  font-weight: 650;
}

.rec-state.warn {
  color: #b4472e;
  border-color: #e7c4b8;
  background: #fdf3ef;
}

.rec-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-row .idx {
  flex: 0 0 44px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--dim);
}

.rec-row input {
  width: 62px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.rec-row input:focus {
  border-color: var(--brand);
}

.rec-row .colon {
  color: var(--dim);
}

.rec-row .who {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-row .who.win {
  color: var(--brand-2);
  font-weight: 650;
}

.rec-row .who.play {
  color: var(--brand);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

/*
 * 赛程页最底部的入口条。
 * 现场临时要改赛程时，不用记那条带编排码的链接 —— 点这里输码即可。
 * 做成小字链接而不是大按钮：观众看到也不会以为「点一下就能改」。
 */
.page-foot {
  display: flex;
  justify-content: center;
  margin: 20px 0 6px;
}

.page-foot .foot-link {
  border: 0;
  background: transparent;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.page-foot .foot-link:hover {
  color: var(--brand);
  background: var(--surface-2);
}

/* 已经是编辑模式：换成品牌绿，表示这台设备有权限 */
.page-foot .foot-link.on {
  color: var(--brand-2);
}

.page-foot .foot-link.on::after {
  content: ' ✓';
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 14px);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(23, 21, 15, 0.92);
  color: #fff;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 80vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------- 小工具类 ---------------------------- */

.muted {
  color: var(--dim);
}

.small {
  font-size: 12px;
}

.mt8 {
  margin-top: 8px;
}

.mt12 {
  margin-top: 12px;
}

.mt16 {
  margin-top: 16px;
}

.mt20 {
  margin-top: 20px;
}

.hide {
  display: none !important;
}

.flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flex .spacer {
  flex: 1;
}

@media (max-width: 640px) {
  .shell {
    padding: 0 14px 70px;
  }

  .topbar {
    padding: 0 14px;
    height: 54px;
  }

  .page-head {
    padding: 24px 0 16px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .ev-name {
    font-size: 17px;
  }

  .card-head,
  .card-body {
    padding-left: 15px;
    padding-right: 15px;
  }

  .entry {
    padding-left: 15px;
    padding-right: 15px;
  }

  table.stand th:first-child,
  table.stand td:first-child {
    padding-left: 15px;
  }

  .bracket {
    padding: 14px;
    gap: 12px;
  }

  .bracket-col {
    min-width: 168px;
  }

  .hide-sm {
    display: none !important;
  }
}

/* ---------------------------- 报名名次输入 / 分组小选择 ---------------------------- */

.seed-input {
  width: 34px;
  height: 26px;
  flex: 0 0 34px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  padding: 0;
  -moz-appearance: textfield;
}

.seed-input::-webkit-outer-spin-button,
.seed-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.seed-input:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
  color: var(--ink);
}

.mini-select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  font-size: 10.5px;
  color: var(--dim);
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.14s ease;
  -webkit-appearance: none;
  appearance: none;
}

.group-entry:hover .mini-select,
.group-entry .mini-select:focus {
  opacity: 1;
}

@media (max-width: 640px) {
  .mini-select {
    opacity: 1;
  }
}

/* 对阵图：每列用等分槽位，保证上下两场的中点对齐下一轮 */
.bracket-col {
  justify-content: stretch;
  gap: 0;
}

.bracket-col-head {
  margin-bottom: 6px;
}

.bslot {
  display: flex;
  align-items: center;
  min-height: 0;
}

.bslot .bo {
  width: 100%;
}

/* ---------------------------- 抽签方式分段选择 ---------------------------- */

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.seg button {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--dim);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s ease, color 0.14s ease;
}

.seg button + button {
  border-left: 1px solid var(--line);
}

.seg button:hover {
  color: var(--ink);
}

.seg button.on {
  background: var(--brand-soft);
  color: var(--brand-2);
  font-weight: 600;
}

/* 组名可直接编辑 */
.group-head .gname-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  padding: 2px 4px;
  border-radius: 6px;
  font-family: inherit;
}

.group-head .gname-input:hover {
  border-color: var(--line);
}

.group-head .gname-input:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
}

/* 三四名决赛 */
.third-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 20px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--line-2);
}

.third-head {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  font-weight: 600;
  white-space: nowrap;
}

.third-head small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--dim);
  margin-top: 3px;
}

.third-box {
  width: 240px;
  max-width: 60%;
}

/* ---------------------------- 现场 · 同时进行 ---------------------------- */

/*
 * 「正在进行的比赛」用的是和赛程列表同一个 .match-row 方框，
 * 这里只负责把它摆成三列，两处看起来才是同一套东西。
 */
.court-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 960px) {
  .court-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
}

/* ---------------------------- 并列抽签 ---------------------------- */

.draw-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin: 16px 16px 0;
  border: 1px solid #eadbb6;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--gold-soft), #fffdf6);
  color: #6d5a26;
  font-size: 12.5px;
  line-height: 1.55;
}

.draw-banner-txt {
  flex: 1;
  min-width: 0;
}

.draw-banner-txt b {
  color: var(--gold);
}

.draw-group {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2, #ece5da);
}

.draw-group:first-child {
  padding-top: 2px;
}

.draw-group:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.draw-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.draw-group-head span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.draw-group-head em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--dim);
  margin-left: 6px;
}

.draw-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.draw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.draw-no {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft, #e7efe9);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.draw-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.draw-ctrl {
  display: inline-flex;
  gap: 6px;
  flex: none;
}

.draw-ctrl button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f4;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.draw-ctrl button:hover {
  color: var(--brand-2);
  border-color: var(--brand-2);
  background: var(--brand-soft, #e7efe9);
}

/* ---------------------------- 投屏地址 ---------------------------- */

.cast-url {
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--brand-soft);
  border: 1px solid #d5e5de;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-all;
  letter-spacing: -0.01em;
}

/* ---------------------------- 报名 / 分组 完成态 ---------------------------- */

/* ---------------------------- 项目名（单项目时单独一行） ---------------------------- */

/* 只有一个项目时，项目名单独占一行并加重；多个项目才用下面的胶囊切换 */
.ev-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.015em;
  color: var(--ink);
}

.ev-name::before {
  content: '';
  flex: none;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
}

/* 多项目时的切换胶囊 */
.chip[data-event] {
  height: 32px;
  padding: 0 15px;
}

/* 完成态下的只读名单 */
.name-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.name-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: 13.5px;
  color: var(--ink);
}

.name-tag i {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 4px;
  padding: 1px 4px;
  font-variant-numeric: tabular-nums;
}

.name-tag em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.03em;
}

/* 队名就地编辑：平时像普通文字，点进去才出现下划线和光标 */
.name-edit {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  border-bottom: 1px dashed transparent;
  border-radius: 0;
  padding: 0 0 1px;
  margin: 0;
  min-width: 2em;
  max-width: 100%;
  outline: none;
  transition: border-color 0.15s ease;
}

.entry .name-edit {
  flex: 1;
  min-width: 0;
}

.name-tag .name-edit {
  max-width: 56vw;
}

/* 标签里的名字默认带一道浅虚线，暗示「点一下能改」 */
.name-tag .name-edit:not(:focus) {
  border-bottom-color: rgba(141, 133, 122, 0.45);
}

.name-edit:hover {
  border-bottom-color: var(--line);
}

.name-edit:focus {
  border-bottom-style: solid;
  border-bottom-color: var(--brand);
}

/* 只读分组里的人员名 */
.group-entry .gname-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------- 赛事列表 · 卡片操作 ---------------------------- */

/* 整张卡可点（.tour-hit 铺满），右上角按钮浮在上面 */
.tour-card {
  cursor: pointer;
}

.tour-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.tour-card .tour-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.tour-card .tour-edit {
  flex: none;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
}

.tour-card .tour-edit:hover {
  border-color: var(--brand);
  color: var(--brand-2);
  background: var(--brand-soft);
}

/* 修改赛事弹层里的删除区 */
.edit-danger {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.edit-danger .t {
  flex: 1;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.55;
}

/* 卡片底部操作条（完成报名 / 完成分组） */
.card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}

.card-foot .hint {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.5;
}

.card-foot .btn {
  flex: none;
}

@media (max-width: 520px) {
  .card-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }
}

/* 标题栏的副标题在窄屏自动省略，别把按钮挤出去 */
.card-head .sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 标题不许被副标题挤成两行 */
.card-head h2 {
  flex: none;
}

/* 窄屏上标题栏挤了标题 + 两个按钮时会顶出卡片，
   允许换行比裁掉半个按钮好 */
@media (max-width: 620px) {
  .card-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}
