/* ============================================================
   御定奇门宝鉴 · 玄机排盘 — 首页（故宫夕阳）
   构图：太和殿式中轴对称、低角度广角、汉白玉台基、琉璃瓦、雾霭
   ============================================================ */
:root {
  --line-gold: #c9a86a;
  --line-gold-soft: rgba(201, 168, 106, 0.34);
  --text-main: #f3e7d2;
  --text-soft: #d8c6a8;
  --cinnabar: #c1493a;
  --cinnabar-deep: #8e2f23;
  --gold: #c9a86a;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  color: var(--text-main);
  font-family: var(--font-serif);
  background:
    radial-gradient(ellipse at 50% 78%, rgba(246, 189, 106, 0.42), transparent 46%),
    radial-gradient(ellipse at 50% 94%, rgba(226, 120, 55, 0.2), transparent 58%),
    linear-gradient(180deg, #0b1120 0%, #1b2036 34%, #3c3344 58%, #8a4f3d 74%, #cf7f3e 86%, #f0a653 96%, #f7c67f 100%);
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 16px;
  background: #141f33;
  border: 1px solid var(--line-gold-soft);
  color: var(--text-main);
}
.skip-link:focus { left: 0; }

/* ---------- 导航 ---------- */
.home-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(11, 17, 28, 0.9), rgba(11, 17, 28, 0.45));
  border-bottom: 1px solid var(--line-gold-soft);
  backdrop-filter: blur(8px);
}
.home-brand { display: flex; align-items: center; gap: 12px; }
.home-brand-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--cinnabar), var(--cinnabar-deep));
  color: #f3e7cf;
  font-size: 13px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(243, 231, 207, 0.55);
}
.home-brand-name { font-size: 16px; letter-spacing: 0.16em; color: var(--text-main); }
.home-nav-links { display: flex; gap: 22px; }
.home-nav-links a {
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 0.14em;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
}
.home-nav-links a:hover { color: #f5ddb0; border-bottom-color: var(--line-gold); }

/* ---------- 场景 ---------- */
.scene {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.layer { position: absolute; will-change: transform; }
.layer svg { display: block; }
.layer-palace {
  left: 50%;
  bottom: -1%;
  width: min(1440px, 102vw);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
}

/* 天顶淡星 */
.star-svg { animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle {
  0%, 100% { opacity: 0.22; }
  50% { opacity: 0.7; }
}

/* 金尘画布 */
#dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

/* ---------- 主标题 ---------- */
.hero {
  position: absolute;
  left: 50%;
  top: 8vh;
  transform: translateX(-50%);
  z-index: 6;
  text-align: center;
  max-width: 720px;
  width: calc(100% - 40px);
  pointer-events: none;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -46px -90px;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 0%, rgba(11, 17, 32, 0.76), rgba(11, 17, 32, 0.34) 52%, transparent 80%);
  pointer-events: none;
}
.hero-seal {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  background: linear-gradient(160deg, var(--cinnabar), var(--cinnabar-deep));
  color: #f3e7cf;
  font-size: 17px;
  letter-spacing: 0.1em;
  border: 1px solid rgba(243, 231, 207, 0.55);
  box-shadow: inset 0 0 0 2px rgba(193, 73, 58, 0.4);
}
.hero-title {
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #fdf3dc;
  text-shadow: 0 2px 16px rgba(62, 26, 10, 0.9);
}
.hero-sub {
  margin: 14px auto 0;
  font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 0.12em;
  color: #f3e2c8;
  text-shadow: 0 1px 8px rgba(62, 26, 10, 0.9);
}
.hero-actions {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  pointer-events: auto;
}
.btn-primary, .btn-ghost {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.28em;
  padding: 12px 30px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.btn-primary {
  background: linear-gradient(180deg, #a63a2c, var(--cinnabar-deep));
  color: #f4ead2;
  border: 1px solid var(--gold);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover { box-shadow: 0 4px 18px rgba(193, 73, 58, 0.45); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(20, 31, 51, 0.72);
  color: #e6d7b8;
  border: 1px solid var(--line-gold-soft);
}
.btn-ghost:hover { color: #f5ddb0; border-color: var(--line-gold); }
.btn-primary:focus-visible, .btn-ghost:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- 页脚 ---------- */
.home-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 10px 16px 12px;
  text-align: center;
  background: linear-gradient(0deg, rgba(120, 60, 25, 0.55), transparent);
  pointer-events: none;
}
.home-footer p {
  margin: 0;
  font-size: 12px;
  color: #f3ddb4;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 6px rgba(62, 26, 10, 0.8);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .home-nav { padding: 0 14px; height: 60px; }
  .home-brand-name { font-size: 14px; }
  .home-nav-links { gap: 14px; }
  .home-nav-links a { font-size: 13px; }
  .hero { top: 7vh; }
  .hero-seal { width: 44px; height: 44px; font-size: 15px; }
  .hero-actions { gap: 12px; }
  .btn-primary, .btn-ghost { padding: 11px 22px; font-size: 14px; }
  .layer-palace { width: 100vw; }
}
@media (max-width: 420px) {
  .hero { top: 6vh; }
  .hero-title { letter-spacing: 0.16em; }
  .hero-sub { letter-spacing: 0.08em; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-primary, .btn-ghost { width: min(240px, 100%); }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  .star-svg { animation: none; opacity: 0.45; }
  #dust { display: none; }
}