/* ============================================================
   网络报名 · 共用样式
   ------------------------------------------------------------
   与编排软件同一套视觉（品牌橙 #E8552D / 深蓝文字 #131A2C），
   手机优先：单列、大按钮（≥44px 触控高度）、输入字号 ≥16px（避免 iOS 自动放大）
   ============================================================ */
:root {
  --bg: #F4F5F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --surface-3: #F1F3F8;
  --border: #E8EAF1;
  --border-strong: #D9DDE8;
  --text: #131A2C;
  --text-2: #59627A;
  --text-3: #8E97AC;
  --brand: #E8552D;
  --brand-600: #D14520;
  --brand-soft: #FFF1EC;
  --green: #12A150;
  --green-soft: #E8F7EE;
  --amber: #D98200;
  --amber-soft: #FFF6E6;
  --red: #D93F5C;
  --red-soft: #FDECEF;
  --blue: #2E6BE6;
  --blue-soft: #EAF1FE;
  --teal: #0EA5A4;
  --teal-soft: #E6F7F7;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(19, 26, 44, .05);
  --sh-2: 0 2px 8px rgba(19, 26, 44, .07);
  --sh-3: 0 12px 28px rgba(19, 26, 44, .14);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); }
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 14px 96px; }
.wrap--wide { max-width: 1180px; }

