:root {
  --ink: #040b09;
  --ink-2: #07150f;
  --court: #0b2b22;
  --neon: #d9ff3f;
  --clay: #ff6b45;
  --chalk: #eaf4ec;
  --muted: #7c988e;
  --line: rgba(217, 255, 63, 0.14);
  --display: "Barlow Condensed", "Noto Sans SC", "PingFang SC", sans-serif;
  --body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 球场背景 ---------- */
.court {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.court::before,
.court::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.court::before {
  width: 60vw;
  height: 60vw;
  top: -18vw;
  right: -12vw;
  background: radial-gradient(circle, rgba(217, 255, 63, 0.13), transparent 68%);
}

.court::after {
  width: 52vw;
  height: 52vw;
  bottom: -20vw;
  left: -14vw;
  background: radial-gradient(circle, rgba(255, 107, 69, 0.12), transparent 70%);
}

.court svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -26%;
  width: 100%;
  height: 130%;
  transform: perspective(880px) rotateX(58deg) scale(1.2);
  transform-origin: 50% 100%;
  opacity: 0.5;
}

.court-lines {
  fill: none;
  stroke: rgba(234, 244, 236, 0.16);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.court-lines--strong { stroke: rgba(217, 255, 63, 0.3); }

.court-ball {
  position: absolute;
  left: 8%;
  top: 62%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f4ffbe, var(--neon) 62%, #9bbf16);
  box-shadow: 0 0 24px 6px rgba(217, 255, 63, 0.35);
  opacity: 0;
}

.court-ball.serving {
  animation: serve 1.3s cubic-bezier(0.45, 0, 0.35, 1) forwards;
}

@keyframes serve {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  12% { opacity: 0.95; }
  100% { transform: translate(72vw, -26vh) scale(0.9); opacity: 0; }
}

/* ---------- 页头 ---------- */
.layout,
.site-foot {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 0 4px rgba(217, 255, 63, 0.14);
}

.player:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

/* ---------- 主布局：左栏 + 阵容 ---------- */
.layout {
  width: min(1180px, 100%);
  margin: 0 auto;
}

/* 移动端：左栏解开为顶部堆叠，队标行仍可整页吸顶 */
.side { display: contents; }

.panel {
  min-width: 0;
  padding: clamp(22px, 5vw, 44px) clamp(18px, 5vw, 40px) 72px;
}

.panel.enter,
.team-hero.enter { animation: panel-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* 战队主视觉（左栏） */
.team-hero {
  padding: clamp(18px, 4vw, 26px) clamp(18px, 5vw, 40px) 6px;
}

.team-hero:empty { display: none; }

.team-hero .hero-letter {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(92px, 24vw, 148px);
  line-height: 0.78;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(234, 244, 236, 0.45);
  user-select: none;
}

.team-hero h2 {
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.team-hero h2 em {
  font-style: normal;
  color: var(--neon);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
}

.stats > div {
  padding: 0 20px;
  border-left: 1px solid rgba(234, 244, 236, 0.14);
}

.stats > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.stats dt {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats dd {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--chalk);
}

/* 队长徽标（浮于照片右上角） */
.captain-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 4px;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff8a5c, var(--clay));
  color: #1c0a05;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  box-shadow: 0 8px 22px -8px rgba(255, 107, 69, 0.85);
}

.captain-badge svg { flex: 0 0 auto; }

.mini-tag {
  padding: 1px 9px 2px;
  border: 1px solid rgba(234, 244, 236, 0.28);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(234, 244, 236, 0.85);
}

/* 阵容 */
.roster-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: clamp(24px, 4vw, 36px) 0 14px;
}

.roster-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.roster-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(234, 244, 236, 0.12);
}

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

/* 大幅球员卡：整卡即照片 */
.player {
  position: relative;
  aspect-ratio: 5 / 8;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, var(--court), var(--ink-2));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 42ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.player:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 255, 63, 0.45);
  box-shadow: 0 26px 52px -28px rgba(217, 255, 63, 0.7);
}

.player img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.03);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.player:hover img {
  transform: scale(1.07);
}

.player img.is-broken { display: none; }

.portrait-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  color: rgba(234, 244, 236, 0.3);
}

.player.is-fallback .portrait-fallback { display: grid; }

