/* ==========================================================================
   MOK 篮球社区 · 全站样式
   移动端优先 · 简洁干净 · CSS 变量统一配色
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand: #e8622c;        /* 主色（篮球橙） */
  --brand-dark: #c94f1d;
  --brand-soft: #fdeee7;

  /* 中性色 */
  --bg: #f6f6f8;
  --card: #ffffff;
  --text: #1a1a1e;
  --text-sub: #6b6b73;
  --text-faint: #9b9ba3;
  --border: #e8e8ec;

  /* 队色 */
  --team-m: #2f6fed;
  --team-k: #e02020;

  /* 尺寸 */
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 16px;

  /* 触控尺寸：手指能稳稳点中的最小高度 */
  --tap: 44px;

  /* 阴影：分两级，卡片用 1，浮层/首屏用 2 */
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-2: 0 8px 26px rgba(10, 14, 22, .28);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden; /* 长数字串（如 149/303）不得把页面撑出横向滚动 */
}

a { color: inherit; text-decoration: none; }

/* ---------- 首屏横幅 ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  /* 高度由图片比例决定（1536×1024），整张横幅图完整显示、不裁不拉 */
  aspect-ratio: 1536 / 1024;
  margin-bottom: var(--gap);
  border-radius: 14px;
  overflow: hidden;
  background: #f7efe3;
  box-shadow: 0 8px 26px rgba(90, 62, 34, .18);
}

.hero-art {
  position: absolute;
  inset: 0;
  background: #f7efe3 url("hero-cup-banner.jpg?v=1794354435174") center/cover no-repeat;
  /* 优先 WebP，老浏览器回落到 JPEG */
  background-image: -webkit-image-set(url("hero-cup-banner.webp?v=1794354435174") type("image/webp"), url("hero-cup-banner.jpg?v=1794354435174") type("image/jpeg"));
  background-image: image-set(url("hero-cup-banner.webp?v=1794354435174") type("image/webp"), url("hero-cup-banner.jpg?v=1794354435174") type("image/jpeg"));
}

/* 底部一层纸色薄雾，熔进页面即可（文字用纸面铭牌保证可读） */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(247, 239, 227, .85) 0%,
    rgba(247, 239, 227, 0) 22%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 16px;
}

.hero-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border: 1px solid rgba(200, 51, 43, .5);
  border-radius: 999px;
  background: rgba(255, 252, 246, .92);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.hero-sub {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 252, 246, .92);
  color: var(--text-sub);
  font-size: 13px;
  letter-spacing: .5px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 var(--gap);
  max-width: 720px;
  margin: 0 auto;
}

.site-logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
}

.site-logo .logo-dot { color: var(--brand); }

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: absolute;
  left: 8px;
  transition: .2s;
}
.nav-toggle span { top: 17px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 14px;
  white-space: nowrap;
}

.nav-links a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* ---------- 布局 ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--gap);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 4px;
}

.page-sub { color: var(--text-sub); font-size: 13px; margin-bottom: var(--gap); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: var(--gap);
}

