/* ============================================
   StarCraft Remastered 中文资料站
   Main Stylesheet
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent-gold: #c9a84c;
  --accent-gold-light: #e8c96a;
  --accent-gold-dark: #a8882a;
  --accent-teal: #4ac9c9;
  --accent-blue: #4a7ac9;
  --accent-purple: #8a4ac9;
  --accent-red: #c94a4a;
  --border-color: #2a2a3e;
  --border-glow: rgba(201, 168, 76, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --font-main: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-gold-light);
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--bg-primary);
  font-weight: 900;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-gold);
  background: rgba(201, 168, 76, 0.1);
}

.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Hide hamburger on desktop where inline nav links are shown */
@media (min-width: 1025px) {
  .nav-toggle {
    display: none;
  }
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  margin-top: 64px;
  padding: 6rem 1.5rem 4rem;
  background: linear-gradient(180deg, #0f0f1a 0%, #0a0a0f 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(74, 201, 201, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border: 1px solid var(--accent-gold-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(201, 168, 76, 0.4);
  color: var(--bg-primary);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-dark);
}

.btn-secondary:hover {
  background: rgba(201, 168, 76, 0.1);
  transform: translateY(-2px);
}

/* ============================================
   Container
   ============================================ */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Section Headers
   ============================================ */

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-dark));
  margin: 1rem auto;
  border-radius: 2px;
}

/* ============================================
   Category Cards (Index)
   ============================================ */

.categories {
  padding: 4rem 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-teal));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.category-card a {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Color variants for category icons */
.icon-replays { background: rgba(74, 201, 201, 0.15); color: var(--accent-teal); }
.icon-tools { background: rgba(74, 122, 201, 0.15); color: var(--accent-blue); }
.icon-maps { background: rgba(138, 74, 201, 0.15); color: var(--accent-purple); }
.icon-matches { background: rgba(201, 168, 76, 0.15); color: var(--accent-gold); }
.icon-groups { background: rgba(74, 201, 74, 0.15); color: #4ac94a; }
.icon-players { background: rgba(201, 74, 74, 0.15); color: var(--accent-red); }

/* ============================================
   Latest Updates Section (Index)
   ============================================ */

.latest-updates {
  padding: 4rem 0;
  background: var(--bg-secondary);
}

.update-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
}

.update-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.update-item:hover {
  border-color: var(--accent-gold-dark);
}

.update-tag {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.tag-replay { background: rgba(74, 201, 201, 0.15); color: var(--accent-teal); }
.tag-tool { background: rgba(74, 122, 201, 0.15); color: var(--accent-blue); }
.tag-map { background: rgba(138, 74, 201, 0.15); color: var(--accent-purple); }
.tag-match { background: rgba(201, 168, 76, 0.15); color: var(--accent-gold); }
.tag-group { background: rgba(74, 201, 74, 0.15); color: #4ac94a; }
.tag-player { background: rgba(201, 74, 74, 0.15); color: var(--accent-red); }

.update-title {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.update-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================
   Stats Bar
   ============================================ */

.stats-bar {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item h3 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ============================================
   Page Header (Sub-pages)
   ============================================ */

.page-header {
  margin-top: 64px;
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(180deg, #0f0f1a 0%, #0a0a0f 100%);
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Content Cards (Sub-pages)
   ============================================ */

.content-section {
  padding: 3rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.content-card:hover {
  border-color: var(--accent-gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.content-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.content-card .meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.content-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

.content-card .card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-link {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.card-link:hover {
  color: var(--accent-gold-light);
}

/* ============================================
   Player Cards
   ============================================ */

.player-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.player-info h3 {
  margin-bottom: 0.25rem;
}

.player-title {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.player-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Group Cards
   ============================================ */

.group-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.group-qr {
  width: 120px;
  height: 120px;
  background: var(--bg-primary);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-size: 1rem;
  color: var(--accent-gold);
  font-weight: 700;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

/* ============================================
   Responsive
   ============================================ */

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

/* Mobile nav breakpoint expanded to cover landscape phones & tablets */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 0.75rem 1rem;
  }

}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-item h3 {
    font-size: 1.5rem;
  }
}

/* ============================================
   Homepage Two-Column Layout
   ============================================ */

.home-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.home-sidebar {
  position: sticky;
  top: 80px;
}

/* Sidebar categories card */
.sidebar-categories {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.sidebar-categories .categories-grid {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.sidebar-categories .category-card {
  padding: 1rem;
  text-align: center;
}

.sidebar-categories .category-card p {
  display: none;
}

.sidebar-categories .category-icon {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-categories .category-card h3 {
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* Yuezhan preview card */
.yuezhan-card-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.yuezhan-card-preview:hover {
  border-color: var(--accent-gold-dark);
}

.yuezhan-card-preview + .yuezhan-card-preview {
  margin-top: 0.75rem;
}

.yuezhan-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.yuezhan-preview-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.yuezhan-preview-teams {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.yuezhan-preview-team {
  flex: 1;
  padding: 0.5rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.8rem;
}

.yuezhan-preview-team-a {
  background: rgba(74, 122, 201, 0.15);
  color: var(--accent-blue);
}

.yuezhan-preview-team-b {
  background: rgba(201, 74, 74, 0.15);
  color: var(--accent-red);
}

.yuezhan-preview-vs {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.yuezhan-preview-footer {
  margin-top: 0.75rem;
  text-align: right;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .home-sidebar {
    position: static;
  }

  .sidebar-categories .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
