/* ============================================================
   星辰宇宙 · 深空 + 玫瑰金
   手机优先（390 宽为准）
   ============================================================ */

:root {
  --void: #05060d;
  --void-2: #0a0c16;
  --void-3: #10121f;
  --star: #f2ece8;
  --star-dim: #b9b0ba;
  --star-faint: #7d7686;
  --rose: #e8c4b8;
  --rose-2: #c9a08f;
  --gold: #d9b48f;
  --line: rgba(232, 196, 184, 0.16);
  --line-2: rgba(232, 196, 184, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-weight: 300;
  background: var(--void);
  color: var(--star);
  line-height: 2;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- 星空画布 ---------- */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 顶部与底部的星雾 */
.veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -10%, rgba(122, 108, 190, 0.2), transparent 62%),
    radial-gradient(90% 40% at 50% 108%, rgba(190, 130, 120, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(5, 6, 13, 0) 0%, rgba(5, 6, 13, 0.25) 50%, rgba(5, 6, 13, 0.55) 100%);
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

/* 触屏星点涟漪 */
.touch-spark {
  position: fixed;
  z-index: 40;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 244, 236, 0.95), rgba(232, 196, 184, 0.35) 55%, transparent 70%);
  transform: scale(0.4);
}

.touch-spark.pop {
  animation: sparkPop 0.68s ease-out forwards;
}

@keyframes sparkPop {
  0% { opacity: 0.9; transform: scale(0.4); }
  55% { opacity: 0.55; transform: scale(9); }
  100% { opacity: 0; transform: scale(16); }
}

/* 顶部阅读进度 */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  background: rgba(232, 196, 184, 0.08);
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(232, 196, 184, 0.15), #f3cdba 60%, #fff2e8);
  box-shadow: 0 0 12px rgba(255, 220, 200, 0.8);
  transition: width 0.12s linear;
}

/* 跟随滚动的极光 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background:
    radial-gradient(60% 34% at var(--ax, 50%) 14%, rgba(150, 128, 210, 0.17), transparent 70%),
    radial-gradient(50% 30% at calc(100% - var(--ax, 50%)) 72%, rgba(226, 158, 140, 0.14), transparent 72%);
}

/* ---------- 入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.85s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* JS 接管后：位移由滚动实时驱动，取消 transition 避免打架 */
.reveal.runtime {
  transition: opacity 0.5s ease-out;
}

/* 不同方向的入场 */
.reveal.from-left {
  transform: translateX(-30px);
}
.reveal.from-right {
  transform: translateX(30px);
}
.reveal.from-left.in,
.reveal.from-right.in {
  transform: none;
}

/* 首屏：由 --cover-p 驱动淡出与上移 */
.cover {
  opacity: calc(1 - var(--cover-p, 0));
  transform: translateY(calc(var(--cover-p, 0) * -52px));
  will-change: opacity, transform;
}

/* ---------- 首屏 ---------- */
.cover {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 0;
  position: relative;
}

.eyebrow {
  font-family: "Didot", "Bodoni MT", Georgia, serif;
  font-size: 0.62rem;
  letter-spacing: 6.5px;
  text-indent: 6.5px;
  color: var(--rose-2);
  opacity: 0.75;
  margin-bottom: 2.4rem;
  animation: fadeUp 2.4s ease-out both;
}

.cover h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-weight: 400;
  line-height: 1.5;
  animation: fadeUp 2.4s 0.25s ease-out both;
}

.n1 {
  font-size: clamp(2.6rem, 13.6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  line-height: 1.28;
  background: linear-gradient(178deg, #ffffff 0%, #fff0e6 28%, #f3cdba 62%, #d4a190 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 16px rgba(255, 226, 208, 0.5))
    drop-shadow(0 0 46px rgba(240, 200, 180, 0.34))
    drop-shadow(0 0 90px rgba(232, 196, 184, 0.2));
}

.link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0;
}

.link i {
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 196, 184, 0.55));
}

.link i:last-child {
  background: linear-gradient(90deg, rgba(232, 196, 184, 0.55), transparent);
}

.link em {
  font-style: normal;
  font-family: "Didot", serif;
  font-size: 0.9rem;
  color: var(--gold);
  opacity: 0.95;
  text-shadow: 0 0 12px rgba(217, 180, 143, 0.6);
}