/* 姓名压在照片底部 */
.player-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 46px 14px 13px;
  background: linear-gradient(180deg, transparent, rgba(4, 11, 9, 0.42) 42%, rgba(4, 11, 9, 0.92));
}

.player-name {
  display: block;
  overflow: hidden;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--chalk);
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(4, 11, 9, 0.8);
}

.player-name.is-latin {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.caption-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

/* ---------- 展示方式切换 ---------- */
.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: clamp(20px, 4vw, 32px) 0 16px;
}

.view-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(234, 244, 236, 0.12);
  border-radius: 12px;
  background: rgba(234, 244, 236, 0.04);
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 15px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.seg-btn:hover { color: var(--chalk); }

.seg-btn.is-active {
  background: var(--neon);
  color: var(--ink);
}

.seg-btn:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

/* ---------- 顶部队伍切换 ---------- */
.team-switch {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(4, 11, 9, 0.82);
  border-bottom: 1px solid rgba(234, 244, 236, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.team-switch[hidden] { display: none; }

.team-switch__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 10px clamp(18px, 5vw, 40px);
  overflow-x: auto;
  scrollbar-width: none;
}

.team-switch__inner::-webkit-scrollbar { display: none; }

.team-chip {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 2px;
  padding: 6px 13px 7px;
  border: 1px solid rgba(234, 244, 236, 0.14);
  border-radius: 999px;
  background: rgba(234, 244, 236, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.team-chip__letter {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
}

.team-chip__suffix {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.team-chip:hover {
  border-color: rgba(217, 255, 63, 0.4);
  background: rgba(217, 255, 63, 0.07);
  color: var(--chalk);
}

.team-chip.is-active {
  border-color: transparent;
  background: var(--neon);
  color: var(--ink);
}

.team-chip.is-active .team-chip__suffix { opacity: 0.65; }

.team-chip:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

/* ---------- 团队合影大卡片 ---------- */
.group-photo {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 210, 120, 0.35);
  border-radius: 20px;
  background:
    radial-gradient(130% 90% at 26% 14%, rgba(255, 217, 102, 0.95), rgba(255, 217, 102, 0) 58%),
    linear-gradient(168deg, #f7bf45 0%, #ec9a30 52%, #cf7223 100%);
  box-shadow: 0 30px 60px -34px rgba(255, 178, 76, 0.7);
}

.group-photo.is-portrait {
  aspect-ratio: 9 / 16;
  max-width: 460px;
  margin: 0 auto;
}

.group-photo.is-landscape {
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

/* 自定义背景：去掉原有的金色描边与光晕，深色背景时顶部信息改用浅色文字 */
.group-photo.has-custom-bg {
  border-color: rgba(234, 244, 236, 0.2);
  box-shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.65);
}

.group-photo.is-dark .gp-eyebrow {
  color: rgba(234, 244, 236, 0.78);
}

.group-photo.is-dark .gp-count {
  border-color: rgba(234, 244, 236, 0.35);
  color: rgba(234, 244, 236, 0.86);
}

.group-photo.has-custom-bg.is-dark .gp-sponsor {
  background: linear-gradient(180deg, rgba(4, 11, 9, 0), rgba(4, 11, 9, 0.7) 52%, rgba(4, 11, 9, 0.88));
}

/* 背景设置面板 */
.bg-panel {
  display: grid;
  gap: 12px;
  margin: -4px 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(234, 244, 236, 0.12);
  border-radius: 14px;
  background: rgba(234, 244, 236, 0.04);
}

.bg-panel[hidden] { display: none; }

.bg-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bg-row[hidden] { display: none; }

.bg-row-label {
  min-width: 44px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.bg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bg-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(234, 244, 236, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.bg-swatch:hover { transform: translateY(-2px); }

.bg-swatch.is-active {
  border-color: var(--neon);
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

.bg-color {
  width: 46px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(234, 244, 236, 0.22);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.bg-color::-webkit-color-swatch-wrapper { padding: 0; }

.bg-color::-webkit-color-swatch {
  border: 0;
  border-radius: 9px;
}

.bg-color::-moz-color-swatch {
  border: 0;
  border-radius: 9px;
}

.bg-angle {
  flex: 1;
  min-width: 110px;
  accent-color: var(--neon);
  cursor: pointer;
}

.bg-angle-value {
  min-width: 42px;
  font-family: var(--display);
  font-size: 14px;
  color: var(--chalk);
  text-align: right;
}

.group-photo__stage {
  position: absolute;
  inset: 0;
}

.group-photo__meta {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.gp-eyebrow {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(64, 31, 3, 0.72);
}

.gp-count {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 11px;
  border: 1px solid rgba(64, 31, 3, 0.35);
  border-radius: 999px;
  color: rgba(64, 31, 3, 0.8);
}

.gp-fig {
  position: absolute;
  margin: 0;
  transform-origin: center bottom;
  animation: gp-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes gp-in {
  from { opacity: 0; transform: translateY(20px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.gp-fig img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 20px rgba(96, 44, 0, 0.34));
}

.gp-fig.is-fallback { display: none; }

.gp-name {
  position: absolute;
  left: calc(50% + var(--label-dx, 0%));
  top: calc(100% + 0.4% + var(--label-dy, 0%));
  transform: translate(-50%, -100%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px 3px 9px;
  border: 1px solid rgba(234, 244, 236, 0.2);
  border-radius: 999px;
  background: rgba(4, 11, 9, 0.82);
  color: var(--chalk);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gp-name.is-latin {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding-left: 10px;
}

.gp-crown {
  display: inline-flex;
  color: var(--neon);
}

.gp-crown svg { display: block; }

/* 卡片底部赞助信息 */
.gp-sponsor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 34px 18px 12px;
  background: linear-gradient(180deg, rgba(45, 21, 2, 0), rgba(45, 21, 2, 0.72) 52%, rgba(38, 17, 2, 0.9));
  color: #fff4de;
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.group-photo.is-landscape .gp-sponsor {
  padding: 16px 16px 7px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .group-photo.is-landscape .gp-sponsor {
    padding: 10px 10px 5px;
    font-size: 8px;
  }
}

/* 布局编辑态 */
.group-photo.is-editing .gp-fig {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.group-photo.is-editing .gp-fig img {
  pointer-events: none;
  -webkit-user-drag: none;
}

.group-photo.is-editing .gp-fig.is-selected {
  z-index: 4;
  outline: 2px dashed var(--neon);
  outline-offset: 2px;
  border-radius: 6px;
}

.group-photo.is-editing .gp-name {
  z-index: 5;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.group-photo.is-editing .gp-name:active { cursor: grabbing; }

.gp-resize {
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 3;
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 0 4px rgba(217, 255, 63, 0.18);
  cursor: ew-resize;
  touch-action: none;
  transform: translateY(-50%);
}

.group-photo.is-editing .gp-resize { display: block; }

/* 选中人物后出现的删除按钮 */
.gp-remove {
  position: absolute;
  top: -11px;
  right: -11px;
  z-index: 7;
  display: none;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 107, 69, 0.75);
  border-radius: 50%;
  background: rgba(12, 6, 4, 0.94);
  color: #ff8a5c;
  font-family: var(--display);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  touch-action: none;
}

.group-photo.is-editing .gp-fig.is-selected .gp-remove { display: grid; }

.gp-remove:hover {
  background: #ff6b45;
  color: #1c0a05;
}

.gp-remove:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

.gp-fig.is-removing {
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.layout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.layout-bar[hidden] { display: none; }

.layout-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.layout-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-status {
  color: var(--neon);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- 队员卡弹窗 ---------- */
body.is-modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 11, 9, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
}

.modal__card {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, var(--court), var(--ink-2));
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  animation: panel-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 2px;
  border: 1px solid rgba(234, 244, 236, 0.24);
  border-radius: 999px;
  background: rgba(4, 11, 9, 0.62);
  color: var(--chalk);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}

.modal__close:hover { background: rgba(4, 11, 9, 0.88); }

.modal__close:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

.modal__photo {
  position: relative;
  aspect-ratio: 5 / 8;
  overflow: hidden;
  perspective: 1200px;
  background: linear-gradient(165deg, var(--court), var(--ink-2));
}

.modal__photo.is-flippable { cursor: pointer; }

.modal__photo.is-flippable:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: -3px;
}

.modal__photo-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal__photo.is-flipped .modal__photo-inner { transform: rotateY(180deg); }

.modal__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.modal__face--back { transform: rotateY(180deg); }

.modal__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.modal__photo img.is-broken { display: none; }

.modal__photo.is-fallback .portrait-fallback { display: grid; }

/* 关闭按钮占据右上角，队长徽标下移避让 */
.modal__photo .captain-badge { top: 56px; right: 14px; }

.captain-badge[hidden] { display: none; }

/* 翻转提示：有氛围照时引导用户点击翻转 */
.flip-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(4, 11, 9, 0.72);
  color: #fff4de;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, 0);
  opacity: 0;
  animation: flipHintIn 0.45s ease forwards, flipHintPulse 2.4s ease-in-out 0.6s infinite;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.flip-hint[hidden] { display: none; }

.flip-hint.is-dismissing {
  animation: flipHintOut 0.35s ease forwards;
}

.flip-hint__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  animation: flipHintIconSpin 2.4s ease-in-out infinite;
}

@keyframes flipHintIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes flipHintOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 10px); }
}

@keyframes flipHintPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 6px 22px rgba(255, 217, 102, 0.45); }
}

@keyframes flipHintIconSpin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
  .flip-hint,
  .flip-hint__icon { animation: none; opacity: 1; }
}


.modal__team {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.modal__body { padding: 16px 18px 2px; }

.modal__name {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--chalk);
}

.modal__name.is-latin {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.caption-tags[hidden] { display: none; }

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 0;
}

.modal__original {
  border: 1px solid rgba(234, 244, 236, 0.18);
}

.modal__hidden[hidden] { display: none; }

.modal__download:disabled {
  opacity: 0.6;
  cursor: progress;
}

.modal__sponsor {
  margin: 14px 0 0;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, rgba(45, 21, 2, 0) 0%, rgba(45, 21, 2, 0.72) 42%, rgba(38, 17, 2, 0.9) 100%);
  color: #fff4de;
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-align: center;
}

@media (max-width: 720px) {
  .modal { padding: 10px; }

  .modal__card {
    width: min(340px, 100%);
    max-height: calc(100vh - 20px);
  }

  /* 限制照片高度，保证姓名与按钮、赞助信息不被挤出屏幕 */
  .modal__photo {
    width: 100%;
    max-height: 50vh;
  }

  .modal__body { padding: 12px 14px 0; }

  .modal__name { font-size: 22px; }

  .modal__name.is-latin { font-size: 26px; }

  .modal__actions { padding: 10px 14px 0; }

  .modal__actions .seg-btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .modal__sponsor {
    margin-top: 10px;
    padding: 12px 14px;
    font-size: 10px;
    line-height: 1.5;
  }
}

/* 横屏手机高度很矮，进一步压缩照片高度，保证赞助信息可见 */
@media (max-width: 720px) and (max-height: 480px) {
  .modal__photo { max-height: 45vh; }
}

/* 状态提示 */
.state {
  max-width: 560px;
  margin: 40px auto;
  padding: 28px;
  border: 1px dashed rgba(234, 244, 236, 0.22);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.state strong { display: block; margin-bottom: 8px; color: var(--chalk); font-weight: 500; }

.state code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(234, 244, 236, 0.08);
  color: var(--neon);
  font-size: 12px;
}

/* ---------- 页脚 ---------- */
.site-foot {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 5vw, 40px) 40px;
  border-top: 1px solid rgba(234, 244, 236, 0.08);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.site-foot p { margin: 4px 0; }

.foot-note { color: rgba(124, 152, 142, 0.7); text-align: center; }

.foot-note code {
  color: rgba(217, 255, 63, 0.75);
  font-size: 11px;
}

/* ---------- 桌面端：左栏吸顶 + 阵容 ---------- */
@media (min-width: 960px) {
  .layout {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .side {
    display: block;
    position: sticky;
    top: 68px;
    max-height: calc(100vh - 86px);
    overflow-y: auto;
    scrollbar-width: none;
    padding: clamp(20px, 3vw, 34px) 12px 24px 4px;
  }

  .side::-webkit-scrollbar { display: none; }

  .team-hero { padding: 24px 6px 0; }

  .roster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
