/* ============================================================
   S16 Finals Recap — Design Tokens & Global Styles
   ============================================================ */
:root {
  --primary: #E11D48;
  --primary-dark: #9F1239;
  --gold: #F59E0B;
  --gold-light: #FCD34D;
  --bg: #0A0A0F;
  --bg-section: #0F0F18;
  --bg-card: #13131C;
  --bg-card-hover: #1A1A28;
  --border: #26263A;
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --win: #10B981;
  --lose: #EF4444;
  --blue: #38BDF8;
  --purple: #A78BFA;
  --radius-card: 16px;
  --radius-sm: 8px;
  --shadow: 0 20px 40px -15px rgba(0,0,0,.4);
  --max-w: 1120px;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Chakra Petch', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: 'Russo One', 'Chakra Petch', 'PingFang SC', sans-serif; line-height: 1.3; }

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

img { max-width: 100%; display: block; }

/* ============ Navbar ============ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,15,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w); height: 100%; margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center; gap: 24px;
}
.nav-logo {
  font-family: 'Russo One', sans-serif; font-size: 20px; color: var(--text);
  white-space: nowrap;
}
.nav-logo span { color: var(--gold); margin-left: 4px; }
.nav-links {
  list-style: none; display: flex; gap: 4px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-secondary); white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--gold); background: rgba(245,158,11,.1); }
.nav-actions { display: flex; align-items: center; }
.btn-print {
  background: transparent; border: 1px solid var(--gold); color: var(--gold);
  padding: 7px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 13px; white-space: nowrap;
  transition: background .2s, color .2s;
}
.btn-print:hover { background: var(--gold); color: #0A0A0F; }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; flex-direction: column;
  justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .3s, opacity .3s;
}

/* ============ Hero ============ */
#hero {
  position: relative; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 60px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(225,29,72,.18), transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(245,158,11,.12), transparent 60%),
    var(--bg);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 80%);
}
.hero-content { position: relative; text-align: center; max-width: 820px; }
.hero-tag {
  display: inline-block; font-size: 13px; letter-spacing: 2px;
  color: var(--gold); border: 1px solid rgba(245,158,11,.4);
  padding: 6px 18px; border-radius: 999px; margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(42px, 9vw, 88px); color: var(--text);
  letter-spacing: 2px; margin-bottom: 18px;
}
.hero-subtitle {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(28px, 5vw, 48px); margin-bottom: 14px;
}
.score-win { color: var(--win); }
.score-lose { color: var(--lose); }
.hero-meta { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 32px; }
.badge {
  font-size: 13px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,.03);
}
.badge-gold { color: var(--gold-light); border-color: rgba(245,158,11,.4); }
.badge-red { color: #FB7185; border-color: rgba(225,29,72,.4); }
.badge-purple { color: var(--purple); border-color: rgba(167,139,250,.4); }
.hero-desc { color: var(--text-secondary); font-size: 15.5px; max-width: 680px; margin: 0 auto; }
.hero-scroll-hint {
  margin-top: 48px; font-size: 12px; letter-spacing: 3px;
  color: var(--text-muted); animation: floatY 2.4s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ============ Sections ============ */
section { padding: 88px 0; scroll-margin-top: var(--nav-h); }
.section-dark { background: var(--bg-section); }
.section-title {
  font-size: clamp(26px, 4.5vw, 38px); color: var(--text);
  margin-bottom: 16px; position: relative; padding-left: 18px;
}
.section-title::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 5px; border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), var(--primary));
}
.section-desc { color: var(--text-secondary); font-size: 15px; max-width: 820px; margin-bottom: 40px; }
.subsection-title {
  font-size: 21px; color: var(--gold-light); margin: 44px 0 20px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* ============ Review Cards ============ */
.review-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px; margin-bottom: 32px;
}
.review-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px;
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s, background .25s;
  display: flex; flex-direction: column;
}
.review-card:hover {
  transform: translateY(-4px); border-color: rgba(245,158,11,.5);
  background: var(--bg-card-hover);
}
.review-card-header { display: flex; gap: 8px; margin-bottom: 14px; }
.platform-tag, .review-type {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 600;
}
.platform-bili { background: rgba(251,113,133,.14); color: #FB7185; }
.platform-toutiao { background: rgba(245,158,11,.14); color: var(--gold); }
.platform-36kr { background: rgba(56,189,248,.14); color: var(--blue); }
.platform-sohu { background: rgba(167,139,250,.14); color: var(--purple); }
.platform-wanplus { background: rgba(16,185,129,.14); color: var(--win); }
.review-type { background: rgba(255,255,255,.06); color: var(--text-muted); }
.review-title { font-size: 16.5px; color: var(--text); margin-bottom: 8px; line-height: 1.5; }
.review-author { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.review-content { font-size: 14px; color: var(--text-secondary); flex: 1; }
.review-link {
  display: inline-block; margin-top: 16px; color: var(--gold);
  font-size: 14px; font-weight: 600;
  transition: color .2s, transform .2s;
}
.review-link:hover { color: var(--gold-light); transform: translateX(4px); }

/* ============ Game blocks ============ */
.game-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 18px 24px; border-radius: var(--radius-card); margin-bottom: 28px;
  border: 1px solid var(--border);
}
.game-header-lose { background: linear-gradient(90deg, rgba(239,68,68,.12), transparent); border-left: 4px solid var(--lose); }
.game-header-win { background: linear-gradient(90deg, rgba(16,185,129,.12), transparent); border-left: 4px solid var(--win); }
.game-header-gold { background: linear-gradient(90deg, rgba(245,158,11,.16), transparent); border-left: 4px solid var(--gold); }
.game-number { font-family: 'Russo One', sans-serif; font-size: 18px; color: var(--text); }
.game-result { font-weight: 700; font-size: 15px; }
.result-lose { color: var(--lose); }
.result-win { color: var(--win); }
.result-gold { color: var(--gold); }
.game-duration { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text-muted); }
.game-summary {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 22px 26px;
  color: var(--text-secondary); font-size: 15px; margin-bottom: 32px;
}

