/* ============================================
   星枢纪 (Astral Chronicle) — 主样式系统
   设计风格：Apple 留白 × LV 高级感 × Riot Universe 叙事
   ============================================ */

/* ——— CSS Variables ——— */
:root {
  /* 主色 */
  --color-cosmic-black: #0B1018;
  --color-sacred-gold: #C8A96A;
  --color-starlight-white: #F5F3EF;
  --color-deep-blue: #1A2940;
  --color-text-gray: #8A919B;

  /* 四象辅助色 */
  --color-azure-dragon: #3E7E8C;
  --color-white-tiger: #D8D8D2;
  --color-vermillion-bird: #B94C42;
  --color-black-tortoise: #55656E;

  /* 归墟色系 — 五浊墟庭 */
  --color-void-black: #0B0B10;
  --color-void-brown: #1C1418;
  --color-void-purple: #2A1F2E;
  --color-void-rot: #3B2C2F;
  --color-void-withered: #2B3A33;
  --color-void-light: #6D4B7E;
  --color-void-text: #9A8B9E;

  /* 字体 */
  --font-heading-cn: 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', serif;
  --font-body-cn: 'Source Han Sans SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-heading-en: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-body-en: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* 字号 */
  --fs-h1: 72px;
  --fs-h2: 48px;
  --fs-h3: 32px;
  --fs-body: 18px;
  --fs-small: 14px;

  /* 行高 */
  --lh-heading: 1.2;
  --lh-body: 1.7;

  /* 间距 */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 32px;
  --spacing-lg: 64px;
  --spacing-xl: 120px;

  /* 页面宽度 */
  --content-max: 1440px;
  --page-max: 1600px;
  --side-padding: 120px;

  /* 圆角 */
  --radius-button: 12px;
  --radius-card: 18px;
  --radius-image: 18px;

  /* 阴影 */
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.4);

  /* 动画 */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  --duration-fade: 0.6s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-cosmic-black);
  color: var(--color-starlight-white);
  font-family: var(--font-body-cn);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
}

/* ——— Typography ——— */
h1, h2, h3, h4 {
  font-family: var(--font-heading-cn);
  font-weight: 700;
  line-height: var(--lh-heading);
  color: var(--color-starlight-white);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.en-title {
  font-family: var(--font-heading-en);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sacred-gold);
}

.en-body {
  font-family: var(--font-body-en);
}

.caption {
  font-size: var(--fs-small);
  color: var(--color-text-gray);
}

/* ——— Navigation ——— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 64px;
  background: linear-gradient(to bottom, rgba(11, 16, 24, 0.95), rgba(11, 16, 24, 0));
  transition: background var(--duration-fade) var(--ease-out);
}

.nav.scrolled {
  background: rgba(11, 16, 24, 0.95);
  backdrop-filter: blur(20px);
}

.nav-logo {
  font-family: var(--font-heading-cn);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-starlight-white);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.nav-logo .en {
  font-family: var(--font-heading-en);
  font-size: 12px;
  display: block;
  color: var(--color-sacred-gold);
  letter-spacing: 0.12em;
}

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

.nav-links a {
  color: var(--color-starlight-white);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.04em;
  transition: color 0.3s var(--ease-out);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-sacred-gold);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-sacred-gold);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--color-starlight-white);
  transition: all 0.3s var(--ease-out);
}

/* ——— Hero Sections ——— */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg .overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(11, 16, 24, 0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 0 var(--spacing-md);
}

.hero-content h1 {
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.06em;
}

.hero-content .subtitle {
  font-size: 20px;
  color: var(--color-text-gray);
  margin-bottom: var(--spacing-lg);
  line-height: var(--lh-body);
}

/* ——— Buttons ——— */
.btn {
  display: inline-block;
  padding: 16px 48px;
  border-radius: var(--radius-button);
  font-family: var(--font-body-cn);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  border: none;
}

.btn-primary {
  background: var(--color-sacred-gold);
  color: var(--color-cosmic-black);
}