.n2 {
  font-size: clamp(2.6rem, 13.6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  line-height: 1.28;
  background: linear-gradient(178deg, #ffffff 0%, #fbf0ea 30%, #e8d0c6 66%, #c8a99e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 16px rgba(250, 232, 224, 0.52))
    drop-shadow(0 0 46px rgba(235, 210, 200, 0.34));
}

.sub {
  margin-top: 2rem;
  font-size: 0.82rem;
  letter-spacing: 3.2px;
  text-indent: 3.2px;
  color: #a99fab;
  animation: fadeUp 2.4s 0.5s ease-out both;
}

.scroll {
  position: absolute;
  bottom: 2.2rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  font-size: 0.54rem;
  letter-spacing: 5px;
  text-indent: 5px;
  color: var(--star-faint);
  opacity: 0.55;
  animation: drift 3.2s ease-in-out infinite;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes drift {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(5px); }
}

/* ---------- 竖排诗句 ---------- */
.verse {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.8rem;
  padding: 3.6rem 0 3.2rem;
}

.verse .v-line:nth-child(2) {
  margin-top: 2.8rem;
}

.v-line p {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 1.16rem;
  letter-spacing: 10px;
  line-height: 1;
  color: #ddd4d2;
  text-shadow: 0 0 18px rgba(200, 170, 200, 0.18);
}

/* ---------- 分隔 ---------- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.6rem 0;
}

.divider span {
  width: 3.4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.divider i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rose);
  opacity: 0.55;
  box-shadow: 0 0 10px rgba(232, 196, 184, 0.6);
}

/* ---------- 章节 ---------- */
.chapter {
  padding: 1.4rem 0 1.6rem;
}

.ch-no {
  font-family: "Didot", "Bodoni MT", Georgia, serif;
  font-size: 0.58rem;
  letter-spacing: 4px;
  color: var(--rose-2);
  opacity: 0.7;
  margin-bottom: 0.55rem;
}

.ch-no.center {
  text-align: center;
}

h2 {
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 1.04rem;
  font-weight: 400;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  color: #f0e8e6;
  margin-bottom: 1.15rem;
}

.prose {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #cfc7d2;
  text-align: justify;
  letter-spacing: 0.3px;
}

/* ---------- 列表 ---------- */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.list li {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid rgba(232, 196, 184, 0.1);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
              border-color 0.3s;
}

/* 逐条错峰 */
.chapter.in .list li:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.08s; }
.chapter.in .list li:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.2s; }
.chapter.in .list li:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.32s; }

.list li:active {
  border-top-color: rgba(232, 196, 184, 0.3);
}

.list li:last-child {
  border-bottom: 1px solid rgba(232, 196, 184, 0.1);
}

.li-idx {
  flex: 0 0 auto;
  width: 1.7rem;
  font-family: "Didot", "Bodoni MT", Georgia, serif;
  font-size: 0.64rem;
  letter-spacing: 1px;
  color: var(--rose-2);
  opacity: 0.65;
  padding-top: 0.32rem;
}

.list h3 {
  line-height: 1.5;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.04rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  margin-bottom: 0.15rem;
  color: #ece4e2;
}

.list p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #a99fab;
}

/* ---------- 生日 ---------- */
.bd {
  text-align: center;
}

.bd h2 {
  text-align: center;
}

.bd-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 0.4rem 0;
}

.bd-item {
  flex: 1 1 0;
  max-width: 156px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9rem 0.3rem 0.8rem;
  border-top: 1px solid rgba(232, 196, 184, 0.14);
  border-bottom: 1px solid rgba(232, 196, 184, 0.14);
}

.bd-item .who {
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.7rem;
  letter-spacing: 5px;
  text-indent: 5px;
  color: var(--rose-2);
  opacity: 0.85;
  margin-bottom: 0.32rem;
}

