/* 首页：墨底 + 青蓝辉光 + 楷体米白标题 */
:root {
  --ink: #0a0c10;
  --paper: #ece7dc;
  --cyan: #7fd8ff;
  --muted: #7a8494;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #0a0c10;
  color: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 底层渐变：中央偏上一团极淡的冷光，四周沉下去 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 720px at 50% 34%, #16202b 0%, #0d1218 46%, #0a0c10 78%),
    radial-gradient(700px 500px at 82% 88%, #101922 0%, transparent 70%);
  z-index: -3;
}

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

/* 呼吸的辉光 */
.glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(520px 420px at 50% 38%, rgba(127, 216, 255, 0.09), transparent 68%);
  animation: breathe 15s ease-in-out infinite alternate;
}

@keyframes breathe {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

/* 纸纹噪点：内联 SVG，不额外请求图片 */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 暗角 */
.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, transparent 38%, rgba(0, 0, 0, 0.62) 100%);
}

main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px max(64px, 7vh);
  text-align: center;
}

h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Kaiti SC", "STSong", "SimSun", serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 6.4vw, 4.2rem);
  letter-spacing: 0.3em;
  padding-left: 0.3em; /* 抵消字距造成的视觉右偏 */
  color: var(--paper);
  text-shadow:
    0 0 42px rgba(196, 228, 255, 0.18),
    0 0 90px rgba(127, 216, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 1.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rule {
  width: clamp(120px, 17vw, 220px);
  height: 1px;
  margin: clamp(22px, 3.4vw, 34px) 0 clamp(16px, 2.4vw, 22px);
  background: linear-gradient(90deg, transparent, rgba(196, 228, 255, 0.32), transparent);
  transform-origin: center;
  animation: rule-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.sign {
  margin: 0;
  font-family: Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.34em;
  color: var(--muted);
  text-indent: 0.34em;
  animation: fade 1.4s ease-out 0.7s both;
}

/* 目录入口：hero 下的两个小链接，保持墨底上的克制 */
.links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: clamp(30px, 4.2vh, 44px);
  font-size: 0.76rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  animation: fade 1.2s ease-out 1.05s both;
}

.links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.links a:hover,
.links a:focus-visible {
  color: var(--paper);
  outline: none;
}

.links a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.links .sep {
  color: rgba(236, 231, 220, 0.16);
  letter-spacing: 0;
  text-indent: 0;
}

/* 备案信息：固定贴底，字距收紧，与 hero 的松散气质区分开 */
.beian {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  animation: fade 1.2s ease-out 1.3s both;
}

.beian a {
  color: var(--muted);
  text-decoration: none;
}

.beian a:hover,
.beian a:focus-visible {
  color: var(--paper);
  text-decoration: underline;
  outline: none;
}

@keyframes rise {
  from {
    opacity: 0;
    filter: blur(10px);
    letter-spacing: 0.46em;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    letter-spacing: 0.3em;
    transform: none;
  }
}

@keyframes rule-in {
  from {
    opacity: 0;
    transform: scaleX(0.2);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 拿不到 canvas 2D context 时的兜底：把辉光调亮一点，页面依然成立 */
.no-canvas .glow {
  background: radial-gradient(560px 460px at 50% 38%, rgba(127, 216, 255, 0.14), transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
  .glow {
    opacity: 0.9;
  }
}

@media (max-width: 480px) {
  h1 {
    letter-spacing: 0.24em;
    padding-left: 0.24em;
  }
  .beian {
    font-size: 0.66rem;
  }
}