.card + .card { margin-top: 0; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .more { font-size: 13px; color: var(--text-sub); font-weight: 400; }

/* ---------- 首页：公告 ---------- */
.announce-item { padding: 4px 0; }
.announce-item + .announce-item { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.announce-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.announce-date { color: var(--text-faint); font-size: 12px; margin-bottom: 4px; }
.announce-content { color: var(--text-sub); font-size: 13px; }

/* ---------- 比赛列表 / 卡片 ---------- */
.game-card { display: block; }
.game-meta { color: var(--text-faint); font-size: 12px; margin-bottom: 8px; }
.game-scoreline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.game-team { display: flex; align-items: center; gap: 8px; flex: 1; }
.game-team.right { justify-content: flex-end; text-align: right; }
.team-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.team-badge.team-m { background: var(--team-m); }
.team-badge.team-k { background: var(--team-k); }
.team-name { font-weight: 600; }
.game-score { font-size: 22px; font-weight: 700; margin: 0 16px; }
.game-score .dash { color: var(--text-faint); font-weight: 400; }

/* ---------- 排行榜 ---------- */
/* 榜单切换（分段控件，手机窄屏可横向滑动） */
.rank-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  padding: 3px;
  background: var(--bg);
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rank-tabs::-webkit-scrollbar { display: none; }

.rank-tab {
  flex: 1 1 0;
  padding: 7px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.rank-tab.is-active {
  background: var(--card);
  color: var(--brand);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.rank-tab:active { opacity: .7; }

.rank-list { list-style: none; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.rank-item + .rank-item { border-top: 1px solid var(--border); }
.rank-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-num { background: #ffd54d; color: #5c4300; }
.rank-item:nth-child(2) .rank-num { background: #dfe3e8; color: #3a3f45; }
.rank-item:nth-child(3) .rank-num { background: #e7b68a; color: #5c3410; }
.rank-name { flex: 1; font-weight: 500; min-width: 0; }
.rank-sub { color: var(--text-faint); font-size: 12px; flex-shrink: 0; }
.rank-val {
  font-weight: 700;
  color: var(--brand);
  font-size: 16px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.rank-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 12px;
}
.section-note { color: var(--text-faint); font-size: 12px; font-weight: 400; }

/* ---------- 头像（照片 / 首字占位 通用） ----------
 * 照片：assets/players/*.png 统一规格（360×360 透明、人像居中、自带白色描边）
 * 所以这里只需居中裁切，不能再做偏移，否则会跟描边错位。
 */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  object-fit: cover;          /* 照片裁剪成圆形，不变形 */
  object-position: center;    /* 人像已标准化居中 */
  background: var(--bg);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  line-height: 40px;
  overflow: hidden;
}
/* 首字占位（span）需要居中排版，并加一圈白边与照片的统一描边呼应 */
span.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9);
}
img.avatar { box-shadow: 0 0 0 1px rgba(15, 23, 42, .06); }
.avatar.team-m { background: var(--team-m); }
.avatar.team-k { background: var(--team-k); }
.avatar.team-x { background: var(--text-faint); }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.xs { width: 26px; height: 26px; font-size: 12px; }
.avatar.xl { width: 96px; height: 96px; font-size: 34px; }

/* 表格里的球员单元格（头像 + 姓名） */
.cell-player {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.stat-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- 球员列表（手机：两列照片卡） ---------- */
.player-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pcard {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 8px 12px;
  text-align: center;
  transition: transform .12s;
}
.pcard:active { transform: scale(.97); }
.pcard .avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  font-size: 28px;
  line-height: 72px;
  border-radius: 50%;
}
span.pcard .avatar { line-height: 1; }
.pcard-name { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.pcard-meta { font-size: 11px; color: var(--text-faint); margin-bottom: 9px; }
.pcard-stats {
  display: flex;
  justify-content: center;
  gap: 2px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.pcard-stats > span {
  flex: 1;
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.35;
}
.pcard-stats b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pcard-stats > span:first-child b { color: var(--brand); }
/* 一场没打的人（经纪人/替补）：不摆三个「—」，那看着像三根装饰线 */
.pcard-note {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: .3px;
}

/* 球员详情：大头像头部 */
.player-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: var(--gap);
}
.player-hero .avatar { width: 88px; height: 88px; font-size: 34px; border-radius: 50%; }
span.player-hero .avatar { line-height: 1; }
.player-hero-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
/* 个人页名字旁的号码：跟着大名字走，比列表卡里的更大一号 */
.player-hero-name .pnum { font-size: 16px; padding: 1px 11px; vertical-align: 3px; }
.player-hero-meta { font-size: 13px; color: var(--text-sub); overflow-wrap: anywhere; }
.team-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 11px;
  color: #fff;
  vertical-align: middle;
}
.team-chip.team-m { background: var(--team-m); }
.team-chip.team-k { background: var(--team-k); }
/* 队外人员（经纪人）：中性灰，不占任何队色 */
.team-chip.team-x { background: var(--text-faint); }

/* 四个关键数据格 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}
.stat-grid .num { font-size: 20px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat-grid .lbl { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.stat-line { margin-top: 12px; font-size: 13px; color: var(--text-sub); line-height: 1.7; overflow-wrap: anywhere; }

/* ---------- 统计表 ---------- */
.stat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -14px;
  padding: 0 14px;
  scrollbar-width: none;      /* Firefox：隐藏滚动条 */
  -ms-overflow-style: none;   /* 旧 IE/Edge */
}
.table-wrap::-webkit-scrollbar { display: none; height: 0; }  /* WebKit：隐藏滚动条 */
.table-wrap .stat-table { min-width: 480px; }
/* 个人页的表格 12 列，需要更宽；其它页面（如比赛详情）保持原样 */
#player-detail .table-wrap .stat-table { min-width: 640px; }
/* 日期双写法：窄屏（手机卡片）显示「9月21日」，宽屏表格里显示「9/21」省地方 */
.stat-table .d-short { display: none; }
@media (min-width: 561px) {
  #player-detail .stat-table .d-long { display: none; }
  #player-detail .stat-table .d-short { display: inline; }
}
/* 表格比屏幕宽时的提示（JS 判断真的溢出才显示） */
.table-hint {
  display: none;
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
  margin: 0 0 6px;
  letter-spacing: .02em;
}
.table-hint.on { display: block; }
.stat-table th,
.stat-table td { padding: 8px 6px; text-align: center; }
/* 个人页列多，把留白收窄一点，12 列才排得开 */
#player-detail .stat-table th,
#player-detail .stat-table td { padding: 7px 4px; }
.stat-table th {
  color: var(--text-sub);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.stat-table td { border-bottom: 1px solid var(--bg); }
.stat-table .name-cell { text-align: left; font-weight: 500; }
.stat-table .hl { font-weight: 700; color: var(--brand); }

/* ---------- 个人页逐场数据：手机上改成「每场一张卡」----------
 * 桌面是完整表格（12 项横排）；窄屏横滑太难受、还看不全，
 * 所以小屏下每场比赛独立成块，12 项数据全部直接摊开，不用滑。
 */
@media (max-width: 560px) {
  #player-detail .table-hint { display: none !important; }  /* 不用滑了，提示也别留 */
  #player-detail .table-wrap { overflow: visible; margin: 0; padding: 0; }
  #player-detail .table-wrap .stat-table { min-width: 0; display: block; }
  #player-detail .stat-table thead { display: none; }
  #player-detail .stat-table tbody { display: block; }

  #player-detail .stat-table tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px 6px;
    padding: 10px 12px 11px;
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: 10px;
  }

  #player-detail .stat-table td {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0;
    border: 0;
    text-align: left;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }
  #player-detail .stat-table td::before {
    content: attr(data-label);
    font-size: 10px;
    line-height: 1.2;
    color: var(--text-faint);
    font-weight: 500;
  }

  /* 每张卡的第一行：左边日期，右边对手 + 阶段徽章 */
  #player-detail .stat-table td.cell-date {
    grid-column: 1 / 3;
    flex-direction: row;
    align-items: center;
    font-weight: 600;
  }
  #player-detail .stat-table td.cell-opp {
    grid-column: 3 / 5;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 12px;
    color: var(--text-sub);
  }
  #player-detail .stat-table td.cell-date::before,
  #player-detail .stat-table td.cell-opp::before { content: none; }

  #player-detail .stat-table .hl { color: var(--brand); font-weight: 700; }
}