.bd-item em {
  font-family: "Didot", "Bodoni MT", "STSong", Georgia, serif;
  font-style: normal;
  font-size: clamp(1.45rem, 6.9vw, 1.75rem);
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff8f4, #dfbcb0 70%, #b98d80);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bd-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

.bd-note {
  line-height: 1.6;
  margin-top: 1rem;
  font-size: 0.7rem;
  letter-spacing: 3.4px;
  text-indent: 3.4px;
  color: #a99fab;
  opacity: 0.75;
}

/* ============================================================
   计时 · 星轨重版（醒目 + 高级）
   ============================================================ */

.timer {
  text-align: center;
  margin: 2rem -1.75rem 0;
  padding: 3.4rem 1.4rem 3.2rem;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(58% 42% at 50% 34%, rgba(224, 170, 150, 0.13), transparent 70%),
    radial-gradient(90% 60% at 50% 108%, rgba(120, 108, 190, 0.14), transparent 66%),
    linear-gradient(180deg, rgba(10, 9, 18, 0.55), rgba(4, 5, 11, 0.9));
  border-top: 1px solid rgba(232, 196, 184, 0.14);
  border-bottom: 1px solid rgba(232, 196, 184, 0.14);
}

/* 双层内框，像一幅装裱的星图 */
.timer::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(232, 196, 184, 0.16);
  pointer-events: none;
  z-index: -1;
}

.timer::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(232, 196, 184, 0.06);
  pointer-events: none;
  z-index: -1;
}

/* 四角星芒 */
.timer .corner {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(232, 196, 184, 0.5);
  transform: rotate(45deg);
  opacity: 0.55;
}
.timer .corner.tl { top: 5px; left: 5px; }
.timer .corner.tr { top: 5px; right: 5px; }
.timer .corner.bl { bottom: 5px; left: 5px; }
.timer .corner.br { bottom: 5px; right: 5px; }

.t-label {
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.78rem;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: #b3a7ae;
}

/* 主数字：巨大、发光、渐变 */
.t-num {
  position: relative;
  display: inline-block;
  font-family: "Didot", "Bodoni MT", "STSong", "Songti SC", Georgia, serif;
  font-size: clamp(5.4rem, 30vw, 8rem);
  font-weight: 300;
  line-height: 0.98;
  margin: 0.5rem 0 0.2rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(178deg, #fffdfb 0%, #ffe9dd 26%, #f0c4b0 56%, #cf9a88 82%, #a97a6c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 18px rgba(255, 214, 196, 0.3))
    drop-shadow(0 0 46px rgba(232, 196, 184, 0.16));
  animation: numBreath 5.5s ease-in-out infinite;
}

@keyframes numBreath {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(255, 214, 196, 0.24)) drop-shadow(0 0 40px rgba(232, 196, 184, 0.12)); }
  50% { filter: drop-shadow(0 0 26px rgba(255, 224, 208, 0.44)) drop-shadow(0 0 66px rgba(232, 196, 184, 0.22)); }
}

/* 数字下方一道细光带（星轨地平线） */
.t-num::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.12em;
  width: 62%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 225, 210, 0.65), transparent);
  box-shadow: 0 0 14px rgba(255, 214, 196, 0.5);
}

.t-num small {
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.13em;
  letter-spacing: 0.5em;
  margin-left: 0.55rem;
  vertical-align: 1.35em;
  -webkit-text-fill-color: #d9b09f;
  color: #d9b09f;
  filter: none;
  animation: none;
}

/* 星轨刻度式时钟 */
.t-clock {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 2rem;
  padding: 0.95rem 0.6rem 0.7rem;
  border-top: 1px solid rgba(232, 196, 184, 0.2);
  border-bottom: 1px solid rgba(232, 196, 184, 0.09);
}

/* 星轨两端的小星点 */
.t-clock::before,
.t-clock::after {
  content: "";
  position: absolute;
  top: -2.5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 232, 220, 0.85);
  box-shadow: 0 0 10px rgba(255, 214, 196, 0.8);
}
.t-clock::before { left: -1px; }
.t-clock::after { right: -1px; }

.t-clock div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 3.2rem;
  position: relative;
}

/* 每个单位上方一个刻度点 */
.t-clock div::before {
  content: "";
  width: 1px;
  height: 5px;
  background: rgba(232, 196, 184, 0.45);
  margin-bottom: 0.15rem;
}

.t-clock span {
  font-family: "Didot", "Bodoni MT", Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  line-height: 1;
  color: #f6ece7;
  text-shadow: 0 0 16px rgba(255, 214, 196, 0.28);
}

.t-clock small {
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-indent: 3px;
  color: #b0a6b3;
}

.t-clock b {
  color: rgba(232, 196, 184, 0.28);
  font-weight: 400;
  font-size: 0.95rem;
  padding-top: 1.35rem;
}