/* ---------- 顶部标题 ---------- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 14px; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
}
.topbar__mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, #F26A44, #E8552D 60%, #D14520);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.topbar__title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.topbar__sub { font-size: 11.5px; color: var(--text-3); }
.topbar .spacer { flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 14px; margin-bottom: 12px;
}
.card__title { font-size: 14px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card__hint { font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 14px;
  font-family: inherit; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s ease, border-color .15s ease;
}
.btn:active { background: var(--surface-3); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.btn--primary:active { background: var(--brand-600); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--red); border-color: #F2C6CE; background: var(--red-soft); }
.btn--sm { min-height: 34px; padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; font-family: inherit; color: var(--text);
  background: var(--surface); min-height: 44px;
}
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* 性别选择（大按钮，适合手机点） */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; min-height: 44px; border: 1.5px solid var(--border-strong); background: var(--surface);
  border-radius: 10px; font-size: 15px; font-family: inherit; color: var(--text-2); cursor: pointer;
}
.seg button.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-600); font-weight: 700; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7;
}
.badge--gray { background: var(--surface-3); color: var(--text-2); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; line-height: 1.65; margin-bottom: 10px;
}
.notice--info { background: var(--blue-soft); color: #1B4BA8; }
.notice--warn { background: var(--amber-soft); color: #8A5300; }
.notice--err { background: var(--red-soft); color: #A3263F; }
.notice--ok { background: var(--green-soft); color: #0B7A3C; }

/* ---------- 运动员卡片 ---------- */
.ath {
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 11px; margin-bottom: 10px; background: var(--surface);
}
.ath--err { border-color: #F2C6CE; background: #FFFCFD; }
.ath__head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.ath__no {
  width: 24px; height: 24px; border-radius: 7px; background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.ath__count { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.ath__count.is-on { color: var(--green); font-weight: 700; }
.ath__count.is-over { color: var(--red); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  background: var(--brand-soft); color: var(--brand-600); border: 1px solid #F7CDBE;
  border-radius: 999px; padding: 3px 9px; font-size: 12.5px;
}
.chip button { appearance: none; border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; }
.chip--empty { background: var(--surface-3); color: var(--text-3); border-color: var(--border); }

/* ---------- 底部固定操作条 ---------- */
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center;
  backdrop-filter: blur(6px);
}
.foot .spacer { flex: 1; }

/* ---------- 底部抽屉（选项目） ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(19, 26, 44, .42); z-index: 60;
  display: none; align-items: flex-end;
}
.sheet-mask.is-open { display: flex; }
.sheet {
  background: var(--surface); width: 100%; max-height: 86vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet__bar { width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 6px auto 10px; }
.sheet__title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.sheet__sub { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.evgroup { margin-bottom: 12px; }
.evgroup__label { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; color: var(--text-3); margin-bottom: 6px; }
.evopt {
  display: flex; align-items: center; gap: 9px; padding: 11px; border: 1.5px solid var(--border);
  border-radius: 10px; margin-bottom: 6px; cursor: pointer;
}
.evopt.is-on { border-color: var(--brand); background: var(--brand-soft); }
.evopt.is-full { opacity: .55; }
.evopt__name { flex: 1; min-width: 0; font-size: 14px; }
.evopt__meta { font-size: 11.5px; color: var(--text-3); flex: none; }
.evopt.is-on .evopt__meta { color: var(--brand-600); }

/* ---------- 表格（管理端） ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.tbl th { background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: 12px; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.c, table.tbl th.c { text-align: center; }

/* ---------- 统计块 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 12px; }
.stat__label { font-size: 11.5px; color: var(--text-3); }
.stat__value { font-size: 22px; font-weight: 700; line-height: 1.3; }
.stat__value small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 2px; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(19, 26, 44, .94); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13.5px; z-index: 90; max-width: 86vw; text-align: center;
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.toast.is-on { opacity: 1; }
.toast--err { background: #A3263F; }
.toast--ok { background: #0B7A3C; }

.muted { color: var(--text-3); }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- 桌面端微调 ---------- */
@media (min-width: 900px) {
  .wrap { padding-bottom: 40px; }
  .foot { position: sticky; bottom: 0; border-radius: var(--r-md); border: 1px solid var(--border); }
}
@media print {
  .foot, .topbar { display: none; }
  body { background: #fff; }
}

/* ============================================================
   管理端专用
   ============================================================ */

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 9px; white-space: nowrap; min-height: 38px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab.is-on { background: var(--brand); color: #fff; }
.tab .n {
  background: rgba(19, 26, 44, .08); color: inherit; border-radius: 999px;
  font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 17px;
}
.tab.is-on .n { background: rgba(255, 255, 255, .26); }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.toolbar .sep { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-height: 38px; padding: 7px 10px; font-size: 14px; }

/* ---------- 数字块（紧凑） ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 9px 11px;
}
.kpi__label { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.kpi__value { font-size: 20px; font-weight: 700; line-height: 1.35; }
.kpi--brand { border-color: #F7CDBE; background: var(--brand-soft); }
.kpi--brand .kpi__value { color: var(--brand-600); }
.kpi--green { border-color: #BEE7CE; background: var(--green-soft); }
.kpi--green .kpi__value { color: var(--green); }
.kpi--amber { border-color: #F3D9A6; background: var(--amber-soft); }
.kpi--amber .kpi__value { color: var(--amber); }
.kpi--red { border-color: #F2C6CE; background: var(--red-soft); }
.kpi--red .kpi__value { color: var(--red); }
.kpi--blue { border-color: #C9D9FA; background: var(--blue-soft); }
.kpi--blue .kpi__value { color: var(--blue); }

/* ---------- 侧栏布局（宽屏） ---------- */
.cols { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1080px) {
  .cols--2 { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 56px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar--green > i { background: var(--green); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(19, 26, 44, .46); z-index: 70;
  display: none; align-items: flex-start; justify-content: center;
  padding: 20px 14px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto;
}
.modal-mask.is-open { display: flex; }
.sheet-mask--top { z-index: 95; }
.modal {
  background: var(--surface); width: 100%; max-width: 620px; border-radius: var(--r-lg);
  box-shadow: var(--sh-3); animation: up .18s ease; overflow: hidden;
}
.modal--wide { max-width: 860px; }
.modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0; z-index: 2;
}
.modal__title { font-size: 14.5px; font-weight: 700; flex: 1; min-width: 0; }
.modal__sub { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.modal__body { padding: 14px; }
.modal__foot {
  display: flex; gap: 8px; align-items: center; padding: 10px 14px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.modal__foot .sep { flex: 1; }
.x {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--text-3); padding: 2px 6px; border-radius: 8px;
}
.x:active { background: var(--surface-3); }

/* ---------- 二维码块 ---------- */
.qrbox { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.qrbox__img {
  width: 176px; height: 176px; flex: none; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 6px; background: #fff;
}
.qrbox__img img { width: 100%; height: 100%; display: block; }
.qrbox__info { flex: 1; min-width: 200px; }
.passcode {
  font-size: 30px; font-weight: 700; letter-spacing: 6px; color: var(--brand-600);
  line-height: 1.2;
}
.linkbox {
  display: flex; gap: 6px; align-items: center; margin-top: 8px;
}
.linkbox input {
  flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 8px 10px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace;
  color: var(--text-2); background: var(--surface-2);
}

/* ---------- 运动员编辑（代填） ---------- */
.ea { border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 10px; margin-bottom: 9px; }
.ea__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ea__row { display: flex; gap: 8px; }
.ea__row > * { min-width: 0; }
.ea .input, .ea .select { min-height: 38px; padding: 7px 9px; font-size: 14px; }
.ea .seg button { min-height: 38px; font-size: 14px; }

/* ---------- 折叠块 ---------- */
details.fold { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 10px; }
details.fold > summary {
  cursor: pointer; padding: 11px 13px; font-size: 13.5px; font-weight: 700; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '▾'; margin-left: auto; color: var(--text-3); font-size: 12px; }
details.fold[open] > summary::after { content: '▴'; }
details.fold > .fold__body { padding: 0 13px 13px; }

/* ---------- 审核明细表 ---------- */
table.tbl--wrap td { white-space: normal; }
table.tbl tbody tr.is-on { background: var(--brand-soft); }

/* ---------- 代码块 ---------- */
.code {
  background: #131A2C; color: #E6EAF2; border-radius: var(--r-md); padding: 10px 12px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.7;
  overflow-x: auto; white-space: pre; margin-top: 8px;
}
.code--light { background: var(--surface-3); color: var(--text-2); }

/* ---------- 登录页 ---------- */
.gate { max-width: 400px; margin: 8vh auto 0; }
.gate__logo {
  width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 12px;
  background: linear-gradient(145deg, #F26A44, #E8552D 60%, #D14520);
  display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 700;
  box-shadow: var(--sh-2);
}