/* ---------- 接龙报名 ----------
 * 一屏内看清三件事：这场什么时候、来了多少人、M/K 各来了谁。
 * 队色不写死，全部跟着 --team-m / --team-k 变量走（换皮肤自动跟着变）。
 */
.sg-card { padding: 18px 16px; }

/* 头部 */
.sg-title { font-size: 19px; font-weight: 800; line-height: 1.32; letter-spacing: .2px; }
.sg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 9px;
  font-size: 13px;
  color: var(--text-sub);
}
/* 两项之间加个间隔圆点，不用手写分隔符 */
.sg-meta > * + * { position: relative; padding-left: 13px; }
.sg-meta > * + *::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  transform: translateY(-50%);
}
.sg-total b {
  font-size: 17px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* 两队报名比例：一条双色细条，扫一眼就知道哪队人多 */
.sg-bar { display: flex; gap: 3px; height: 7px; margin: 15px 0 9px; }
.sg-bar i { display: block; height: 100%; min-width: 8px; border-radius: 99px; transition: width .4s ease; }
.sg-bar .m { background: var(--team-m); }
.sg-bar .k { background: var(--team-k); }
.sg-bar .x { background: var(--text-faint); }

.sg-legend { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.sg-lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
}
.sg-lg i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sg-lg b { color: inherit; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sg-lg.m { color: var(--team-m); }
.sg-lg.k { color: var(--team-k); }

/* 分队名单：队名左边一条队色竖线，比色块标签更安静，也不会和「M 队」重复 */
.sg-groups { display: grid; gap: 15px; }
.sg-g-m { --tc: var(--team-m); }
.sg-g-k { --tc: var(--team-k); }
.sg-ghead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-left: 11px;
  font-size: 14px;
  font-weight: 700;
}
.sg-ghead::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--tc, var(--text-faint));
  transform: translateY(-50%);
}
.sg-gnum { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-faint); }