@keyframes secPulse {
  0% { opacity: 0.42; text-shadow: none; }
  8% { opacity: 1; text-shadow: 0 0 22px rgba(255, 226, 210, 0.65); }
  100% { opacity: 1; text-shadow: 0 0 16px rgba(255, 214, 196, 0.28); }
}

#ss {
  animation: secPulse 1s steps(1, end) infinite;
}

.t-note {
  line-height: 1.7;
  margin-top: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #a99fab;
}

/* 计时区章节编号与标题 */
.timer .ch-no {
  margin-bottom: 0.7rem;
}

/* ---------- 点我 ---------- */

/* ---------- 点我 ---------- */
.whisper {
  text-align: center;
  padding: 3rem 0 1.8rem;
}

.whisper button {
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.88rem;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  padding: 0.75rem 2.2rem;
  background: transparent;
  color: var(--rose);
  border: 1px solid rgba(232, 196, 184, 0.34);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.45s, color 0.45s, box-shadow 0.45s, transform 0.15s;
}

.whisper button:active {
  background: rgba(232, 196, 184, 0.1);
  box-shadow: 0 0 28px rgba(232, 196, 184, 0.16);
  transform: scale(0.98);
}

#loveMsg {
  min-height: 1.9rem;
  margin-top: 1.6rem;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1rem;
  letter-spacing: 1.8px;
  color: var(--rose);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s, transform 0.7s;
}

#loveMsg.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 结尾 ---------- */
.end {
  text-align: center;
  padding: 2rem 0 3rem;
}

.end p {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.02rem;
  line-height: 2;
  letter-spacing: 1.2px;
  color: #c4bac4;
}

.fin {
  display: block;
  margin-top: 1.6rem;
  font-family: "Didot", "Bodoni MT", Georgia, serif;
  font-size: 0.6rem;
  letter-spacing: 6px;
  text-indent: 6px;
  color: var(--star-faint);
  opacity: 0.5;
}

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid rgba(232, 196, 184, 0.08);
  margin: 0 -1.75rem;
  padding: 2.2rem 1.75rem calc(2.4rem + env(safe-area-inset-bottom));
  text-align: center;
}

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.66rem;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 0.6rem;
  letter-spacing: 2.6px;
  text-indent: 2.6px;
  color: var(--rose);
  border: 1px solid rgba(232, 196, 184, 0.28);
  border-radius: 2px;
  opacity: 0.8;
}

