/* 浙师大教工足球队约球专用版 —— 苹果风移动优先样式 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: #F2F2F7;
  color: #1C1C1E;
  font-size: 16px;
  line-height: 1.45;
  touch-action: manipulation;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: rgba(249, 249, 251, 0.92);
  border-bottom: 0.5px solid #D1D1D6;
  padding-top: env(safe-area-inset-top);
}
.topbar-in {
  max-width: 480px; margin: 0 auto; height: 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px;
}
.app-name { font-size: 16px; font-weight: 600; letter-spacing: 0.2px; }

/* ---------- 主容器 ---------- */
.wrap {
  max-width: 480px; margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top) + 12px) 14px calc(76px + env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh;
}

/* ---------- 底部页签 ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 40;
  width: 100%; max-width: 480px;
  background: rgba(249, 249, 251, 0.95);
  border-top: 0.5px solid #D1D1D6;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
}
.tabbar button {
  flex: 1; min-height: 54px; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; font-size: 11px; color: #8E8E93;
}
.tabbar button.on { color: #007AFF; }
.tab-ic { display: block; line-height: 0; }
.tab-ic svg { width: 24px; height: 24px; display: block; }

/* ---------- 通用组件 ---------- */
.big-title { font-size: 30px; font-weight: 700; margin: 4px 2px 12px; }
.sub-title { font-size: 19px; font-weight: 600; margin: 18px 2px 8px; }
.card {
  background: #FFFFFF; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 14px; margin-bottom: 12px;
}
.card.tight { padding: 8px; }
.muted { color: #8E8E93; }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.wrap-flex { flex-wrap: wrap; }
.grow { flex: 1; }
.badge {
  display: inline-block; font-size: 12px; line-height: 1;
  padding: 4px 7px; border-radius: 6px; background: #E9F2FF; color: #007AFF;
}
.badge.gray { background: #EFEFF4; color: #636366; }
.badge.green { background: #E4F7E9; color: #248A3D; }
.badge.red { background: #FDECEA; color: #D70015; }
.badge.gold { background: #FFF3D6; color: #9A6B00; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border: none; border-radius: 12px;
  background: #007AFF; color: #FFFFFF; font-size: 16px; font-weight: 600;
}
.btn:active { opacity: 0.75; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: #EFEFF4; color: #007AFF; }
.btn.plain { background: none; color: #007AFF; font-weight: 500; padding: 0 8px; }
.btn.danger { background: #FDECEA; color: #FF3B30; }
.btn.danger-solid { background: #FF3B30; color: #FFFFFF; }
.btn:disabled { opacity: 0.45; }
.btn.sm { min-height: 38px; font-size: 14px; padding: 0 12px; border-radius: 10px; }

.seg {
  display: flex; background: #E3E3E8; border-radius: 11px; padding: 2px; gap: 2px;
}
.seg button {
  flex: 1; min-height: 44px; border: none; background: none; border-radius: 9px;
  font-size: 15px; color: #1C1C1E; padding: 0 6px;
}
.seg button.on { background: #FFFFFF; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.seg.sm button { min-height: 44px; font-size: 13px; }

.field-label { font-size: 13px; color: #636366; margin: 12px 2px 6px; }
.input, .select {
  width: 100%; min-height: 44px; font-size: 16px;
  border: none; border-radius: 10px; background: #F2F2F7; color: #1C1C1E;
  padding: 0 12px; outline: none;
}
.input:focus, .select:focus { box-shadow: 0 0 0 2px #007AFF inset; }
textarea.input { padding: 10px 12px; min-height: 60px; resize: vertical; }

/* 球衣色点选 */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; background: none; padding: 4px 2px; min-width: 48px; min-height: 52px;
  font-size: 12px; color: #636366; border-radius: 10px;
}
.swatch .dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid #C7C7CC; display: block;
}
.swatch.on { color: #007AFF; font-weight: 600; }
.swatch.on .dot { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #007AFF; }

/* ---------- 场次卡片 ---------- */
.match-card { text-align: left; width: 100%; border: none; font-size: 15px; }
.match-when { font-size: 17px; font-weight: 600; }
.match-meta { color: #636366; font-size: 13px; margin-top: 2px; }

/* ---------- 人数牌（图外） ---------- */
.plates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.plate {
  display: flex; align-items: center; gap: 6px;
  background: #FFFFFF; border-radius: 999px; padding: 7px 12px;
  font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.plate .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #C7C7CC; }
.plate b { font-weight: 600; }

/* ---------- 球场图 ---------- */
.pitch-card { padding: 6px; }
.pitch-card svg { display: block; width: 100%; height: auto; }
.slot { cursor: pointer; }
.slot .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #636366; padding: 6px 6px 2px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

/* ---------- 列表与时间线 ---------- */
.list-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 0.5px solid #E5E5EA; font-size: 15px;
}
.list-row:last-child { border-bottom: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #EFEFF4; border-radius: 999px; padding: 6px 11px; font-size: 13px;
  border: none; min-height: 36px; color: #1C1C1E;
}
button.chip { min-height: 44px; padding: 6px 13px; }
.chip.on { background: #007AFF; color: #FFFFFF; }
.chip.red { background: #FDECEA; color: #D70015; }
.chip.green { background: #E4F7E9; color: #248A3D; }
.chip.gold { background: #FFF3D6; color: #9A6B00; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.timeline-item { display: flex; gap: 9px; padding: 7px 0; border-bottom: 0.5px solid #E5E5EA; font-size: 14px; align-items: baseline; }
.timeline-item:last-child { border-bottom: none; }
.timeline-item .ic { width: 20px; text-align: center; flex: none; }
.timeline-item .tm { color: #8E8E93; font-size: 12px; margin-left: auto; flex: none; }
.del-x { border: none; background: none; color: #C7C7CC; font-size: 16px; min-width: 40px; min-height: 40px; }
/* 黄/红牌图标：CSS 色块，老设备也稳显 */
.evc { display: inline-block; width: 11px; height: 15px; border-radius: 2px; vertical-align: -2px; }
.evc.y { background: #FFCC00; border: 1px solid #D9A400; }
.evc.r { background: #FF3B30; border: 1px solid #D70015; }

/* ---------- 底部弹层 ---------- */
.sheet-mask {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.35);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-width: 480px; margin: 0 auto; background: #FFFFFF;
  border-radius: 20px 20px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  max-height: 82vh; max-height: 82dvh; overflow-y: auto;
}
.sheet h3 { margin: 2px 0 4px; font-size: 19px; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: #D1D1D6; margin: 0 auto 10px; }
.ev-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ev-grid button {
  flex: 1 1 30%; min-height: 44px; border: none; border-radius: 10px;
  background: #F2F2F7; font-size: 15px; color: #1C1C1E;
}
.ev-grid button:active { background: #E5E5EA; }

/* ---------- 吐司 ---------- */
.toast {
  position: fixed; left: 50%; top: calc(60px + env(safe-area-inset-top));
  transform: translateX(-50%); z-index: 80;
  background: rgba(28, 28, 30, 0.92); color: #FFFFFF;
  font-size: 14px; padding: 10px 16px; border-radius: 12px;
  max-width: 88%; text-align: center;
}

/* ---------- 看板 ---------- */
.kpis { display: flex; gap: 10px; }
.kpis .kpi { flex: 1; text-align: center; }
.kpi .num { font-size: 26px; font-weight: 700; }
.kpi .cap { font-size: 12px; color: #8E8E93; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 14px; }
.bar-row .nm { width: 52px; flex: none; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 12px; background: #EFEFF4; border-radius: 6px; overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: #007AFF; border-radius: 6px; }
.bar-fill.green { background: #34C759; }
.bar-fill.orange { background: #FF9F0A; }
.bar-fill.gray { background: #AEAEB2; }
.bar-fill.red { background: #FF6961; }
.bar-row .val { width: 58px; flex: none; font-size: 13px; color: #636366; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 7px 4px; border-bottom: 0.5px solid #E5E5EA; text-align: center; }
table.tbl th { color: #8E8E93; font-weight: 500; }
table.tbl td:first-child, table.tbl th:first-child { text-align: left; }
.cal { width: 100%; border-collapse: collapse; font-size: 12px; }
.cal th { color: #8E8E93; font-weight: 500; padding: 4px 0; }
.cal td { text-align: center; height: 38px; vertical-align: top; padding-top: 4px; color: #3A3A3C; }
.cal td .dnum { display: inline-block; min-width: 22px; }
.cal td.has .dnum { background: #007AFF; color: #FFFFFF; border-radius: 50%; line-height: 22px; font-weight: 600; }
.cal td.dim { color: #C7C7CC; }
.cal td .cnt { display: block; font-size: 10px; color: #007AFF; }
.empty-tip { text-align: center; color: #8E8E93; padding: 26px 0; font-size: 14px; }
.warn { color: #FF3B30; font-size: 13px; margin-top: 6px; }
.divider { height: 0.5px; background: #E5E5EA; margin: 12px 0; }
