* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #04060f;
  color: #e8efff;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

/* ================= 封面 ================= */
.cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1.15s cubic-bezier(.4, 0, .2, 1);
}
.cover.gone {
  opacity: 0;
  pointer-events: none;
}
.cover-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 16px 3px rgba(150, 185, 255, .9), 0 0 60px 12px rgba(90, 130, 255, .35);
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .45; }
  50%      { transform: scale(1.45); opacity: 1; }
}
.cover-text {
  margin-top: 34px;
  font-size: 12px;
  letter-spacing: .42em;
  text-indent: .42em;
  color: rgba(190, 208, 255, .45);
  animation: fadeIn 3s ease 0.6s both;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ================= HUD ================= */
.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 20;
  padding: 0 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.2, .8, .2, 1);
}
.hud.on { opacity: 1; transform: translateY(0); }

.days {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}
.d-num {
  font-family: "Times New Roman", "Songti SC", serif;
  font-size: clamp(58px, 17vw, 108px);
  font-weight: 400;
  letter-spacing: .02em;
  color: #f2f7ff;
  text-shadow: 0 0 28px rgba(140, 175, 255, .55), 0 0 90px rgba(80, 120, 255, .28);
  font-variant-numeric: tabular-nums;
}
.d-unit {
  font-size: clamp(13px, 3.4vw, 18px);
  letter-spacing: .3em;
  color: rgba(190, 212, 255, .6);
  padding-bottom: 14px;
}
.since {
  margin-top: 12px;
  font-size: clamp(11px, 3vw, 13px);
  letter-spacing: .16em;
  color: rgba(178, 200, 245, .5);
  font-variant-numeric: tabular-nums;
}