/* ---------- 宽屏 ---------- */
@media (min-width: 640px) {
  .wrap { padding: 0 2.4rem; }
  .timer {
    margin-left: -2.4rem;
    margin-right: -2.4rem;
    padding-left: 2.4rem;
    padding-right: 2.4rem;
  }
  footer {
    margin: 0 -2.4rem;
    padding-left: 2.4rem;
    padding-right: 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .eyebrow, .cover h1, .sub { animation: none; }
  .scroll, #ss { animation: none; }
}

/* ============================================================
   手机真机专项（她是用手机看的）
   ============================================================ */

/* 1. 整页：避免回弹时露出白底 */
html {
  background: var(--void);
  overscroll-behavior-y: none;
}

/* 2. 惯性滚动与触摸优化 */
body {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  text-rendering: optimizeLegibility;
}

/* 3. 顶部与底部安全区（刘海屏 / 全面屏） */
.wrap {
  padding-top: env(safe-area-inset-top);
  padding-left: max(1.75rem, env(safe-area-inset-left));
  padding-right: max(1.75rem, env(safe-area-inset-right));
}

.progress {
  top: env(safe-area-inset-top);
}

/* 4. 按钮触摸目标不小于 44px，便于手指点按 */
.whisper button {
  min-height: 46px;
  min-width: 150px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 5. 防止 iOS 双击缩放与文字自动放大 */
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 6. 关闭点击高亮，保留自定义星点反馈 */
a, button, .card, .list li {
  -webkit-tap-highlight-color: transparent;
}

/* 7. 竖屏短屏（如 iPhone SE 375×667）收紧首屏留白 */
@media (max-height: 700px) and (orientation: portrait) {
  .cover {
    min-height: 100svh;
    padding-top: 2.4rem;
    padding-bottom: 2rem;
  }
  .cover .eyebrow {
    margin-bottom: 1.6rem;
  }
  .n1, .n2 {
    font-size: clamp(2.2rem, 12.4vw, 2.9rem);
  }
  .sub {
    margin-top: 1.4rem;
  }
  .scroll {
    bottom: 1.2rem;
  }
}

/* 8. 窄屏（≤360px）避免名字溢出 */
@media (max-width: 360px) {
  .n1, .n2 {
    font-size: clamp(2rem, 12vw, 2.6rem);
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }
  .t-num {
    font-size: clamp(4.4rem, 27vw, 6rem);
  }
  .t-clock div {
    min-width: 2.5rem;
  }
}

/* 9. 横屏时首屏不再强制满屏 */
@media (orientation: landscape) and (max-height: 500px) {
  .cover {
    min-height: auto;
    padding: 2.6rem 0 1.6rem;
  }
  .cover .eyebrow {
    margin-bottom: 1rem;
  }
  .n1, .n2 {
    font-size: 1.6rem;
  }
}

/* 10. 低端机 / 省电：降低星空与光晕开销 */
@media (prefers-reduced-data: reduce) {
  .aurora {
    display: none;
  }
  .veil {
    background: var(--void-2);
  }
  .t-num,
  .n1,
  .n2 {
    filter: none;
    animation: none;
  }
  .t-num::after {
    box-shadow: none;
  }
}

/* ============================================================
   11. 我们的星 · 今天 · 许愿 · 整数天彩蛋
   ============================================================ */

/* ---------- 两颗命名的星 ---------- */
.named-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.named-link {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.named-link line {
  stroke: rgba(232, 196, 184, 0.6);
  stroke-width: 1;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
  animation: linkBreath 5.4s ease-in-out infinite;
}

@keyframes linkBreath {
  0%, 100% { opacity: 0.34; }
  50% { opacity: 0.92; }
}

.nstar {
  position: absolute;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#nstarA { left: 17%; top: 25%; }
#nstarB { left: 77%; top: 14%; }

.nstar-core {
  position: relative;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff8f3;
  box-shadow:
    0 0 5px 2px rgba(255, 240, 228, 0.9),
    0 0 16px 7px rgba(232, 196, 184, 0.45),
    0 0 40px 18px rgba(232, 196, 184, 0.16);
  animation: starPulse 3.8s ease-in-out infinite;
}

#nstarB .nstar-core { animation-delay: -1.9s; }

@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.5); opacity: 1; }
}

.nstar-core::before,
.nstar-core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.nstar-core::before {
  width: 26px;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(255, 242, 234, 0.6), transparent);
}

.nstar-core::after {
  width: 1px;
  height: 26px;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, transparent, rgba(255, 242, 234, 0.6), transparent);
}

.nstar-date {
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: rgba(232, 196, 184, 0.62);
  pointer-events: none;
  text-shadow: 0 0 12px rgba(5, 6, 13, 0.92);
  transition: opacity 0.4s ease;
}

.nstar.on .nstar-date { opacity: 0; }

.nstar-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translate(-50%, 5px);
  white-space: nowrap;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--star);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 14px rgba(5, 6, 13, 0.95);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.nstar.on .nstar-tip,
.nstar:hover .nstar-tip {
  opacity: 0.95;
  transform: translate(-50%, 0);
}

.nstar:hover .nstar-date { opacity: 0; }

/* ---------- 今天 ---------- */
.daily {
  text-align: center;
}

.daily-date {
  margin-top: 1.15rem;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: var(--star-faint);
}

.daily-line {
  margin: 1.45rem auto 0;
  max-width: 17em;
  font-size: 1rem;
  line-height: 2.2;
  color: var(--rose);
  text-wrap: balance;
}

.daily-line::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  margin: 1.35rem auto 0;
  background: var(--line-2);
}

/* ---------- 整数天 / 生日彩蛋 ---------- */
.milestone {
  margin-top: 2.4rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(232, 196, 184, 0.075), rgba(232, 196, 184, 0.012));
  text-align: center;
}

.milestone[hidden] { display: none; }

.ms-day {
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--gold);
}

.ms-text {
  margin-top: 0.55rem;
  font-size: 0.86rem;
  line-height: 1.95;
  color: var(--star);
}

/* ---------- 点天空：许愿流星 ---------- */
.wish {
  position: fixed;
  z-index: 30;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  box-shadow: 0 0 10px 3px rgba(255, 238, 224, 0.75);
}

