/* ==========================================================
   匹克球赛事助手 · H5
   ========================================================== */

:root {
  --bg: #f5f6f3;
  --card: #ffffff;
  --ink: #14231b;
  --ink-2: #41564b;
  --muted: #84958c;
  --line: #e6ebe3;
  --line-2: #d3dcd0;
  --brand: #0c5a44;
  --brand-2: #12876a;
  --lime: #d8f45c;
  --lime-2: #c6e545;
  --lime-ink: #27350a;
  --gold: #e0aa2e;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --r: 16px;
  --shadow: 0 1px 2px rgba(13, 42, 30, .04), 0 4px 16px rgba(13, 42, 30, .05);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

a { color: var(--brand-2); text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.boot {
  min-height: 70vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------- 顶栏 */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }

.brand .lg {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0a3d2e, #12876a);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(12, 90, 68, .22);
}
.brand .lg svg { width: 24px; height: 24px; }

.brand-tx { min-width: 0; }
.brand-tx strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tx small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #0d6b50;
  background: #e9f6f0;
  border-radius: 99px;
  padding: 4px 8px;
  flex: 0 0 auto;
}
.live i { width: 6px; height: 6px; border-radius: 50%; background: #18a06f; }
.live.off { color: #94651a; background: #fdf3dd; }
.live.off i { background: #e0aa2e; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex: 0 0 auto;
}
.icon-btn svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------- 主区域 */

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px calc(92px + var(--safe-b));
  min-height: 70vh;
}

.page-h { display: flex; align-items: flex-end; gap: 8px; margin: 2px 2px 12px; }
.page-h h1 { font-size: 19px; margin: 0; letter-spacing: .3px; }
.page-h .sub { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* ---------------------------------------------------------- 底栏 */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar-in {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--brand); }
.tab.on::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brand-2);
}
.tab .badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 20px);
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  background: #e0503c;
  color: #fff;
  font-size: 9.5px;
  line-height: 15px;
  text-align: center;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .07s, background .15s, box-shadow .15s;
}
.btn:active { transform: scale(.975); }
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(12, 90, 68, .18);
}
.btn.lime { background: var(--lime); border-color: var(--lime-2); color: var(--lime-ink); }
.btn.ghost { background: transparent; }
.btn.danger { background: #fff; border-color: #efc9c3; color: var(--danger); }
.btn.sm { height: 34px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.xs { height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; }
.btn.link { height: auto; padding: 0; border: none; background: none; color: var(--brand-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- 通用卡片 */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 11px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 14px; margin: 0; }
.card-h .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 12px 14px; }
.card-b.flush { padding: 0; }

/* ---------------------------------------------------------- 进度卡 */

.pcard {
  position: relative;
  overflow: hidden;
  background: linear-gradient(125deg, #08382a, #0c5a44 55%, #14876a);
  color: #fff;
  border-radius: 20px;
  padding: 16px 16px 15px;
  box-shadow: 0 8px 24px rgba(10, 61, 46, .22);
}
.pcard::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 22px rgba(255, 255, 255, .04), 0 0 0 48px rgba(255, 255, 255, .025);
}
.pcard .k { font-size: 11px; opacity: .78; letter-spacing: 1px; }
.pcard .v { font-size: 27px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; margin: 2px 0 9px; }
.pcard .v small { font-size: 12.5px; font-weight: 600; opacity: .72; margin-left: 3px; letter-spacing: 0; }
.pcard .row { display: flex; align-items: center; gap: 12px; }
.pbar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; flex: 1; }
.pbar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #b7e84a, var(--lime)); transition: width .4s; }
.pcard .hint { font-size: 10.5px; opacity: .74; margin-top: 8px; }

/* ---------------------------------------------------------- 分段 / 筛选 */

.seg {
  display: flex;
  background: #e9eee6;
  padding: 3px;
  border-radius: 12px;
  gap: 2px;
  margin: 12px 0;
}
.seg button {
  flex: 1;
  height: 34px;
  border: 0;
  background: none;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: inherit;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .07); }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 11px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: inherit;
}
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------------------------------------------------- 轮次 / 比赛 */

.round { margin-top: 14px; }
.round:first-child { margin-top: 2px; }
.round-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 3px 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.round-h .ln { flex: 1; height: 1px; background: var(--line); }
.round-h .n { font-size: 10px; color: var(--muted); font-weight: 600; }

