/* ============================================================
   Celestial Archive — "墨韵敦煌" Global Design System
   融合水墨画的留白呼吸感与敦煌壁画的暖调叙事感
   ============================================================ */

/* 字体加载 */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Serif+SC:wght@400;600;700&family=Ma+Shan+Zheng&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
  /* 主色系 */
  --bg-primary: #f5f0e8;
  --bg-card: #faf7f2;
  --bg-dark: #2d2418;

  /* 文字色系 */
  --text-primary: #2c2416;
  --text-secondary: #6b5e4e;
  --text-on-dark: #e8dcc8;

  /* 点缀强调色 */
  --accent-vermillion: #c44d34;
  --accent-gold: #b8a06e;
  --accent-stone: #3d7a8c;

  /* 字体栈 */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-chinese: 'Noto Serif SC', 'SimSun', 'STSong', serif;
  --font-chinese-display: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;

  /* 间距体系 */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 80px;
  --space-xxl: 120px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* 阴影 */
  --shadow-card: 0 2px 12px rgba(44,36,22,0.06);
  --shadow-card-hover: 0 8px 30px rgba(44,36,22,0.12);
  --shadow-glow: 0 0 20px rgba(184,160,110,0.3);

  /* 图片滤镜 —— 壁画做旧效果 */
  --filter-mural: sepia(0.25) saturate(0.9) contrast(1.08) brightness(0.92);
}

/* ============================================================
   基础重置
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  /* 微妙的纸纹理叠加 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.3;
}

/* 无障碍：仅屏幕阅读器可见 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--accent-stone);
  text-decoration: none;
  transition: color 0.3s;
}
a:hover {
  color: var(--accent-vermillion);
}

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

/* 壁画滤镜 —— 给 hero 图片施加敦煌古画质感 */
img.mural-filter,
.mural-filter img {
  filter: var(--filter-mural);
}

/* ============================================================
   布局工具类
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0;
}

/* ============================================================
   通用祥云纹理
   ============================================================ */
.bg-cloud-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath d='M50 140c-10 0-18-8-18-18s8-18 18-18c2-15 14-26 28-26 12 0 22 7 26 18 3-1 6-1 9-1 16 0 29 12 29 28 0 11-6 20-15 25' fill='white' fill-opacity='0.03'/%3E%3C/svg%3E");
}

/* 更淡的云纹变体，用于卡片装饰 */
.bg-cloud-pattern-light {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath d='M50 140c-10 0-18-8-18-18s8-18 18-18c2-15 14-26 28-26 12 0 22 7 26 18 3-1 6-1 9-1 16 0 29 12 29 28 0 11-6 20-15 25' fill='white' fill-opacity='0.04'/%3E%3C/svg%3E");
}

/* ============================================================
   文本装饰
   ============================================================ */

/* 金色佛光 —— 用于神祇名号 */
.text-glow {
  text-shadow: 0 0 12px rgba(184,160,110,0.4), 0 0 30px rgba(184,160,110,0.15);
}

/* 中文展示字体 */
.text-chinese {
  font-family: var(--font-chinese-display);
}

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

/* ============================================================
   共享区块标题
   ============================================================ */
.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}
.title-ornament {
  display: inline-block;
  width: 40px;
  height: 2px;
  background: var(--accent-gold);
}

/* ============================================================
   共享 CTA 按钮
   ============================================================ */
.cta-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.cta-link:hover {
  background: var(--accent-gold);
  color: #111;
  box-shadow: var(--shadow-glow);
}

/* ============================================================
   共享导航栏
   ============================================================ */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-lg);
  background: linear-gradient(180deg, rgba(45,36,24,0.95), rgba(45,36,24,0.7) 80%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-back {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent-gold);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s;
}
.nav-back:hover {
  color: #fff;
}
.nav-back-arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--accent-gold);
  border-bottom: 2px solid var(--accent-gold);
  transform: rotate(45deg);
}

/* ============================================================
   共享子页面 Hero 基础
   ============================================================ */
.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-dark);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  opacity: 0.35;
  filter: var(--filter-mural);
}
.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-dark) 0%, transparent 60%);
}
.page-hero-text {
  position: relative;
  z-index: 2;
  padding: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.page-hero-kicker {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #dac98a;
  margin-bottom: var(--space-xs);
}
.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: #fff;
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 30px rgba(184,160,110,0.2);
}
.page-hero-sub {
  font-size: 1.15rem;
  color: var(--text-on-dark);
  font-style: italic;
  max-width: 520px;
}

/* ============================================================
   共享页脚
   ============================================================ */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: var(--space-xl) 0 var(--space-md);
  border-top: 1px solid rgba(232,220,200,0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
}
.footer-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 320px;
}
.footer-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.footer-nav a {
  color: var(--text-on-dark);
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.footer-nav a:hover {
  opacity: 1;
  color: var(--accent-gold);
}
.social-icons {
  display: flex;
  gap: var(--space-sm);
}
.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(232,220,200,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
}
.social-icon:hover {
  background: var(--accent-gold);
  box-shadow: var(--shadow-glow);
}
.footer-copy {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.5;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(232,220,200,0.08);
}

/* ============================================================
   滚动淡入动画
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   响应式 —— 移动端 < 768px
   ============================================================ */
@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-desc {
    max-width: none;
  }
  .footer-nav {
    align-items: center;
  }
  .social-icons {
    justify-content: center;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .nav-bar {
    padding: var(--space-sm) var(--space-md);
  }
  .page-hero-text {
    padding: var(--space-lg) var(--space-md);
  }
}
