/* ==========================================================================
   雨夜单页 · 样式表
   参考站点视觉：全屏插画 + 视差 + 雾气 + Canvas 雨丝/气泡 + 大时钟 + 终端弹窗
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  background: #0b1018;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* ---------- 页面壳 ---------- */

.rain-page {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background: #0b1018;
  color: rgba(255, 255, 255, 0.9);
}

/* 左侧压暗，让文字从画里浮出来 */
.rain-page::before {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(90deg, #070a10bd, #070a1047 48%, #070a1014);
  pointer-events: none;
  content: "";
}

/* ---------- 背景插画（视差 + 慢镜头呼吸） ---------- */

.bg-layer {
  --depth-x: 0;
  --depth-y: 0;
  position: absolute;
  inset: -3%;
  z-index: 0;
  overflow: hidden;
  filter: saturate(0.94) contrast(0.96);
  perspective: 900px;
  transform-style: preserve-3d;
  transform-origin: 58% 46%;
  animation: slow-frame 18s ease-in-out infinite alternate;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform, filter;
  transform: translate3d(calc(var(--depth-x) * -0.55px), calc(var(--depth-y) * -0.42px), -24px) scale(1.06);
  filter: contrast(1.02);
  transition: transform 0.18s ease-out;
}

/* 霓虹反光 */
.bg-layer::before,
.bg-layer::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.bg-layer::before {
  z-index: 1;
  background:
    linear-gradient(90deg, #080c125c, #080c120a 52%, #080c1224),
    linear-gradient(180deg, #080c120f, #080c1233 70%, #080c1294),
    radial-gradient(circle at 73% 43%, rgba(250, 176, 216, 0.18), transparent 15%),
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 34%);
  mix-blend-mode: screen;
  transform: translate3d(calc(var(--depth-x) * 0.28px), calc(var(--depth-y) * 0.22px), 34px);
  animation: light-breathe 7s ease-in-out infinite;
}

/* 玻璃上的斜向水痕 */
.bg-layer::after {
  z-index: 2;
  background: repeating-linear-gradient(
    105deg,
    transparent 0,
    transparent 64px,
    rgba(255, 255, 255, 0.1) 65px,
    transparent 67px
  );
  opacity: 0.28;
  filter: blur(0.4px);
  animation: glass-slide 10s linear infinite;
}

/* 焦点区域：中间清楚、四角压暗 */
.depth-focus {
  position: absolute;
  inset: -6%;
  z-index: 3;
  background:
    radial-gradient(circle at 62% 42%, transparent 0 26%, rgba(8, 12, 18, 0.2) 54%, rgba(8, 12, 18, 0.5) 100%),
    linear-gradient(90deg, rgba(8, 12, 18, 0.2), transparent 38%, rgba(8, 12, 18, 0.16));
  opacity: 0.72;
  pointer-events: none;
  transform: translate3d(calc(var(--depth-x) * 0.18px), calc(var(--depth-y) * 0.14px), 58px);
}

.depth-focus::before {
  position: absolute;
  inset: 12% 28% 10% 40%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 64%);
  filter: blur(18px);
  content: "";
}

/* ---------- 雾气 ---------- */

.mist {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(223, 239, 247, 0.2), transparent 24%),
    radial-gradient(circle at 72% 76%, rgba(170, 204, 224, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%, rgba(255, 255, 255, 0.05));
  opacity: 0.82;
  animation: mist-drift 14s ease-in-out infinite alternate;
  will-change: transform;
}

/* ---------- 两个 Canvas ---------- */

.rain-canvas,
.bubble-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rain-canvas {
  z-index: 3;
}

.bubble-canvas {
  z-index: 4;
}

/* ---------- 主体文案 ---------- */

.message {
  position: relative;
  z-index: 6;
  display: flex;
  min-height: 100%;
  width: min(760px, calc(100% - 40px));
  flex-direction: column;
  justify-content: center;
  padding-left: clamp(20px, 8vw, 112px);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.58);
}

.eyebrow {
  margin: 0 0 14px;
  color: #d8eff9b3;
  font-size: clamp(0.74rem, 1.8vw, 0.9rem);
  line-height: 1.4;
  text-transform: uppercase;
}

/* 大时钟：等宽字体 + 粉/青错位发光 */
.clock {
  margin: 0;
  color: #f6fcfff5;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: clamp(5.8rem, 21vw, 12rem);
  font-weight: 700;
  line-height: 0.84;
  white-space: nowrap;
  text-shadow:
    0 0 28px rgba(151, 222, 255, 0.26),
    10px 0 0 rgba(255, 105, 186, 0.14),
    -8px 0 0 rgba(118, 209, 255, 0.16),
    0 18px 42px rgba(0, 0, 0, 0.5);
}

.clock-separator {
  display: inline-block;
  min-width: 0.5em;
  text-align: center;
  transition: opacity 0.12s linear;
}

.clock-separator--hidden {
  opacity: 0;
}

