/* ============================================================
   中国球员巡回赛战绩周报 - Styles
   浅色主题 · 现代化设计
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #eef1f6;
  --color-surface: #ffffff;
  --color-header: #0f1e33;
  --color-header-text: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #5b6b83;
  --color-text-muted: #94a3b8;
  --color-border: #e3e9f1;
  --color-border-light: #f1f5f9;
  --color-made-cut: #059669;
  --color-made-cut-bg: #ecfdf5;
  --color-missed-cut: #dc2626;
  --color-missed-cut-bg: #fef2f2;
  --color-withdrew: #d97706;
  --color-withdrew-bg: #fffbeb;
  --color-accent: #0f766e;
  --color-accent-light: #f0fdfa;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(15, 30, 51, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 30, 51, 0.09);
  --shadow-lg: 0 12px 32px rgba(15, 30, 51, 0.14);
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 320px at 50% -80px, rgba(15, 118, 110, 0.07), transparent 70%),
    var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  background: linear-gradient(120deg, #0f1e33 0%, #14304f 55%, #0f766e 130%);
  color: var(--color-header-text);
  padding: 18px 0;
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-title::before {
  content: '⛳';
  font-size: 1.2rem;
}

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

.admin-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.week-badge {
  background: rgba(255,255,255,0.14);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.updated-at {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.62);
}

/* ============================================================
   Tour Tabs
   ============================================================ */

