:root {
  --primary: #ff6b35;
  --secondary: rgb(105,118,218);
  --success: #4caf50;
  --danger: #f44336;
  --warning: #ff9800;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #333;
  --text-light: #666;
  --border: #ddd;
  --god: #9c27b0;
  --competitive: #2196f3;
  --newbie: #4caf50;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: var(--secondary);
  color: white;
  padding: 15px;
  text-align: center;
}

.header h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.season-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  opacity: 0.9;
}

/* 奖励指标表格 */
.bonus-pool-table {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  display: inline-block;
}

.bonus-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.bonus-header {
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.bonus-header span {
  min-width: 60px;
  text-align: center;
}

.bonus-values {
  font-size: 16px;
  font-weight: bold;
}

.bonus-values span {
  min-width: 60px;
  text-align: center;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 15px 15px;
  background: var(--secondary);
  border-bottom: none;
}

.nav-btn {
  flex: 0 0 auto;
  padding: 6px 16px;
  border: none;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
}

.nav-btn.active {
  background: rgba(255,255,255,0.35);
  color: white;
  border-bottom: none;
}

/* Pages */
.page {
  display: none;
  padding: 15px;
  padding-bottom: 80px;
}

.page.active {
  display: block;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 领奖台 - 前3名 */
.podium-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 0 0;
  margin-bottom: 16px;
}

.podium-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  min-width: 0;
}

.podium-item.first {
  background: linear-gradient(145deg, #fff9e6, #ffe082);
  padding-top: 12px;
  padding-bottom: 14px;
  z-index: 3;
}

.podium-item.second {
  background: linear-gradient(145deg, #f5f5f5, #e0e0e0);
  margin-bottom: -6px;
  z-index: 2;
}

.podium-item.third {
  background: linear-gradient(145deg, #fff3e0, #ffcc80);
  margin-bottom: -12px;
  z-index: 1;
}

.podium-rank-num {
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 4px;
}

.podium-item.first .podium-rank-num {
  font-size: 40px;
  color: #f9a825;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.podium-item.second .podium-rank-num {
  font-size: 36px;
  color: #757575;
}

.podium-item.third .podium-rank-num {
  font-size: 36px;
  color: #e65100;
}

.podium-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: white;
  margin-bottom: 6px;
}

.podium-item.first .podium-avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.podium-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  padding: 0 4px;
}

.podium-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.podium-titles {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}

.podium-score {
  font-size: 13px;
  font-weight: bold;
  color: var(--primary);
  flex-shrink: 0;
}

.podium-badge {
  font-size: 10px;
  background: #ff5722;
  color: white;
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 4px;
}

/* 区域分组 */
.zone-section {
  margin-bottom: 16px;
}

.zone-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  padding: 8px 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.zone-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-light);
}

/* 排名网格 - 横行显示 */
.rank-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

.rank-card {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  border: 2px solid transparent;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.rank-card.near-fengshen {
  border-color: #ff9800;
}

.rank-card-rank {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-light);
  line-height: 1;
  min-width: 28px;
  text-align: center;
}

.rank-card-rank.rank-top-1,
.rank-card-rank.rank-top-2,
.rank-card-rank.rank-top-3 {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}

.rank-card-rank.rank-top-1 {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
}