.sg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-chip {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
}
/* 队色淡染：用伪元素铺一层 --tc，再压 opacity，避免为每队写死 rgba */
.sg-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--tc, transparent);
  opacity: .18;
}
/* 队色变量显式挂在胶囊上（类名要和 HTML 的 sg-m / sg-k 对齐，
   别只靠 .sg-group 继承 —— 以后改分组类名就会静默掉色） */
.sg-chip.sg-m { --tc: var(--team-m); }
.sg-chip.sg-k { --tc: var(--team-k); }
.sg-chip .avatar { flex: 0 0 26px; }
/* 自己那颗描一圈主色，方便一眼找到 */
.sg-chip.is-me { box-shadow: 0 0 0 1.5px var(--brand); }
.sg-chip.is-me::before { opacity: .3; }
.sg-me {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--ink, #fff);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.sg-none {
  padding: 9px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-faint);
  font-size: 12.5px;
}

/* 报名后的操作区：取消 / 换人 / 报名链接，等宽竖排 */
.sg-actions { display: grid; gap: 10px; margin-top: 18px; }

/* 桌面屏幕够宽时两个按钮并排，别让一条 650px 宽的按钮孤零零横在那 */
@media (min-width: 720px) {
  .sg-actions { grid-template-columns: 1fr 1fr; }
  .sg-actions .btn { order: 1; }
  /* 「不是我 · 换个人」是纠错入口，横跨两列压在下面一行 */
  .sg-actions .btn-swap { grid-column: 1 / -1; order: 3; }
  .sg-actions .btn-hint { grid-column: 1 / -1; order: 4; }
}

/* 「不是我 · 换个人」做成轻量文字按钮：
   它是个纠错入口，不该和「取消报名」「查看报名链接」抢视觉权重 */
.btn.btn-swap {
  background: none;
  box-shadow: none;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 500;
  padding: 6px;
  min-height: 38px;
}
.btn.btn-swap:active { color: var(--brand); background: none; }
.btn.btn-swap[disabled] { opacity: .5; }

/* 轻提示条（接龙变更成功后反馈） */
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 9999;
  max-width: calc(100vw - 40px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(18, 24, 40, .95);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 26px rgba(10, 14, 22, .35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  font-size: 15px;
}
.btn:active { background: var(--brand-dark); }
.btn.block { display: block; width: 100%; }
.btn.disabled { background: #c8c8ce; }
.btn-hint { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 8px; }

/* ---------- 提示 / 空状态 ---------- */
.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 0;
  font-size: 14px;
}

/* ---------- 战报分享卡 ---------- */
.share-img {
  display: block;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(10, 14, 22, .35);
}
.share-actions { margin-top: 14px; }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  padding: 24px var(--gap) 32px;
}

