/* ============================================================
   羽毛球比赛系统 · 移动端样式
   配色：中国海关关徽色系（藏青 #0B3355 + 关徽金 #B8891F + 白）
   风格：亮色底、运动感、横竖屏自适应
   ============================================================ */

:root {
  /* —— 海关主色 —— */
  --navy: #0b3355;
  --navy-2: #14507f;
  --blue: #1d6fb8;
  --blue-soft: #e8f1fa;
  --blue-line: #c3dcf1;
  --gold: #b8891f;
  --gold-bright: #d9a93a;
  --gold-deep: #8a6614;
  --gold-soft: #fdf4de;
  --gold-line: #edd9a4;

  /* —— 运动强调色 —— */
  --green: #0e9f6e;
  --green-soft: #e2f7ee;
  --orange: #d97b06;
  --orange-soft: #fff2dc;
  --red: #cf3f3f;
  --red-soft: #fdeaea;

  /* —— 中性 —— */
  --bg: #eef2f8;
  --bg-2: #e4eaf3;
  --card: #ffffff;
  --card-2: #f6f9fc;
  --line: #d5dfeb;
  --line-soft: #e6edf5;
  --text: #12283f;
  --muted: #5f7791;
  --muted-2: #8ba1b8;
  --placeholder: #b6c4d4;

  --radius: 16px;
  --radius-sm: 11px;
  --tabbar-h: 58px;
  --topbar-h: 56px;
  --shadow: 0 6px 20px rgba(11, 51, 85, 0.08);
  --shadow-lg: 0 14px 40px rgba(11, 51, 85, 0.16);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* 兼容旧变量名，避免遗漏引用 */
  --primary: var(--green);
  --primary-soft: var(--green-soft);
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  --warn: var(--orange);
  --warn-soft: var(--orange-soft);
  --danger: var(--red);
  --danger-soft: var(--red-soft);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 关键：下面 .sheet-mask / .dialog-mask 用了 display:flex，
   其优先级高于 hidden 属性的 UA 样式，必须显式兜底，
   否则遮罩会永远铺满屏幕、吞掉手机上的所有点击。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ------------------------------------------------------------ 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--topbar-h);
  padding: calc(var(--safe-t) + 8px) 14px 8px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 62%, var(--blue) 100%);
  color: #fff;
  border-bottom: 3px solid var(--gold-bright);
  box-shadow: 0 4px 16px rgba(11, 51, 85, 0.22);
}
/* 运动斜纹 */
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.07) 0 10px,
    rgba(255, 255, 255, 0) 10px 22px
  );
  pointer-events: none;
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; z-index: 1; }
.logo { font-size: 24px; line-height: 1; }
.title-wrap { min-width: 0; }
.topbar h1 {
  font-size: 16.5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58vw;
  color: #fff;
}
.topbar .sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58vw;
}
.topbar-right { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }

.role-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  white-space: nowrap;
  font-weight: 600;
}
.role-chip.admin { background: var(--gold-bright); border-color: var(--gold-bright); color: #3a2a00; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

/* ------------------------------------------------------------ 布局 */

.view {
  padding: 14px 14px 26px;
  max-width: 720px;
  margin: 0 auto;
  min-height: 60vh;
}

.section { margin-bottom: 18px; }
/*
 * 小节标题行：左边标题、右边计数、可能还有一个动作按钮（批量移除 / 批量删除 / 粘贴名单…）。
 *
 * 手机上这三样挤在一行会互相压：标题换行、计数被挤、按钮窄到只剩一两个字
 * （用户截图反馈「批量移除太窄了」）。
 * 规则改成：
 *   · 标题 flex:1 吃掉剩余宽度（min-width:0 允许它自己换行，不推挤别人）；
 *   · 计数不压缩；
 *   · 动作按钮**不参与压缩**、文字不换行、给一个最小宽度，
 *     排不下时整条换到第二行（order:5 让它排在计数之后，视觉上归到下一行）。
 */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 2px 10px;
}
.section-head h2 { font-size: 15px; color: var(--navy); flex: 1 1 auto; min-width: 0; }
.section-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  margin-right: 7px;
  vertical-align: -2px;
}
.section-head .hint { font-size: 12px; color: var(--muted); flex: 0 0 auto; order: 3; }
/* 赛程页「按时段分组」的头：时间 · 场地标签（这个点哪几块场地在打）· 日期与场次数 */
.section-head.slot-head h2 { flex: 0 0 auto; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.section-head .slot-courts { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; order: 2; }
.section-head .slot-courts .tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: var(--card-2);
  border-color: var(--line);
  padding: 2px 10px;
}
.section-head > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  order: 5;
  min-width: 88px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; overflow: hidden; }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ 通用控件 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 51, 85, 0.22);
}
.btn.gold {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  border-color: var(--gold);
  color: #3a2a00;
  box-shadow: 0 4px 12px rgba(184, 137, 31, 0.26);
}
.btn.accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.sport { background: linear-gradient(135deg, #12b981 0%, var(--green) 100%); border-color: var(--green); color: #fff; }
.btn.ghost { background: var(--card); }
.btn.danger { background: var(--red-soft); border-color: #f0bcbc; color: var(--red); }
.btn.warn { background: var(--orange-soft); border-color: #f0d09a; color: var(--orange); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 70px; resize: vertical; font-family: inherit; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 111, 184, 0.14);
}
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%235f7791' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag.ok { background: var(--green-soft); border-color: #b7e6d4; color: #0a7d57; }
.tag.warn { background: var(--orange-soft); border-color: #f0d09a; color: var(--orange); }
.tag.info { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.tag.danger { background: var(--red-soft); border-color: #f0bcbc; color: var(--red); }
.tag.gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-deep); }
.tag.ghost { background: var(--card-2); }
/* 抢七（6 局制网球：12 局打成 6:6 后加的那一局）—— 一眼能看出这场打过抢七 */
.tag.tb { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); font-weight: 700; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .em-icon { font-size: 34px; display: block; margin-bottom: 8px; opacity: .8; }

.divider { height: 1px; background: var(--line-soft); margin: 12px 0; }

/* ------------------------------------------------------------ 首页 */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 10px 28px rgba(11, 51, 85, 0.26);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.06) 0 12px,
    rgba(255, 255, 255, 0) 12px 26px
  );
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -50px; top: -60px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 169, 58, 0.45), transparent 68%);
  /* 纯装饰，绝不能吃点击（同 .profile-hero::after 的坑：盒子盖住谁，谁就点不动） */
  pointer-events: none;
}
.hero h2 { font-size: 19px; margin-bottom: 6px; position: relative; color: #fff; }
.hero .meta { font-size: 12.5px; color: rgba(255, 255, 255, 0.82); position: relative; }
.hero .meta span + span::before { content: " · "; color: rgba(255, 255, 255, 0.5); }

.progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  position: relative;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-bright), #f0cf72);
  transition: width .45s ease;
}
.progress-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.86);
  margin-top: 6px;
  position: relative;
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--navy); }
.stat-box .k { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat-box .v.green { color: var(--green); }
.stat-box .v.blue { color: var(--blue); }
.stat-box .v.gold { color: var(--gold); }

/* ------------------------------------------------------------ 比赛卡片 */

.match {
  display: block;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  margin-bottom: 9px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.match:active { background: var(--card-2); }
.match.st-awaiting_sign { border-left-color: var(--gold-bright); }
.match.st-done { border-left-color: var(--green); }
.match.st-pending { border-left-color: var(--blue-line); }
/* 打完一局就存一局：还在打（有比分但没提交）用蓝色实线，与「未开始」的浅蓝区分开 */
.match.st-playing { border-left-color: var(--blue); }
/* 未排场的场次：不能直接录成绩（要先补录日期/时段/场地），用橙色虚线边一眼区分 */
.match.st-unscheduled { border-left-color: var(--orange); border-left-style: dashed; }

/* 首页赛事卡片上的「本届规则」：赛制 / 积分 / 排名 / 签字 / 休息 逐行列出来。
   规则名固定宽度、说明自适应换行 —— 长句子（6 局制网球那句）在手机上也留在卡片里。 */
.rule-box { margin-top: 9px; }
.rule-head {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .4px;
  margin-bottom: 5px;
}
.rule-list {
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 5px;
}
.rule-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.55; }
.rule-k { flex: 0 0 4.2em; font-weight: 800; color: var(--muted); }
.rule-v { flex: 1 1 auto; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.rule-line + .rule-line { margin-top: 3px; }

/* 记分面板里的「保存进度」条：一行状态 + 一个手动保存按钮 */
.save-bar { display: flex; align-items: center; }
.save-bar .save-state { flex: 1 1 auto; min-width: 0; }
.save-bar .save-state.ok { color: #0a7d57; font-weight: 700; }
.save-bar .save-state.bad { color: var(--red); font-weight: 700; }

.match-top { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.match-top .time {
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  background: var(--navy);
  padding: 1px 8px;
  border-radius: 6px;
  letter-spacing: .3px;
}

.team { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.team .nm { flex: 1; min-width: 0; font-size: 14.5px; }
.team .nm .u { display: block; font-size: 11px; color: var(--muted-2); }
.team .sc {
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  text-align: right;
  color: var(--muted-2);
}
.team.win .nm { font-weight: 800; color: var(--green); }
.team.win .sc { color: var(--green); }
.team.lose .nm, .team.lose .sc { color: var(--muted-2); }
.team + .team { border-top: 1px dashed var(--line); margin-top: 3px; padding-top: 7px; }

.vs-line { text-align: center; font-size: 11px; color: var(--muted-2); margin: 4px 0; letter-spacing: 2px; }

/* ------------------------------------------------------------ 积分榜 */

.rank-list { display: flex; flex-direction: column; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.rank-item:last-child { border-bottom: none; }
.rank-item:active { background: var(--card-2); }
.rank-item.top1 { background: linear-gradient(90deg, rgba(217, 169, 58, 0.16), rgba(217, 169, 58, 0) 62%); }
.rank-item.top2 { background: linear-gradient(90deg, rgba(29, 111, 184, 0.10), rgba(29, 111, 184, 0) 62%); }
.rank-item.top3 { background: linear-gradient(90deg, rgba(184, 137, 31, 0.09), rgba(184, 137, 31, 0) 62%); }

.rank-no {
  width: 26px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: 0 0 26px;
}
.rank-no.m1 { color: var(--gold); }
.rank-no.m2 { color: var(--blue); }
.rank-no.m3 { color: #a9743f; }

.avatar {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 76px; height: 76px; flex-basis: 76px; font-size: 26px; }
.avatar.xl { width: 96px; height: 96px; flex-basis: 96px; font-size: 34px; }
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
.avatar.gold { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(217, 169, 58, 0.28); }

.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 14.5px; font-weight: 700; color: var(--navy); }
.rank-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.rank-pts { text-align: right; flex: 0 0 auto; }
.rank-pts .p { font-size: 19px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.rank-pts .s { font-size: 10.5px; color: var(--muted-2); }

.badge-inline { display: inline-flex; gap: 2px; margin-left: 4px; font-size: 12px; }

/* ------------------------------------------------------------ 选手形象墙 */

.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.player-tile {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-tile:active { background: var(--card-2); }

/* 「勋章刚更新」：签字确认后服务端延时重算勋章，变动的选手先亮一下。
   动画延时由 JS 按服务端给的变动次序错峰设置，肉眼能看出先后。 */
.player-tile.badge-fresh {
  border-color: var(--gold);
  animation: badgeFresh 1.6s ease-out both;
}
@keyframes badgeFresh {
  0% { box-shadow: 0 0 0 0 rgba(184, 137, 31, .55); }
  60% { box-shadow: 0 0 0 10px rgba(184, 137, 31, 0); }
  100% { box-shadow: var(--shadow); }
}
.fresh-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--gold-bright, #d9a93a), var(--gold, #b8891f));
  box-shadow: 0 1px 4px rgba(11, 51, 85, .18);
}
.fresh-note {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: var(--gold-soft, #fdf4de);
  color: #7a5a12;
  font-size: 13px;
  font-weight: 700;
  animation: badgeFresh 1.6s ease-out both;
}
.player-tile::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  /* 纯装饰，绝不能吃点击 */
  pointer-events: none;
}
.player-tile .avatar { margin: 0 auto 8px; }
/* 形象墙卡片 overflow:hidden，角标往外挪会被裁掉，收进来一点 */
.player-tile .sport-badges { top: 2px; right: 2px; }
.player-tile .nm { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.player-tile .un { font-size: 11px; color: var(--muted); margin-top: 1px; }
.player-tile .pts { margin-top: 7px; font-size: 12px; color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.player-tile .bds { margin-top: 4px; font-size: 12px; letter-spacing: 1px; }

/* ------------------------------------------------------------ 个人主页 */

.profile-hero {
  border-radius: 20px;
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(11, 51, 85, 0.26);
  position: relative;
  overflow: hidden;
}
.profile-hero::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -70px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 169, 58, 0.4), transparent 70%);
  /* 纯装饰，绝不能吃点击！
     它是最后一个子元素，绘制在 .row 之上；而命中测试看的是**盒子**、不是画出来的像素，
     所以这个 190×190 的圆（连全透明的部分）会把右下角的点击整片接走 ——
     正好盖住「上传形象照」按钮。实测 390×844 / 844×390 / 810×1080 / 1440×900
     四种视口，按钮中心的 elementFromPoint 全是 .profile-hero，真机点了完全没反应。 */
  pointer-events: none;
}
.profile-hero.rank-1 {
  background: linear-gradient(135deg, #3d2f08 0%, var(--navy) 55%, var(--gold-deep) 140%);
}
.profile-hero > * { position: relative; }
.profile-hero .name { font-size: 20px; font-weight: 800; color: #fff; }
.profile-hero .nick { font-size: 12.5px; color: var(--gold-bright); margin-top: 2px; }
.profile-hero .bio { font-size: 12.5px; color: rgba(255, 255, 255, 0.86); margin-top: 8px; }
.profile-hero .tiny, .profile-hero .muted { color: rgba(255, 255, 255, 0.72) !important; }
.profile-hero .avatar { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.16); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-cell {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 4px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-cell .v { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--navy); }
.stat-cell .v.green { color: var(--green); }
.stat-cell .v.blue { color: var(--blue); }
.stat-cell .k { font-size: 10.5px; color: var(--muted); }

.trend { display: flex; gap: 6px; align-items: center; }
.trend .dot {
  width: 24px; height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
}
.trend .dot.w { background: var(--green-soft); border-color: #b7e6d4; color: #0a7d57; }
.trend .dot.l { background: var(--red-soft); border-color: #f0bcbc; color: var(--red); }

.badge-wall { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 8px;
  background: var(--card);
  border: 1px solid var(--gold-line);
  /* 圆角矩形，不是胶囊。
     胶囊（border-radius:999px）只有一行短文字时好看，但勋章是**两行**
     （名称 + 说明），左右两端是半径 = 半个高度的圆弧，内容会顶到弧线外面 ——
     表现就是「积分王的『稀有』标注超出了勋章范围」。 */
  border-radius: 12px;
  box-shadow: var(--shadow);
}
/* 图标是 emoji：它是 flex 子项，默认 flex-shrink:1。
   名称一长（比如「积分王」再加个「稀有」），图标就被挤扁到几乎没有宽度，
   emoji 看起来就「失效」了。这里禁止收缩，并显式给出 emoji 字体栈，
   免得先被正文字体匹配走。 */
.badge-item .ic {
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
  font-size: 17px;
  line-height: 1.3;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
}
/* 文字块要能收缩，否则长名字会把整个勋章撑破 */
.badge-item > div { min-width: 0; }
.badge-item .tx {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.badge-item .dsc { font-size: 10px; color: var(--muted); }

/* ------------------------------------------------------------ 粘贴名单预览
   「自动归到这些项目」的每一行 */
.import-hit {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.import-hit:last-child { border-bottom: 0; }
.import-hit .grow { min-width: 0; }
.import-hit .nm { font-weight: 700; font-size: 13px; }
.import-hit .tag { flex: 0 0 auto; }

/* ------------------------------------------------------------ 对阵 / 签字 */

.vs-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
}
.vs-side { text-align: center; }
.vs-side .avatar { margin: 0 auto 8px; }
.vs-side .n { font-size: 14px; font-weight: 700; line-height: 1.35; }
.vs-side .u { font-size: 11px; color: var(--muted); }
.vs-side.win .n { color: var(--green); }
.vs-side.lose { opacity: .58; }
.vs-mid { text-align: center; }
.vs-mid .vs { font-size: 12px; color: var(--muted-2); font-weight: 800; letter-spacing: 2px; }
.vs-mid .gs { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 4px; color: var(--navy); }

.game-scores { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.game-pill {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.game-pill .lbl { font-size: 10px; color: var(--muted); display: block; text-align: center; font-weight: 500; }
/* 抢七那一局单独描边，跟普通局区分开 */
.game-pill.tb { border-color: var(--blue-line); background: var(--blue-soft); }
.game-pill.tb .lbl { color: var(--blue); font-weight: 700; }

.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sign-box {
  background: #fff;
  border-radius: var(--radius-sm);
  min-height: 116px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.sign-box img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.sign-box .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a9b6c4;
  font-size: 12px;
}
.sign-box .meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(11, 51, 85, 0.86);
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.sign-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ------------------------------------------------------------ 签字人选择 */

.signer-pick { display: flex; flex-direction: column; gap: 8px; }
.signer-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  transition: border-color .15s, background .15s, transform .08s;
}
.signer-card:active { transform: scale(0.98); }
.signer-card.on {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(217, 169, 58, 0.2);
}
.signer-card .sn { flex: 1; min-width: 0; }
.signer-card .sn b { font-size: 15px; color: var(--navy); }
.signer-card .sn span { display: block; font-size: 11.5px; color: var(--muted); }
.signer-card .tick {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  flex: 0 0 24px;
}
.signer-card.on .tick { background: var(--gold); border-color: var(--gold); color: #fff; }

/* 签字板 */
.pad-wrap {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.pad-wrap canvas { display: block; width: 100%; touch-action: none; background: #fff; }
.pad-line {
  position: absolute;
  left: 8%; right: 8%;
  bottom: 26%;
  border-bottom: 1px dashed #cfd9e4;
  pointer-events: none;
}
.pad-hint {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #c3ccd6;
  font-size: 15px;
  letter-spacing: 3px;
  pointer-events: none;
}
.pad-tools { display: flex; gap: 8px; margin-top: 10px; }
.pad-tools .btn { flex: 1; }

.handoff { text-align: center; padding: 28px 18px; }
.handoff .big { font-size: 46px; }
.handoff h3 { font-size: 19px; margin: 12px 0 8px; color: var(--navy); }

/* ------------------------------------------------------------ 记分板 */

.scoreboard { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.sb-team { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; }
.sb-team .n { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; color: var(--navy); }
.sb-team .r { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; color: var(--navy); }
.sb-team.lead .r { color: var(--green); }
.sb-team.lead .n { color: var(--green); }
.sb-games { display: flex; gap: 6px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.sb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tap-btn {
  min-height: 84px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--card);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  color: var(--navy);
  box-shadow: var(--shadow);
}
.tap-btn:active { transform: scale(0.97); }
.tap-btn.a {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  border-color: var(--navy);
  color: #fff;
}
.tap-btn.b {
  background: linear-gradient(160deg, var(--gold-bright) 0%, var(--gold) 100%);
  border-color: var(--gold);
  color: #3a2a00;
}
.tap-btn .plus { font-size: 30px; line-height: 1; font-weight: 900; }
.tap-btn .cap { font-size: 11px; font-weight: 600; opacity: .92; }

/* ------------------------------------------------------------ 裁判工作台 */

.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.op-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 13px;
  min-height: 92px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: inherit;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .08s;
}
.op-btn::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold-bright), var(--navy));
  /* 纯装饰，绝不能吃点击 */
  pointer-events: none;
}
.op-btn:active { transform: scale(0.97); background: var(--card-2); }
.op-btn .op-ic { font-size: 22px; line-height: 1; }
.op-btn .op-tx { font-size: 14px; font-weight: 800; margin-top: 4px; color: var(--navy); }
.op-btn .op-sub { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------ 文档上传 */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 24px 16px;
  background: var(--blue-soft);
  border: 2px dashed var(--blue-line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color .16s, background .16s;
}
.dropzone.over,
.dropzone:active { border-color: var(--navy); background: #dceaf8; }
.dropzone .dz-ic { font-size: 30px; line-height: 1; }
.dropzone .dz-t { font-size: 14px; font-weight: 700; color: var(--navy); }
.dropzone .dz-s { font-size: 11.5px; color: var(--muted); }

.import-table {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 12.5px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--card);
}
.import-table .it-head,
.import-table .it-row {
  display: grid;
  /* 姓名 | 单位 | 项目 | 性别 | 状态
     （没有「电话/手机号」列：平台不登记手机号与身份证号） */
  grid-template-columns: 1fr 1.1fr 1.2fr 0.5fr 0.7fr;
  gap: 6px;
  padding: 7px 10px;
  align-items: center;
}
.import-table .it-head {
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  position: sticky;
  top: 0;
}
.import-table .it-row { border-top: 1px solid var(--line-soft); }
.import-table .it-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-table .it-row.exists { opacity: .55; }
.import-table .it-row > span:last-child { text-align: right; color: var(--green); font-size: 11.5px; font-weight: 700; }
.import-table .it-row.exists > span:last-child { color: var(--muted); }
/* 报名表模式：项目列（组别）更需要宽度 */
.import-table.with-cat .it-head,
.import-table.with-cat .it-row {
  grid-template-columns: 1fr 1fr 1.4fr 0.5fr 0.7fr;
}

/* ------------------------------------------------------------ 多运动导航 */

.ctx-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(11, 51, 85, 0.18);
}
.ctx-bar:active { transform: scale(0.99); }
.ctx-bar .ctx-ico { font-size: 14px; opacity: .9; }
.ctx-bar .ctx-label { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.ctx-bar .ctx-caret { opacity: .8; }

.sport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sport-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 13px;
  background: var(--card);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: inherit;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .08s, border-color .15s;
}
.sport-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold-bright), var(--navy));
  /* 纯装饰，绝不能吃点击 */
  pointer-events: none;
}
.sport-tile:active { transform: scale(0.97); }
.sport-tile.on { border-color: var(--navy); background: var(--blue-soft); }
.sport-tile .st-ic { font-size: 26px; line-height: 1; }
.sport-tile .st-nm { font-size: 15px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.sport-tile .st-sub { font-size: 11.5px; color: var(--muted); }

.op-btn.on { border-color: var(--navy); background: var(--blue-soft); }

.pick-group { margin-bottom: 16px; }
.pick-title { font-size: 14px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.pick-block {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.pick-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 600; }
.pick-tour {
  cursor: pointer;
  padding: 8px 10px;
  margin: -2px -4px 8px;
  border-radius: 8px;
  background: var(--blue-soft);
}
.pick-tour:active { background: var(--card-2); }
.pick-tour .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chips .chip { padding: 6px 12px; font-size: 12.5px; }

/* 「本组别 / 本赛事总榜」切换条：比普通 chips 更醒目 */
.scope-chips { gap: 6px; }
.scope-chips .chip {
  flex: 1;
  justify-content: center;
  text-align: center;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--card);
}
.scope-chips .chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.manage-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.manage-block:last-child { border-bottom: none; }

/* ------------------------------------------------------------ 排名权重标注 */

.wt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  margin-right: 3px;
  vertical-align: -1px;
}
.wt-a { background: var(--gold-bright); color: #3a2a00; }
.wt-b { background: var(--navy); color: #fff; }
.wt-c, .wt-d, .wt-e { background: var(--line); color: var(--muted); }

.rank-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 12px;
  color: var(--muted);
}
.rank-legend .rl-title { font-weight: 700; color: var(--navy); margin-right: 2px; }
/* ①积分 → ②净胜场 → ③净胜局 → ④净胜分 → ⑤相互战绩
   五项**同一个样式**：金色/深蓝/灰色的小圆号 + 同样的文字。
   以前 ① 是金色文字、② 独自套了个深蓝药丸，看起来像两种东西（用户要求统一）。 */
.rank-legend .rl-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--navy);
  font-weight: 700;
}
.rank-legend .rl-item .wt { margin-right: 3px; }
.rank-legend .rl-arrow { color: var(--muted-2); }

/* 榜单表头：与行内的积分/净胜场两列对齐 */
.rank-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--blue-soft);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
}
.rank-head .rh-no { flex: 0 0 26px; text-align: center; color: var(--muted); }
.rank-head .rh-name { flex: 1; min-width: 0; }
.rank-head .rh-pts,
.rank-head .rh-diff { flex: 0 0 auto; min-width: 58px; text-align: right; display: flex; align-items: center; justify-content: flex-end; }
/* 表头这两列也统一：都是「小圆号 + 文字」，不给「净胜场」单独加深蓝底 */
.rank-head .rh-pts .wt,
.rank-head .rh-diff .wt { margin-right: 3px; }

.rank-diff {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: right;
}
.rank-diff .d {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.rank-diff .d.neg { color: var(--muted-2); }
.rank-diff .s { font-size: 10px; color: var(--muted-2); }

/* ------------------------------------------------------------ 记分：逐局校验 */

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color .15s, background .15s;
}
.score-row .row-no { flex: 0 0 54px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
/* 抢七那一行（6 局制网球） */
.score-row .row-no.tb { color: var(--blue); font-weight: 800; }
.score-row .row-colon { color: var(--muted-2); font-weight: 700; }
.score-input {
  flex: 1;
  min-height: 42px;
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 6px 8px;
  min-width: 0;
}
/* 未录入时显示选手姓名，颜色调淡、字号收小，一眼能看出是提示而非比分 */
.score-input::placeholder {
  color: var(--placeholder);
  opacity: 1;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  text-overflow: ellipsis;
}
.score-input:focus::placeholder { color: #c7d2de; }
.score-row.ok { border-color: var(--green); background: var(--green-soft); }
.score-row.bad { border-color: var(--red); background: var(--red-soft); }
.score-row.locked { opacity: .55; background: var(--bg-2); border-style: dashed; }
.score-row.locked .score-input { background: var(--bg-2); }

.row-status {
  font-size: 11.5px;
  color: var(--muted-2);
  padding: 3px 2px 8px 64px;
}
.row-status.ok { color: #0a7d57; }
.row-status.bad { color: var(--red); }
.row-status.locked { color: var(--muted-2); font-style: italic; }

.manual-rows { display: flex; flex-direction: column; gap: 2px; }
.manual-eval {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--blue-soft);
  border-radius: var(--radius-sm);
}
.manual-eval .pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.manual-eval .score-a { background: var(--navy); color: #fff; }
.manual-eval .score-b { background: var(--gold-bright); color: #3a2a00; }
/* 判定提示条（`.tag`）可能很长 —— 6 局制网球那句
   「6 局制：一局先得 4 分即胜；先胜 6 局且净胜 2 局；6:6 打抢七（先得 7 分且净胜 2 分，不封顶）」，
   而 `.tag` 默认 `white-space: nowrap`：手机上（430px 实测）这一条会整条顶出卡片右边缘、被截断。
   这里让它独占一行并允许换行（长串数字/英文也能断开），任何长度的提示都留在屏幕内。 */
.manual-eval .tag {
  flex: 1 1 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
  border-radius: 10px;
  text-align: left;
}

.decided-banner {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-deep);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.tap-btn.disabled { opacity: .4; pointer-events: none; filter: grayscale(.5); }

/* ------------------------------------------------------------ 排场 */

.day-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.day-row:last-child { border-bottom: none; }
.day-main { flex: 1; min-width: 0; }
.day-date { font-size: 15px; font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.day-row .day-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.day-row .btn.sm { white-space: nowrap; flex: 1 1 auto; }

.wd-row { display: flex; gap: 6px; flex-wrap: wrap; }
.wd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12.5px;
  cursor: pointer;
  color: var(--muted);
}
.wd.on { border-color: var(--navy); color: var(--navy); font-weight: 700; }
.wd input { margin: 0; }

.slot-box { max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.slot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.slot-row:last-child { border-bottom: none; }
.slot-row:active { background: var(--card-2); }
.slot-row.on { background: var(--gold-soft); }
.slot-row.full { opacity: .5; }
.slot-row .slot-t {
  flex: 0 0 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.slot-row .slot-c { flex: 1; font-size: 11.5px; color: var(--muted); }
.slot-row .slot-s { font-size: 11.5px; color: var(--green); font-weight: 700; }
.slot-row.full .slot-s { color: var(--muted-2); }
.slot-row.on .slot-s { color: var(--gold-deep); }

/* 调场：这个时段放不下（撞人 / 休息不够 / 场地满）→ 灰掉，原因写在下面一行 */
.slot-row.unavail {
  opacity: .55;
  background: repeating-linear-gradient(135deg, #f6f7f9 0 6px, #eef0f3 6px 12px);
  cursor: not-allowed;
}
.slot-row.unavail:active { background: repeating-linear-gradient(135deg, #f6f7f9 0 6px, #eef0f3 6px 12px); }
.slot-row.unavail .slot-t { color: var(--muted-2); }
.slot-row.unavail .slot-s { color: #b03030; }
.slot-why {
  padding: 4px 10px 8px;
  color: #b03030;
  background: #fff8f8;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.45;
}

/* ------------------------------------------------------------ 分享二维码 */

.qr-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--navy);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  text-align: center;
}

/* 顶栏按钮里的图标跟随文字色 */
.topbar .icon-btn svg { display: block; }

/* 平板等宽屏：顶栏按钮和图标都要放大 ——
   iPad 上按 34px 的按钮太小，右上角那一排不好点。
   按视口宽度分档，手机上保持原样。 */
@media (min-width: 600px) {
  .topbar-right { gap: 10px; }
  .topbar .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
  .topbar .icon-btn svg { width: 26px; height: 26px; }
  .role-chip { font-size: 12.5px; padding: 5px 13px; }
}
@media (min-width: 900px) {
  .topbar-right { gap: 12px; }
  .topbar .icon-btn { width: 48px; height: 48px; border-radius: 13px; }
  .topbar .icon-btn svg { width: 28px; height: 28px; }
  .role-chip { font-size: 13px; padding: 6px 15px; }
}
/* 横屏（哪怕手机横过来）也把按钮放大一点，方便点 */
html.landscape-mode .topbar .icon-btn { width: 42px; height: 42px; }
html.landscape-mode .topbar .icon-btn svg { width: 25px; height: 25px; }

/* 手动锁定了屏幕方向时给个金色描边，一眼看出不是「跟随设备」 */
.topbar .icon-btn.locked {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold-deep);
}

/* ------------------------------------------------------------ 游客可见性 */
.vis-card { border-color: var(--gold-line); }
.vis-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.vis-row:last-of-type { border-bottom: none; }
.vis-name { font-weight: 700; }

/* 积分榜上方的免责说明：本榜排名仅做参考，排名以工会通知为准 */
.rank-note {
  margin: 2px 0 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}
/* 重点提醒条（引导点进「个人形象页」）——
   用户 2026-09-20：原来那条淡蓝的"不够显眼"。现在做成蓝色→紫色的实心渐变条 + 白字加粗，
   带呼吸光晕和轻轻上下点的手指图标；点整条会滚到下面的选手列表。
   动效遵守 `prefers-reduced-motion`：系统里关了动画就只留静态的高对比条。 */
.rank-note.tip {
  background: linear-gradient(135deg, #1d6fb8 0%, #4553cf 55%, #7a3fd0 100%);
  border: 0;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(29, 111, 184, .32);
  animation: tip-glow 2.6s ease-in-out infinite;
}
.rank-note.tip .tip-ic {
  display: inline-block;
  margin-right: 5px;
  animation: tip-nudge 1.5s ease-in-out infinite;
}
@keyframes tip-glow {
  0%, 100% { box-shadow: 0 6px 18px rgba(29, 111, 184, .30); transform: translateY(0); }
  50% { box-shadow: 0 12px 26px rgba(122, 63, 208, .46); transform: translateY(-1px); }
}
@keyframes tip-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }   /* 小手朝下点：跟着"往下看选手"的方向走 */
}
@media (prefers-reduced-motion: reduce) {
  .rank-note.tip,
  .rank-note.tip .tip-ic { animation: none; }
}

/* 开关 */
.switch {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 26px;
  display: inline-block;
  cursor: pointer;
}

/* 一行"标题 + 说明 + 开关"（赛事设置里的「本届需要双方签字确认」这类） */
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch-row .grow { flex: 1 1 auto; min-width: 0; }
.switch-row .switch { align-self: center; }
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: background .18s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(11, 51, 85, .25);
  transition: transform .18s;
  /* 纯装饰，绝不能吃点击（开关整体仍是 label，点击照样能切换） */
  pointer-events: none;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ------------------------------------------------------------ 使用手册 */

.man-wrap { padding-bottom: 6px; }
.man-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.man-lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 12px;
}
.man-sec { margin-bottom: 12px; }
.man-sec-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.man-sec-head h2 { font-size: 14.5px; font-weight: 800; color: var(--navy); margin: 0; }
.man-sec-head span { font-size: 16px; line-height: 1; }

.man-step { margin-bottom: 12px; }
.man-step:last-child { margin-bottom: 0; }
.man-step-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.man-no {
  flex: 0 0 19px;
  width: 19px; height: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.man-step-title { font-size: 13.5px; font-weight: 700; color: var(--text); }

.man-list { margin: 0; padding-left: 26px; }
.man-list li {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 3px;
}
.man-list li b { color: var(--navy); }

.man-sub {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-deep, var(--navy));
  margin: 10px 0 4px;
}
.man-where {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.man-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--card-2);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  line-height: 1.6;
}
.man-warn {
  font-size: 12px;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 10px;
  line-height: 1.6;
  font-weight: 600;
}

.man-kv { display: flex; flex-direction: column; gap: 7px; }
.man-kv-row { display: flex; gap: 8px; align-items: flex-start; }
.man-kv-k {
  flex: 0 0 auto;
  max-width: 44%;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.6;
}
.man-kv-v {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}

/* 报名表自动分派的落点列表 */
.plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.plan-row:last-child { border-bottom: none; }
.plan-row .grow { min-width: 0; }
.plan-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-sport { font-weight: 700; color: var(--navy); }
.plan-cat {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 6px;
  padding: 1px 7px;
}
.plan-bad { border-left: 3px solid var(--red); padding-left: 8px; }

/* ------------------------------------------------------------ 口令输入 */

.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap .input { flex: 1; padding-right: 46px; }
.pwd-eye {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  opacity: .75;
}
.pwd-eye:active { background: var(--card-2); opacity: 1; }

/* ------------------------------------------------------------ 参赛名单 */

/* 名单按项目分开，选择条紧贴在名单上方 */
.roster-pick-hint { margin: 2px 0 5px; font-size: 11.5px; }

.roster-card { border-color: var(--gold-line); }

/* 已加入的组合：金色左边条 + 编号 + 头像，一眼看清谁已报名 */
.entry-list { display: flex; flex-direction: column; gap: 8px; }
.entry-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fbf6e8 0%, #fdfaf2 100%);
  border: 1px solid var(--gold-line);
  border-left: 5px solid var(--gold-bright);
  box-shadow: 0 1px 2px rgba(184, 137, 31, .08);
}
.entry-no {
  flex: 0 0 19px;
  width: 19px; height: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gold-bright);
  color: #3a2a00;
  font-size: 12px;
  font-weight: 800;
}
/* 批量移除模式：勾选框占的位置和序号一样宽，切模式时布局不跳 */
.entry-item > .entry-pick { flex: 0 0 19px; width: 18px; height: 18px; margin: 0; }
.entry-item.picking { border-left-color: var(--orange); }
.entry-avatars { display: flex; gap: -6px; flex: 0 0 auto; }
.entry-avatars > * { margin-right: -8px; border: 2px solid #fff; border-radius: 50%; }
.entry-avatars > *:last-child { margin-right: 0; }
.entry-dot {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 12px;
}
.entry-main { flex: 1; min-width: 0; }
.entry-names {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry-meta { font-size: 11.5px; color: var(--gold-deep); margin-top: 2px; }
.entry-empty {
  padding: 14px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: center;
}

/* 勾选加入：选中整行高亮 */
.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pick-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-variant-numeric: tabular-nums;
}
.pick-count.done { background: var(--green-soft); color: #0a7d57; }
.pick-count.over { background: var(--red-soft); color: var(--red); }

.pick-list { max-height: 280px; overflow-y: auto; }
.pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  margin-bottom: 4px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.pick-row input[type=checkbox] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}
.pick-row .pick-tick {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1.5px dashed var(--line);
  color: var(--line);
  font-size: 13px;
  font-weight: 800;
}
/* 选中态：整行加粗高亮，右侧打勾 */
.pick-row.picked {
  border-color: var(--navy);
  background: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(11, 51, 85, .07);
}
.pick-row.picked .small { font-weight: 800; color: var(--navy); }
.pick-row.picked .pick-tick {
  border-style: solid;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
/* 已报名：灰底 + 绿色标签，不能再选 */
.pick-row.used {
  background: var(--card-2);
  border-style: dashed;
  opacity: .8;
  cursor: default;
}

/* ------------------------------------------------------------ 形象墙 / 总表 */

/* 头像 + 性别配色 + 运动项目角标 */
.avatar-wrap { position: relative; display: inline-block; flex: 0 0 auto; }
.avatar-wrap.male .avatar { background: #e3eefb; color: #123a63; border-color: #bcd8f2; }
.avatar-wrap.female .avatar { background: #fde8f1; color: #b03a6e; border-color: #f6c6da; }
.sport-badges {
  position: absolute;
  top: -4px;
  right: -8px;
  display: flex;
  gap: 2px;
  pointer-events: none;
}
.sport-badges .sb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--gold-bright);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(11, 51, 85, .18);
}

/* 单位荣誉墙 */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.unit-tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  padding: 11px 9px 10px;
  text-align: center;
  cursor: pointer;
}
.unit-tile:active { background: var(--gold-soft); }
.unit-sports { top: 6px; right: 6px; }
.unit-sports .sb { width: 16px; height: 16px; font-size: 9.5px; }
.unit-ic { font-size: 19px; line-height: 1; }
.unit-nm { font-size: 12.5px; font-weight: 800; color: var(--navy); margin-top: 6px; }
.unit-pts { font-size: 16px; font-weight: 900; color: var(--gold); margin-top: 4px; font-variant-numeric: tabular-nums; }
.unit-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.unit-bds { margin-top: 7px; display: flex; justify-content: center; gap: 4px; }
.unit-bds .ub { font-size: 13px; line-height: 1; }

/* 形象墙上的小勋章 */
.player-tile .bds { display: flex; justify-content: center; gap: 3px; flex-wrap: wrap; }
.player-tile .bdi { font-size: 13px; line-height: 1; }

/* ------------------------------------------------------------ 荣誉勋章墙 */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
}
.badge-card {
  background: var(--card);
  border: 1.5px solid var(--gold-line);
  border-radius: var(--radius-sm);
  padding: 11px 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.badge-card:active { transform: scale(.97); }
.badge-card.empty { opacity: .5; border-style: dashed; box-shadow: none; }
.badge-card .bc-ic { font-size: 25px; line-height: 1; }
.badge-card .bc-lb { font-size: 12.5px; font-weight: 800; color: var(--navy); margin-top: 8px; }
.badge-card .bc-ds { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; min-height: 32px; }
.badge-card .bc-n {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-block;
  margin-top: 8px;
}

/* 获得条件（勋章墙卡片上直接写出来） */
.badge-card { position: relative; }
.badge-card .bc-how {
  font-size: 10.5px;
  color: var(--navy);
  background: var(--blue-soft);
  border-radius: 6px;
  padding: 5px 7px;
  margin-top: 7px;
  line-height: 1.55;
  text-align: left;
}
.rare-flag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #d94f4f, #b8891f);
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: .5px;
}
.rare-mini {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #d94f4f, #b8891f);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 1px;
}
.common-mini {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card-2);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 1px;
}

/* 弹层里的「获得条件」说明块 */
.how-box {
  background: var(--blue-soft);
  border: 1px solid #c3dcf1;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  margin-bottom: 12px;
}
.how-box .how-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}
.how-box .how-text { font-size: 12.5px; color: var(--navy); line-height: 1.7; }

/* 稀有勋章在个人主页上也有个标记 */
.badge-wall .badge-item.is-rare {
  border-color: #d94f4f;
  background: linear-gradient(180deg, #fff7f7 0%, #fdeaea 100%);
}

/* 个人主页上的勋章：放大一些，更显眼 */
/* 个人主页上的勋章：比默认稍大一点点即可。
   之前放到了 30px/15px，整块显得又大又笨，这里收回来。 */
.badge-wall { gap: 7px; }
.badge-wall .badge-item {
  padding: 8px 11px 8px 9px;
  border-width: 1.5px;
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #fffdf6 0%, #fdf6e4 100%);
  box-shadow: 0 1px 4px rgba(184, 137, 31, .12);
  cursor: pointer;
}
.badge-wall .badge-item .ic { font-size: 20px; line-height: 1.3; width: 26px; }
.badge-wall .badge-item .tx { font-size: 12.5px; font-weight: 800; color: var(--navy); }
.badge-wall .badge-item .dsc { font-size: 10.5px; }

/* ------------------------------------------------------------ 卡路里 */

.kcal-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.kcal-num {
  font-size: 29px;
  font-weight: 900;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kcal-num span { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.kcal-side { flex: 1; min-width: 140px; }
.fun-line {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-deep);
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 600;
}

/* ------------------------------------------------------------ 上传形象照 */

/* 勾选行：做成明显的整行可点区域，未勾选时按钮点不动要有反馈 */
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  cursor: pointer;
}
.agree-row input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--navy); }
.agree-row.need-agree {
  border-color: var(--red);
  background: var(--red-soft);
  animation: shakeX .4s ease;
}
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 「选择照片并上传」：按钮是**真实可见的 <button>**，隐藏的 file 控件只做
   「程序化打开选择框」的载体（按钮的 click 里同步调 file.click()）。

   不再用「透明 input 铺满整个按钮」的命中层：那要求浏览器把点击命中到一个
   完全透明的元素上，iOS Safari / 部分鸿蒙浏览器会静默吞掉这类点击，表现就是
   「按钮点了没反应」，而且完全量不出问题（几何覆盖 100% 也没用）。
   本站后台的「选择照片」「导入表格」按钮用的一直是 file.click()，从未出过问题。 */
.pick-wrap { position: relative; display: block; }
.pick-wrap.is-off { opacity: .55; }

/* 视觉隐藏但仍参与渲染（不能用 display:none —— iOS 会拒绝程序化 .click()）；
   pointer-events:none 保证它永远不会成为点击目标，只接受 .click() 调用。 */
.pick-wrap .pick-file {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}
.pick-wrap .pick-text { pointer-events: none; }

/* ------------------------------------------------------------ 淘汰赛 */

/* 赛程页顶部的赛制说明条（单败淘汰 / 含季军赛 / 几人表） */
.knockout-note {
  border-left: 4px solid var(--gold-bright);
  background: linear-gradient(180deg, #fdf8ec 0%, #fffdf7 100%);
}

/* 管理页「淘汰赛」卡片里的信息行 */
.ko-card .ko-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.ko-card .ko-row:last-child { border-bottom: 0; }
.ko-card .ko-name { font-weight: 600; font-size: 13px; }
.ko-card .ko-meta { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------ 查选手参赛记录 */

/* 一行一场：时间 · 轮次 · 胜/负 · 对手与比分（点开那场比赛） */
.pm-match {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.pm-match:active { background: var(--card-2); }
.pm-match .pm-time {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.pm-match .pm-round { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.pm-match .pm-opp { min-width: 0; }
.pm-btn { flex: 0 0 auto; }

/* ------------------------------------------------------------ 单位规范化提示 */

/* 单位输入框下面的即时提示：会被统一 / 认不出的新写法 / 已是规范名 */
.unit-hint { margin-top: 6px; line-height: 1.5; }
.unit-hint.is-change { color: var(--blue); font-weight: 700; }
.unit-hint.is-unknown { color: var(--orange); font-weight: 700; }
.unit-hint.is-ok { color: #0a7d57; font-weight: 700; }

/* ------------------------------------------------------------ 排期冲突提示 */

/* 名单与对阵表对不上（加人之后新人没有场次）时的核对提示 */
.roster-sync {
  border: 1.5px solid var(--gold-line);
  background: linear-gradient(180deg, #fffdf6 0%, var(--gold-soft) 100%);
}
.roster-sync .btn { width: 100%; }

/* 「只有 1 个参赛方」的处理卡 / 状态卡：
   待处理（金）· 已判冠军（金）· 已取消（红）· 判定失效（橙） */
.solo-card.pending, .solo-card.champion, .solo-note.champion {
  border: 1.5px solid var(--gold-line);
  background: linear-gradient(180deg, #fffdf6 0%, var(--gold-soft) 100%);
}
.solo-card.cancelled, .solo-note.cancelled {
  border: 1.5px solid #f0bcbc;
  background: linear-gradient(180deg, #fff8f8 0%, var(--red-soft) 100%);
}
.solo-card.stale, .solo-note.stale {
  border: 1.5px solid #f0d09a;
  background: linear-gradient(180deg, #fffdf7 0%, var(--orange-soft) 100%);
}
/* 赛事/项目选择条里已取消的项目：压暗一点，别让人以为还能排场 */
.chip.cancelled { opacity: .6; border-style: dashed; }
.chip.cancelled.active { opacity: 1; }

.conflict-card {
  border: 1.5px solid #f0bcbc;
  background: linear-gradient(180deg, #fff8f8 0%, #fdeaea 100%);
}
.conflict-card .section-head h2 { color: #b03030; }
.conflict-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 2px;
  border-bottom: 1px solid #f4d4d4;
  cursor: pointer;
}
.conflict-row:active { background: rgba(207, 63, 63, .06); }
.conflict-row .cf-dot {
  flex: 0 0 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
}

/* ------------------------------------------------------------ 过期排期
   过期的场次：时间已过但还没打。它既保留在原比赛日那天（记录不丢），
   也会出现在「待排场次」里等着重排 —— 两边互不干涉。
   视觉上用琥珀色而不是红色：这不是「出错」，是「需要重排」。 */
.conflict-row.is-expired { border-bottom-color: #f0d09a; }
.conflict-row.is-expired .cf-dot { background: var(--orange); }

.match.is-expired {
  border-left-color: var(--orange);
  background: linear-gradient(180deg, #fffdf7 0%, var(--orange-soft) 100%);
}
.match .expired-note { color: var(--orange); font-weight: 600; }
.match .expired-arch { color: var(--muted); }

/* 补录：故意安排在已经过去的时间（比赛打过了，事后补登记）。
   用蓝色区分于过期的琥珀色 —— 它不是问题，是历史记录。 */
.match.is-backfill { border-left-color: var(--blue); }
.match.is-backfill .time { color: var(--blue); font-weight: 600; }

/* 补录弹窗里的场次勾选列表 */
.bf-list {
  max-height: 42vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
}
.bf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.bf-row:last-child { border-bottom: 0; }
.bf-row input { flex: 0 0 auto; width: 18px; height: 18px; }
.bf-row .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bf-row .nm { font-weight: 600; font-size: 13px; }

/* ------------------------------------------------------------ 长按保存浮层 */

/* 鸿蒙/微信等不支持系统分享的浏览器：把图铺满屏幕让用户长按存图 */
.longpress-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 20, 34, .94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.longpress-img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  -webkit-touch-callout: default;   /* 关键：允许长按弹出「存储图像」 */
  user-select: auto;
}
.longpress-tip { margin-top: 18px; text-align: center; }
.longpress-tip .lp-title { color: #fff; font-size: 15px; font-weight: 800; }
.longpress-tip .lp-sub { color: rgba(255, 255, 255, .7); font-size: 12.5px; margin-top: 6px; }
.longpress-tip .btn { min-width: 150px; }

/* ------------------------------------------------------------ 站点页脚 */

.site-foot {
  max-width: 720px;
  margin: 18px auto 8px;
  padding: 16px 16px 4px;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-foot .foot-line { font-size: 12.5px; color: var(--muted); }
.site-foot .foot-line b { color: var(--navy); font-weight: 800; }
.site-foot .foot-dim { font-size: 11px; color: var(--muted-2); margin-top: 5px; letter-spacing: .2px; }

.photo-head { display: flex; align-items: center; gap: 14px; }
.photo-preview {
  flex: 0 0 72px;
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold-bright);
  background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview .ph-ph { font-size: 11px; color: var(--muted-2); text-align: center; padding: 0 6px; }
.photo-name { font-size: 17px; font-weight: 800; color: var(--navy); }
.warn-box {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  border: 1px solid #f0bcbc;
  color: #9b2c2c;
  font-size: 12.5px;
  line-height: 1.7;
}

/* ------------------------------------------------------------ 弹层 */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 28px + var(--safe-b));
  transform: translateX(-50%) translateY(10px);
  background: var(--navy);
  border: 1px solid var(--navy-2);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 100;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  max-width: 86vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  /* 提示是纯通知，永远不许吃点击。
     一旦它能接点击，它压住哪个按钮、那个按钮就「点不动」——
     横屏手机上它正好压在弹层底部那排按钮上（实测：按钮 y 313~357，toast y 327~370），
     于是「点上传没反应 → 提示挡住按钮 → 再点还是没反应」。 */
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); border-color: #b63636; }
.toast.ok { background: var(--green); border-color: #0b8159; }
.toast.warn { background: var(--gold-deep); border-color: #8a6712; }

.sheet-mask, .dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(11, 51, 85, 0.42);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dialog-mask { align-items: center; padding: 20px; }

.sheet {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--line);
  border-bottom: none;
  padding: 8px 16px calc(20px + var(--safe-b));
  animation: slideUp .22s ease;
  box-shadow: var(--shadow-lg);
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 6px auto 14px; }
.sheet h3 { font-size: 16px; margin-bottom: 12px; color: var(--navy); }

.dialog {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
}
.dialog h3 { font-size: 16px; margin-bottom: 8px; color: var(--navy); }
.dialog .actions { display: flex; gap: 10px; margin-top: 16px; }
.dialog .actions .btn { flex: 1; }


/* ------------------------------------------------------------ 弹层滚动锁 */

/* 弹层打开时锁死背景页面，避免在弹层里滑动时把后面的页面也带着滚。
   位置由 js 通过 body.style.top 保留，关闭时还原（见 util.js lockScroll）。 */
html.scroll-locked,
html.scroll-locked body { overflow: hidden; height: 100%; }
html.scroll-locked body { position: fixed; left: 0; right: 0; width: 100%; }

/* 弹层内部滚到底/顶时不要继续传给背景 */
.sheet-mask, .dialog-mask, .sheet { overscroll-behavior: contain; }

/* ------------------------------------------------------------ 底部标签栏 */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(11, 51, 85, 0.07);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
  cursor: pointer;
  position: relative;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--navy); font-weight: 700; }
.tab.active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gold-bright);
  /* 纯装饰，绝不能吃点击 */
  pointer-events: none;
}

/* ------------------------------------------------------------ 形象卡 */

.card-canvas-wrap {
  background: var(--card-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 10px;
  text-align: center;
  overflow: auto;
}
.card-canvas-wrap canvas { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 0 auto; }

.spin {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(11, 51, 85, 0.2);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 40px; color: var(--muted); }

@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .field-grid { grid-template-columns: 1fr 1fr 1fr; }
}


/* ============================================================
   横屏操作模式（裁判拿手机横着记分 / 签字）
   底部标签栏改成左侧竖向导航，内容改成多列，弹层改成居中面板

   由 html.landscape-mode 控制，而不是直接写在媒体查询里：
   - 设备横屏时由 JS 自动加上（跟随设备）
   - 也可点顶栏按钮手动强制横屏 / 强制竖屏
   横屏样式只有这一份，自动与手动共用，不会走样。
   注意：这里刻意用扁平选择器，不用 CSS 嵌套，
   以免旧版手机浏览器整块样式被丢弃。
   ============================================================ */

html.landscape-mode body { padding-bottom: 0; padding-left: 68px; }

html.landscape-mode .topbar {
  min-height: 46px;
  padding: calc(var(--safe-t) + 5px) 14px 5px;
}
html.landscape-mode .topbar h1 { font-size: 15px; max-width: none; }
html.landscape-mode .topbar .sub { display: none; }
html.landscape-mode .logo { font-size: 20px; }

html.landscape-mode .view { max-width: 1100px; padding: 10px 16px 16px; }

/* 竖向标签栏 */
html.landscape-mode .tabbar {
  top: 0; bottom: 0; left: 0; right: auto;
  width: 68px;
  height: auto;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, 1fr);
  padding-bottom: 0;
  border-top: none;
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 18px rgba(11, 51, 85, 0.07);
}
html.landscape-mode .tab { font-size: 9.5px; gap: 3px; }
html.landscape-mode .tab svg { width: 20px; height: 20px; }
html.landscape-mode .tab.active::before {
  top: 50%; left: 0;
  transform: translateY(-50%);
  width: 3px; height: 26px;
  border-radius: 0 3px 3px 0;
}

/* 内容多列化，减少纵向滚动 */
html.landscape-mode .op-grid { grid-template-columns: repeat(4, 1fr); }
html.landscape-mode .op-btn { min-height: 84px; padding: 11px; }
html.landscape-mode .op-btn .op-tx { font-size: 13px; }
html.landscape-mode .player-grid { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); }
html.landscape-mode .stat-row { grid-template-columns: repeat(6, 1fr); }
html.landscape-mode .rank-list { display: grid; grid-template-columns: 1fr 1fr; }
html.landscape-mode .rank-item { border-bottom: 1px solid var(--line-soft); }
html.landscape-mode .hero { padding: 13px 16px; }
html.landscape-mode .hero h2 { font-size: 17px; }
html.landscape-mode .stat-grid { grid-template-columns: repeat(8, 1fr); }

/* 弹层：居中面板，充分利用宽度 */
html.landscape-mode .sheet-mask { align-items: center; padding: 10px; }
html.landscape-mode .sheet {
  max-width: 940px;
  max-height: calc(100vh - 20px);
  border-radius: 18px;
  border-bottom: 1px solid var(--line);
  padding: 6px 20px 16px;
}
html.landscape-mode .sheet-handle { display: none; }
html.landscape-mode .handoff { padding: 16px 18px; }
html.landscape-mode .handoff .big { font-size: 34px; }

/* 记分板：比分与加分键左右并排，全程无需滚动 */
html.landscape-mode .sb-live { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: stretch; }
html.landscape-mode .sb-actions { margin-top: 0; }
html.landscape-mode .tap-btn { min-height: 118px; }
html.landscape-mode .sb-team .r { font-size: 34px; }

/* 签字：画布铺满宽度，工具与按钮一行排开 */
html.landscape-mode .sign-grid { grid-template-columns: 1fr 1fr; }

html.landscape-mode .toast { bottom: 20px; left: calc(50% + 34px); }

/* 弹层打开时把提示挪到顶部：底部正是弹层的操作按钮区，
   提示留在下面不但挡住按钮，还会把要提示的内容压在按钮上。
   ★ 必须写在上面这条横屏规则**之后**，并且用 html.landscape-mode.scroll-locked
     把优先级提到 (0,3,1) —— 否则横屏那条 (0,2,1) 会把 bottom 拉回 20px，
     而 top/bottom 同时生效会把提示从顶部一直撑到屏幕底部（实测撑成 358px 高）。 */
html.scroll-locked .toast,
html.landscape-mode.scroll-locked .toast {
  top: calc(var(--safe-t) + 12px);
  bottom: auto;
  transform: translateX(-50%) translateY(-10px);
}
html.scroll-locked .toast.show,
html.landscape-mode.scroll-locked .toast.show {
  transform: translateX(-50%) translateY(0);
}
