/* ============================================================
   睡愈力 — 站点公共壳样式（从 index.html 内联样式抽取）
   月夜暖金色系 · 气质：沉静 · 温暖 · 人文 · 月光
   范围：design tokens / reset / 噪点 / 背景光晕 / 导航 / 移动菜单 / 按钮 / 页脚
   注：index.html 仍保留其内联副本，本文件供子页面使用
   ============================================================ */

:root {
  --bg-deep:    #0b0d13;
  --bg-base:    #111318;
  --bg-surface: #181b23;
  --bg-elevated:#1e212b;
  --bg-card:    #1a1d26;

  --gold:       #c4a265;
  --gold-hover: #d4b87a;
  --gold-dim:   #8a7040;
  --gold-pale:  #e8d5b0;
  --gold-glow:  rgba(196,162,101,0.18);

  --text:       #e6e3db;
  --text-muted: #96938b;
  --text-dim:   #5c5a53;

  --border:     #252830;
  --border-light:#2e313b;

  --font-display: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "KaiTi", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 68px;
}

/* ---- 全局按钮呼吸感 ---- */
.btn { letter-spacing: 0.04em; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(196,162,101,0.35); color: #fff; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* 极淡噪点纹理 — 打破暗底的数字感 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }

/* ---- 背景光晕 ---- */
.bg-ambiance { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-ambiance::before {
  content: ''; position: absolute; border-radius: 50%; filter: blur(140px);
  width: 660px; height: 660px;
  background: var(--gold);
  top: -300px; right: -180px;
  opacity: 0.06;
  animation: ambientDrift 10s ease-in-out infinite alternate;
}
.bg-ambiance::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(160px);
  width: 480px; height: 480px;
  background: #5a6a7a;
  bottom: 10%; left: -200px;
  opacity: 0.04;
  animation: ambientDrift 12s ease-in-out infinite alternate-reverse;
}
@keyframes ambientDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 24px) scale(1.06); }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(11,13,19,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}
.nav--on,
.nav.topbar--on {
  background: rgba(11,13,19,0.82);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 6px 24px rgba(0,0,0,0.35);
}
.nav__inner {
  width: min(1160px, 100% - 48px); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--gold-pale);
  transition: opacity 0.2s;
}
.nav__brand:hover { opacity: 0.8; }
.nav__logo-img { height: 34px; width: auto; display: block; }
.nav__links { display: flex; gap: 2px; align-items: center; }
.nav__links a {
  padding: 8px 16px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s, background 0.2s; white-space: nowrap;
}
.nav__links a:hover,
.nav__links a.on { color: var(--text); background: rgba(255,255,255,0.04); }
.nav__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; position: relative; }

/* 头像 + 悬浮下拉 */
.nav__user { position: relative; display: flex; align-items: center; }
.nav__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: #1a1814;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background 0.2s; flex-shrink: 0;
}
.nav__avatar:hover { background: var(--gold-hover); }
.nav__drop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 170px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  overflow: hidden; z-index: 20;
}
.nav__drop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__drop-user {
  padding: 12px 18px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.nav__drop a, .nav__drop button {
  display: block; width: 100%; padding: 11px 18px; font-size: 13px;
  text-align: left; color: var(--text-muted); transition: background 0.15s, color 0.15s;
}
.nav__drop a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav__drop button:hover { background: rgba(255,255,255,0.04); color: var(--t-error, #f87171); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.nav__toggle.open span:nth-child(1),
.nav__toggle.burger--x span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2),
.nav__toggle.burger--x span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3),
.nav__toggle.burger--x span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Body scroll lock */
body.locked { overflow: hidden; }

/* ---- 移动菜单 ---- */
.mob-menu {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(11,13,19,0.97);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.mob-menu.on,
.mob-menu.mob-panel--show { opacity: 1; visibility: visible; }
.mob-menu__inner { width: 100%; max-width: 340px; padding: 32px 24px; text-align: center; }
.mob-menu__links { display: flex; flex-direction: column; gap: 2px; margin-bottom: 32px; }
.mob-menu__links a {
  display: block; padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 17px; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.mob-menu__links a:hover,
.mob-menu__links a.on { color: #fff; background: rgba(255,255,255,0.04); }
.mob-menu__actions { display: flex; flex-direction: column; gap: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; padding: 10px 22px;
  border-radius: var(--radius-full); white-space: nowrap;
  letter-spacing: 0.02em; transition: all 0.3s var(--ease);
}
.btn--gold {
  background: linear-gradient(135deg, var(--gold) 0%, #b8924e 100%);
  color: #1a1814; font-weight: 700;
  box-shadow: 0 4px 16px var(--gold-glow);
}
.btn--gold:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--gold-glow); }
.btn--outline {
  border: 1px solid var(--border-light); color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}
.btn--outline:hover { border-color: var(--gold-dim); color: var(--text); background: rgba(196,162,101,0.05); }
.btn--sm { padding: 7px 16px; font-size: 13px; }
.btn--lg { padding: 13px 28px; font-size: 15px; }
.btn--block { display: flex; justify-content: center; width: 100%; }
.btn__arrow { transition: transform 0.2s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 52px 0 24px; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.footer__inner {
  width: min(1120px, 100% - 48px); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px;
}
.footer__brand { font-family: var(--font-display); font-size: 17px; color: var(--text-muted); letter-spacing: 0.06em; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.footer__brand-logo { height: 26px; width: auto; }
.footer__brand-desc { font-size: 13px; line-height: 1.8; color: var(--text-dim); }
.footer__col-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer__col ul { display: flex; flex-direction: column; gap: 8px; }
.footer__col a { font-size: 13px; color: var(--text-dim); transition: color 0.2s; }
.footer__col a:hover { color: var(--text); }
.footer__bottom {
  width: min(1120px, 100% - 48px); margin: 0 auto;
  padding-top: 24px; margin-top: 32px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ============================================================
   RESPONSIVE（仅导航 / 移动菜单 / 页脚相关）
   ============================================================ */
@media (max-width: 1024px) {
  .nav__links, .nav__actions .btn { display: none; }
  .nav__user { display: none !important; }
  .nav__toggle { display: flex; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .nav { height: var(--nav-h); }
  .nav__inner { gap: 16px; }
  .nav__brand { font-size: 18px; }
  .nav__logo-img { height: 28px; }

  .footer { padding: 40px 0 20px; }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .footer__brand { font-size: 15px; }
  .footer__col ul { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
  .footer__col a { font-size: 12px; }
  .footer__bottom { flex-direction: column; text-align: center; gap: 4px; font-size: 11px; }

  .mob-menu__links a { font-size: 16px; padding: 12px 16px; }
  .mob-menu__actions .btn--outline {
    color: var(--text); background: rgba(255,255,255,0.06); border-color: var(--border-light);
  }
  .mob-menu__actions .btn--gold {
    display: flex; justify-content: center;
  }
}