.btn-primary:hover {
  background: #D4B87A;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-starlight-white);
  border: 1px solid rgba(245, 243, 239, 0.3);
}

.btn-secondary:hover {
  border-color: var(--color-sacred-gold);
  color: var(--color-sacred-gold);
}

/* ——— Sections ——— */
.section {
  padding: var(--spacing-xl) var(--side-padding);
  max-width: var(--page-max);
  margin: 0 auto;
}

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

.section-dark {
  background: var(--color-cosmic-black);
}

.section-blue {
  background: var(--color-deep-blue);
}

/* ——— 归墟专属 Section ——— */
.section-void {
  background: var(--color-void-black);
}

.section-void-brown {
  background: var(--color-void-brown);
}

.section-void-purple {
  background: var(--color-void-purple);
}

/* 浊光 — 脏的、扩散的、侵蚀边缘的光 */
.glow-void {
  box-shadow: 0 0 40px rgba(109, 75, 126, 0.15),
              0 0 80px rgba(109, 75, 126, 0.06),
              inset 0 0 20px rgba(27, 20, 24, 0.3);
}

/* 归墟卡片 */
.card-void {
  background: rgba(42, 31, 46, 0.4);
  border: 1px solid rgba(109, 75, 126, 0.15);
  border-radius: var(--radius-card);
  backdrop-filter: blur(8px);
  transition: all 0.3s var(--ease-out);
}

.card-void:hover {
  border-color: rgba(109, 75, 126, 0.3);
  box-shadow: 0 0 30px rgba(109, 75, 126, 0.1);
}

/* 腐蚀边框效果 */
.border-erode {
  border: 1px solid;
  border-image: linear-gradient(
    135deg,
    rgba(109, 75, 126, 0.3),
    rgba(59, 44, 47, 0.2),
    rgba(42, 31, 46, 0.1)
  ) 1;
}

/* 归墟标题色 */
.title-void {
  color: var(--color-void-light);
}

.text-void {
  color: var(--color-void-text);
}

/* 五浊轮盘 */
.wheel-void {
  position: relative;
  width: 360px;
  height: 360px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(109, 75, 126, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-void::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(109, 75, 126, 0.08);
  animation: voidPulse 4s ease-in-out infinite;
}

@keyframes voidPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}

.wheel-center {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11,11,16,0.9), rgba(42,31,46,0.8));
  border: 1px solid rgba(109,75,126,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-void-light);
  font-family: var(--font-heading-cn);
  font-size: 16px;
  z-index: 1;
}

/* 归墟按钮 */
.btn-void {
  display: inline-block;
  padding: 16px 48px;
  border-radius: var(--radius-button);
  font-family: var(--font-body-cn);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  border: 1px solid rgba(109, 75, 126, 0.4);
  background: rgba(42, 31, 46, 0.3);
  color: var(--color-void-light);
}

.btn-void:hover {
  background: rgba(109, 75, 126, 0.15);
  border-color: rgba(109, 75, 126, 0.6);
  box-shadow: 0 0 30px rgba(109, 75, 126, 0.15);
}

/* 归墟 section divider */
.section-divider-void {
  text-align: center;
  padding: var(--spacing-lg) 0;
  font-family: var(--font-heading-cn);
  font-size: 18px;
  color: var(--color-void-text);
  letter-spacing: 0.08em;
}

.section-divider-void::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-void-light), transparent);
  margin: var(--spacing-sm) auto 0;
  opacity: 0.4;
}

.section-label {
  font-family: var(--font-heading-en);
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--color-sacred-gold);
  text-transform: uppercase;
  margin-bottom: var(--spacing-sm);
}

/* ——— 角色图裁切（隐去AI水印） ——— */
.img-crop {
  object-fit: cover;
  object-position: center top;
  transform: scale(1.05);
  overflow: hidden;
}

.img-crop-wrapper {
  overflow: hidden;
  border-radius: var(--radius-image);
}