/* ============ Detail list ============ */
.detail-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 36px; }
.detail-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px;
  font-size: 14.5px; color: var(--text-secondary);
}
.detail-item strong { color: var(--gold-light); font-weight: 600; }

/* ============ Player evaluations ============ */
.player-eval-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px;
}
.player-col {
  border-radius: var(--radius-card); padding: 22px;
  border: 1px solid var(--border);
}
.player-col-blg { background: linear-gradient(180deg, rgba(225,29,72,.07), var(--bg-card)); }
.player-col-gen { background: linear-gradient(180deg, rgba(56,189,248,.06), var(--bg-card)); }
.team-label {
  font-family: 'Russo One', sans-serif; font-size: 17px;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.team-blg { color: #FB7185; }
.team-gen { color: var(--blue); }
.player-eval {
  padding: 14px 0; border-bottom: 1px dashed var(--border);
}
.player-eval:last-child { border-bottom: none; }
.player-eval .p-name {
  font-family: 'Russo One', sans-serif; font-size: 15px; color: var(--text);
  margin-right: 10px;
}
.player-eval .p-champ {
  font-size: 12px; color: var(--gold);
  background: rgba(245,158,11,.1); padding: 2px 9px; border-radius: 999px;
}
.player-eval p { font-size: 13.5px; color: var(--text-secondary); margin-top: 8px; }

/* ============ Diagrams ============ */
.diagram-block { margin: 28px 0; }
.diagram-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 28px 0;
}
.diagram-img {
  width: 100%; height: auto; border-radius: var(--radius-card);
  border: 1px solid var(--border); background: #0F0F18;
}
.diagram-caption {
  text-align: center; font-size: 12.5px; color: var(--text-muted);
  margin-top: 10px;
}

/* ============ Stat cards ============ */
.stat-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin: 36px 0;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 26px 22px;
  transition: border-color .25s, transform .25s;
}
.stat-card:hover { border-color: rgba(245,158,11,.45); transform: translateY(-3px); }
.stat-num {
  font-family: 'Russo One', sans-serif; font-size: 40px; color: var(--gold);
  line-height: 1.1; margin-bottom: 10px;
}
.stat-unit { font-size: 16px; color: var(--gold-light); margin-left: 4px; }
.stat-card h4 { font-size: 16px; color: var(--text); margin-bottom: 10px; }
.stat-card p { font-size: 13.5px; color: var(--text-secondary); }

