/* ==============================================
   撑伞人 — 星空深夜模式 (21:00-06:00)
   容器：全站暗色 + 星空粒子 + 暖光点缀
   子功能：今晚话题 / 晚安电台 / 情绪急救箱 / 配对聊天
   ============================================== */

/* ===== 全站暗色覆盖 ===== */
body.night-mode {
  background: #0d1117;
  color: rgba(255,255,255,0.82);
  transition: background 1.2s ease, color 1.2s ease;
}
body.night-mode .nav {
  background: rgba(13,17,23,0.65) !important;
  backdrop-filter: blur(16px);
  border-color: rgba(255,255,255,0.05) !important;
}
body.night-mode .nav .nav-item { color: rgba(255,255,255,0.75); }
body.night-mode .nav .nav-item:hover,
body.night-mode .nav .nav-item.active { color: #c4b5fd; }
body.night-mode .nav.scrolled {
  background: rgba(13,17,23,0.88) !important;
}

/* ===== 星空 Canvas ===== */
#nightStars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}
body.night-mode #nightStars { opacity: 1; }

/* ===== 首页夜间容器 ===== */
body.night-mode .hero-video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13,17,23,0.55);
}
body.night-mode .section {
  background: transparent;
}
body.night-mode .section-header h2 { color: rgba(255,255,255,0.88); }
body.night-mode .section-header .sub { color: rgba(255,255,255,0.45); }

/* ===== 夜间状态栏 ===== */
.night-status {
  display: none;
  position: fixed;
  top: calc(var(--nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 8px 20px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1px;
  gap: 16px;
  align-items: center;
}
body.night-mode .night-status { display: flex; }
.night-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c4b5fd;
  animation: starPulse 2s ease-in-out infinite;
}
@keyframes starPulse {
  0%, 100% { box-shadow: 0 0 4px #c4b5fd; }
  50%      { box-shadow: 0 0 12px #a0c4ff; }
}

/* ==============================================
   今晚话题
   ============================================== */
.topic-banner {
  display: none;
  max-width: 640px;
  margin: 28px auto;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(196,181,253,0.12);
  text-align: center;
  cursor: pointer;
  transition: all 400ms var(--ease);
  position: relative;
  overflow: hidden;
}
body.night-mode .topic-banner { display: block; }
.topic-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,181,253,0.3), transparent);
}
.topic-banner:hover {
  border-color: rgba(196,181,253,0.28);
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}
.topic-banner .topic-label {
  font-size: 11px;
  color: #c4b5fd;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.topic-banner .topic-title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.90);
  margin-bottom: 6px;
}
.topic-banner .topic-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.topic-banner .topic-count {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  border-radius: 12px;
  background: rgba(196,181,253,0.08);
  font-size: 12px;
  color: #c4b5fd;
}

/* ==============================================
   晚安电台 播放器
   ============================================== */
.radio-player {
  display: none;
  max-width: 500px;
  margin: 24px auto;
  padding: 22px 28px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(160,196,255,0.10);
  text-align: center;
}
body.night-mode .radio-player { display: block; }
.radio-player .radio-status {
  font-size: 11px;
  color: #a0c4ff;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.radio-player .radio-title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
}
.radio-player .radio-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.40);
  margin-bottom: 14px;
}
.radio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.radio-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.70);
  font-size: 18px;
  cursor: pointer;
  transition: all 240ms;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-btn:hover {
  background: rgba(160,196,255,0.12);
  border-color: rgba(160,196,255,0.25);
}
.radio-btn.play {
  width: 56px; height: 56px;
  background: rgba(160,196,255,0.15);
  border-color: rgba(160,196,255,0.25);
  font-size: 22px;
}

/* ==============================================
   匿名配对聊天
   ============================================== */
.match-banner {
  display: none;
  max-width: 500px;
  margin: 20px auto;
  padding: 22px 28px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(196,181,253,0.08), rgba(160,196,255,0.06));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(196,181,253,0.15);
  text-align: center;
}
.match-banner.active { display: block; }
.match-banner .match-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.match-banner h4 {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  margin-bottom: 4px;
}
.match-banner .match-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 14px;
}
.match-banner .match-timer {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  background: rgba(196,181,253,0.10);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}
.btn-match {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 28px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(135deg, #a0c4ff, #c4b5fd);
  color: #0d1117;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 320ms;
}
.btn-match:hover {
  box-shadow: 0 4px 24px rgba(160,196,255,0.30);
  transform: translateY(-2px);
}
.btn-match:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==============================================
   情绪急救箱 悬浮按钮
   ============================================== */
.firstaid-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(196,181,253,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(196,181,253,0.20);
  color: #c4b5fd;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 320ms;
  animation: aidFloat 3s ease-in-out infinite;
}
@keyframes aidFloat {
  0%, 100% { box-shadow: 0 0 12px rgba(196,181,253,0.10); }
  50%      { box-shadow: 0 0 24px rgba(196,181,253,0.25); }
}
.firstaid-float:hover {
  background: rgba(196,181,253,0.25);
  border-color: rgba(196,181,253,0.40);
  transform: scale(1.08);
}
/* 只在夜间模式显示 */
.firstaid-float { display: none; }
body.night-mode .firstaid-float { display: flex; }

/* ==============================================
   Responsive
   ============================================== */
@media (max-width: 768px) {
  .night-status { font-size: 11px; gap: 10px; }
  .topic-banner { margin: 20px 16px; padding: 22px 20px; }
  .topic-banner .topic-title { font-size: 16px; }
  .radio-player { margin: 20px 16px; }
  .match-banner { margin: 20px 16px; }
  .firstaid-float {
    bottom: 16px; right: 16px;
    width: 44px; height: 44px; font-size: 20px;
  }
}