/* ——— 首页双世界入口 ——— */
.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 64px;
  min-height: 70vh;
  align-items: center;
}

.home-card {
  position: relative;
  border-radius: var(--radius-card);
  padding: 64px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.6s var(--ease-out);
  text-decoration: none;
  overflow: hidden;
  min-height: 480px;
  justify-content: center;
}

/* ——— 四象卡 ——— */
.home-card-order {
  background: radial-gradient(ellipse at center, rgba(26,41,64,0.6) 0%, rgba(11,16,24,0.95) 100%);
  border: 1px solid rgba(200,169,106,0.2);
}

.home-card-order::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(200,169,106,0.06) 0%, transparent 70%);
  opacity: 0.5;
  transition: opacity 0.6s var(--ease-out);
}

.home-card-order:hover {
  border-color: rgba(200,169,106,0.5);
  box-shadow: 0 0 80px rgba(200,169,106,0.1), 0 0 40px rgba(200,169,106,0.05);
  transform: translateY(-4px);
}

.home-card-order:hover::before {
  opacity: 1;
}

.home-card-order .home-card-icon {
  font-size: 48px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 12px rgba(200,169,106,0.3));
  transition: filter 0.6s var(--ease-out);
}

.home-card-order:hover .home-card-icon {
  filter: drop-shadow(0 0 24px rgba(200,169,106,0.6));
}

/* ——— 归墟卡 ——— */
.home-card-void {
  background: radial-gradient(ellipse at 60% 40%, rgba(42,31,46,0.5) 0%, rgba(11,11,16,0.98) 100%);
  border: 1px solid rgba(109,75,126,0.2);
}

.home-card-void::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at 60% 40%, rgba(109,75,126,0.08) 0%, transparent 70%);
  opacity: 0.3;
  transition: all 0.8s ease;
  animation: voidFog 3s ease-in-out infinite;
}

@keyframes voidFog {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.03); }
}

.home-card-void:hover {
  border-color: rgba(109,75,126,0.5);
  box-shadow: 0 0 100px rgba(109,75,126,0.12), 0 0 50px rgba(109,75,126,0.06), inset 0 0 60px rgba(42,31,46,0.2);
  transform: translateY(-4px);
}

.home-card-void:hover::before {
  opacity: 0.6;
  animation: voidFogIntense 1.5s ease-in-out infinite;
}

@keyframes voidFogIntense {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.home-card-void .home-card-icon {
  font-size: 48px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 12px rgba(109,75,126,0.3));
  transition: filter 0.6s var(--ease-out);
}

.home-card-void:hover .home-card-icon {
  filter: drop-shadow(0 0 28px rgba(109,75,126,0.7));
}

/* 卡片内部元素 */
.home-card-tagline {
  font-family: var(--font-heading-en);
  font-size: 11px;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
}

.home-card-order .home-card-tagline { color: var(--color-sacred-gold); }
.home-card-void .home-card-tagline { color: var(--color-void-light); }

.home-card-title {
  font-family: var(--font-heading-cn);
  font-size: 36px;
  margin-bottom: 8px;
}

.home-card-order .home-card-title { color: var(--color-starlight-white); }
.home-card-void .home-card-title { color: var(--color-void-light); }

.home-card-subtitle {
  font-family: var(--font-heading-en);
  font-size: 18px;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.home-card-order .home-card-subtitle { color: var(--color-sacred-gold); }
.home-card-void .home-card-subtitle { color: rgba(109,75,126,0.8); }

.home-card-symbols {
  display: flex;
  gap: 16px;
  font-size: 24px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-card-order .home-card-symbols { color: var(--color-starlight-white); }
.home-card-void .home-card-symbols { color: var(--color-void-light); }

.home-card-features {
  font-size: 14px;
  line-height: 2;
  margin-bottom: 32px;
}

.home-card-order .home-card-features { color: var(--color-text-gray); }
.home-card-void .home-card-features { color: var(--color-void-text); }

/* ——— 黑雾过渡遮罩 ——— */
.void-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(42,31,46,0.98), rgba(11,11,16,1));
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-out;
}

