/* style.css — 各层布局与视觉样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #05070f;
  cursor: crosshair;
}

/* 天空渐变层（由 JS 设置 --sky-top / --sky-bottom） */
#sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: linear-gradient(to bottom, var(--sky-top, #0a1030), var(--sky-bottom, #1a1a3a));
  transition: background 1.2s linear;
}

/* 星空流云 canvas */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* 天体容器 */
#celestial {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* 太阳 */
#sun {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform, opacity;
  transition: opacity 0.6s linear;
}

/* 月亮 */
#moon {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform, opacity;
  transition: opacity 0.6s linear;
}
#moonSvg { width: 100%; height: 100%; overflow: visible; }
#moonDark { fill: #2a2e44; }
#moonLit { fill: #f4f1e4; }

/* 城市剪影 */
#city {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.clayer { transition: transform 0.2s linear; }

/* 窗户：夜间暗淡，白天显示为暗色玻璃 */
.w { opacity: max(0.07, var(--day-win, 0)); transition: opacity 1.5s linear; }
.w.lit { opacity: max(var(--win, 0), var(--day-win, 0)); transition: opacity 1.2s linear; }
.w.lit.night { opacity: max(var(--win, 0), var(--day-win, 0)); transition: opacity 1.2s linear; }
.w.lit.sleep { opacity: max(var(--win-sleep, 0), var(--day-win, 0)); transition: opacity 2s linear; }
/* 白天所有窗户统一显示为暗色玻璃（覆盖夜间暖色填充） */
#city.daytime .w { fill: #7898b0; }

/* 彩虹轨迹 canvas（最顶层） */
#trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 4;
  pointer-events: none;
}

/* ICP 备案（法律要求，最小化呈现） */
#icp {
  position: fixed;
  right: 8px;
  bottom: 4px;
  z-index: 5;
  font: 9px/1 -apple-system, "PingFang SC", system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.22);
  text-decoration: none;
  letter-spacing: 0.5px;
}
#icp:hover { color: rgba(255, 255, 255, 0.5); }