/* ============ Hupu comments ============ */
.comment-group { margin-bottom: 40px; }
.comment-group-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; color: var(--text); margin-bottom: 18px;
}
.comment-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Russo One', sans-serif; font-size: 14px;
}
.avatar-gold { background: rgba(245,158,11,.18); color: var(--gold); }
.avatar-green { background: rgba(16,185,129,.18); color: var(--win); }
.avatar-red { background: rgba(225,29,72,.18); color: #FB7185; }
.avatar-blue { background: rgba(56,189,248,.18); color: var(--blue); }
.avatar-purple { background: rgba(167,139,250,.18); color: var(--purple); }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm); padding: 18px 22px;
}
.comment-featured {
  border-left-color: var(--primary);
  background: linear-gradient(90deg, rgba(225,29,72,.08), var(--bg-card));
}
.comment-text { font-size: 14.5px; color: var(--text); line-height: 1.8; }
.comment-meta { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ============ Sources table ============ */
.sources-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card); border: 1px solid var(--border);
  margin-bottom: 24px;
}
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  min-width: 640px;
}
.data-table th {
  background: #1A1A28; color: var(--gold-light); text-align: left;
  padding: 14px 16px; font-weight: 600; white-space: nowrap;
  position: sticky; top: 0;
}
.data-table td {
  padding: 13px 16px; color: var(--text-secondary);
  border-top: 1px solid var(--border); vertical-align: top;
}
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.disclaimer {
  font-size: 12.5px; color: var(--text-muted);
  background: rgba(255,255,255,.02); border-radius: var(--radius-sm);
  padding: 16px 20px; line-height: 1.8;
}

/* ============ Footer ============ */
.site-footer {
  background: #07070C; border-top: 1px solid var(--border);
  padding: 48px 0; text-align: center;
}
.footer-title { font-family: 'Russo One', sans-serif; font-size: 16px; color: var(--gold); letter-spacing: 2px; }
.footer-sub { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.footer-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ============ Back to top ============ */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold); color: #0A0A0F; border: none;
  font-size: 20px; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  box-shadow: 0 8px 24px rgba(245,158,11,.35);
}
.back-to-top.show { opacity: .92; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

/* ============ Fade-in ============ */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.fade-in.visible { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .review-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .diagram-pair { grid-template-columns: 1fr; }
  .player-eval-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .container { padding: 0 18px; }
  .nav-toggle { display: flex; margin-left: auto; }
  .nav-actions { display: none; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(10,10,15,.97); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden;
    transition: max-height .35s cubic-bezier(.16,1,.3,1);
  }
  .nav-links.open { max-height: 70vh; overflow-y: auto; }
  .nav-link { padding: 15px 24px; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 15px; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .stat-cards { grid-template-columns: 1fr; }
  .game-header { padding: 14px 18px; gap: 10px; }
  .game-duration { margin-left: 0; width: 100%; }
  .review-card, .stat-card, .player-col { padding: 18px; }
  .hero-badges { gap: 8px; }
  .badge { font-size: 12px; padding: 6px 12px; }
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
  /* Mobile table horizontal scroll — never compress */
  .data-table { min-width: 600px; white-space: nowrap; }
  .data-table td { white-space: normal; }
}

/* ============ Print (compact adult version) ============ */
@page { margin: 9mm 10mm; }
@media print {
  body { background: #fff !important; color: #111 !important; font-size: 9.5pt; line-height: 1.45; }
  .navbar, .nav-actions, .back-to-top, .hero-scroll-hint, .btn-print { display: none !important; }
  #hero { min-height: 0 !important; padding: 12px 0 !important; }
  .hero-bg { display: none !important; }
  .hero-title, .section-title, .subsection-title, .game-number { color: #111 !important; }
  .hero-tag, .badge, .comment-meta, .diagram-caption, .footer-meta { color: #444 !important; }
  section { padding: 14px 0 !important; }
  .section-dark, .game-summary, .review-card, .stat-card, .player-col,
  .detail-item, .comment-card, .data-table th, .data-table td,
  .game-header, .diagram-img {
    background: #fff !important; color: #111 !important;
    border-color: #bbb !important;
  }
  .review-grid, .stat-cards, .player-eval-grid, .diagram-pair {
    grid-template-columns: 1fr 1fr !important; gap: 8px !important;
  }
  .review-card, .stat-card, .player-col, .comment-card {
    box-shadow: none !important; border-radius: 4px !important; padding: 10px !important;
    break-inside: avoid;
  }
  .diagram-img { max-height: 200px; width: 100%; object-fit: contain; break-inside: avoid; }
  .fade-in { opacity: 1 !important; transform: none !important; animation: none !important; }
  .stat-num, .review-link, .gold, .section-title::before { color: #9F1239 !important; }
  .section-title::before { background: #9F1239 !important; }
  a { color: #111 !important; text-decoration: underline; }
  .sources-table-wrap { overflow: visible !important; }
  .data-table { font-size: 8.5pt; min-width: 0; white-space: normal; }
  .data-table th, .data-table td { padding: 5px 7px !important; }
  h2 { break-after: avoid; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .fade-in { opacity: 1; transform: none; }
}
