/* ========== 页面背景 ========== */
:root {
  --day-bg: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 50%, #98FB98 100%);
  --night-bg: linear-gradient(180deg, #0a0e27 0%, #1a1a3e 50%, #2d2d5a 100%);
  --transition-duration: 0.8s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--night-bg);
  transition: background var(--transition-duration) ease;
  position: relative;
}

body.day-mode {
  background: var(--day-bg);
}

/* ========== 主题切换覆盖层 ========== */
.theme-transition-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ========== 星空粒子 ========== */
.stars-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.8s ease;
}

body.day-mode .stars-layer {
  opacity: 0;
}

.star-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ========== 阳光光束 ========== */
.sun-rays {
  position: fixed;
  top: -50%;
  right: -20%;
  width: 150%;
  height: 150%;
  background: radial-gradient(ellipse at center, rgba(255, 223, 148, 0.3) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.day-mode .sun-rays {
  opacity: 1;
}

/* ========== 云朵 ========== */
.clouds-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.day-mode .clouds-layer {
  opacity: 1;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50px;
  animation: float-cloud var(--float-duration, 20s) linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud::before {
  width: 60%;
  height: 120%;
  top: -60%;
  left: 15%;
}

.cloud::after {
  width: 40%;
  height: 100%;
  top: -40%;
  left: 45%;
}

@keyframes float-cloud {
  from { transform: translateX(-200px); }
  to { transform: translateX(calc(100vw + 200px)); }
}

/* ========== 月光效果 ========== */
.moon-glow {
  position: fixed;
  top: 10%;
  left: 10%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 255, 200, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.8s ease;
}

body.day-mode .moon-glow {
  opacity: 0;
}

/* ========== 音量控制面板 ========== */
.volume-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 15px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 100;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.volume-panel:hover {
  opacity: 1;
}

.volume-icon {
  width: 20px;
  height: 20px;
  color: white;
}

#volumeSlider {
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#volumeSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========== 自定义 theme-button ========== */
theme-button {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
}
