/* ==========================================================================
   Template C · STARRY（星空梦幻）
   深夜幕 / 星屑闪烁 / 月晕 / 玻璃卡片 / 星座连线
   ========================================================================== */

.tpl-starry {
  --st-bg: #080c18;
  --st-bg-2: #0d1428;
  --st-ink: #eef1f7;
  --st-ink-2: #c3cbe0;
  --st-mute: #8e9ab8;
  --st-gold: #c9a96a;
  --st-glass: rgba(255, 255, 255, 0.045);
  --st-line: rgba(255, 255, 255, 0.14);
  --st-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;

  background:
    radial-gradient(120% 70% at 78% -8%, rgba(74, 96, 168, 0.42), rgba(8, 12, 24, 0) 60%),
    radial-gradient(90% 50% at 18% 12%, rgba(46, 62, 128, 0.5), rgba(8, 12, 24, 0) 62%),
    linear-gradient(180deg, #0b1226 0%, #080c18 44%, #0a1020 78%, #070b16 100%);
  color: var(--st-ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* --- 夜空 --- */
.st-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.st-stars {
  position: absolute;
  inset: 0;
}

.st-stars i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(200, 220, 255, 0.8);
  animation: st-twinkle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: opacity, transform;
}

@keyframes st-twinkle {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.86);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.06);
  }
}

.st-sky::before {
  /* 偶发流星 —— 用固定像素定位，避免长页面里百分比被拉散 */
  content: "";
  position: absolute;
  top: 96px;
  left: -12%;
  width: 130px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85));
  transform: rotate(18deg);
  opacity: 0;
  animation: st-shoot 11s ease-in infinite;
  animation-delay: 4s;
}

@keyframes st-shoot {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(18deg);
  }
  3% {
    opacity: 1;
  }
  14% {
    opacity: 0;
    transform: translate3d(120vw, 36vh, 0) rotate(18deg);
  }
  100% {
    opacity: 0;
  }
}

.st-moon {
  position: absolute;
  top: 44px;
  right: 12%;
  width: 56px;
  height: 56px;
}

.st-moon__glow {
  position: absolute;
  inset: -120px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(233, 224, 196, 0.22) 0%,
    rgba(201, 169, 106, 0.1) 34%,
    rgba(201, 169, 106, 0) 68%
  );
}

.st-moon__body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fffdf4 0%, #f0e8d4 46%, #d9cfb4 100%);
  box-shadow: 0 0 26px rgba(240, 232, 212, 0.45), inset -6px -6px 14px rgba(148, 134, 104, 0.35);
}

.st-horizon {
  position: absolute;
  left: 50%;
  top: 460px;
  transform: translateX(-50%);
  width: 140%;
  height: 320px;
  background: radial-gradient(60% 100% at 50% 50%, rgba(70, 92, 168, 0.18), rgba(8, 12, 24, 0) 72%);
}

/* --- 主体 --- */
.st-main {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 22px;
}

.st-label {
  display: inline-block;
  font-size: 8.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--st-gold);
  opacity: 0.9;
}

/* --- Hero --- */
.st-hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 0 48px;
}

.st-eyebrow {
  font-size: 9px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--st-gold);
  opacity: 0.85;
}

.st-names {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--st-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 10.5vw, 3rem);
  line-height: 1.2;
  letter-spacing: 0.16em;
  color: #f6f5ee;
  text-shadow: 0 0 30px rgba(168, 186, 232, 0.35);
}

.st-names__line {
  display: block;
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--st-gold), transparent);
  opacity: 0.8;
}

.st-title {
  margin-top: 22px;
  max-width: 20em;
  font-size: 0.9rem;
  line-height: 1.95;
  letter-spacing: 0.08em;
  color: var(--st-ink-2);
}

/* --- 玻璃计时板 --- */
.st-board {
  margin-top: 36px;
  width: min(300px, 100%);
  padding: 26px 20px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--st-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 30px 60px -40px rgba(0, 0, 0, 0.9),
    0 0 60px -30px rgba(120, 150, 240, 0.55);
}

.st-board__label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--st-mute);
}

.st-board__row {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
}

