/* 重置与页面底色：天空、纸面、颗粒。 */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: #eaf6ff;
  background-image:
    radial-gradient(150% 100% at 84% -18%, #fffdf6 0%, rgba(255, 253, 246, 0) 54%),
    radial-gradient(110% 80% at 4% 2%, #eaf6ff 0%, rgba(234, 246, 255, 0) 62%),
    radial-gradient(120% 90% at 50% 118%, #f7ecdf 0%, rgba(247, 236, 223, 0) 64%),
    linear-gradient(176deg, #cfe9f7 0%, #e6f4fd 34%, #fbf8f1 72%, #f4ecdd 100%);
  background-repeat: no-repeat;
  min-height: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--ink, #2e3b4e);
  font-family: var(--font-body, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif);
  font-size: clamp(15px, 0.92rem + 0.14vw, 17px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

::selection {
  background: rgba(243, 184, 192, 0.45);
  color: var(--ink, #2e3b4e);
}

:focus-visible {
  outline: 2px solid #8fb8a0;
  outline-offset: 3px;
  border-radius: 4px;
}

/* 图层：可选配图 → 场景 → 花瓣 → 颗粒 → 内容 → 常驻控件 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--art-url, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out, ease-out);
  pointer-events: none;
}

body.has-art::before {
  opacity: 1;
  background-image:
    linear-gradient(180deg, rgba(251, 248, 241, 0.42), rgba(251, 248, 241, 0.3)),
    var(--art-url, none);
  background-size: cover, cover;
}

body.has-art #scene-mount > * {
  opacity: 0;
  transition: opacity 1.2s var(--ease-out, ease-out);
}

#scene-mount {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

#petal-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.hero,
.stage,
#content,
.site-foot {
  position: relative;
  z-index: 10;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .hero__cue {
    animation: none !important;
    opacity: 0.58 !important;
  }

  .hero__cue i {
    animation: none !important;
    top: auto;
    bottom: 0;
    opacity: 0.7 !important;
  }
}

html.is-instant *,
html.is-instant *::before,
html.is-instant *::after {
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