/* ---------- 移动端导航（<640px 收成汉堡菜单） ---------- */
@media (max-width: 640px) {
  .nav-toggle { display: block; }

  /* 手机屏幕：收紧卡片与页面留白，提升信息密度 */
  .card { padding: 14px; margin-bottom: 12px; }
  .page { padding: 12px; }
  .section-title { margin-bottom: 10px; }
  /* 手机：横幅同样是 1536×896 的比例，宽度铺满即可，高度自然约 214px */
  .hero { margin-bottom: 12px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;   /* 必须与 .site-header-inner 的高度一致，否则下拉菜单会盖住导航栏底部 */
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--gap);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; font-size: 15px; }
}

/* ---------- 桌面端（>640px）隐藏汉堡 ---------- */
@media (min-width: 641px) {
  .nav-toggle { display: none; }
}

/* ==========================================================================
   手机优先美化层（后定义，覆盖上面的基础样式）
   1) 触控：可点区域不小于 --tap，去掉微信/安卓的灰色点击方块
   2) 按钮：加高、圆角、渐变、按下有明确反馈
   3) 骨架屏：加载时显示「内容的形状」，而不是「加载中…」四个字
   ========================================================================== */

/* ---------- 1. 触控 ---------- */
a,
button,
.pcard,
.game-card,
.rank-tab,
.nav-toggle {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;        /* 去掉双击缩放带来的 300ms 点击延迟 */
}

.pcard,
.game-card { transition: transform .14s ease, background .14s ease; }

/* 手机上永远没有 hover，只有按下，所以反馈必须做在 :active 上 */
.pcard:active { transform: scale(.965); }
.game-card:active { transform: scale(.985); background: #fafafc; }

.nav-toggle {
  width: var(--tap);
  height: var(--tap);
  border-radius: 12px;
}
.nav-toggle:active { background: var(--bg); }
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after { left: 11px; }
.nav-toggle span { top: 21px; }

/* 顶部导航：加高、毛玻璃，滚动时内容不会糊在一起 */
.site-header {
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.site-header-inner { height: 56px; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  transition: background .14s ease, color .14s ease;
}
.nav-links a:active { background: var(--bg); }

/* ---------- 2. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #f0733d 0%, var(--brand) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .3px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(232, 98, 44, .26),
              inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:active {
  transform: translateY(1px) scale(.985);
  box-shadow: 0 2px 8px rgba(232, 98, 44, .22),
              inset 0 1px 0 rgba(255, 255, 255, .16);
  filter: brightness(.95);
}
.btn.block { display: flex; width: 100%; }
.btn.disabled { background: #c8c8ce; box-shadow: none; }

/* 次要按钮：白底描边，用于不抢主操作的场合 */
.btn.ghost {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
}
.btn.ghost:active {
  background: #f4f5f8;
  box-shadow: inset 0 0 0 1px var(--border);
  filter: none;
}
.btn-hint { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 10px; }

/* 分段控件（榜单 / 队伍筛选）：加高到手指能点准 */
.rank-tabs { border-radius: 12px; padding: 4px; gap: 5px; }
.rank-tab {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 14px;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.rank-tab:active { opacity: 1; transform: scale(.97); }

/* ---------- 3. 骨架屏 ---------- */
.sk {
  position: relative;
  display: block;
  overflow: hidden;
  background: #eaecf1;
  border-radius: 7px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, .85) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  animation: sk-sweep 1.25s ease-in-out infinite;
}
@keyframes sk-sweep { to { transform: translateX(100%); } }

.sk-line { height: 12px; border-radius: 6px; }
.sk-circle { border-radius: 50%; flex-shrink: 0; }

/* 通用行：头像 + 文字 + 右侧数值（榜单 / 公告） */
.sk-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.sk-row + .sk-row { border-top: 1px solid var(--border); }
.sk-main { flex: 1; min-width: 0; }
.sk-main .sk-line + .sk-line { margin-top: 7px; }

/* 比赛卡 */
.sk-game { padding: 2px 0; }
.sk-game + .sk-game { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.sk-scoreline { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

/* 球员卡网格（与 .player-grid / .pcard 同尺寸，替换时不跳动） */
.sk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sk-pcard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 8px 12px;
  text-align: center;
}
.sk-pcard .sk-stats {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* 表格 */
.sk-table-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.sk-table-row + .sk-table-row { border-top: 1px solid var(--bg); }

/* 尊重系统里的「减少动态效果」开关 */
@media (prefers-reduced-motion: reduce) {
  .sk::after { animation: none; }
  .pcard, .game-card, .btn, .rank-tab { transition: none; }
}

/* ---------- 4. 空状态 / 提示 ---------- */
.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 44px 16px;
  font-size: 14px;
  line-height: 1.7;
}
.empty::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #f0f1f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b6b8c2' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M8.5 13.5c1 1.2 2.2 1.8 3.5 1.8s2.5-.6 3.5-1.8'/%3E%3C/svg%3E") center / 26px no-repeat;
}

/* 手机端：按钮再高一点，避免误触 */
@media (max-width: 640px) {
  .btn { min-height: 50px; }
  .rank-tab { min-height: 40px; }
  .empty { padding: 40px 12px; }
}

/* ---------- 5. 轻量过渡：头像淡入、页面进入 ---------- */
/* 头像文件本身只有 ~20KB，但列表里几十张同时出现时，
   直接「啪」地弹出来会闪；淡入一下看起来更稳。 */
img.avatar { animation: av-in .26s ease both; }
@keyframes av-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}

main.page { animation: page-in .3s ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  img.avatar,
  main.page { animation: none; }
}

/* ---------- 6. 小链接的隐形热区 ---------- */
/* 「球员 ›」「全部 ›」字号只有 13px，看着没问题，但手指点不中。
   这里不动外观，只在四周补一圈透明热区，让可点高度接近 44px。 */
.section-title .more { position: relative; }
.section-title .more::after {
  content: "";
  position: absolute;
  inset: -12px -10px;
}

/* ---------- 7. 罚球口径说明（浅灰小字） ---------- */
/* 罚球只在最后两张表里有真实记录，其余场次是「未记录」而非 0，
   所以数字后面跟一句浅灰说明，避免被误读成整季罚球命中率。 */
.stat-line .ft-note { color: var(--text-faint); font-size: 12px; }

/* ==========================================================================
   8. 赛季阶段：切换条 + 比赛标签
   --------------------------------------------------------------------------
   阶段是比赛的属性，全站共用一条切换条。常规赛是默认值所以不打标签，
   只有季后赛/争霸赛才在比赛卡上标出来，避免每行都挂一个「常规赛」显得吵。
   ========================================================================== */
.stage-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.stage-tabs::-webkit-scrollbar { display: none; }

.stage-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}
.stage-tab.is-active {
  background: var(--brand-soft);
  border-color: #f3c1a8;
  color: var(--brand-dark);
  font-weight: 700;
}
.stage-num { font-size: 11px; font-weight: 400; color: var(--text-faint); }
.stage-tab.is-active .stage-num { color: var(--brand-dark); opacity: .7; }