.st-board__num {
  font-family: var(--st-serif);
  font-size: clamp(2.8rem, 15vw, 3.8rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #fdf8ea;
  text-shadow: 0 0 26px rgba(240, 220, 170, 0.4);
}

.st-board__unit {
  font-family: var(--st-serif);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--st-gold);
}

.st-board__clock {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--st-mute);
}

.st-board__clock--hint {
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--st-gold);
  opacity: 0.85;
}

.st-scroll {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--st-mute);
}

.st-scroll__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--st-gold);
  box-shadow: 0 0 12px rgba(201, 169, 106, 0.9);
  animation: st-pulse 2.6s ease-in-out infinite;
}

@keyframes st-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(4px);
  }
}

.st-scroll__text {
  font-size: 8.5px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

/* --- 星图相册 --- */
.st-gallery {
  padding: 56px 0 0;
}

.st-section-head {
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.st-h2 {
  margin-top: 10px;
  font-family: var(--st-serif);
  font-weight: 400;
  font-size: 1.32rem;
  letter-spacing: 0.14em;
  color: #f2f1ea;
}

.st-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 22px 0 6px;
  scrollbar-width: none;
}

.st-strip::-webkit-scrollbar {
  display: none;
}

.st-photo {
  position: relative;
  flex: 0 0 78%;
  max-width: 300px;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 26px 50px -34px rgba(0, 0, 0, 0.9);
  cursor: zoom-in;
}

.st-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.22, 0.68, 0.24, 1);
  filter: saturate(0.95) brightness(0.96);
}

.st-photo:hover img {
  transform: scale(1.04);
}

.st-photo figcaption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 34px 14px 13px;
  background: linear-gradient(180deg, rgba(6, 9, 20, 0), rgba(6, 9, 20, 0.86));
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: #e8ebf3;
}

.st-photo__idx {
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--st-gold);
  flex: none;
}

.st-photo__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-swipe {
  margin-top: 12px;
  text-align: center;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: var(--st-mute);
  opacity: 0.7;
}

/* --- 信 --- */
.st-letter {
  padding: 56px 0 8px;
}

.st-letter__card {
  margin: 0 auto;
  max-width: 560px;
  padding: 30px 22px 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 40px 70px -50px rgba(0, 0, 0, 0.95);
}

.st-letter__p {
  font-size: 14px;
  line-height: 2.2;
  letter-spacing: 0.05em;
  color: #dfe4f0;
  text-align: justify;
  text-justify: inter-ideograph;
}

.st-letter__body {
  margin-top: 16px;
}

.st-letter__p + .st-letter__p {
  margin-top: 18px;
}

.st-letter__sign {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--st-serif);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--st-gold);
}

.st-letter__sign i {
  width: 18px;
  height: 1px;
  background: rgba(201, 169, 106, 0.5);
}

/* --- 结尾 --- */
.st-outro {
  padding: 64px 0 56px;
  text-align: center;
}

.st-constellation {
  width: 168px;
  height: auto;
  margin: 0 auto;
  display: block;
  opacity: 0.9;
}

.st-blessing {
  margin-top: 22px;
  font-family: var(--st-serif);
  font-size: 1.24rem;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: #f6f2e6;
  text-shadow: 0 0 30px rgba(200, 190, 160, 0.25);
}

.st-outro__date {
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--st-mute);
}

.st-mark {
  display: inline-block;
  margin-top: 32px;
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--st-mute);
  opacity: 0.72;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.st-mark:hover {
  border-bottom-color: currentColor;
}

/* --- 一句宣言 --- */
.st-tagline {
  margin-top: 12px;
  max-width: 22em;
  font-family: var(--st-serif);
  font-size: 0.85rem;
  line-height: 1.9;
  letter-spacing: 0.14em;
  color: var(--st-gold);
  opacity: 0.9;
}

/* --- 走过的那些天 --- */
.st-story {
  padding: 58px 0 0;
}

.st-track {
  position: relative;
  margin-top: 24px;
  padding-left: 26px;
  text-align: left;
}