.wish::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 1px;
  width: 84px;
  height: 1px;
  background: linear-gradient(270deg, rgba(255, 242, 234, 0.9), rgba(255, 242, 234, 0));
  transform-origin: right center;
  animation: wishTail 0.95s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes wishTail {
  from { transform: scaleX(0) translateY(0); opacity: 1; }
  to { transform: scaleX(1) translateY(6px); opacity: 0; }
}

.wish-msg {
  position: fixed;
  z-index: 30;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: rgba(242, 236, 232, 0.92);
  pointer-events: none;
  text-shadow: 0 0 16px rgba(5, 6, 13, 0.95);
  animation: wishMsg 2.3s ease forwards;
}

@keyframes wishMsg {
  0% { opacity: 0; }
  16% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- 手机微调 ---------- */
@media (max-width: 420px) {
  #nstarA { left: 13%; top: 23%; }
  #nstarB { left: 80%; top: 13%; }
  .nstar-core::before { width: 20px; }
  .nstar-core::after { height: 20px; }
  .daily-line { font-size: 0.94rem; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .named-link line,
  .nstar-core { animation: none; }
  .wish::after,
  .wish-msg { animation-duration: 0.01s; }
}

/* ============================================================
   12. 星轨 · 今日卡片 · 藏在落款里的信
   ============================================================ */

/* ---------- 星轨 ---------- */
.orbit {
  text-align: center;
}

#orbitCanvas {
  display: block;
  width: 100%;
  max-width: 330px;
  margin: 1.7rem auto 0;
  height: auto;
}

.orbit-note {
  margin-top: 1.2rem;
  font-size: 0.68rem;
  line-height: 2.05;
  letter-spacing: 0.13em;
  color: var(--star-faint);
}

/* ---------- 存卡片按钮 ---------- */
.daily-save {
  margin-top: 1.55rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--rose);
  font-family: inherit;
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.daily-save:hover { background: rgba(232, 196, 184, 0.08); }
.daily-save:active { transform: scale(0.97); }

/* ---------- 落款的点击暗示 ---------- */
.seal {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

/* ---------- 信 ---------- */
.letter {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 5, 11, 0.88);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.45s ease;
}

.letter[hidden] { display: none; }

.letter-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 84vh;
  overflow-y: auto;
  padding: 2.1rem 1.65rem 1.8rem;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(16, 18, 31, 0.985), rgba(7, 8, 16, 0.995));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: letterIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.letter-kicker {
  font-size: 0.6rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--gold);
  text-align: center;
}

.letter-box h2 {
  margin-top: 0.75rem;
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  text-align: center;
  color: var(--star);
}

.letter-body {
  margin-top: 1.6rem;
  font-size: 0.86rem;
  line-height: 2.15;
  color: var(--star-dim);
}

.letter-body p + p { margin-top: 1.05rem; }

.letter-sign {
  margin-top: 1.7rem;
  text-align: right;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--rose-2);
}

.letter-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: none;
  color: var(--star-faint);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 卡片 ---------- */
.card-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  background: rgba(4, 5, 11, 0.92);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.35s ease;
}

.card-layer[hidden] { display: none; }

.card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-height: 94vh;
}

.card-hint {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--star-faint);
}

#cardImg {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 3px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
}

.card-close {
  padding: 0.55rem 1.35rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  color: var(--rose);
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes letterIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   13. 接下来的日子 · 分享 · 回到顶部
   ============================================================ */

.count-list {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
}

.count-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.25rem 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(232, 196, 184, 0.1);
}

.count-list li:first-child {
  border-top: 1px solid rgba(232, 196, 184, 0.1);
}

.c-label {
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: var(--star);
}

.c-date {
  grid-column: 1 / 2;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--star-faint);
}

.c-days {
  font-family: "Didot", "Bodoni MT", Georgia, serif;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--rose);
  white-space: nowrap;
}

.c-days.soon { color: var(--gold); }

.share-btn {
  margin-top: 2.1rem;
  padding: 0.55rem 1.35rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  color: var(--rose);
  font-family: inherit;
  font-size: 0.63rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  cursor: pointer;
  transition: background 0.3s ease;
}

.share-btn:hover { background: rgba(232, 196, 184, 0.08); }

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.5rem;
  z-index: 40;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(8, 9, 17, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--rose);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 5.4rem;
  z-index: 50;
  transform: translate(-50%, 10px);
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(20, 22, 34, 0.95);
  color: var(--star);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
