*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--on-glass);
  /* 应用渲染前直接用背景图兜底，避免刷新时闪绿色纯色 */
  background: var(--sea-200) url("../../../../media/moyu/index/background-beach.jpg") center / cover no-repeat;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  background: var(--sea-300);
  color: var(--ink-900);
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--coral-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.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;
}

#root {
  min-height: 100vh;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.app-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

.video-background-stack {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* 背景图就绪前先显示兜底渐变，避免刷新时闪纯色 */
  background:
    url("../../../../media/moyu/index/background-beach.jpg") center / cover no-repeat,
    linear-gradient(
      180deg,
      var(--sea-400) 0%,
      var(--sea-300) 34%,
      var(--sea-200) 58%,
      var(--sea-100) 74%,
      var(--paper-warm) 100%
    );
}

.video-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  filter: saturate(1.02) contrast(1.01);
  opacity: 0;
  transition: opacity var(--d-scene) var(--ease-out);
  will-change: opacity;
}

.video-background.is-ready {
  opacity: 1;
}

.video-background-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, oklch(0.27 0.05 190 / 0.3) 0%, transparent 26%, transparent 58%, oklch(0.99 0.008 180 / 0.4) 100%),
    radial-gradient(120% 80% at 50% 0%, oklch(0.27 0.05 190 / 0.22) 0%, transparent 62%);
}

@keyframes tide-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes tide-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tide-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.86;
  }
}

.tide-rise {
  animation: tide-rise var(--d-slow) var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .tide-rise {
    animation: tide-fade var(--d-fast) linear both !important;
  }

  .video-background {
    transition: none !important;
  }
}
