/* ═══════════════════════════════════════════════════
   致雪莉 · 浪漫表白信笺样式设计
   ═══════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  forced-color-adjust: none;
  -webkit-forced-color-adjust: none;
}

html {
  color-scheme: dark only;
  background-color: #070913;
  color: #f8fafc;
  forced-color-adjust: none;
  -webkit-forced-color-adjust: none;
}

:root {
  color-scheme: dark only;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  
  --bg-dark: #070913;
  --card-bg: rgba(18, 22, 38, 0.65);
  --card-border: rgba(244, 182, 193, 0.18);
  --card-glow: rgba(244, 114, 182, 0.12);
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --accent-rose: #fda4af;
  --accent-gold: #fde047;
  --accent-purple: #c084fc;
}

body {
  background-color: #070913;
  color: var(--text-main);
  font-family: var(--font-serif);
  min-height: 100vh;
  line-height: 1.8;
  overflow-x: hidden;
  position: relative;
  forced-color-adjust: none;
  -webkit-forced-color-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(244, 63, 94, 0.35);
  color: #fff;
}

/* 粒子背景画布 */
#particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

/* 全屏视频遮罩 */
.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  cursor: pointer;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-overlay.fade-out {
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* 主内容容器 */
.main-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px 100px;
}

.letter-container {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 顶部信笺头部 */
.letter-header {
  text-align: center;
  padding: 20px 0 10px;
  animation: fadeInDown 1.2s ease-out;
}

.letter-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(251, 207, 232, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 14px;
}

.ornament-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--accent-rose);
  opacity: 0.6;
}

.ornament-line::before,
.ornament-line::after {
  content: "";
  display: inline-block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

.cross-icon {
  font-size: 1.1rem;
}

/* 篇章信笺卡片 */
.letter-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px 30px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.45),
    0 0 30px var(--card-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}

.letter-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(253, 164, 175, 0.5), transparent);
}

.letter-card:hover {
  transform: translateY(-3px);
  border-color: rgba(253, 164, 175, 0.35);
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(244, 114, 182, 0.22);
}

.chapter-tag {
  font-size: 0.78rem;
  color: var(--accent-rose);
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-tag::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(253, 164, 175, 0.2), transparent);
}

/* 文本正文排版 */
.letter-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: clamp(1rem, 2.5vw, 1.12rem);
  color: var(--text-muted);
}

.paragraph {
  letter-spacing: 0.03em;
  line-height: 1.95;
  text-align: justify;
}

.highlight-line {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.12em;
  text-shadow: 0 0 18px rgba(254, 215, 170, 0.35);
  letter-spacing: 0.04em;
}

.special-quote {
  font-weight: 600;
  font-size: 1em;
  padding: 2px 0;
  color: var(--accent-rose);
}

