/* ========================================
   疯人月 · Lunatic Luna 官网样式
   东方幻想风 · 深色主题
   ======================================== */

/* ---- CSS Variables ---- */
:root {
  --bg-deep: #0a0a14;
  --bg-card: rgba(20, 18, 40, 0.85);
  --bg-nav: rgba(10, 10, 20, 0.92);
  --text-primary: #e8e0f0;
  --text-secondary: #b0a0c8;
  --text-muted: #706890;
  --accent: #c8a0ff;
  --accent-glow: #a060ff;
  --accent-gold: #e8c858;
  --moon-pale: #f0e8d0;
  --border: rgba(160, 120, 220, 0.2);
  --radius: 12px;
  --radius-sm: 6px;
  --shadow-glow: 0 0 30px rgba(160, 96, 255, 0.15);
  --font-heading: 'Georgia', 'Noto Serif SC', 'SimSun', serif;
  --font-body: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --max-width: 1100px;
  --nav-height: 64px;
}

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

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

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

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

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

/* ---- Starfield BG ---- */
.starfield {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(60, 20, 100, 0.15) 0%, transparent 70%);
}

/* ---- Navbar ---- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary) !important;
  text-decoration: none;
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 6px rgba(200, 160, 255, 0.5));
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(160, 96, 255, 0.1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 80px) 24px 100px;
  display: flex;
  align-items: center;
  gap: 60px;
  min-height: 80vh;
}

.hero-content {
  flex: 1;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 24px;
  background: rgba(160, 96, 255, 0.08);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.3;
  margin-bottom: 20px;
}

.title-line { display: block; }
.title-line.accent {
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(232, 200, 88, 0.3);
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  color: #fff;
  box-shadow: 0 4px 20px rgba(160, 96, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(160, 96, 255, 0.45);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(160, 96, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero Visual */
.hero-visual {
  flex: 0 0 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.moon-orbit {
  position: relative;
  width: 240px;
  height: 240px;
}

.moon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f8f0d8, #c8b878, #806030);
  box-shadow:
    0 0 40px rgba(240, 220, 150, 0.3),
    0 0 80px rgba(200, 160, 80, 0.15),
    inset 0 0 20px rgba(255, 240, 200, 0.5);
  animation: moon-pulse 4s ease-in-out infinite;
}

.orbit-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(200, 160, 255, 0.15);
  animation: orbit-spin 20s linear infinite;
}

.orbit-ring::after {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

@keyframes moon-pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(240, 220, 150, 0.3), 0 0 80px rgba(200, 160, 80, 0.15); }
  50% { box-shadow: 0 0 60px rgba(240, 220, 150, 0.5), 0 0 120px rgba(200, 160, 80, 0.25); }
}

@keyframes orbit-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---- Sections ---- */
.section {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
}

.section-dark {
  background: rgba(12, 10, 30, 0.5);
  max-width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ---- Games Grid ---- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}

.game-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1040, #201850);
}

.game-card-body {
  padding: 20px;
}

.game-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--accent-gold);
}

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

.game-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.game-card-footer .btn {
  padding: 6px 16px;
  font-size: 0.85rem;
}

/* Placeholder */
.game-card-placeholder {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.game-card-placeholder h3 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.game-card-placeholder p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ---- Stats ---- */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 60px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(232, 200, 88, 0.3);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ---- Page Hero ---- */
.page-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: calc(var(--nav-height) + 60px) 24px 40px;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---- Games List ---- */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ---- About ---- */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.about-card h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.about-card p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.8;
}

.about-card p:last-child { margin-bottom: 0; }

.contact-methods {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.contact-icon { font-size: 1.2rem; }

.contact-icon { font-size: 1.2rem; }

/* ---- Game Detail (games page) ---- */
.game-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.game-detail-header {
  display: flex;
  gap: 32px;
  padding: 32px;
  border-bottom: 1px solid var(--border);
}

.game-detail-cover {
  flex: 0 0 240px;
  height: 320px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a1050, #4a2080);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  border: 1px solid var(--border);
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.game-detail-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-badge {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--accent-gold);
  border-radius: 20px;
  color: var(--accent-gold);
  font-size: 0.8rem;
  width: fit-content;
}

.game-detail-meta h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--accent-gold);
}

.game-tagline {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.05rem;
}

.game-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.game-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.stat-icon { font-size: 1.1rem; }

.game-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tag {
  padding: 4px 12px;
  background: rgba(160, 96, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--accent);
}

.game-detail-body {
  padding: 32px;
}

.game-section {
  margin-bottom: 28px;
}

.game-section:last-child { margin-bottom: 0; }

.game-section h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.game-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.game-section ul, .game-section ol {
  color: var(--text-secondary);
  padding-left: 20px;
  line-height: 1.8;
}

.game-section li { margin-bottom: 4px; }

.game-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Rule Cards ---- */
.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.rule-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--accent-gold);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

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

.rule-section:last-child { margin-bottom: 0; }

.rule-section h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.rule-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.rule-section ul, .rule-section ol {
  color: var(--text-secondary);
  padding-left: 24px;
  line-height: 1.8;
}

.rule-section li { margin-bottom: 6px; }

.rule-section ul ul, .rule-section ol ul {
  margin-top: 6px;
  margin-bottom: 6px;
}

.rule-table {
  width: 100%;
  max-width: 400px;
  border-collapse: collapse;
  margin: 12px 0;
  color: var(--text-secondary);
}

.rule-table th, .rule-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  text-align: center;
}

.rule-table th {
  background: rgba(160, 96, 255, 0.08);
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 768px) {
  .game-detail-header {
    flex-direction: column;
    padding: 20px;
  }
  .game-detail-cover {
    flex: none;
    width: 100%;
    height: 240px;
  }
  .game-detail-body { padding: 20px; }
  .rule-card { padding: 20px; }
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 12px;
}

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

.footer-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
  font-style: italic;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 40px;
    min-height: auto;
    padding-top: calc(var(--nav-height) + 40px);
  }

  .hero-desc { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-visual { flex: none; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-nav);
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }

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

  .stats-row {
    flex-direction: column;
    gap: 24px;
  }

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

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .section { padding: 48px 16px; }
  .section-title { font-size: 1.5rem; }
}