.mrow {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 11px 9px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(13, 42, 30, .03);
  position: relative;
}
.mrow.tap { cursor: pointer; }
.mrow.tap:active { transform: scale(.995); background: #fcfdfb; }
.mrow.done { background: #fbfcf9; }
.mrow.is-live { border-color: #efdcae; background: #fffdf6; }

.mrow-h { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.mrow-h .tag { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.mrow-h .sp { margin-left: auto; display: flex; gap: 5px; align-items: center; }

.tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--g, 1), 30px);
  gap: 5px;
  align-items: center;
  padding: 2px 0;
}
.tr .nm {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tr.win .nm { color: var(--brand-2); font-weight: 800; }
.tr.lose .nm { color: #a3b0a8; font-weight: 500; }
.sc {
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f2f5f0;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.sc.blank { background: transparent; color: #d3dbd0; }
.tr.win .sc { background: #e3f4ec; color: #0b6a4f; }

.mrow-f {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
}
.mrow-f .sp { margin-left: auto; }
.mrow-f .win-tag { color: #0b6a4f; font-weight: 700; }

.state {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.state.wait { background: #f0f3ee; color: #7d8f86; }
.state.live { background: #fff2d6; color: #a5751a; }
.state.done { background: #e4f3ec; color: #0d6b50; }
.state.bye { background: #eaeff8; color: #5a6b8c; }

/* ---------------------------------------------------------- 排名 */

table.rank { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rank th {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .4px;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.rank td { padding: 9px 10px; border-bottom: 1px solid #f0f4ee; vertical-align: middle; }
.rank tr:last-child td { border-bottom: none; }
.rank td.rk { width: 50px; }
.rank td.nt { text-align: right; color: var(--muted); font-size: 11px; white-space: nowrap; }
.rank td.nm { font-weight: 600; }

.medal {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.medal.g1 { background: linear-gradient(135deg, #f2c94c, #d99b16); }
.medal.g2 { background: linear-gradient(135deg, #c3ced4, #8fa0a8); }
.medal.g3 { background: linear-gradient(135deg, #d5a06a, #a9713c); }
.medal.plain { background: #eef2ec; color: var(--muted); }

table.st { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 300px; }
.st th { font-size: 10px; font-weight: 700; color: var(--muted); padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.st td { padding: 7px 4px; text-align: center; border-bottom: 1px solid #f0f4ee; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st td.nm { text-align: left; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.st tr:last-child td { border-bottom: none; }
.st tr.out td { color: #a3b0a8; }
.st tr.q .nm { color: var(--brand-2); }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------- 队伍 */

.tcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  box-shadow: 0 1px 2px rgba(13, 42, 30, .03);
}
.tlist { display: flex; flex-direction: column; gap: 8px; }
.tc-h { display: flex; align-items: center; gap: 7px; }
.tc-h h3 { margin: 0; font-size: 14.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tc-players { font-size: 11.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.6; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eff3ec;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.lime { background: #eef9c9; color: #46570f; }
.chip.brand { background: #e3f2ec; color: var(--brand); }
.chip.gold { background: #fdf3d8; color: #8a6110; }
.chip.red { background: var(--danger-bg); color: var(--danger); }

.seed-btn {
  border: none;
  background: none;
  font-size: 17px;
  color: #cbd4c8;
  padding: 0 2px;
  line-height: 1;
}
.seed-btn.on { color: var(--gold); }

/* ---------------------------------------------------------- 我的 */

.set-list { display: flex; flex-direction: column; }
.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.set-row:last-child { border-bottom: none; }
.set-row .ic { width: 30px; height: 30px; border-radius: 9px; background: #eef3ea; display: grid; place-items: center; font-size: 15px; flex: 0 0 30px; }
.set-row .tx { flex: 1; min-width: 0; }
.set-row .tx b { display: block; font-weight: 600; font-size: 13.5px; }
.set-row .tx span { display: block; font-size: 11px; color: var(--muted); }
.set-row .go { color: #c3cec1; font-size: 16px; }

.kv { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); flex: 0 0 auto; }
.kv .v { margin-left: auto; text-align: right; font-weight: 600; }

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

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .tip { font-size: 11px; color: var(--muted); line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(18, 135, 105, .12);
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2384958c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.row2 { display: flex; gap: 10px; }
.row2 > .field { flex: 1; }

.member-row { display: flex; gap: 7px; align-items: center; margin-bottom: 8px; }
.member-row .idx { width: 18px; font-size: 11px; color: var(--muted); text-align: center; flex: 0 0 18px; }
.member-row .input { padding: 9px 11px; }
.member-row .del { border: none; background: #f4f7f2; color: #9aa8a0; width: 32px; height: 38px; border-radius: 9px; flex: 0 0 32px; font-size: 14px; }

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

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { font-size: 42px; line-height: 1; margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--ink-2); }
.empty p { margin: 0 auto 16px; font-size: 12.5px; max-width: 300px; line-height: 1.7; }

.warn {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #fff6e0;
  color: #7a5510;
  border: 1px solid #f2e0b3;
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
}
.warn.info { background: #eef5ff; color: #2f5a92; border-color: #d4e3f7; }
.warn.ok { background: #eaf7f0; color: #0f6b4c; border-color: #cfe9dd; }
.warn.danger { background: var(--danger-bg); color: #9c2f22; border-color: #f3cdc8; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.65; }

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

.mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 26, 18, .48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s;
}
.mask.in { opacity: 1; }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  background: #fff;
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(26px);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
}
.mask.in .sheet { transform: none; }

.sheet-h {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 10px;
  flex: 0 0 auto;
}
.sheet-h .st { font-size: 16px; font-weight: 700; }
.sheet-h .ss { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sheet-h .x {
  margin-left: auto;
  border: none;
  background: #f0f3ee;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1;
  flex: 0 0 30px;
}
.sheet-b { padding: 0 16px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-f {
  padding: 10px 16px calc(14px + var(--safe-b));
  display: flex;
  gap: 9px;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
}
.sheet-f .btn { flex: 1; }

/* 记分弹层 */

.sc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--g, 1), minmax(46px, 1fr));
  gap: 7px;
  align-items: center;
  padding: 5px 0;
}
.sc-row .nm {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-row.b .nm { color: var(--ink-2); }
.sc-in {
  height: 56px;
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 13px;
  text-align: center;
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: var(--ink);
  background: #fbfdfa;
  padding: 0;
  appearance: none;
  -moz-appearance: textfield;
}
.sc-in::-webkit-outer-spin-button,
.sc-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sc-in:focus { outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(18, 135, 105, .13); }
.sc-in::placeholder { color: #d6dfd3; font-weight: 500; }
.sc-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--g, 1), minmax(46px, 1fr));
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 2px 0 0;
}

/* ---------------------------------------------------------- Toast */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
  width: min(90vw, 420px);
}
.toast {
  background: #12211a;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: 11px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .24);
  animation: tin .2s ease-out;
  max-width: 100%;
  text-align: center;
}
.toast.err { background: #9c2f22; }
.toast.ok { background: #0d6b50; }
.toast.out { animation: tout .24s ease-in forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes tout { to { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------- 二维码 / 分享 */

.share { text-align: center; padding: 6px 0 2px; }
.qr-wrap {
  display: inline-block;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  line-height: 0;
}
.qr-wrap svg { display: block; }
.share .url {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.5;
}
.share .acts { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* ---------------------------------------------------------- 报名页 */

.join-head {
  background: linear-gradient(135deg, #08382a, #0c5a44 60%, #14876a);
  color: #fff;
  padding: 26px 18px 22px;
  border-radius: 0 0 22px 22px;
}
.join-head .org { font-size: 11px; opacity: .75; letter-spacing: 2px; }
.join-head h1 { margin: 6px 0 4px; font-size: 22px; }
.join-head p { margin: 0; font-size: 12.5px; opacity: .8; }
.join-body { padding: 14px; max-width: 720px; margin: 0 auto; }
.join-foot { padding: 6px 0 30px; }

/* ---------------------------------------------------------- 响应式 */

@media (min-width: 640px) {
  .mask { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; margin: 0; }
  .sheet-f { padding-bottom: 14px; }
  .tabbar-in { grid-template-columns: repeat(4, 1fr); }
  .main { padding-left: 18px; padding-right: 18px; }
}

@media print {
  .top, .tabbar, .toasts, .mask { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
}

/* --- 记分弹层里的长队名允许换行 --- */
.sc-row .nm { white-space: normal; line-height: 1.3; word-break: break-word; }

/* --- 未产生对阵时不显示记分格 --- */
.tr.pending { grid-template-columns: minmax(0, 1fr); }

/* --- 报名页右上角返回赛程 --- */
.join-head { position: relative; }
.join-link { position: absolute; top: 16px; right: 18px; color: #fff; opacity: .82; font-size: 12px; }

/* ---------------- 名单页 ---------------- */
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.prow:last-child { border-bottom: none; }
.prow .who { min-width: 0; flex: 1; }
.prow .who b { display: block; font-size: 13.5px; }
.prow .who small { color: var(--muted); font-size: 11.5px; }
.prow .acts { display: flex; gap: 6px; flex: 0 0 auto; }
.tc-h .chip { flex: 0 0 auto; }

/* ---------------- 裁判计分 ---------------- */
.ref { min-height: 100dvh; display: flex; flex-direction: column; background: #f4f6f2; }
.ref-login { padding: 52px 22px 40px; max-width: 520px; margin: 0 auto; text-align: center; }
.rl-badge { display: inline-block; background: #0c5a44; color: #fff; border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 700; letter-spacing: 3px; }
.ref-login h1 { font-size: 21px; margin: 16px 0 4px; }
.ref-login p { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }
.rl-form { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.rl-back { display: inline-block; margin-top: 20px; color: var(--brand-2); font-size: 12.5px; }

.ref-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.ref-top > div { flex: 1; min-width: 0; }
.ref-top b { display: block; font-size: 14px; }
.ref-top small { color: var(--muted); font-size: 11px; }
.ref-top .rt-mid { text-align: center; }

.ref-tabs { display: flex; gap: 6px; padding: 10px 12px 6px; }
.ref-tabs button { flex: 1; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ref-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.ref-list { padding: 6px 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.ref-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-align: left; width: 100%; }
.rr-l { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.rr-n { flex: 1; font-weight: 700; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-n i { font-style: normal; color: var(--muted); font-weight: 400; margin: 0 6px; font-size: 11px; }
.rr-go { color: #c3cec6; font-size: 18px; }

.ref-board { flex: 1; display: flex; gap: 8px; padding: 10px; min-height: 0; }
.ref-board.swapped { flex-direction: row-reverse; }
.refp { flex: 1; border: none; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px 8px; color: #fff; transition: transform .07s ease; }
.refp:active { transform: scale(.985); }
.refp:disabled { opacity: .8; }
.refp.a { background: linear-gradient(160deg, #0d5f48, #083a2b); }
.refp.b { background: linear-gradient(160deg, #b9562e, #8c3d1e); }
.refp .nm { font-size: 14px; font-weight: 700; opacity: .92; text-align: center; line-height: 1.35; }
.refp .pt { font-size: 86px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.refp .gw { font-size: 12px; opacity: .8; }
.refp .plus { font-size: 11px; opacity: .5; margin-top: 6px; }

.ref-foot { display: flex; gap: 8px; padding: 10px 12px; }
.ref-foot .btn { flex: 1; }
.ref-score { display: flex; gap: 8px; padding: 0 12px 18px; flex-wrap: wrap; }
.ref-score .gs { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 5px 9px; font-size: 11.5px; font-weight: 700; }
.ref-score .gs i { font-style: normal; color: var(--muted); font-weight: 400; margin-right: 6px; }

/* ---------------- 场地视图 ---------------- */
.court-sec { margin-bottom: 10px; }
.court-h { display: flex; align-items: baseline; gap: 8px; margin: 4px 2px 8px; }
.court-h b { font-size: 14.5px; }
.court-h span { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.ccard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.cc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cc-h b { font-size: 12px; color: var(--brand-2); }
.cc-h > span { font-size: 11px; color: var(--muted); }
.cc-h .chip { flex: 0 0 auto; margin-left: auto; }
.cc-r { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.cc-r .nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-r .sc { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cc-r.win .nm, .cc-r.win .sc { color: var(--brand-2); font-weight: 800; }
.cc-f { margin-top: 4px; font-size: 11px; color: var(--muted); }

/* 隐藏 Netlify 免费版徽标，避免遮挡底部导航 */
a[href*="netlify.com"],
iframe[src*="netlify"],
.netlify-badge,
[data-netlify-badge],
#netlify-badge,
.netlify-drawer,
#netlify-drawer { display: none !important; visibility: hidden !important; pointer-events: none !important; }

/* 底部安全区：给 Netlify 免费版徽标留出空间，避免压住导航和登录按钮 */
.tabbar { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 54px) !important; }
.sheet-foot, .ref-foot, .foot, .modal-foot { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 54px) !important; }
.sheet-b { padding-bottom: 54px !important; }