/* 音乐按钮 */
.music {
  position: fixed;
  right: 22px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(150, 180, 255, .22);
  background: rgba(16, 24, 48, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 1.6s ease, border-color .3s;
}
.hud.on .music { opacity: 1; }
.music:active { border-color: rgba(180, 205, 255, .5); }
.bars { display: flex; align-items: flex-end; gap: 2.5px; height: 13px; }
.bars i {
  display: block;
  width: 2px;
  height: 4px;
  background: rgba(190, 212, 255, .5);
  border-radius: 1px;
  transition: height .3s, background .3s;
}
.music.playing .bars i { background: #d8e6ff; animation: bar 1.1s ease-in-out infinite; }
.music.playing .bars i:nth-child(2) { animation-delay: .22s; }
.music.playing .bars i:nth-child(3) { animation-delay: .44s; }
@keyframes bar {
  0%, 100% { height: 4px; }
  50%      { height: 13px; }
}

/* ================= 特殊日期 ================= */
.banner {
  position: fixed;
  top: calc(30px + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 25;
  width: min(86vw, 460px);
  padding: 18px 22px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, rgba(60, 78, 140, .28), rgba(24, 30, 62, .42));
  border: 1px solid rgba(150, 180, 255, .22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 50px rgba(40, 60, 140, .3), inset 0 1px 0 rgba(255, 255, 255, .07);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
.banner.on { opacity: 1; transform: translate(-50%, 0); }
.banner-title {
  font-size: 12px;
  letter-spacing: .34em;
  text-indent: .34em;
  color: rgba(190, 212, 255, .6);
  margin-bottom: 10px;
}
.banner-body {
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: .06em;
  color: rgba(236, 243, 255, .9);
}

/* ================= 照片详情 ================= */
.card {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 26px calc(40px + env(safe-area-inset-bottom));
  background: rgba(3, 5, 12, .9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .55s ease;
}
.card.on { opacity: 1; pointer-events: auto; }
.card img {
  width: auto;
  max-width: min(88vw, 420px);
  max-height: 62vh;
  border-radius: 4px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(160, 190, 255, .14);
  transform: scale(.96);
  transition: transform .55s cubic-bezier(.2, .8, .2, 1);
}
.card.on img { transform: scale(1); }
.card-meta {
  margin-top: 26px;
  text-align: center;
  max-width: 460px;
}
.card-date {
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(160, 185, 235, .55);
  font-variant-numeric: tabular-nums;
}
.card-place {
  margin-top: 9px;
  font-size: 13px;
  letter-spacing: .2em;
  color: rgba(200, 216, 250, .75);
}
.card-place:empty { display: none; }
.card-caption {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .05em;
  color: rgba(240, 246, 255, .92);
}
.card-close {
  position: absolute;
  bottom: calc(22px + env(safe-area-inset-bottom));
  font-size: 10px;
  letter-spacing: .3em;
  color: rgba(160, 185, 235, .35);
}

/* ================= 提示 ================= */
.hint {
  position: fixed;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 15;
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(170, 195, 245, .38);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.8s ease;
  pointer-events: none;
}
.hint.on { opacity: 1; }

@media (max-width: 380px) {
  .hud { padding: 0 20px; }
  .since { letter-spacing: .1em; }
}

/* ================= 登录 ================= */
.login {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: #04060f;
  opacity: 0; pointer-events: none;
  transition: opacity .7s ease;
}
.login.on { opacity: 1; pointer-events: auto; }
.login-inner { width: min(86vw, 330px); text-align: center; }
.login-days {
  font-size: 12px; letter-spacing: .2em;
  color: rgba(185, 208, 250, .55); margin-bottom: 26px;
}
.login-days b {
  font-family: "Times New Roman", serif; font-size: 28px;
  color: #eef4ff; margin: 0 5px; font-weight: 400;
}
.login-line {
  height: 1px; margin-bottom: 26px;
  background: linear-gradient(90deg, transparent, rgba(150, 185, 255, .35), transparent);
}
.login input {
  width: 100%; box-sizing: border-box; margin-bottom: 12px;
  padding: 13px 15px; border-radius: 10px;
  border: 1px solid rgba(140, 170, 235, .2);
  background: rgba(10, 14, 30, .85);
  color: #eaf2ff; font-size: 14px; letter-spacing: .12em; outline: none;
}
.login input:focus { border-color: rgba(150, 190, 255, .5); }
.login button {
  width: 100%; margin-top: 10px; padding: 13px;
  border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(150, 190, 255, .3);
  background: rgba(58, 88, 165, .3);
  color: #eaf2ff; font-size: 13px; letter-spacing: .3em;
  transition: background .25s;
}
.login button:active { background: rgba(80, 115, 205, .45); }
.login button:disabled { opacity: .5; }
.login-err {
  min-height: 18px; margin-top: 12px;
  font-size: 12px; color: #ff9aa2; letter-spacing: .08em;
}

/* ================= 其它 ================= */
.cover.waiting { opacity: 0; pointer-events: none; }

.empty {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8; text-align: center;
  font-size: 14px; line-height: 2; letter-spacing: .12em;
  color: rgba(190, 212, 255, .55);
  opacity: 0; pointer-events: none; transition: opacity 1s ease;
}
.empty.on { opacity: 1; }
.empty span { font-size: 11px; color: rgba(160, 185, 235, .32); }

/* ================= 那颗专属的星 ================= */
.hero {
  position: fixed;
  left: 50%;
  top: 15%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transform: scale(.6);
  transition: opacity 2s ease, transform 2s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  animation: heroFloat 7s ease-in-out infinite;
}
.hero.on { opacity: 1; transform: scale(1); pointer-events: auto; }
.hero.big { width: 54px; height: 54px; margin-left: -27px; }

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.hero i { position: absolute; display: block; }

.hero-glow {
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255,255,255,.95) 0%,
    rgba(190,215,255,.55) 18%,
    rgba(120,160,255,.18) 42%,
    rgba(80,120,255,0) 72%);
  filter: blur(1px);
}
.hero-core {
  left: 50%; top: 50%;
  width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 3px rgba(200,220,255,.9), 0 0 30px 8px rgba(120,160,255,.45);
}
.hero-rays {
  left: 50%; top: 50%;
  width: 150%; height: 1.2px;
  margin-left: -75%; margin-top: -.6px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  opacity: .75;
}
.hero-rays::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 1.2px; height: 150%;
  margin-left: -.6px; margin-top: -75%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.85), transparent);
}

/* 点开之后 */
.hero-card {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  background: rgba(4, 6, 15, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
.hero-card.on { opacity: 1; pointer-events: auto; }
.hero-title {
  font-size: 12px;
  letter-spacing: .44em;
  text-indent: .44em;
  color: rgba(190, 212, 255, .65);
  margin-bottom: 26px;
}
.hero-body {
  max-width: 460px;
  font-size: 15px;
  line-height: 2.1;
  letter-spacing: .06em;
  text-align: center;
  color: rgba(240, 246, 255, .95);
  white-space: pre-line;
}
.hero-close {
  position: absolute;
  bottom: calc(26px + env(safe-area-inset-bottom));
  font-size: 10px;
  letter-spacing: .3em;
  color: rgba(160, 185, 235, .35);
}

.loading {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  font-size: 11px;
  letter-spacing: .42em;
  text-indent: .42em;
  color: rgba(180, 205, 250, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease;
}
.loading.on { opacity: 1; }

.card-x {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: rgba(220, 232, 255, .7);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.card-x:active { background: rgba(255, 255, 255, .14); }

.hero-body {
  max-height: 58vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
.hero-body::-webkit-scrollbar { width: 0; }
.hero-close { cursor: pointer; padding: 10px 24px; }