.stage-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10.5px;
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}
.stage-chip.stage-playoff { background: #fdeaea; color: #c0392b; }
.stage-chip.stage-cup { background: #fff4e0; color: #a86000; }

/* ==========================================================================
   9. 球队页
   ========================================================================== */
.team-switch { display: flex; gap: 8px; margin-bottom: 14px; }
.team-switch button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.team-switch button.on[data-team="M"] { background: var(--team-m); border-color: var(--team-m); color: #fff; font-weight: 700; }
.team-switch button.on[data-team="K"] { background: var(--team-k); border-color: var(--team-k); color: #fff; font-weight: 700; }

.record-line { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 4px; }
.record-big { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.record-sub { font-size: 13px; color: var(--text-sub); padding-bottom: 4px; }

.metric-list { margin-top: 6px; }
.metric-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 14px;
}
.metric-row:last-child { border-bottom: none; }
.metric-row .k { color: var(--text-sub); font-size: 13px; flex: 0 0 92px; }
.metric-row .v { font-weight: 700; }
.metric-row .n { color: var(--text-faint); font-size: 12px; margin-left: auto; }

/* 阶段对比表：常规赛 vs 季后赛，右侧差值 */
.cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp-table th, .cmp-table td { padding: 9px 6px; border-bottom: 1px solid var(--bg); text-align: right; white-space: nowrap; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; color: var(--text-sub); white-space: normal; }
.cmp-table thead th { color: var(--text-faint); font-weight: 600; font-size: 12px; }
.cmp-table td:first-child { color: var(--text-sub); }
.delta-pos { color: var(--brand-dark); font-weight: 700; }
.delta-neg { color: #1a7f42; font-weight: 700; }
.delta-flat { color: var(--text-faint); }

/* 近期战绩：最近 5 场的胜负条 */
.form-row-list { margin-top: 14px; }
.form-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 13px;
  color: inherit;
  text-decoration: none;
  min-height: var(--tap);
}
.form-item:last-child { border-bottom: none; }
.form-res {
  width: 24px; height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
}
.form-res.w { background: #c0392b; }
.form-res.l { background: #9b9ba3; }
.form-opp { color: var(--text-sub); }
.form-score { margin-left: auto; font-weight: 700; }

/* ---------- 10. 页脚：版本号（居中）+ 管理员入口（仅首页，右侧悬浮） ---------- */
.site-footer {
  position: relative;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  padding: 24px var(--gap) 32px;
}
.footer-admin {
  position: absolute;
  right: 6px;
  bottom: 18px;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 12px;
  padding: 8px 10px;   /* 扩大触控热区 */
  border-radius: 8px;
}
.footer-admin:active { background: rgba(0,0,0,.06); }

/* ==========================================================================
   11. 身份选择弹层（接龙 / 评论共用）
   ========================================================================== */
.id-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 10, 16, .55);
  opacity: 0;
  transition: opacity .2s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.id-mask.show { opacity: 1; }
.id-sheet {
  width: min(420px, 100%);
  max-height: 78vh;
  background: var(--card, #fff);
  border-radius: 18px 18px 0 0;
  padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(30px);
  transition: transform .22s ease;
}
.id-mask.show .id-sheet { transform: translateY(0); }
.id-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.id-sub { font-size: 12px; font-weight: 400; color: var(--text-faint); margin-left: 6px; }
.id-team { font-size: 12px; color: var(--text-faint); margin: 10px 2px 6px; }
.id-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.id-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  border: none;
  background: none;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.id-item:active { background: rgba(0,0,0,.06); }
.id-item .avatar { width: 44px; height: 44px; }
.id-name { font-size: 12px; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-cancel {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--bg, #f2f3f5);
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
}

/* 接龙：取消报名按钮用弱化样式，和「我要报名」区分开 */
.btn-leave { background: transparent; color: var(--text-sub); box-shadow: inset 0 0 0 1px var(--border); }
.btn-leave:active { background: var(--bg); }

/* ==========================================================================
   12. 比赛评论区
   ========================================================================== */
.cmt-count { font-size: 13px; font-weight: 400; color: var(--text-faint); }
.cmt-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg);
}
.cmt-item:last-child { border-bottom: none; }
.cmt-item .avatar.sm { width: 36px; height: 36px; flex: 0 0 36px; }
.cmt-item .avatar.xs, .cmt-me .avatar.xs { width: 26px; height: 26px; font-size: 12px; }
.cmt-body { min-width: 0; flex: 1; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.cmt-chip { font-size: 10.5px; color: var(--text-faint); background: var(--bg); border-radius: 10px; padding: 1px 7px; }
.cmt-time { margin-left: auto; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.cmt-text { margin-top: 3px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.cmt-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bg);
  flex-direction: column;
}
.cmt-me {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  align-self: flex-start;
  touch-action: manipulation;
}
.cmt-change { font-size: 11px; color: var(--text-faint); }
.cmt-compose textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;   /* ≥16px 防手机自动放大，取 15 视编辑器实测，如仍放大可调 16 */
  font-family: inherit;
  resize: vertical;
  background: var(--card);
  color: var(--text);
}
.cmt-compose textarea:focus { outline: none; border-color: var(--brand, #e8734a); }
.cmt-send { align-self: flex-end; min-width: 96px; }

.avatar.sm { width: 36px; height: 36px; font-size: 15px; }

/* ---------- 球衣号码徽章（球员列表卡 / 个人页名字旁） ---------- */
.pnum {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .07);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 800;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  line-height: 1.5;
  vertical-align: 2px;
}