.tour-tabs {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
  border-color: #b9c6d6;
  color: var(--color-text);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(120deg, var(--color-header), #14304f);
  border-color: var(--color-header);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.tab-icon { font-size: 1rem; }

.tab-sub {
  font-size: 0.7rem;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   Event Selector Bar
   ============================================================ */

/* 赛季选择框（标题栏右上角） */
.header-season-select {
  position: absolute;
  top: 14px;
  right: 24px;
  z-index: 10;
  max-width: 130px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
  padding: 7px 14px;
  font-size: 0.82rem;
}

.header-season-select option {
  color: #111;
}

/* 赛事选择框（实时成绩榜标题栏） */
.live-event-select {
  flex: 1 1 240px;
  max-width: 360px;
}

/* 空态中的官网链接 */
.empty-state-sub {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.empty-state-link {
  color: var(--color-made-cut, #4caf50);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.empty-state-link:hover { opacity: 0.8; }

.event-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-select {
  flex: 1;
  max-width: 520px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.event-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.event-hint {
  flex: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.event-hint.on {
  color: #1a7f37;
  border-color: rgba(42, 158, 76, 0.45);
  background: rgba(42, 158, 76, 0.1);
}

/* 赛季切换下拉（与赛事下拉同一视觉，窄宽度） */
.season-select {
  flex: none;
  max-width: 150px;
  border-radius: 10px;
}

/* 空赛季提示 */
.season-empty {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 44px 24px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--color-text-muted);
}
.season-empty .empty-state-sub {
  font-size: 0.82rem;
  margin-top: 6px;
  color: var(--color-text-muted);
  opacity: 0.75;
}

/* 中国高尔夫 40 年 · 空赛季里程碑 */
.season-milestone {
  max-width: 560px;
  margin: 22px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: var(--color-accent-light);
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-left: 4px solid var(--color-accent);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 0.88rem;
  line-height: 1.55;
}
.season-milestone-label {
  flex: none;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--color-accent);
  background: rgba(15, 118, 110, 0.1);
  border-radius: 999px;
  padding: 3px 10px;
  margin-top: 1px;
  white-space: nowrap;
}
.season-milestone-year {
  flex: none;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-accent);
}
.season-milestone-text {
  flex: 1;
}

/* ============================================================
   Main Content
   ============================================================ */

.main-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 44px;
}

/* ============================================================
   Tournament Hero
   ============================================================ */

.tournament-hero {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
  padding: 22px 24px 18px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background: radial-gradient(600px 200px at 80% 0%, var(--color-accent), transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.tour-logo {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.hero-info {
  flex: 1;
  min-width: 220px;
}

.tournament-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tournament-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.tournament-meta span { position: relative; }

.tournament-meta span:not(:last-child)::after {
  content: '·';
  position: absolute;
  right: -9px;
  color: var(--color-text-muted);
}

.hero-extras {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* 右上角统计区标签：中国球员 | 参赛 | 晋级 | 本站最佳（全端显示） */
.hero-extras::before {
  content: '中国球员';
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 1px;
}

.hero-stats {
  display: flex;
  gap: 22px;
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--color-bg);
  border-radius: 10px;
}

.hero-stat { text-align: right; }

.hero-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-stat-best {
  padding-left: 20px;
  border-left: 1px solid var(--color-border);
  text-align: left;
}

.hero-best-value { font-size: 0.95rem; line-height: 1.3; }

/* 赛事名 → 巡回赛官网链接 */
.hero-official-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--color-border);
  transition: border-color 0.15s;
}

.hero-official-link:hover {
  border-bottom-color: var(--color-accent);
}

.hero-best {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--color-accent-light);
  border: 1px solid #c8f0e8;
  border-radius: 10px;
  font-size: 0.85rem;
}

.hero-best-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hero-best-name { font-weight: 700; }

.hero-best-rank {
  font-weight: 700;
  color: var(--color-made-cut);
}

.hero-best-score {
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

/* ============================================================
   Sections
   ============================================================ */

.results-section,
.player-stats-section,
.stats-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border-light);
}

.section-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.player-search {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text);
  width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.player-search:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.results-legend {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
}

.legend-made-cut i { background: var(--color-made-cut); }
.legend-missed-cut i { background: var(--color-missed-cut); }
.legend-withdrew i { background: var(--color-withdrew); }

.stats-source {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ============================================================
   Results Table
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.results-table thead th {
  background: var(--color-bg);
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.results-table thead th:nth-child(2) {
  text-align: left;
}

.results-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}

.results-table th.sortable:hover {
  color: var(--color-accent);
  background: #e8eef5;
}

.results-table th.sortable.active {
  color: var(--color-accent);
}

.sort-ind {
  display: inline-block;
  width: 14px;
  font-size: 0.7rem;
  margin-left: 3px;
  opacity: 0.75;
}

.results-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.results-table tbody tr {
  transition: background 0.12s;
}

.results-table tbody tr:hover {
  background: #f7fafc;
}

/* Row status */
.results-table tbody tr.row-made-cut {
  border-left: 3px solid var(--color-made-cut);
}

.results-table tbody tr.row-missed-cut {
  border-left: 3px solid var(--color-missed-cut);
  opacity: 0.72;
}

.results-table tbody tr.row-withdrew {
  border-left: 3px solid var(--color-withdrew);
  opacity: 0.65;
}

/* Cells */
.cell-rank {
  font-weight: 700;
  min-width: 48px;
  font-family: var(--font-mono);
  text-align: center;
}

.cell-rank.top3 { color: var(--color-made-cut); }

.cell-player-name { font-weight: 600; text-align: center; }

.cell-player-name-en {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.cell-total {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

.cell-total.under-par { color: var(--color-made-cut); }
.cell-total.over-par { color: var(--color-missed-cut); }

.cell-round {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-align: center;
  min-width: 36px;
}

.cell-round.under-par { color: var(--color-made-cut); }

.cell-round.null-round { color: var(--color-text-muted); }

.cell-earnings {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

.cell-cumulative {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  min-width: 72px;
  white-space: nowrap;
}

.cutoff-col { color: var(--color-text-secondary); }
.gap-col { font-weight: 700; }

/* R2D 排名表格 */
.cell-country {
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}
.cell-r2d-events,
.cell-r2d-wins,
.cell-r2d-top10 {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.cell-r2d-points {
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-accent);
}
.r2d-info {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: 8px;
}
/* 联邦快递杯第70名 = 美巡卡保级线 */
.r2d-cutline-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: #d35400;
  vertical-align: middle;
  white-space: nowrap;
}
.r2d-cutline-row td {
  background: rgba(211, 84, 0, 0.07);
}
.r2d-pga-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: #1e8e3e;
  vertical-align: middle;
  white-space: nowrap;
}
.r2d-pga-owned-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #5f6368;
  background: rgba(95, 99, 104, 0.12);
  vertical-align: middle;
  white-space: nowrap;
}
/* 冠军豁免（DP World Tour Category 1 冠军会员，2 年豁免期） */
.r2d-exempt-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: #7b1fa2;
  vertical-align: middle;
  white-space: nowrap;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 44px 24px;
  color: var(--color-text-muted);
}

.empty-state-icon { font-size: 2.5rem; margin-bottom: 8px; }
.empty-state-text { font-size: 0.95rem; }

/* ============================================================
   No-Tournament State (中巡休赛周提示)
   ============================================================ */

.no-tournament-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.no-tournament-icon { font-size: 2.8rem; margin-bottom: 10px; }

.no-tournament-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

.no-tournament-next {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--color-text);
}

.no-tournament-next strong { color: var(--color-accent); }

.no-tournament-meta { font-size: 0.9rem; margin-bottom: 4px; }

.no-tournament-days {
  font-size: 0.95rem;
  margin-top: 8px;
  color: var(--color-accent);
  font-weight: 600;
}

.no-tournament-last {
  font-size: 0.85rem;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(128, 128, 128, 0.15);
}

/* ============================================================
   Event Summary Cards
   ============================================================ */

.stats-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
}

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

.stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.stat-card:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-week {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-card-event {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-card-detail {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card-rank {
  font-weight: 700;
  color: var(--color-made-cut);
}

.stat-card-score {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.stat-card-link {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--color-border-light);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}

.stat-card-link a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.stat-card-link a:hover {
  text-decoration: underline;
}

/* ============================================================
   Player Season Stats
   ============================================================ */

.player-stats-section { margin-top: 0; }
.player-stats-section .section-header { margin-bottom: 16px; }

.stats-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.player-stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.player-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.player-stat-card.ps-top {
  border-left-width: 4px;
}

.player-stat-card .ps-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.ps-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.ps-badge-1 { background: #c9a227; box-shadow: 0 1px 3px rgba(201, 162, 39, 0.4); }
.ps-badge-2 { background: #8a9aa8; box-shadow: 0 1px 3px rgba(138, 154, 168, 0.4); }
.ps-badge-3 { background: #b97a4a; box-shadow: 0 1px 3px rgba(185, 122, 74, 0.4); }
.ps-badge-s { background: var(--color-accent); }

.player-stat-card .ps-name-en {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.player-stat-card .ps-name mark.ps-match,
.player-stat-card .ps-name-en mark.ps-match {
  background: transparent;
  color: var(--color-accent);
  font-weight: 700;
  padding: 0;
}

.ps-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 36px 16px;
  font-size: 0.9rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
}

.player-stat-card .ps-row {
  display: flex;
  justify-content: space-between;
  padding: 4.5px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--color-border-light);
}

.player-stat-card .ps-row:last-of-type {
  border-bottom: none;
}

.player-stat-card .ps-label { color: var(--color-text-secondary); }
.player-stat-card .ps-value { font-weight: 600; }

.player-stat-card .ps-external {
  margin-top: 12px;
  font-size: 0.75rem;
}

.player-stat-card .ps-external a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.player-stat-card .ps-external a:hover { text-decoration: underline; }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px 28px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.footer-copyright {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.footer-icp {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.footer-icp a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-icp a:hover {
  text-decoration: underline;
}

/* ============================================================
   Hole by Hole (逐洞成绩) — 欧巡赛专用
   记分图标规范：
   ○ Birdie 小鸟(-1)  ◎ Eagle 老鹰(-2)  ◎◎ Albatross 信天翁(-3)
   (无符号) Par 标准杆(0)
   □ Bogey 柏忌(+1)  ▣ Double Bogey 双柏忌(+2)  ▦ Triple Bogey+ 三柏忌及以上(≥+3)
   ============================================================ */

.hbh-round-selector {
  display: flex;
  gap: 6px;
  padding: 8px 0 4px;
}

.hbh-round-btn {
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s;
}

.hbh-round-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.hbh-round-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* 记分图标图例 */
.hbh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 4px 0 8px;
  font-size: 0.68rem;
  color: var(--color-text-muted);
}
.hbh-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.hbh-legend .legend-sym {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
}
.hbh-legend .legend-sym.sym-birdie { border-radius: 50%; border: 1.5px solid #15803d; background: #dcfce7; }
.hbh-legend .legend-sym.sym-eagle { border-radius: 50%; border: 1.5px solid #166534; background: #bbf7d0; }
.hbh-legend .legend-sym.sym-albatross { border-radius: 50%; border: 2px solid #92400e; background: #fef3c7; box-shadow: inset 0 0 0 2px #fde68a; }
.hbh-legend .legend-sym.sym-bogey { border-radius: 3px; border: 1.5px solid #b91c1c; background: #fee2e2; }
.hbh-legend .legend-sym.sym-double { border-radius: 3px; border: 1.5px solid #991b1b; background: #fecaca; }
.hbh-legend .legend-sym.sym-triple { border-radius: 3px; border: 1.5px solid #7f1d1d; background: #fca5a5; }

/* 逐洞成绩表 — 与"全部球员"页签风格一致 */
.live-table-wrapper.hbh-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table.hbh-table {
  min-width: 900px;
}

.results-table.hbh-table th,
.results-table.hbh-table td {
  text-align: center;
  padding: 6px 4px;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* 表头与"全部球员"页签一致 */
.results-table.hbh-table thead th {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* 排名列和球员列固定不动 */
.results-table.hbh-table .th-sticky {
  position: sticky;
  left: 0;
  background: var(--color-surface);
  z-index: 2;
  text-align: left;
  min-width: 40px;
}

.results-table.hbh-table .th-sticky2 {
  position: sticky;
  left: 40px;
  background: var(--color-surface);
  z-index: 2;
  text-align: left;
  min-width: 110px;
}

.results-table.hbh-table thead .th-sticky,
.results-table.hbh-table thead .th-sticky2 {
  background: var(--color-bg);
}

/* 逐洞成绩颜色编码 — 浅色主题，数字放在图标中间 */
.cell-hole-score {
  position: relative;
  z-index: 0;
  font-weight: 600;
}

/* 图标形状容器 — 绝对定位居中，置于文字下方 */
.cell-hole-score.hole-birdie::before,
.cell-hole-score.hole-eagle::before,
.cell-hole-score.hole-albatross::before,
.cell-hole-score.hole-bogey::before,
.cell-hole-score.hole-double::before,
.cell-hole-score.hole-triple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

/* 低于标准杆 → 圆形 */
.cell-hole-score.hole-birdie::before,
.cell-hole-score.hole-eagle::before,
.cell-hole-score.hole-albatross::before {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* 高于标准杆 → 方形 */
.cell-hole-score.hole-bogey::before,
.cell-hole-score.hole-double::before,
.cell-hole-score.hole-triple::before {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

/* ○ Birdie 小鸟(-1)：圆环 + 浅绿底 */
.cell-hole-score.hole-birdie::before {
  border: 1.5px solid #15803d;
  background: #dcfce7;
}
/* ◎ Eagle 老鹰(-2)：实心圆 + 中绿底 */
.cell-hole-score.hole-eagle::before {
  border: 1.5px solid #166534;
  background: #bbf7d0;
}
/* ◎◎ Albatross 信天翁(-3)：双环 + 金底 */
.cell-hole-score.hole-albatross::before {
  border: 2px solid #92400e;
  background: #fef3c7;
  box-shadow: inset 0 0 0 2px #fde68a;
}
/* □ Bogey 柏忌(+1)：方框 + 浅红底 */
.cell-hole-score.hole-bogey::before {
  border: 1.5px solid #b91c1c;
  background: #fee2e2;
}
/* ▣ Double Bogey 双柏忌(+2)：实心方 + 中红底 */
.cell-hole-score.hole-double::before {
  border: 1.5px solid #991b1b;
  background: #fecaca;
}
/* ▦ Triple Bogey+ 三柏忌+(≥+3)：实心方 + 深红底 */
.cell-hole-score.hole-triple::before {
  border: 1.5px solid #7f1d1d;
  background: #fca5a5;
}

/* 文字颜色（底色由图标提供，td本身无背景） */
.cell-hole-score.hole-albatross { color: #92400e; font-weight: 700; }
.cell-hole-score.hole-eagle     { color: #166534; font-weight: 700; }
.cell-hole-score.hole-birdie    { color: #15803d; font-weight: 600; }
.cell-hole-score.hole-par       { color: var(--color-text); }
.cell-hole-score.hole-bogey     { color: #b91c1c; font-weight: 600; }
.cell-hole-score.hole-double    { color: #991b1b; font-weight: 700; }
.cell-hole-score.hole-triple    { color: #7f1d1d; font-weight: 700; }
.cell-hole-score.hole-none      { color: var(--color-text-muted); opacity: 0.4; }

.th-hole {
  min-width: 28px;
  font-size: 0.7rem;
}

.th-par {
  display: block;
  font-size: 0.6rem;
  opacity: 0.5;
  font-weight: 400;
}

.cell-hole-out,
.cell-hole-in,
.cell-hole-total {
  font-weight: 700;
  background: var(--color-border-light);
}

/* 逐洞表移动端优化 — 与"全部球员"页签风格一致 */
@media (max-width: 640px) {
  .results-table.hbh-table { min-width: 720px; }
  .results-table.hbh-table th,
  .results-table.hbh-table td { padding: 5px 3px; font-size: 0.7rem; }
  .results-table.hbh-table thead th { font-size: 0.68rem; padding: 6px 4px; }
  .results-table.hbh-table .th-sticky2 { min-width: 90px; }
  .hbh-round-btn { padding: 3px 10px; font-size: 0.72rem; }
  .hbh-legend { font-size: 0.62rem; gap: 4px 8px; }
  /* 图标缩小适配移动端 */
  .cell-hole-score.hole-birdie::before,
  .cell-hole-score.hole-eagle::before,
  .cell-hole-score.hole-albatross::before { width: 17px; height: 17px; }
  .cell-hole-score.hole-bogey::before,
  .cell-hole-score.hole-double::before,
  .cell-hole-score.hole-triple::before { width: 16px; height: 16px; }
  .desktop-only { display: none !important; }
  .wechat-qr-link { right: 10px !important; top: 50% !important; transform: translateY(-50%) !important; }
}

/* ============================================================
   Responsive · Mobile First
   ============================================================ */

/* Tablet & below */
@media (max-width: 860px) {
  html { font-size: 14px; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px;
    gap: 8px;
  }

  .header-season-select { right: 16px; top: 12px; }
  .site-title { font-size: 1.15rem; }

  /* Hero: logo + info 一行，stats + best 合并为一个框（左"中国球员"标签，右侧数据居中） */
  .hero-content { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .tour-logo { width: 40px; height: 40px; border-radius: 8px; font-size: 0.9rem; }
  .hero-info { flex: 1 1 200px; min-width: 0; }
  .hero-extras {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: var(--color-bg);
    border-radius: 10px;
    padding: 10px 14px;
  }
  .hero-extras::before {
    content: '中国球员';
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 1px;
  }
  .hero-stats {
    flex: 1 1 auto;
    justify-content: space-evenly;
    align-items: center;
    gap: 0;
    background: transparent;
    padding: 0;
    min-width: 0;
  }
  .hero-stats .hero-stat { text-align: center; flex: 0 0 auto; min-width: 44px; }
  .hero-stats .hero-stat-best { text-align: center; flex: 1 1 auto; padding-left: 0; border-left: 1px solid var(--color-border); }
  .hero-best {
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
  }

  .stat-cards { grid-template-columns: 1fr; }
  .player-stats-grid { grid-template-columns: 1fr; }

  .results-table th,
  .results-table td {
    padding: 7px 8px;
    font-size: 0.82rem;
  }

  .tab-btn { padding: 8px 14px; font-size: 0.84rem; }
  .tab-sub { display: none; }
}

/* Mobile */
@media (max-width: 640px) {
  html { font-size: 13px; }

  /* Header */
  .site-header { padding: 12px 0; }
  .header-inner { padding: 0 12px; gap: 6px; }
  .site-title { font-size: 1.05rem; gap: 6px; }
  .header-meta { gap: 6px; width: 100%; }
  .header-meta a { font-size: 0.72rem !important; margin-right: 6px !important; }
  .week-badge { padding: 3px 10px; font-size: 0.78rem; }
  .updated-at { font-size: 0.72rem; }

  /* Tour tabs */
  .tour-tabs {
    padding: 10px 12px 0;
    gap: 5px;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
    gap: 5px;
  }
  .tab-icon { font-size: 0.9rem; }

  /* Header season select & live event select */
  .header-season-select { max-width: 100px; font-size: 0.78rem; padding: 5px 10px; right: 16px; top: 12px; }
  .live-event-select { max-width: none; font-size: 0.8rem; padding: 7px 12px; flex-basis: 100%; }

  /* Main content */
  .main-content { padding: 0 10px 28px; }

  /* Sections */
  .results-section,
  .player-stats-section,
  .stats-section {
    padding: 14px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
  }

  /* Section header */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }
  .section-header h3 { font-size: 0.95rem; }

  .results-tools {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .player-search { width: 100%; font-size: 0.82rem; }

  .stats-tools {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .stats-hint { white-space: normal; font-size: 0.72rem; }

  .results-legend {
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.72rem;
  }

  /* Tournament hero */
  .tournament-hero {
    padding: 14px 12px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
  }
  .tour-logo { width: 36px; height: 36px; border-radius: 8px; font-size: 0.85rem; }
  .tournament-name { font-size: 1.05rem; }
  .tournament-meta { font-size: 0.78rem; gap: 2px 10px; }
  .hero-extras { padding: 8px 10px; }
  .hero-extras::before { font-size: 0.66rem; }
  .hero-stats { gap: 14px; }
  .hero-stat-best { border-left: 1px solid var(--color-border); }
  .hero-best-value { font-size: 0.85rem; }
  .hero-stat-label { font-size: 0.62rem; }
  .hero-stat-value { font-size: 0.9rem; }
  .hero-best {
    padding-left: 12px;
    font-size: 0.78rem;
    gap: 6px;
  }

  /* Tables - compact mobile */
  .results-table { font-size: 0.82rem; }
  .results-table thead th {
    padding: 6px 6px;
    font-size: 0.68rem;
  }
  .results-table td {
    padding: 6px 6px;
  }
  .cell-rank { min-width: 36px; }
  .cell-player-name { font-size: 0.82rem; }
  .cell-total { font-size: 0.85rem; }
  .cell-round { font-size: 0.78rem; min-width: 30px; }
  .cell-earnings { font-size: 0.76rem; }
  .cell-cumulative { font-size: 0.74rem; min-width: 56px; }

  /* Live leaderboard */
  .live-leaderboard-section { border-radius: 8px; margin-bottom: 14px; }
  .live-leaderboard-section .section-header {
    padding: 10px 12px;
    gap: 4px;
  }
  .live-leaderboard-section .section-header h3 { font-size: 0.92rem; }
  .live-tabs {
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .live-tab-btn {
    padding: 7px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
  }
  .live-table { min-width: 520px; font-size: 0.78rem; }
  .live-table th { padding: 6px 5px; font-size: 0.68rem; }
  .live-table td { padding: 5px 5px; }
  .live-table .cell-player-name { font-size: 0.78rem; }
  .live-table .cell-today { font-size: 0.78rem; min-width: 36px; }
  .live-table .cell-hole { font-size: 0.74rem; min-width: 32px; }
  .live-table .cell-teetime { font-size: 0.7rem; }
  .live-tools {
    width: 100%;
    justify-content: space-between;
    font-size: 0.72rem;
  }

  /* Rank tabs (CLPGA / CGA) */
  .clpga-rank-tabs,
  .cga-rank-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 2px;
  }
  .clpga-rank-tabs .live-tab-btn,
  .cga-rank-tabs .live-tab-btn {
    padding: 7px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  /* Player stats cards */
  .player-stat-card {
    padding: 14px;
    border-radius: 8px;
  }
  .player-stat-card .ps-name { font-size: 0.95rem; gap: 6px; }
  .player-stat-card .ps-row { font-size: 0.76rem; padding: 4px 0; }
  .ps-badge { font-size: 0.66rem; padding: 2px 7px; }

  /* Stat cards */
  .stat-card { padding: 12px 14px; border-radius: 8px; }
  .stat-card-event { font-size: 0.82rem; }
  .stat-card-detail { font-size: 0.76rem; }

  /* No tournament */
  .no-tournament-state { padding: 32px 16px; }
  .no-tournament-icon { font-size: 2.2rem; }
  .no-tournament-title { font-size: 1.05rem; }
  .no-tournament-next { font-size: 0.88rem; }
  .no-tournament-meta { font-size: 0.82rem; }
  .no-tournament-days { font-size: 0.85rem; }
  .no-tournament-last { font-size: 0.78rem; }

  /* Footer */
  .site-footer { padding: 8px 12px 20px; font-size: 0.7rem; }

  /* CGA ranking */
  .cga-ranking-section { padding: 12px 10px; border-radius: 8px; }
  .cga-table { min-width: 440px; }
  .cga-ranking-search { width: 100%; }
  .cga-more-btn { padding: 6px 18px; font-size: 0.76rem; }

  /* Season empty */
  .season-empty { padding: 32px 16px; border-radius: 8px; }
  .season-milestone { padding: 10px 12px; font-size: 0.82rem; gap: 8px; }
}

/* Very small phones */
@media (max-width: 380px) {
  html { font-size: 12px; }
  .site-title { font-size: 0.95rem; }
  .tab-btn { padding: 6px 10px; font-size: 0.76rem; }
  .tour-logo { width: 32px; height: 32px; font-size: 0.78rem; border-radius: 6px; }
  .tournament-name { font-size: 0.95rem; }
  .hero-extras { padding: 6px 8px; }
  .hero-stats { gap: 10px; }
  
  .hero-best-value { font-size: 0.78rem; }
  .hero-stat-label { font-size: 0.58rem; }
  .hero-stat-value { font-size: 0.82rem; }
  .hero-best { padding-left: 8px; font-size: 0.72rem; gap: 4px; }
  .hero-best-label { font-size: 0.62rem; }
  .live-table { min-width: 480px; }
}

/* ============================================================
   CGA 中高协职业男子积分榜
   ============================================================ */

.cga-ranking-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.cga-ranking-section .section-header {
  margin-bottom: 6px;
}

.cga-ranking-note {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

/* 积分榜搜索工具 */
.cga-ranking-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cga-ranking-search {
  width: 240px;
}

.cga-search-result {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* 搜索命中高亮 */
.cga-hl {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
}

/* 积分榜搜索空态 */
.cga-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 22px 0;
  font-size: 0.85rem;
}

.cga-table-wrapper {
  overflow-x: auto;
}

.cga-table {
  min-width: 520px;
}

.cga-table thead th {
  font-size: 0.78rem;
}

.cga-table tbody tr.cga-row td {
  border-bottom: 1px solid var(--color-border-light);
}

.cga-table tbody tr.cga-row:last-child td {
  border-bottom: none;
}

/* 本站参赛球员高亮 */
.cga-table tbody tr.cga-in-field {
  background: var(--color-accent-light);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.cga-table tbody tr.cga-in-field:hover {
  background: #e6f9f5;
}

.cga-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border-radius: 999px;
  vertical-align: 1px;
}

.cga-note {
  color: var(--color-accent);
  font-size: 0.72rem;
  margin-top: 2px;
}

/* 排名升降趋势 */
.cell-cga-trend {
  text-align: center;
  font-size: 0.8rem;
  white-space: nowrap;
}

.cga-trend {
  font-weight: 700;
  font-size: 0.8rem;
}

.cga-trend.up { color: var(--color-made-cut); }
.cga-trend.down { color: var(--color-missed-cut); }
.cga-trend.flat { color: var(--color-text-muted); font-weight: 400; }

/* 平均分用等宽字体对齐 */
.cga-avg {
  font-family: var(--font-mono);
}

/* 展开按钮 */
.cga-more-btn {
  display: block;
  margin: 12px auto 0;
  padding: 7px 22px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cga-more-btn:hover {
  background: var(--color-accent);
  color: #fff;
}

@media (max-width: 720px) {
  .cga-ranking-section { padding: 14px 12px; }
  .cga-table { min-width: 480px; }
  .cga-ranking-search { width: 100%; }
}

/* ============================================================
   实时成绩榜（欧巡赛 LIVE）
   ============================================================ */

.live-badge {
  display: inline-block;
  background: #e53e3e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.5); }
  50% { opacity: 0.85; box-shadow: 0 0 0 5px rgba(229, 62, 62, 0); }
}

.live-leaderboard-section {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  overflow: hidden;
}

.live-leaderboard-section .section-header {
  position: relative;
  display: flex;
  justify-content: space-between;   /* 桌面端：成绩榜标题+状态徽章居左，赛程选择框居右，整体水平居中分布 */
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 8px;
}

.live-leaderboard-section .section-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.live-leaderboard-section .section-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  /* 成绩榜标题 + 状态徽章整体（桌面端跟随标题居左） */
  display: flex;
  align-items: center;
  margin: 0;
  white-space: nowrap;
}

.live-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.live-round {
  font-weight: 600;
  color: #e53e3e;
}

.live-updated {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.live-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border);
}

.live-tab-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--color-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  font-weight: 500;
}

.live-tab-btn:hover {
  color: var(--color-text);
}

.live-tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.live-table-wrapper {
  overflow-x: auto;
}

.live-table {
  font-size: 0.85rem;
}

.live-table th {
  background: var(--color-bg-alt);
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 8px;
  text-align: center;
  white-space: nowrap;
}

.live-table td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.live-table .cell-player-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.live-table .cell-player-name-en {
  font-size: 0.7rem;
  color: var(--color-muted);
}

.live-table .cell-teetime {
  color: var(--color-muted);
  font-size: 0.78rem;
  text-align: center;
  white-space: nowrap;
}

.live-table .cell-fedex {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--color-accent);
}

.live-table .cell-earnings {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.live-table .cell-state {
  font-size: 0.72rem;
  text-align: center;
  color: var(--color-muted);
  white-space: nowrap;
}

.live-table .cell-stat-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.live-table .cell-today {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  min-width: 48px;
}

.live-table .cell-today.under-par {
  color: var(--color-made-cut);
}

.live-table .cell-today.over-par {
  color: #e53e3e;
}

.live-table .cell-hole {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: center;
  color: var(--color-muted);
  min-width: 42px;
}

.live-table tr.row-cn {
  background: rgba(15, 118, 110, 0.04);
}

.live-table tr.row-cn .cell-player-name {
  color: var(--color-accent);
}

.live-table .rd-eagle {
  color: #e53e3e;
  font-weight: 700;
}

.live-table .rd-birdie {
  color: var(--color-made-cut);
  font-weight: 600;
}

.live-table .rd-bogey {
  color: var(--color-missed-cut);
}

.live-table .cell-country {
  font-size: 0.72rem;
  color: var(--color-muted);
  letter-spacing: 0.5px;
}

@media (max-width: 720px) {
  .live-leaderboard-section .section-header {
    padding: 12px 14px;
  }
  .live-event-select { flex-basis: 100%; max-width: none; }
  .live-tools { width: 100%; justify-content: space-between; }
  .live-tabs {
    padding: 0 14px;
    overflow-x: auto;
  }
  .live-tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .live-table { min-width: 560px; }
}

/* ---------- PGA 三态：预告倒计时横幅 + hero LIVE 徽章 ---------- */
.countdown-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.16));
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #1e40af;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.countdown-banner b {
  font-size: 1.05rem;
  color: #1d4ed8;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 5px;
  padding: 1px 7px;
  min-width: 30px;
  text-align: center;
  display: inline-block;
}

.countdown-icon {
  font-size: 1.1rem;
}

/* ---------- 美巡页面：标题旁内联倒计时（无底框，左右对称布局） ---------- */
.countdown-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-left: 16px;
  color: #1d4ed8;
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.countdown-inline b {
  font-size: 1rem;
  color: #1e40af;
}

.countdown-inline .cd-t {
  letter-spacing: 1px;
}

/* ============================================================
   美巡赛赛事信息区（成绩榜下方）
   ============================================================ */
.pga-tournament-info {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 冠军卡片 */
.pga-winner-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pga-winner-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0c4a6e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pga-winner-flag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 4px;
}
.pga-winner-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.pga-winner-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: #be123c;
}
.pga-winner-strokes {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
}
.pga-winner-rounds {
  display: flex;
  gap: 6px;
}
.wi-round {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  border-radius: 6px;
  padding: 4px 10px;
  min-width: 38px;
}
.wi-round-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
}
.wi-round-score {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.pga-winner-purse,
.pga-winner-points {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
}

/* 赛事信息栏 */
.pga-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.pga-info-item {
  font-size: 0.85rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pga-info-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}
.pga-info-cut {
  color: #dc2626;
  font-weight: 600;
}

/* TourCast 链接 */
.pga-tourcast-link {
  text-align: right;
}
.pga-tourcast-link a {
  font-size: 0.8rem;
  color: #0369a1;
  text-decoration: none;
  border-bottom: 1px dashed #0369a1;
}
.pga-tourcast-link a:hover {
  color: #0c4a6e;
  border-bottom-style: solid;
}

/* 总杆数列 */
.cell-strokes {
  font-weight: 600;
  color: #475569;
  font-size: 0.85rem;
}

/* ============================================================
   移动端浏览体验优化（纯样式，不改内容与逻辑）
   ============================================================ */

/* 1) 基础：防止 iOS 横屏字体膨胀 / 去掉系统点击高亮 / 表格数字对齐 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, select, input, a, .tab-btn, .live-tab-btn, .hbh-round-btn, .cga-more-btn {
  -webkit-tap-highlight-color: transparent;
}
.live-table, .results-table, .cga-table, .cell-rank, .cell-total, .cell-today, .cell-strokes,
.cell-fedex, .cell-earnings, .cell-cumulative, .cell-stat-num {
  font-variant-numeric: tabular-nums;
}

/* 2) 表单控件 ≥16px：避免 iOS Safari 聚焦时整页自动放大 */
@media (max-width: 860px) {
  .event-select, .player-search, .cga-ranking-search { font-size: 16px; }
  .player-search { padding: 9px 14px; }
}

/* 3) 标题与赛季下拉：移动端防止下拉浮盖标题文字 */
@media (max-width: 640px) {
  .site-title { padding-right: 108px; overflow-wrap: anywhere; }
  .header-season-select { right: 10px; top: 10px; max-width: 96px; }
}

/* 4) 巡赛页签吸顶：长页面随时切换巡赛 */
@media (max-width: 860px) {
  .tour-tabs {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--color-bg);
    padding-top: 6px;
    padding-bottom: 6px;
    box-shadow: 0 2px 8px rgba(15, 30, 51, 0.08);
  }
  .tab-btn { min-height: 42px; }
  .live-tab-btn { min-height: 40px; }
  .hbh-round-btn, .cga-more-btn { min-height: 38px; }
  .admin-link { padding: 7px 11px; }
}

/* 5) 成绩榜：排名+球员两列固定，横向滑动不迷路（仅 .live-table，排除逐洞 hbh） */
@media (max-width: 640px) {
  .live-table:not(.hbh-table) td:nth-child(1),
  .live-table:not(.hbh-table) thead th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    white-space: nowrap;
  }
  .live-table:not(.hbh-table) td:nth-child(2),
  .live-table:not(.hbh-table) thead th:nth-child(2) {
    position: sticky;
    left: 44px;
    z-index: 3;
    min-width: 108px;
    text-align: left;
    white-space: nowrap;
  }
  /* thead 行固定列底色（与原 thead 颜色统一） */
  .live-table:not(.hbh-table) thead th:nth-child(1),
  .live-table:not(.hbh-table) thead th:nth-child(2) {
    background: var(--color-bg);
  }
  /* tbody 固定列：默认白底 */
  .live-table:not(.hbh-table) td:nth-child(1),
  .live-table:not(.hbh-table) td:nth-child(2) {
    background: var(--color-surface);
  }
  /* 中国球员行（row-cn）高亮行：固定列保持同色 */
  .live-table:not(.hbh-table) tr.row-cn td:nth-child(1),
  .live-table:not(.hbh-table) tr.row-cn td:nth-child(2) {
    background: #eef9f7;
  }
  /* 球员列右侧加阴影以视觉分隔固定区与滚动区 */
  .live-table:not(.hbh-table) td:nth-child(2),
  .live-table:not(.hbh-table) thead th:nth-child(2) {
    box-shadow: 4px 0 6px -4px rgba(15, 30, 51, 0.18);
  }
}

/* 6) 表格容器：更顺滑的横滑 + 细滚动条 */
.table-wrapper, .live-table-wrapper, .cga-table-wrapper, .tour-tabs {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c3cddb transparent;
}
.table-wrapper::-webkit-scrollbar,
.live-table-wrapper::-webkit-scrollbar,
.cga-table-wrapper::-webkit-scrollbar {
  height: 5px;
}
.table-wrapper::-webkit-scrollbar-thumb,
.live-table-wrapper::-webkit-scrollbar-thumb,
.cga-table-wrapper::-webkit-scrollbar-thumb {
  background: #c3cddb;
  border-radius: 999px;
}

/* 7) 冠军卡片 / 赛事信息栏 / 倒计时 — 移动端排版 */
@media (max-width: 640px) {
  .countdown-inline { margin-left: 0; display: inline-flex; flex-wrap: wrap; font-size: 0.78rem; gap: 6px; }
  .countdown-banner { font-size: 0.8rem; padding: 7px 12px; flex-wrap: wrap; }
  .pga-winner-card { padding: 12px 14px; gap: 6px; }
  .pga-winner-header { font-size: 0.95rem; gap: 6px; flex-wrap: wrap; }
  .pga-winner-score { font-size: 1.2rem; }
  .pga-winner-strokes { font-size: 0.78rem; }
  .pga-winner-body { gap: 8px 14px; }
  .wi-round { padding: 3px 8px; min-width: 36px; }
  .wi-round-score { font-size: 0.88rem; }
  .pga-winner-purse, .pga-winner-points { font-size: 0.78rem; }
  .pga-info-bar { gap: 6px 14px; padding: 8px 12px; }
  .pga-info-item { font-size: 0.78rem; }
  .pga-info-label { font-size: 0.7rem; }
  .pga-tourcast-link { text-align: left; }
  .tournament-name { overflow-wrap: anywhere; line-height: 1.3; }
}

/* 8) 安全区：iPhone 底部小白条 */
@media (max-width: 860px) {
  .main-content { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* 9) 中等屏（平板竖屏 ≤860）的小优化 */
@media (max-width: 860px) {
  .player-stat-card .ps-name { font-size: 0.92rem; }
  .stat-card { padding: 11px 12px; }
  .stat-card-event { font-size: 0.8rem; }
  .stat-card-detail { font-size: 0.74rem; }
  .header-inner { gap: 8px; }
}

/* ============================================================
   移动端布局优化 v101（仅移动端 CSS，不改内容与逻辑）
   ============================================================ */

/* 10) 赛季选择框：字体缩小，与页面风格一致（覆盖 iOS 16px 规则） */
@media (max-width: 860px) {
  .header-season-select { font-size: 13px; }
}
@media (max-width: 640px) {
  .header-season-select { font-size: 12px; max-width: 88px; padding: 4px 8px; }
}

/* 11) 巡赛页签：图标+名称上下堆叠居中，圆角长方形框 */
@media (max-width: 860px) {
  .tab-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    padding: 8px 14px;
    min-height: 50px;
    border-radius: 12px;
  }
  .tab-icon { font-size: 1.15rem; line-height: 1; }
  .tab-label { font-size: 0.72rem; line-height: 1.2; }
  .tab-sub { display: none; }
}
@media (max-width: 640px) {
  .tab-btn { padding: 7px 12px; min-height: 46px; }
  .tab-icon { font-size: 1rem; }
  .tab-label { font-size: 0.7rem; }
}
@media (max-width: 380px) {
  .tab-btn { padding: 5px 9px; min-height: 42px; }
  .tab-icon { font-size: 0.9rem; }
  .tab-label { font-size: 0.66rem; }
}

/* 12) 成绩榜下拉框：字体缩小适配手机（覆盖 iOS 16px 规则），宽度不超出屏幕 */
@media (max-width: 860px) {
  .live-event-select { font-size: 14px; }
}
@media (max-width: 640px) {
  .live-event-select {
    font-size: 13px;
    padding: 6px 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* 13) 成绩榜标题与状态图标同行不换行（标题+徽章保持居中） */
@media (max-width: 640px) {
  .live-leaderboard-section .section-header {
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;   /* 成绩榜标题 + LIVE 徽章水平居中 */
    gap: 4px 8px;
  }
  .live-leaderboard-section .section-header > h3 {
    position: static;
    transform: none;   /* 取消桌面绝对定位的 translate(-50%,-50%) 残留 */
    flex-shrink: 0;
    margin: 0;
  }
  .live-leaderboard-section .section-header-right {
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
  }
  .live-leaderboard-section .section-header-right .event-hint {
    flex-shrink: 0;
  }
  .live-leaderboard-section .section-header-right .live-event-select {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .live-leaderboard-section .section-header-right .live-tools {
    flex-basis: 100%;
  }
}

/* 桌面端（>720px）：成绩榜标题 + 状态徽章居左、赛程选择框居右，两组水平居中对称分布。
   右侧控件组自适应宽度；下拉框不撑破容器，直播信息过长时独占一行靠右换行（移动端规则不受影响） */
@media (min-width: 721px) {
  .live-leaderboard-section .section-header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* 覆盖 .event-select 的 max-width:520px，防止下拉框撑破右侧组 */
  .live-leaderboard-section .section-header-right .live-event-select {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
  }
  .live-leaderboard-section .section-header-right .event-hint {
    flex: 0 1 auto;
    max-width: 100%;
  }
  /* 直播信息独占一行并靠右，内容过长时内部换行 */
  .live-leaderboard-section .section-header-right .live-tools {
    flex: 1 1 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    row-gap: 2px;
    max-width: 100%;
  }
}

/* 14) 预告/空态卡片（td[colspan] 单行）：解除固定列与表格最小宽度，手机屏内居中完整显示 */
@media (max-width: 720px) {
  /* 表格只含卡片行时不再强制 560px 宽，卡片随屏宽居中 */
  .live-table:has(tbody tr:only-child td[colspan]) {
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 640px) {
  /* 卡片行解除第 1 列固定（sticky/44px 宽）限制 */
  .live-table:not(.hbh-table) td[colspan] {
    position: static;
    left: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    box-shadow: none;
    background: var(--color-surface);
  }
  /* 长英文赛事名/球场名换行，不撑出屏幕 */
  .no-tournament-next,
  .no-tournament-meta,
  .no-tournament-days,
  .no-tournament-last {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