.emphasis-text {
  color: #f1f5f9;
  font-weight: 500;
  border-left: 2px solid var(--accent-purple);
  padding-left: 12px;
  margin: 6px 0;
  background: rgba(192, 132, 252, 0.06);
  border-radius: 0 8px 8px 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

.romantic-line {
  color: #ffedd5;
  font-style: italic;
}

/* 告白篇章区域 */
.final-card {
  border-color: rgba(244, 114, 182, 0.35);
  background: linear-gradient(180deg, rgba(26, 20, 42, 0.8) 0%, rgba(16, 14, 28, 0.9) 100%);
}

/* 祷告深情高光专属殿堂 */
.prayer-sanctuary {
  position: relative;
  margin: 20px 0 24px 0;
  padding: 24px 22px;
  background: radial-gradient(circle at 50% 0%, rgba(253, 224, 71, 0.08) 0%, rgba(244, 114, 182, 0.06) 60%, rgba(192, 132, 252, 0.03) 100%);
  border: 1px solid rgba(253, 164, 175, 0.28);
  border-radius: 16px;
  text-align: center;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 25px rgba(244, 114, 182, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.prayer-glow-dot {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
  animation: starTwinkle 2.5s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.8);
}

.prayer-lead {
  font-size: 0.92rem;
  color: var(--accent-rose);
  letter-spacing: 0.18em;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  opacity: 0.9;
}

.prayer-times {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(1.05rem, 2.8vw, 1.22rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.08em;
  margin: 6px 0;
}

.prayer-times span:not(.prayer-divider) {
  color: #fed7aa;
  text-shadow: 0 0 14px rgba(254, 215, 170, 0.4);
}

.prayer-divider {
  color: var(--accent-rose);
  opacity: 0.6;
  font-size: 1.2rem;
}

.prayer-climax {
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
  margin-top: 8px;
  text-shadow: 0 0 20px rgba(244, 114, 182, 0.5), 0 0 8px rgba(253, 164, 175, 0.4);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.vow-content {
  margin: 18px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.love-declare {
  font-size: clamp(1.22rem, 3vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(244, 114, 182, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  line-height: 1.6;
}

.future-wish {
  font-size: 1.08rem;
  color: #fed7aa;
  line-height: 1.95;
  letter-spacing: 0.04em;
  font-style: italic;
  opacity: 0.95;
}

.letter-signature {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.sign-prefix {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
  letter-spacing: 0.05em;
}

.sign-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-rose);
  letter-spacing: 0.15em;
  text-shadow: 0 0 12px rgba(253, 164, 175, 0.4);
}

/* 底部专属印记与域名卡片 */
.letter-footer {
  text-align: center;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.verse-box {
  margin-bottom: 6px;
}

.blessing-verse {
  font-size: 0.95rem;
  color: var(--accent-rose);
  letter-spacing: 0.18em;
  opacity: 0.88;
}

.domain-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.domain-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.domain-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(253, 164, 175, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.domain-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-rose);
  letter-spacing: 0.15em;
  font-family: var(--font-sans);
}

.domain-subtitle {
  font-size: 0.80rem;
  color: #fed7aa;
  letter-spacing: 0.1em;
  opacity: 0.9;
  font-family: var(--font-serif);
  margin-top: -2px;
  margin-bottom: 2px;
}

.domain-link {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
  transition: color 0.2s ease;
}

.domain-link:hover {
  color: var(--accent-rose);
}

.domain-emails {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #94a3b8;
  font-family: 'SF Mono', 'Courier New', monospace;
  margin-top: 4px;
}

.dot-sep {
  color: rgba(255, 255, 255, 0.2);
}

.copyright {
  font-size: 0.75rem;
  color: #64748b;
  letter-spacing: 0.2em;
  font-family: var(--font-sans);
}

/* ═══════════════════════════════════════════════════
   悬浮音乐播放器
   ═══════════════════════════════════════════════════ */

.music-widget {
  position: fixed;
  right: 0;
  bottom: 32px;
  z-index: 200;
  display: flex;
  align-items: center;
  border-radius: 28px 0 0 28px;
  transition:
    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    padding 0.35s ease;
}

.music-widget:not(.collapsed) {
  transform: translateX(0);
  background: rgba(12, 16, 32, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(244, 114, 182, 0.25);
  border-right: none;
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 6px 0 6px 0;
}

.music-widget.collapsed {
  transform: translateX(35px);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0;
}

.widget-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.28s ease,
    padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  padding: 0;
  font-family: var(--font-sans);
}

.music-widget:not(.collapsed) .widget-panel {
  max-width: 180px;
  opacity: 1;
  padding: 0 8px 0 18px;
}

.track-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}

.track-time {
  font-size: 0.70rem;
  color: #94a3b8;
  font-family: 'SF Mono', 'Courier New', monospace;
  letter-spacing: 0.05em;
}

.widget-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(145deg, #f43f5e 0%, #fb7185 50%, #c084fc 100%);
  color: #fff;
  box-shadow:
    0 0 22px rgba(244, 63, 94, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.widget-btn:hover {
  box-shadow:
    0 0 30px rgba(244, 63, 94, 0.85),
    0 6px 20px rgba(0, 0, 0, 0.45);
  transform: scale(1.06);
}

.widget-btn:active {
  transform: scale(0.91);
}

.icon-disc,
.icon-play,
.icon-pause {
  position: absolute;
  width: 22px;
  height: 22px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.icon-disc {
  opacity: 0;
  transform: scale(0.55);
}

.icon-play {
  opacity: 0;
  transform: scale(0.55);
}

.icon-pause {
  opacity: 0;
  transform: scale(0.55);
}

.music-widget.collapsed .icon-disc {
  opacity: 1;
  transform: scale(1);
}

.music-widget:not(.collapsed).is-paused .icon-play {
  opacity: 1;
  transform: scale(1);
}

.music-widget:not(.collapsed):not(.is-paused) .icon-pause {
  opacity: 1;
  transform: scale(1);
}

.music-widget.collapsed:not(.is-paused) .icon-disc {
  animation: spinDisc 5s linear infinite;
}

@keyframes spinDisc {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式调整 */
@media (max-width: 640px) {
  .main-content {
    padding: 40px 14px 90px;
  }

  .letter-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .confession-highlight {
    padding: 16px;
  }

  .domain-badge-grid {
    grid-template-columns: 1fr;
  }
}