.copy {
  margin: 22px 0 0;
  max-width: min(100%, 36rem);
  color: #eef6fad6;
  font-size: clamp(1.05rem, 3vw, 1.38rem);
  line-height: 1.65;
  white-space: nowrap;
}

.actions {
  display: flex;
  min-height: 44px;
  margin-top: clamp(52px, 7vh, 84px);
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 社交入口：磨砂玻璃按钮 */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(222, 241, 250, 0.28);
  background: rgba(11, 16, 24, 0.42);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.62);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
  border-color: rgba(255, 196, 230, 0.66);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-1px);
}

.social-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- 页脚 ---------- */

.site-footer {
  position: fixed;
  right: clamp(18px, 4vw, 52px);
  bottom: clamp(18px, 4vw, 44px);
  left: clamp(18px, 4vw, 52px);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  opacity: 1;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.rain-page.footer-hidden .site-footer {
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
}

.footer-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.icp {
  color: #ffffffa3;
  font-size: 0.92rem;
  text-decoration: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.62);
  white-space: nowrap;
}

.icp:hover {
  color: #ffffffd6;
}
.brand,
.terminal-trigger,
.footer-separator {
  color: #ffffffa3;
  font-size: 0.92rem;
  text-decoration: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.62);
  white-space: nowrap;
}

.terminal-trigger {
  padding: 0;
  background: transparent;
}

.brand:hover,
.terminal-trigger:hover {
  color: #ffffffd6;
}

/* ---------- 终端弹窗 ---------- */

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #03070c57;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}

.terminal-overlay[hidden] {
  display: none;
}

.terminal-window {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(222, 241, 250, 0.28);
  background: #070b12c7;
  backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px #ffffff0d inset,
    0 28px 80px #00000085;
  color: #eff9ffe0;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

.terminal-header {
  display: grid;
  min-height: 42px;
  grid-template-columns: 82px 1fr 42px;
  align-items: center;
  border-bottom: 1px solid rgba(222, 241, 250, 0.16);
  background: #ffffff0d;
}

.terminal-lights {
  display: flex;
  padding-left: 16px;
  gap: 8px;
}

.terminal-lights span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff70abd6;
}

.terminal-lights span:nth-child(2) {
  background: #ffd36fd1;
}

.terminal-lights span:nth-child(3) {
  background: #76d1ffd6;
}

.terminal-header h2 {
  margin: 0;
  color: #d8eff9ad;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
}

.terminal-close {
  width: 42px;
  height: 42px;
  color: #ffffff99;
}

.terminal-close:hover {
  color: #fff;
}

.terminal-body {
  padding: 22px;
}

.terminal-output {
  display: grid;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  gap: 8px;
  padding-right: 4px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.terminal-line {
  margin: 0;
  color: #eff9ffc2;
}

.prompt {
  color: #76d1ffe0;
}

.terminal-muted {
  color: #d8eff985;
}

.terminal-error {
  color: #ff97bee6;
}

.terminal-form {
  margin-top: 14px;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 4px;
}

.terminal-path {
  color: #eff9ffb8;
}

.terminal-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffffe6;
  font: inherit;
  caret-color: #76d1fff2;
}

/* ---------- 动画 ---------- */

@keyframes slow-frame {
  0% {
    transform: scale(1.02) translate3d(-0.8%, -0.6%, 0);
  }
  to {
    transform: scale(1.075) translate3d(0.8%, 0.4%, 0);
  }
}

@keyframes light-breathe {
  0%,
  to {
    opacity: 0.66;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes glass-slide {
  0% {
    transform: translate3d(calc(-2% + var(--depth-x) * 0.46px), calc(-8% + var(--depth-y) * 0.34px), 48px);
  }
  to {
    transform: translate3d(calc(3% + var(--depth-x) * 0.46px), calc(8% + var(--depth-y) * 0.34px), 48px);
  }
}

@keyframes mist-drift {
  0% {
    transform: translate3d(calc(-1% + var(--depth-x) * 0.2px), calc(var(--depth-y) * 0.16px), 0);
  }
  to {
    transform: translate3d(calc(1% + var(--depth-x) * 0.2px), calc(-0.8% + var(--depth-y) * 0.16px), 0);
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .bg-image {
    object-position: 62% center;
  }

  .message {
    width: min(100% - 32px, 520px);
    padding-left: 20px;
    justify-content: flex-end;
    padding-bottom: 104px;
  }

  .copy {
    max-width: 16rem;
    white-space: normal;
  }

  .site-footer {
    gap: 12px;
  }

  .actions {
    gap: 10px;
    margin-top: 28px;
  }

  .social-link {
    padding: 9px 14px;
    font-size: 0.82rem;
  }

  .social-icon {
    width: 16px;
    height: 16px;
  }

  .brand,
  .icp,
  .terminal-trigger,
  .footer-separator {
    font-size: 0.78rem;
  }
}

/* ---------- 减少动态效果 ---------- */

@media (prefers-reduced-motion: reduce) {
  .bg-layer,
  .bg-layer::before,
  .bg-layer::after,
  .mist {
    animation: none;
  }

  .clock-separator {
    transition: none;
  }
}