.st-track::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(201, 169, 106, 0) 0%,
    rgba(201, 169, 106, 0.5) 12%,
    rgba(201, 169, 106, 0.5) 86%,
    rgba(201, 169, 106, 0) 100%
  );
}

.st-stop {
  position: relative;
  padding-bottom: 26px;
}

.st-stop:last-child {
  padding-bottom: 0;
}

.st-stop__dot {
  position: absolute;
  left: -26px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f6efdb;
  box-shadow: 0 0 12px rgba(240, 220, 170, 0.85);
}

.st-stop__date {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  color: var(--st-gold);
  opacity: 0.85;
}

.st-stop__title {
  margin-top: 7px;
  font-family: var(--st-serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #f2f1ea;
}

.st-stop__text {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: #c3cbe0;
}

/* 时刻照片：夜色里的一小块光 */
.st-stop__photo {
  margin-top: 12px;
  max-width: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.95), 0 0 36px -18px rgba(120, 150, 240, 0.6);
  cursor: zoom-in;
}

.st-stop__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.96) brightness(0.97);
  transition: transform 1s var(--ease);
}

.st-stop__photo:hover img {
  transform: scale(1.03);
}

/* --- 关于你的小事 --- */
.st-tiny {
  padding: 58px 0 0;
}

.st-tiny__list {
  margin-top: 16px;
}

.st-tiny__item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.85;
  color: #d9dfee;
  text-align: left;
}

.st-tiny__item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.st-tiny__idx {
  flex: none;
  width: 22px;
  font-family: var(--st-serif);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--st-gold);
  opacity: 0.85;
}

/* --- 还没做的事 --- */
.st-promises {
  padding: 58px 0 0;
}

.st-promise__list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: left;
}

.st-promise__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #dfe4f0;
}

.st-promise__mark {
  position: relative;
  flex: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 106, 0.65);
}

.st-promise__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(201, 169, 106, 0.32);
}

/* --- 我们的歌 --- */
.st-song {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--st-mute);
}

.st-song span {
  margin-right: 3px;
  color: var(--st-gold);
}

/* --- 宽屏 --- */
@container (min-width: 640px) {
  .st-main {
    padding-inline: 44px;
  }
  .st-names {
    font-size: 3.6rem;
    letter-spacing: 0.2em;
  }
  .st-title {
    font-size: 1rem;
  }
  .st-board {
    width: 320px;
    padding: 30px 24px 26px;
  }
  .st-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    overflow: visible;
    padding-top: 26px;
  }
  .st-strip[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .st-strip[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
    max-width: 420px;
  }
  .st-photo {
    max-width: none;
  }
  .st-swipe {
    display: none;
  }
  .st-letter__card {
    padding: 42px 40px 34px;
  }
  .st-blessing {
    font-size: 1.45rem;
  }

  .st-track {
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
    row-gap: 6px;
  }
  .st-track::before {
    display: none;
  }
  .st-stop {
    position: relative;
    padding: 18px 0 18px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .st-stop__dot {
    left: 0;
    top: 24px;
  }

  .st-tiny__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 44px;
  }

  .st-promise__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
}

@container (min-width: 860px) {
  .st-names {
    font-size: 4rem;
  }
  .st-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================ 专属装饰：星座 / 月相 ============================ */
.st-const {
  position: absolute;
  left: 50%;
  top: 26px;
  width: 74%;
  max-width: 300px;
  transform: translateX(-50%);
  color: #cfd9f7;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.st-const--hero {
  animation: st-twinkle-const 9s ease-in-out infinite;
}

@keyframes st-twinkle-const {
  0%, 100% { opacity: 0.32; }
  50% { opacity: 0.62; }
}

.st-moons {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  opacity: 0.6;
}

.st-moon {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e9e4d4;
  box-shadow: 0 0 8px rgba(200, 214, 255, 0.45);
}

.st-moon--1 { box-shadow: inset -5px 0 0 0 #0b1124; }
.st-moon--2 { box-shadow: inset 4px 0 0 0 #0b1124; }
.st-moon--3 { box-shadow: inset -8px 0 0 0 #0b1124; opacity: 0.7; }
.st-moon--4 { opacity: 0.45; }