.void-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* 响应式 */
@media (max-width: 1024px) {
  .home-split {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 24px;
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .home-card {
    min-height: 360px;
    padding: 48px 32px;
  }

  .home-card-title {
    font-size: 28px;
  }
}

.section-heading {
  margin-bottom: var(--spacing-md);
}

.section-heading .en-title {
  display: block;
  font-size: 16px;
  margin-bottom: var(--spacing-xs);
}

/* ——— Grid ——— */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--spacing-md);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); }

/* ——— Cards ——— */
.card {
  background: rgba(26, 41, 64, 0.5);
  border-radius: var(--radius-card);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-deep-blue);
}

.card-body {
  padding: var(--spacing-md);
}

/* ——— Placeholder Images ——— */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-deep-blue), var(--color-cosmic-black));
  color: var(--color-text-gray);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(200, 169, 106, 0.08) 0%, transparent 70%);
}

.img-placeholder .label {
  position: relative;
  z-index: 1;
  padding: 16px;
  border: 1px dashed rgba(138, 145, 155, 0.3);
  border-radius: var(--radius-button);
}

/* ——— Timeline ——— */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--color-sacred-gold), var(--color-deep-blue), var(--color-sacred-gold));
}

.timeline-item {
  position: relative;
  padding-bottom: var(--spacing-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -44px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-sacred-gold);
}

.timeline-item .era-name {
  font-family: var(--font-heading-cn);
  font-size: var(--fs-h3);
  color: var(--color-sacred-gold);
  margin-bottom: var(--spacing-xs);
}

.timeline-item .era-date {
  font-family: var(--font-heading-en);
  font-size: var(--fs-small);
  color: var(--color-text-gray);
  letter-spacing: 0.08em;
}

/* ——— Footer ——— */
.footer {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background: var(--color-cosmic-black);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-quote {
  font-family: var(--font-heading-cn);
  font-size: var(--fs-h3);
  color: var(--color-starlight-white);
  margin-bottom: var(--spacing-sm);
}

.footer-quote-en {
  font-family: var(--font-heading-en);
  font-size: 14px;
  color: var(--color-text-gray);
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-lg);
}

.footer-copy {
  font-size: var(--fs-small);
  color: var(--color-text-gray);
}

/* ——— Divider / Transition ——— */
.section-divider {
  text-align: center;
  padding: var(--spacing-lg) 0;
  font-family: var(--font-heading-cn);
  font-size: 20px;
  color: var(--color-text-gray);
  letter-spacing: 0.08em;
}

.section-divider::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-sacred-gold);
  margin: var(--spacing-sm) auto 0;
  opacity: 0.5;
}

/* ——— Animations ——— */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-fade) var(--ease-out),
              transform var(--duration-fade) var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— Star Map (星宿录) ——— */
.star-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 900px;
  margin: 0 auto;
}

.star-node {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-sacred-gold);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 0 12px rgba(200, 169, 106, 0.4);
}

.star-node:hover {
  transform: scale(2);
  box-shadow: 0 0 24px rgba(200, 169, 106, 0.8);
}

.star-node.dim { opacity: 0.3; }
.star-node.bright { background: #FFF; box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }

/* ——— Responsive ——— */
@media (max-width: 1024px) {
  :root {
    --fs-h1: 48px;
    --fs-h2: 36px;
    --fs-h3: 24px;
    --side-padding: 40px;
  }

  .nav {
    padding: 16px 24px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(11, 16, 24, 0.98);
    gap: 32px;
  }

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

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: var(--spacing-lg) var(--side-padding);
  }
}

@media (max-width: 430px) {
  :root {
    --fs-h1: 36px;
    --fs-h2: 28px;
    --fs-h3: 22px;
    --fs-body: 16px;
    --side-padding: 20px;
    --spacing-xl: 64px;
  }

  .btn {
    padding: 14px 32px;
    font-size: 14px;
  }
}
