*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

button, a, [role="button"], input, select, textarea {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  text-decoration: underline;
}

input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 999999;
  padding: 12px 24px;
  background: var(--glow-warm);
  color: var(--sky-deep);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
/* 始终预留滚动条空间，防止内容偏移 */
@media (min-width: 769px) {
  html { scrollbar-gutter: stable; }
}
/* WebKit 隐藏滚动条外观但保留空间 */
html::-webkit-scrollbar { width: 6px; }
html::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
html::-webkit-scrollbar-track { background: transparent; }

body {
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  /* 备注：2026-06-12 白屏修复。压过误判脚本残留的 body inline display:none，保证本地/内置浏览器始终可见。 */
  display: block !important;
  background: var(--sky-deep);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  transition: background 2s ease;
  -webkit-user-select: none;
  user-select: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='%23f5c87a' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23f5c87a'/%3E%3C/svg%3E") 12 12, crosshair;
}

img, canvas {
  max-width: 100%;
}

.section,
.footer {
  /* 备注：2026-06-12 深度优化。离屏章节交给浏览器延迟布局/绘制，降低长页首屏压力。 */
  content-visibility: auto;
  contain-intrinsic-size: 1px 760px;
}

.hero,
.keepsake-card,
.glass,
.tilt-card {
  transform: translateZ(0);
}

/* 色温转暖 */
body.warm {
  background: #0a0e1c;
}

/* ── 全局星空背景 ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 620px 420px at 18% 14%, rgba(36, 66, 126, 0.34), transparent 58%),
    radial-gradient(ellipse 540px 540px at 82% 82%, rgba(24, 44, 86, 0.28), transparent 62%),
    radial-gradient(circle at 50% 34%, rgba(245,200,122,0.05), transparent 24%),
    linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-mid) 40%, var(--sky-light) 100%);
  z-index: -2;
  transition: background 2s ease;
}
body.warm::before {
  background:
    radial-gradient(ellipse 620px 420px at 18% 14%, rgba(40, 50, 96, 0.42), transparent 58%),
    radial-gradient(ellipse 540px 540px at 82% 82%, rgba(28, 38, 70, 0.36), transparent 62%),
    radial-gradient(circle at 50% 34%, rgba(245,200,122,0.07), transparent 24%),
    linear-gradient(180deg, #090e1c 0%, #101630 40%, #181f3a 100%);
}
/* 全页城市底纹 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('../assets/hero-night.webp') center/cover no-repeat;
  opacity: 0.045;
  z-index: -1;
  pointer-events: none;
  filter: blur(3px);
  transition: opacity 2s ease;
}
body.warm::after { opacity: 0.1; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .fx-canvas,
  .particle-canvas,
  .lamp-glow,
  .spotlight-overlay {
    display: none !important;
  }
}

/* ── 星星粒子 ── */
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: twinkle var(--dur) ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{opacity:0.2} 50%{opacity:0.9} }

/* ═══ 玻璃卡片 ═══ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
  will-change: transform;
}
.glass:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  pointer-events: none;
}