.rank-card-rank.rank-top-2 {
  background: linear-gradient(135deg, #c0c0c0, #9e9e9e);
}

.rank-card-rank.rank-top-3 {
  background: linear-gradient(135deg, #cd7f32, #ff9800);
}

.rank-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.rank-card-info-row,
.rank-card-info-col {
  display: flex;
  flex: 1;
  min-width: 0;
}

.rank-card-info-row {
  align-items: center;
  gap: 6px;
}

.rank-card-info-col {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.rank-card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.rank-card-badges {
  display: flex;
  gap: 4px;
  justify-content: end;
  align-items: center;
}

.rank-card-titles {
  display: flex;
  gap: 3px;
  justify-content: end;
  flex-wrap: wrap;
}

.rank-card-score {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* 分数展示容器 */
.rank-card-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 60px;
}

/* 总分 */
.rank-card-score-total {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary);
  text-align: right;
}

/* 分数详情（正赛分+喜报分） */
.rank-card-score-detail {
  font-size: 11px;
  color: #666;
  text-align: right;
}

.rank-card-badge {
  font-size: 11px;
  background: #ff5722;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.rank-card-badge.low-activity,
.podium-badge.low-activity {
  background: #9e9e9e;
  color: white;
  font-size: 9px;
}

/* 神标记（夺冠次数） */
.champion-tag-badge {
  font-size: 10px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
  margin-left: 3px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 酬勤标记 */
.chouqin-badge {
  font-size: 10px;
  background: #ff9800;
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
  margin-left: 3px;
  font-weight: bold;
}

/* 流动红旗标记 */
.redflag-badge {
  font-size: 10px;
  background: #e53935;
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
  margin-left: 3px;
  font-weight: bold;
}

/* 喜报标记 */
.xibao-badge {
  font-size: 10px;
  background: #9c27b0;
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
  margin-left: 3px;
  font-weight: bold;
}

/* 活跃度标记 */
.activity-badge {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 6px;
  margin-left: 3px;
  font-weight: bold;
}

.activity-badge.normal-activity {
  background: #2196f3;
  color: white;
}

.activity-badge.low-activity {
  background: #9e9e9e;
  color: white;
}

/* 低活跃度醒目提醒 */
.low-activity-warning {
  font-size: 10px;
  background: linear-gradient(135deg, #ff5252, #ff1744);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: bold;
  margin-top: 4px;
  animation: blink 1.5s ease-in-out infinite;
  box-shadow: 0 2px 4px rgba(255, 23, 68, 0.3);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 低活跃度选手卡片样式 */
.low-activity-player {
  border: 2px solid #ff1744 !important;
  background: linear-gradient(145deg, #fff5f5, #ffebee) !important;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 2px 8px rgba(255, 23, 68, 0.2); }
  50% { box-shadow: 0 2px 16px rgba(255, 23, 68, 0.5); }
}

/* 领奖台上的低活跃度提醒 */
.podium-item .low-activity-warning {
  font-size: 9px;
  padding: 2px 5px;
  margin-top: 3px;
}

/* 旧版卡片样式（保留兼容） */

.player-card {
  background: var(--card);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s;
}

.player-card:active {
  transform: scale(0.98);
}

.rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.rank.top3 {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: white;
}

.rank.normal {
  background: var(--bg);
  color: var(--text-light);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.player-zone {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

/* 称号榜 */
.title-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 4px 6px;
}

.title-card {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.title-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.title-card-icon {
  font-size: 20px;
  line-height: 1;
}

.title-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.title-card-holders {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.title-holder {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-holder-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.title-holder-name {
  flex: 1;
  font-size: 14px;
}

.title-holder-score {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.title-holder-empty {
  font-size: 13px;
  color: var(--text-light);
}

/* 奖牌式称号榜 */
.medals-section {
  margin-bottom: 20px;
}

.medals-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 12px 4px 10px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 12px;
}

.medals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 380px) {
  .medals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.medal-item {
  background: linear-gradient(145deg, #fff9e6, #fff3c7);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.medal-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.medal-title {
  font-size: 13px;
  font-weight: 600;
  color: #8d6e00;
  margin-bottom: 8px;
}

.medal-holders {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.medal-holder {
  background: rgba(255,255,255,0.7);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}

.medal-holder-name {
  font-weight: 500;
  color: var(--text);
  display: block;
}

.medal-holder-stat {
  font-size: 11px;
  color: var(--text-light);
  display: block;
  margin-top: 2px;
}

.medal-holder-empty {
  font-size: 12px;
  color: var(--text-light);
  padding: 4px;
}

/* 称号 */
.player-titles {
  display: flex;
  gap: 2px;
}

.title-icon {
  font-size: 13px;
  cursor: default;
}

.title-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 107, 53, 0.12);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.title-name {
  font-size: 11px;
}

@media (max-width: 380px) {
  .title-name {
    display: none;
  }
}

.zone-god {
  background: rgba(156, 39, 176, 0.15);
  color: var(--god);
}

.zone-competitive {
  background: rgba(33, 150, 243, 0.15);
  color: var(--competitive);
}

.zone-newbie {
  background: rgba(76, 175, 80, 0.15);
  color: var(--newbie);
}

.player-score {
  text-align: right;
}

.score-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
}

.score-change {
  font-size: 11px;
  color: var(--text-light);
}

.score-settlement {
  font-size: 11px;
  color: #e57373;
}

/* Player Avatar */
.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.zone-avatar-god {
  background: linear-gradient(135deg, #9c27b0, #ce93d8);
  box-shadow: 0 2px 6px rgba(156,39,176,0.4);
}

.zone-avatar-competitive {
  background: linear-gradient(135deg, #2196f3, #90caf9);
  box-shadow: 0 2px 6px rgba(33,150,243,0.4);
}

.zone-avatar-newbie {
  background: linear-gradient(135deg, #4caf50, #a5d6a7);
  box-shadow: 0 2px 6px rgba(76,175,80,0.4);
}

/* Near FengShen highlight */
.player-card.near-fengshen {
  animation: pulse 2s infinite;
  border: 2px solid var(--warning);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(255,152,0,0.3); }
  50% { box-shadow: 0 2px 20px rgba(255,152,0,0.6); }
}

.fengshen-badge {
  background: var(--warning);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 6px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Forms */
.form-section {
  background: var(--card);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
}

.form-section h3 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  -webkit-appearance: none;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:active {
  opacity: 0.8;
}

.btn-secondary {
  background: var(--secondary);
}

.btn-danger {
  background: var(--danger);
}

/* 比赛录入 - 选手搜索 */
.player-search-wrap {
  position: relative;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
}

.search-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-item:last-child { border-bottom: none; }
.search-item:active { background: var(--bg); }

.search-item.search-add { color: var(--primary); font-weight: 500; }
.search-score { font-size: 12px; color: var(--text-light); }
.search-empty { padding: 10px 14px; color: var(--text-light); font-size: 13px; }

/* 已选选手列表 */
.match-players-list {
  margin-bottom: 12px;
}

.entry-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-light);
  font-size: 13px;
  background: var(--bg);
  border-radius: 8px;
}

.match-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 6px;
}

.entry-rank {
  width: 24px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.entry-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-score {
  width: 76px !important;
  text-align: center;
  flex-shrink: 0;
}

.entry-remove {
  padding: 4px 8px;
  background: none;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  flex-shrink: 0;
}

/* 比赛类型切换按钮 */
.game-type-btns {
  display: flex;
  gap: 8px;
}

.game-type-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.game-type-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Match Players Input */
.match-player-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
}

.match-player-input .rank-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--secondary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.match-player-input select {
  flex: 1;
}

.match-player-input input[type="number"] {
  width: 80px;
  text-align: center;
}

.xibao-btn {
  padding: 6px 10px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.xibao-btn.xibao-active {
  background: #fff3cd;
  color: #856404;
  border-color: #ffc107;
  font-weight: bold;
}

/* Player List */
.player-list {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.player-item:last-child {
  border-bottom: none;
}

.player-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-item-name {
  font-weight: 500;
}

.player-item-score {
  font-size: 14px;
  color: var(--text-light);
}

.player-item-actions {
  display: flex;
  gap: 8px;
}

.player-item-actions button {
  padding: 6px 12px;
  font-size: 12px;
}

.player-item-previous-rank {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.player-item-previous-rank label {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

.previous-rank-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

.previous-rank-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 创建赛季时的上赛季名次列表 */
.previous-ranks-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg-secondary);
}

.previous-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.previous-rank-item:last-child {
  border-bottom: none;
}

.previous-rank-item .player-name {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

.previous-rank-item .rank-input {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

.previous-rank-item .rank-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 自马选手项样式 */
.zima-player-item {
  background: rgba(141, 110, 99, 0.05);
  opacity: 0.8;
}

.zima-player-item .player-item-name {
  color: #8d6e63;
}

.delete-btn {
  background: var(--danger);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.action-buttons button {
  flex: 1;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  overflow-y: auto;
}

.modal.active {
  display: block;
}

.modal-content {
  background: var(--card);
  margin: 20px auto;
  max-width: 500px;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  min-height: calc(100vh - 40px);
}

.close-btn {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
}

.modal h2 {
  font-size: 18px;
  margin-bottom: 15px;
  padding-right: 30px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-item {
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Match History */
.match-history {
  margin-top: 15px;
}

.match-history h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.match-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.match-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.match-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-rank {
  font-weight: bold;
  color: var(--primary);
}

.match-score {
  text-align: right;
}

.match-rank-badge {
  font-weight: bold;
  color: var(--primary);
}

.match-raw-row {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}

/* Score Breakdown */
.score-breakdown {
  background: white;
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 3px solid var(--primary);
}

.calc-step {
  font-size: 12px;
  color: var(--text);
  padding: 2px 0;
  border-bottom: 1px dashed var(--border);
}

.calc-step:last-of-type {
  border-bottom: none;
}

.settlement-step {
  color: #e74c3c !important;
  font-weight: 500;
}

.calc-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.calc-final {
  font-size: 16px;
  font-weight: bold;
}

.calc-total {
  font-size: 11px;
  color: var(--text-light);
  text-align: right;
  margin-top: 3px;
}

.match-raw {
  font-size: 12px;
  color: var(--text-light);
}

.match-final {
  font-size: 16px;
  font-weight: bold;
}

.positive {
  color: var(--success);
}

.negative {
  color: var(--danger);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 200;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

/* 比赛记录页 */
.match-record-card {
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.match-record-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--secondary), #1565c0);
  color: white;
  flex-wrap: wrap;
}

.mr-index {
  font-weight: bold;
  font-size: 13px;
}

.mr-meta {
  font-size: 13px;
  flex: 1;
}

.match-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.badge-tongsha {
  background: rgba(255,152,0,0.9);
  color: white;
}

.badge-xibao {
  background: rgba(255,255,255,0.25);
  color: white;
}

.mr-player {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.mr-player:last-child {
  border-bottom: none;
}

.mr-player-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.mr-rank {
  font-size: 15px;
  flex-shrink: 0;
}

.mr-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mr-zone {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.zone-tag-god { background: rgba(156,39,176,0.15); color: var(--god); }
.zone-tag-competitive { background: rgba(33,150,243,0.15); color: var(--competitive); }
.zone-tag-newbie { background: rgba(76,175,80,0.15); color: var(--newbie); }

.mr-raw {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}

.mr-final {
  font-size: 15px;
  font-weight: bold;
  flex-shrink: 0;
  min-width: 44px;
  text-align: right;
}

.mr-calc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-light);
  padding-left: 24px;
}

.mr-step {
  background: var(--bg);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text);
}

.mr-sep {
  color: var(--text-light);
  font-size: 10px;
}

.mr-change {
  margin-left: auto;
  color: var(--text-light);
  font-size: 11px;
}

/* 删除比赛按钮 */
.mr-delete-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.2s;
}

.mr-delete-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

/* 最新比赛标记 */
.latest-match {
  border: 2px solid var(--primary);
}

.latest-match .match-record-hd {
  background: linear-gradient(135deg, #d84315, #ff6b35);
}

/* 选手弹窗 - 其他选手 */
.match-others {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.match-others-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.match-other-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}

.match-other-rank {
  width: 20px;
  text-align: center;
}

.match-other-name {
  flex: 1;
  color: var(--text);
}

.match-other-score {
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

.badge-bonus {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* 排行榜区域分组 */
.leaderboard-list {
  gap: 0;
}

.zone-section {
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
}

.zone-section-god {
  background: linear-gradient(160deg, #f3e5f5 0%, #fce4ec 100%);
  box-shadow: 0 2px 12px rgba(156,39,176,0.12);
}

.zone-section-competitive {
  background: linear-gradient(160deg, #e3f2fd 0%, #e8eaf6 100%);
  box-shadow: 0 2px 12px rgba(33,150,243,0.10);
}

.zone-section-newbie {
  background: linear-gradient(160deg, #e8f5e9 0%, #f1f8e9 100%);
  box-shadow: 0 2px 12px rgba(76,175,80,0.10);
}

.zone-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.zone-threshold {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.75;
}

.zone-section-god .zone-section-header {
  color: #7b1fa2;
}

.zone-section-competitive .zone-section-header {
  color: #1565c0;
}

.zone-section-newbie .zone-section-header {
  color: #2e7d32;
}

.zone-section-icon {
  font-size: 16px;
}

.zone-section-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
}

.zone-section .player-card {
  background: rgba(255,255,255,0.75);
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin: 0 8px;
}

.zone-section .player-card:last-child {
  border-bottom: none;
  margin-bottom: 8px;
}

/* Season selector in header */
.season-selector-wrap {
  margin: 6px auto 2px;
}

.season-selector {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  padding: 4px 24px 4px 10px;
  font-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  max-width: 180px;
}

.season-selector option {
  background: #333;
  color: white;
}

.match-season-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

/* 导出按钮 */
.records-actions {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 10px;
}

.export-btn {
  flex: 1;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.export-btn:active {
  opacity: 0.8;
}

/* Admin FAB — 小而不显眼，可拖动 */
.admin-fab {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: grab;
  border: 1px solid rgba(255,255,255,0.2);
  touch-action: none;
  user-select: none;
}

.admin-fab:active {
  cursor: grabbing;
}

.admin-fab.fab-active {
  background: rgba(255,107,53,0.6);
  color: white;
  border-color: transparent;
}

/* 隐藏头部/导航（进入管理后台时）*/
.hidden {
  display: none !important;
}

/* 管理后台顶部栏 */
.admin-header {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  padding: 12px 15px;
  gap: 12px;
}

.admin-back-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-back-btn:active {
  background: rgba(255,255,255,0.35);
}

.admin-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
}

/* 卫冕冠军 */
.champion-crown {
  margin-right: 3px;
  font-size: 13px;
}

.champion-btn {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.champion-btn.champion-active {
  background: #fff8e1;
  color: #f59e0b;
  border-color: #f59e0b;
}

/* 系数详细构成 */
.coef-breakdown {
  display: inline-block;
  font-size: 11px;
  color: #888;
  margin-left: 4px;
}

/* 喜报次数输入框 */
.xibao-input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

.xibao-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* CSV 批量录入 */
.csv-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.csv-hint {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}

.csv-template-link {
  font-size: 12px;
  color: var(--secondary);
  text-decoration: none;
}

.csv-template-link:hover {
  text-decoration: underline;
}

.csv-file-name {
  font-size: 12px;
  color: #333;
  margin-left: 8px;
}

.csv-progress {
  margin-top: 10px;
}

.csv-progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.csv-progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s;
}

.csv-progress-text {
  font-size: 12px;
  color: #666;
}

/* 自马按钮 */
.zima-btn {
  background: linear-gradient(135deg, #8d6e63 0%, #6d4c41 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
}

.zima-btn:active {
  opacity: 0.9;
}

/* 自马标签 */
.zima-tag {
  font-size: 11px;
  color: #8d6e63;
  background: rgba(141, 110, 99, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* 自马行样式 */
.zima-row {
  background: rgba(141, 110, 99, 0.05);
}

.zima-score {
  font-size: 13px;
  color: #8d6e63;
  padding: 6px 8px;
  background: rgba(141, 110, 99, 0.1);
  border-radius: 4px;
}

/* 搜索下拉中的自马标签 */
.search-zima-tag {
  font-size: 11px;
  color: #8d6e63;
  background: rgba(141, 110, 99, 0.15);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}

/* 规则页面样式 */
.rules-container {
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  margin: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rules-header {
  text-align: center;
  padding: 16px 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 16px;
}

.rules-header h2 {
  font-size: 18px;
  color: var(--primary);
  margin: 0;
  font-weight: 600;
}

.rules-content {
  line-height: 1.8;
  color: #333;
}

.rules-section {
  margin-bottom: 24px;
}

.rules-section h3 {
  font-size: 16px;
  color: var(--primary);
  margin: 16px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.rules-section h4 {
  font-size: 14px;
  color: #444;
  margin: 14px 0 10px;
  font-weight: 600;
}

.rules-section ul,
.rules-section ol {
  padding-left: 20px;
  margin: 10px 0;
}

.rules-section li {
  margin-bottom: 8px;
  font-size: 13px;
}

.rules-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid #eee;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 400px;
}

.rules-table th,
.rules-table td {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #eee;
}

.rules-table th {
  background: var(--primary);
  color: white;
  font-weight: 500;
}

.rules-table tr:nth-child(even) {
  background: #fafafa;
}

.rules-table tr:hover {
  background: #f5f5f5;
}

.rules-note {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* 规则页面在小屏幕下的优化 */
@media (max-width: 480px) {
  .rules-container {
    margin: 4px;
    padding: 10px;
  }

  .rules-header h2 {
    font-size: 16px;
  }

  .rules-section h3 {
    font-size: 15px;
  }

  .rules-section h4 {
    font-size: 13px;
  }

  .rules-section li {
    font-size: 12px;
  }

  .rules-table {
    font-size: 11px;
  }

  .rules-table th,
  .rules-table td {
    padding: 8px 4px;
  }
}

/* ========== 运动排行榜 ========== */

.sports-header {
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  color: white;
  padding: 16px;
  margin: 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.sports-stats {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.sports-stat-item {
  text-align: center;
}

.sports-stat-value {
  font-size: 28px;
  font-weight: bold;
  display: block;
}

.sports-stat-label {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
  display: block;
}

.sports-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin: 8px 10px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.sports-card:active {
  transform: scale(0.98);
}

.sports-rank {
  font-size: 18px;
  font-weight: bold;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.sports-rank-1 {
  color: #ff9800;
}

.sports-rank-2 {
  color: #9e9e9e;
}

.sports-rank-3 {
  color: #795548;
}

.sports-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
}

.sports-info {
  flex: 1;
  min-width: 0;
}

.sports-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.sports-detail {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.sports-mileage {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.sports-points {
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.sports-score {
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* 运动小人标记 */
.sports-badges {
  font-size: 14px;
  margin-left: 4px;
  letter-spacing: -2px;
}

/* 管理员操作按钮 */
.sports-admin-actions {
  margin-top: 6px;
}

.badge-cancel-btn {
  background: #ff5722;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.badge-cancel-btn:hover {
  background: #e64a19;
}

/* 运动类型选择按钮 */
.sports-type-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sports-type-btn {
  flex: 1;
  min-width: 50px;
  padding: 10px 8px;
  background: #f5f5f5;
  color: #666;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.sports-type-btn:hover {
  background: #e0e0e0;
}

.sports-type-btn.active {
  background: #4caf50;
  color: white;
  border-color: #2e7d32;
}

/* ========== 新版运动排行榜样式 ========== */
.sports-leaderboard-new {
  padding: 10px;
}

/* 分榜单区域 */
.sports-sub-boards {
  margin-bottom: 20px;
}

.sub-boards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .sub-boards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) {
  .sub-boards-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.sub-board-card {
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sub-board-card:active {
  transform: scale(0.98);
}

.sub-board-card.green {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.sub-board-card.purple {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.sub-board-card.cyan {
  background: linear-gradient(135deg, #00bcd4, #0097a7);
}

.sub-board-card.red {
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

.sub-board-card.blue {
  background: linear-gradient(135deg, #2196f3, #1976d2);
}

.sub-board-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.sub-board-icon {
  font-size: 18px;
}

/* 分榜单前3名 */
.sub-board-top3 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.top3-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  font-size: 12px;
}

.top3-item.rank-1 {
  background: rgba(255,215,0,0.3);
}

.top3-rank {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.top3-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top3-score {
  font-weight: bold;
}

.sub-board-more {
  font-size: 11px;
  opacity: 0.8;
  text-decoration: underline;
  margin-top: 4px;
}

.sub-board-empty {
  font-size: 12px;
  opacity: 0.8;
  padding: 20px 0;
}

/* 总里程榜 */
.sports-total-board {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.total-board-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.total-board-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.total-board-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 12px;
  transition: transform 0.2s;
}

.total-board-item:active {
  transform: scale(0.98);
}

.total-board-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #666;
  background: #e0e0e0;
}

.total-board-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: white;
}

.total-board-rank.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #9e9e9e);
  color: white;
}

.total-board-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #ff9800);
  color: white;
}

.total-board-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

.total-board-info {
  flex: 1;
  min-width: 0;
}

.total-board-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.total-board-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.type-tag {
  font-size: 10px;
  padding: 2px 5px;
  background: rgba(0,0,0,0.05);
  color: #666;
  border-radius: 8px;
}

.type-tag.champion {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: white;
  font-weight: bold;
}

/* 单项冠军标签 */
.champion-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: white;
  border-radius: 10px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 运动指标显示 */
.total-board-points {
  font-size: 11px;
  color: #ff9800;
  margin-top: 4px;
  font-weight: 500;
}

.total-board-score {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  text-align: right;
}

.total-board-score span {
  font-size: 11px;
  font-weight: normal;
  color: #999;
  margin-left: 2px;
}

/* 单项运动详细排名弹窗 */
.type-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

.type-ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 10px;
}

.type-ranking-item.top-1 {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border: 2px solid #ffd700;
}

.type-ranking-item.top-2 {
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
  border: 2px solid #c0c0c0;
}

.type-ranking-item.top-3 {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border: 2px solid #cd7f32;
}

.type-ranking-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}

.type-ranking-item.top-1 .type-ranking-rank {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: white;
}

.type-ranking-item.top-2 .type-ranking-rank {
  background: linear-gradient(135deg, #c0c0c0, #9e9e9e);
  color: white;
}

.type-ranking-item.top-3 .type-ranking-rank {
  background: linear-gradient(135deg, #cd7f32, #ff9800);
  color: white;
}

.type-ranking-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.type-ranking-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.type-ranking-score {
  font-size: 16px;
  font-weight: bold;
  color: #4caf50;
}

/* 运动录入页面 */
.sports-player-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.sports-rules {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

.sports-rules p {
  margin: 8px 0;
}

.sports-rules ul {
  margin: 8px 0;
  padding-left: 20px;
}

.sports-rules li {
  margin: 4px 0;
}

.sports-records-list {
  max-height: 300px;
  overflow-y: auto;
}

.sports-empty {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 380px) {
  .sports-stats {
    gap: 10px;
  }

  .sports-stat-value {
    font-size: 24px;
  }

  .sports-card {
    padding: 10px;
  }

  .sports-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .sports-name {
    font-size: 14px;
  }

  .sports-detail {
    font-size: 11px;
  }

  .sports-score {
    font-size: 16px;
    min-width: 50px;
  }
}

/* ========== 归档管理样式 ========== */

.archives-list {
  margin-top: 10px;
}

.archive-item {
  background: var(--card);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.archive-info {
  margin-bottom: 8px;
}

.archive-name {
  font-weight: bold;
  font-size: 15px;
  color: var(--text);
}

.archive-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.archive-actions-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.archive-actions-row button {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.archive-actions-row .btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.archive-actions-row .btn-danger {
  background: var(--danger);
  color: white;
}

/* 归档弹窗 */
.archive-modal-content {
  max-height: 80vh;
  overflow-y: auto;
}

.archive-preview {
  padding: 10px 0;
}

.preview-section {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.preview-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.preview-section h4 {
  color: var(--secondary);
  margin-bottom: 8px;
  font-size: 14px;
}

.preview-section p {
  font-size: 13px;
  color: var(--text);
  margin: 4px 0;
}

.preview-top5 {
  margin-left: 20px;
  font-size: 13px;
}

.preview-top5 li {
  margin: 4px 0;
  color: var(--text);
}

.preview-top5 li:first-child {
  color: #f39c12;
  font-weight: bold;
}

/* 归档操作区域 */
.archive-actions .form-group {
  margin-bottom: 10px;
}

.archive-actions input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}

.archive-actions .checkbox-label {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.archive-actions .checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ========== 运动榜 Redesign 新卡片样式 ========== */

.sports-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
}

.sports-player-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.sports-player-card:active {
  transform: scale(0.98);
}

.sports-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.sports-card-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #666;
  background: #f0f0f0;
  flex-shrink: 0;
}

.sports-card-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: white;
}

.sports-card-rank.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #9e9e9e);
  color: white;
}

.sports-card-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #ff9800);
  color: white;
}

.sports-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
}

.sports-card-name {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sports-card-mileage {
  font-size: 22px;
  font-weight: bold;
  color: #4caf50;
  flex-shrink: 0;
}

.sports-card-mileage span {
  font-size: 12px;
  font-weight: normal;
  color: #888;
  margin-left: 2px;
}

.sports-card-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sports-type-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sports-type-pill.green {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}

.sports-type-pill.purple {
  background: rgba(156, 39, 176, 0.12);
  color: #7b1fa2;
}

.sports-type-pill.cyan {
  background: rgba(0, 188, 212, 0.12);
  color: #00838f;
}

.sports-type-pill.red {
  background: rgba(244, 67, 54, 0.12);
  color: #c62828;
}

.sports-type-pill.blue {
  background: rgba(33, 150, 243, 0.12);
  color: #1565c0;
}

.sports-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sports-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid;
  background: white;
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.sports-badge-icon {
  font-size: 13px;
}

.sports-card-pb {
  font-size: 13px;
  color: #555;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.sports-pb-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sports-card-highlights {
  font-size: 12px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 运动详情弹窗 */
.sports-detail-modal {
  padding-bottom: 20px;
}

.sports-detail-stats {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 12px;
}

.sports-detail-stat {
  text-align: center;
}

.sports-detail-value {
  font-size: 20px;
  font-weight: bold;
  color: #4caf50;
}

.sports-detail-label {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.sports-detail-section {
  margin-bottom: 16px;
}

.sports-detail-section h4 {
  font-size: 14px;
  color: #333;
  margin-bottom: 10px;
  font-weight: 600;
}

.activity-matrix {
  display: flex;
  gap: 8px;
}

.activity-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0e0e0;
}

.activity-dot.active {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.sports-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sports-detail-pbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sports-pb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 10px;
}

.sports-pb-icon {
  font-size: 16px;
}

.sports-pb-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.sports-pb-value {
  font-size: 14px;
  font-weight: bold;
  color: #4caf50;
}

.sports-detail-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 10px;
}

.type-stat-icon {
  font-size: 16px;
}

.type-stat-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.type-stat-value {
  font-size: 14px;
  font-weight: bold;
  color: #666;
}
