/* ============================================================
   苟活 · 背景
   深夜台灯下的账本：墨色底 + 暖光光束 + 冷色补光 + 纸面颗粒
   ============================================================ */

:root {
  --ink-900: #04060a;
  --ink-800: #070a10;
  --ink-700: #0b1017;
  --amber: #ffc46b;
  --sky: #8fc2ff;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--ink-900);
  color: #e8edf5;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- 背景容器 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--ink-900);
  isolation: isolate;
}

.bg > * {
  position: absolute;
  inset: 0;
}

/* 底色：右上角微亮，向外沉入墨色 */
.bg__base {
  background:
    radial-gradient(
      120% 110% at 82% -10%,
      #151c26 0%,
      #0b1018 42%,
      #05070b 78%,
      #04050a 100%
    );
}

/* 光束画布 */
.bg__rays {
  opacity: 1;
}

/* 账本网格：只在光束附近若隐若现，像纸上的格线 */
.bg__grid {
  background-image:
    linear-gradient(to right, rgba(143, 194, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(143, 194, 255, 0.06) 1px, transparent 1px);
  background-size: 76px 76px;
  background-position: 50% 0;
  -webkit-mask-image: radial-gradient(
    130% 100% at 76% 0%,
    #000 0%,
    rgba(0, 0, 0, 0.45) 38%,
    transparent 70%
  );
  mask-image: radial-gradient(
    130% 100% at 76% 0%,
    #000 0%,
    rgba(0, 0, 0, 0.45) 38%,
    transparent 70%
  );
  opacity: 0.55;
}

/* 光源晕染，让光束的起点有实体感 */
.bg__bloom {
  background:
    radial-gradient(
      46% 38% at 84% 2%,
      rgba(255, 196, 107, 0.22),
      transparent 68%
    ),
    radial-gradient(
      38% 32% at 96% 26%,
      rgba(143, 194, 255, 0.14),
      transparent 70%
    );
  mix-blend-mode: screen;
  filter: blur(10px);
}

/* 底部压暗，给内容留出呼吸 */
.bg__scrim {
  background: linear-gradient(
    to top,
    #04060a 0%,
    rgba(4, 6, 10, 0.62) 14%,
    rgba(4, 6, 10, 0) 44%
  );
}

/* 四角压暗 */
.bg__vignette {
  background:
    radial-gradient(
      125% 105% at 50% 42%,
      transparent 42%,
      rgba(0, 0, 0, 0.42) 78%,
      rgba(0, 0, 0, 0.66) 100%
    );
}

/* 胶片颗粒 */
.bg__grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.13;
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: no-preference) {
  .bg__grain {
    animation: grain-shift 6s steps(5) infinite;
  }
}

@keyframes grain-shift {
  0% {
    background-position: 0 0;
  }
  20% {
    background-position: -12px 6px;
  }
  40% {
    background-position: 8px -10px;
  }
  60% {
    background-position: -6px -14px;
  }
  80% {
    background-position: 14px 8px;
  }
  100% {
    background-position: 0 0;
  }
}

/* ---------- 页面内容层 ---------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (max-width: 720px) {
  .bg__grid {
    background-size: 56px 56px;
    opacity: 0.4;
  }

  .bg__rays {
    opacity: 0.88;
  }

  .bg__bloom {
    opacity: 0.82;
  }
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(64px, 10vh, 120px) 24px;
  text-align: center;
}

/* 内容背后压一层柔光，让文字从光束里浮出来 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    46% 46% at 50% 48%,
    rgba(4, 6, 10, 0.62) 0%,
    rgba(4, 6, 10, 0.26) 52%,
    transparent 74%
  );
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero__logo {
  display: block;
  width: clamp(88px, 12vw, 112px);
  height: clamp(88px, 12vw, 112px);
  border-radius: 26px;
  box-shadow:
    0 24px 60px rgba(11, 92, 255, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 2px 0 rgba(255, 255, 255, 0.22) inset;
}

.hero__title {
  margin: 22px 0 0;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  color: #f4f7fc;
  text-shadow: 0 2px 30px rgba(4, 6, 10, 0.6);
}

.hero__desc {
  margin: 16px 0 0;
  max-width: 24em;
  font-size: clamp(15px, 2.2vw, 17px);
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: rgba(232, 237, 245, 0.62);
}

.hero__download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 15px 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a72ff 0%, #0b5cff 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  outline-offset: 6px;
  outline-color: rgba(143, 194, 255, 0.65);
  box-shadow:
    0 12px 32px rgba(11, 92, 255, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    filter 0.3s ease;
}

.hero__download:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 18px 44px rgba(11, 92, 255, 0.46),
    0 1px 0 rgba(255, 255, 255, 0.32) inset;
}

.hero__download:active {
  transform: translateY(0) scale(0.99);
}

.hero__download-icon {
  flex: none;
  opacity: 0.92;
}

/* 入场：从下往上轻轻浮起 */
@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .hero__title {
    animation-delay: 0.08s;
  }

  .hero__desc {
    animation-delay: 0.16s;
  }

  .hero__download {
    animation-delay: 0.24s;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- SideRays 画布 ---------- */

.side-rays {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.side-rays__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
