/**
 * 白天 · 开放宇宙玻璃（对齐核心页 me-cosmos 定稿）
 * 供：月历 / 折叠（仅色） / 身体
 * 加载顺序：themeTokens → styles.css → siteTheme → 本文件
 */

:root {
  --cosmos-day-ink: #0f2740;
  --cosmos-day-ink-soft: #15324f;
  --cosmos-day-glass-fill: rgba(255, 255, 255, 0.12);
  --cosmos-day-glass-blur: 34px;
}

/* 身体页 aurora 层（page-me 未加载时也要定位） */
body.body-cosmos .me-cosmos__aurora,
body.body-cosmos .me-cosmos__grid,
body.body-cosmos .cosmos-day-aurora,
body.body-cosmos .cosmos-day-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.body-cosmos .me-page,
body.body-cosmos .body-page-shell {
  position: relative;
  z-index: 1;
}

/* ── 共用 aurora 渐变（可贴在任意 __aurora / .dashboard-bg） ── */
body.theme-day .cosmos-day-aurora,
body.theme-day .me-cosmos__aurora,
body.theme-day .fold-cosmos__aurora,
body.theme-day.is-dashboard .dashboard-bg {
  background:
    radial-gradient(ellipse 60% 70% at 88% 22%, rgba(180, 120, 255, 0.48), transparent 58%),
    radial-gradient(ellipse 55% 60% at 10% 78%, rgba(60, 220, 230, 0.36), transparent 55%),
    radial-gradient(ellipse 50% 48% at 48% 8%, rgba(255, 140, 200, 0.34), transparent 52%),
    radial-gradient(ellipse 40% 40% at 70% 85%, rgba(120, 170, 255, 0.24), transparent 50%),
    linear-gradient(165deg, #eef3ff 0%, #e4ecfb 40%, #f6eaf6 100%) !important;
}

body.theme-day .cosmos-day-grid,
body.theme-day .me-cosmos__grid,
body.theme-day .fold-cosmos__grid {
  opacity: 0.1;
  background-image:
    linear-gradient(rgba(80, 60, 160, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 60, 160, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── 单层高透玻璃壳 ── */
body.theme-day .cosmos-day-glass {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06) 48%, rgba(200, 180, 255, 0.08)),
    var(--cosmos-day-glass-fill) !important;
  backdrop-filter: blur(var(--cosmos-day-glass-blur)) saturate(1.55) !important;
  -webkit-backdrop-filter: blur(var(--cosmos-day-glass-blur)) saturate(1.55) !important;
  border-color: transparent !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(120, 100, 220, 0.06),
    0 16px 40px rgba(70, 50, 140, 0.1) !important;
  color: var(--cosmos-day-ink);
}

/* ══════════════════════════════════════
   月历 · 白天 cosmos
   ══════════════════════════════════════ */
body.theme-day.is-dashboard {
  background: transparent !important;
  background-image: none !important;
  color: var(--cosmos-day-ink);
  --glass-blur: 34px;
}

body.theme-day.is-dashboard .dashboard-bg {
  opacity: 1 !important;
  pointer-events: none !important;
}

body.theme-day.is-dashboard .dashboard-bg__canvas,
body.theme-day.is-dashboard .dashboard-bg__mist,
body.theme-day.is-dashboard .dashboard-bg__vignette {
  opacity: 0 !important;
  visibility: hidden !important;
}

body.theme-day.is-dashboard .panel--month.panel--dashboard-glass,
body.theme-day.is-dashboard .panel--month,
body.theme-day.is-dashboard .panel--month.is-season-spring,
body.theme-day.is-dashboard .panel--month.is-season-summer,
body.theme-day.is-dashboard .panel--month.is-season-autumn,
body.theme-day.is-dashboard .panel--month.is-season-winter {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06) 48%, rgba(200, 180, 255, 0.08)),
    var(--cosmos-day-glass-fill) !important;
  backdrop-filter: blur(var(--cosmos-day-glass-blur)) saturate(1.55) !important;
  -webkit-backdrop-filter: blur(var(--cosmos-day-glass-blur)) saturate(1.55) !important;
  border: 0 !important;
  border-color: transparent !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(120, 100, 220, 0.06),
    0 16px 40px rgba(70, 50, 140, 0.1) !important;
  color: var(--cosmos-day-ink);
}

body.theme-day.is-dashboard .panel--month::before {
  opacity: 0 !important;
  background: none !important;
}

body.theme-day.is-dashboard .month-grid__head,
body.theme-day.is-dashboard .month-grid__head-zh,
body.theme-day.is-dashboard .month-grid__head-en,
body.theme-day.is-dashboard .month-cell,
body.theme-day.is-dashboard .month-nav__label,
body.theme-day.is-dashboard .calendar-toolbar {
  color: var(--cosmos-day-ink);
}

body.theme-day.is-dashboard .month-cell {
  background: transparent !important;
  box-shadow: none !important;
}

body.theme-day.is-dashboard .month-cell:hover,
body.theme-day.is-dashboard .month-cell.is-selected {
  background: rgba(255, 255, 255, 0.28) !important;
}

/* ══════════════════════════════════════
   身体 · 白天 cosmos（浏览壳玻璃；输入仍可读）
   ══════════════════════════════════════ */
body.theme-day.me-body.body-page-body,
body.theme-day.body-page-body.body-cosmos {
  --me-glass-fill: var(--cosmos-day-glass-fill);
  --me-glass-blur: var(--cosmos-day-glass-blur);
  background: transparent !important;
  background-image: none !important;
  color: var(--cosmos-day-ink);
}

body.theme-day.body-page-body .body-page-shell,
body.theme-day.body-page-body .site-header {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

body.theme-day.body-page-body .site-header__title,
body.theme-day.body-page-body .site-header__eyebrow,
body.theme-day.body-page-body .site-header__subtitle,
body.theme-day.body-page-body .body-page__subtitle {
  color: var(--cosmos-day-ink) !important;
  text-shadow: none !important;
}

body.theme-day.body-page-body .body-dashboard__aside,
body.theme-day.body-page-body .body-execution-flow,
body.theme-day.body-page-body .body-execution-flow__intro,
body.theme-day.body-page-body .body-panel--primary,
body.theme-day.body-page-body .body-growth-exhibit,
body.theme-day.body-page-body .growth-line-strip-host--body {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06) 48%, rgba(200, 180, 255, 0.08)),
    var(--cosmos-day-glass-fill) !important;
  backdrop-filter: blur(var(--cosmos-day-glass-blur)) saturate(1.55) !important;
  -webkit-backdrop-filter: blur(var(--cosmos-day-glass-blur)) saturate(1.55) !important;
  border: 0 !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 40px rgba(70, 50, 140, 0.1) !important;
  color: var(--cosmos-day-ink);
}

/* 内层面板不叠第二层 */
body.theme-day.body-page-body .body-panel:not(.body-panel--primary):not(.body-figure-stage),
body.theme-day.body-page-body .body-execution-flow__chain li {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border-color: rgba(26, 90, 150, 0.12) !important;
}

/* 解剖图舞台：白天仍保留深色（可读性） */
body.theme-day.body-page-body .body-figure-stage.panel {
  background: linear-gradient(165deg, #0c1428 0%, #08101c 100%) !important;
  color: #e8f0fa !important;
}

/* 输入面：保持纸白可读 */
body.theme-day.body-page-body input,
body.theme-day.body-page-body select,
body.theme-day.body-page-body textarea {
  background: #ffffff !important;
  color: var(--cosmos-day-ink) !important;
  border-color: rgba(26, 90, 150, 0.22) !important;
}

/* ══════════════════════════════════════
   折叠 · 白天：冷静纸感（单独覆盖，避免糖果粉紫）
   ══════════════════════════════════════ */
body.theme-day.fold-cosmos {
  background: #f3f5f7 !important;
  color: #1a2330;
}

/* 折叠页专用底：雾蓝 + 纸白，压掉共用 aurora 的粉紫 */
body.theme-day.fold-cosmos .fold-cosmos__aurora {
  background:
    radial-gradient(ellipse 50% 45% at 85% 18%, rgba(120, 170, 210, 0.22), transparent 58%),
    radial-gradient(ellipse 45% 40% at 12% 72%, rgba(160, 180, 170, 0.16), transparent 55%),
    linear-gradient(168deg, #f6f7f9 0%, #eef2f5 48%, #f4f1ec 100%) !important;
}

body.theme-day.fold-cosmos .fold-cosmos__grid {
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(40, 60, 80, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 60, 80, 0.07) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 40%, #000 25%, transparent 78%);
}

body.theme-day .fold-cosmos__noise {
  opacity: 0.02;
}

body.theme-day.fold-cosmos .fold-float-nav {
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(30, 45, 65, 0.08),
    0 8px 22px rgba(30, 45, 65, 0.06);
}

body.theme-day.fold-cosmos .fold-float-nav__link {
  color: rgba(30, 45, 65, 0.62);
}

body.theme-day.fold-cosmos .fold-float-nav__link.is-active,
body.theme-day.fold-cosmos .fold-float-nav__link:hover {
  color: #122033;
  background: rgba(30, 45, 65, 0.08);
}

body.theme-day.fold-cosmos .fold-float-nav__link.is-active {
  background: #1a3348;
  color: #f7f8fa;
  box-shadow: none;
}

body.theme-day.fold-cosmos .fold-rail__year,
body.theme-day.fold-cosmos .fold-rail__label,
body.theme-day.fold-cosmos .fold-rail__year-num,
body.theme-day.fold-cosmos .fold-rail__year-gz,
body.theme-day.fold-cosmos .fold-orbit__kicker,
body.theme-day.fold-cosmos .fold-orbit__title,
body.theme-day.fold-cosmos .fold-orbit__pillar,
body.theme-day.fold-cosmos .fold-orbit__foldline,
body.theme-day.fold-cosmos .fold-orbit__how,
body.theme-day.fold-cosmos .fold-orbit__hint,
body.theme-day.fold-cosmos .fold-orbit__meta,
body.theme-day.fold-cosmos .fold-signals__eyebrow,
body.theme-day.fold-cosmos .fold-signals__title,
body.theme-day.fold-cosmos .fold-signals__lead,
body.theme-day.fold-cosmos .fold-signals__empty,
body.theme-day.fold-cosmos .fold-signal__text,
body.theme-day.fold-cosmos .fold-signal__when,
body.theme-day.fold-cosmos .fold-months__chip {
  color: #1a2330;
  text-shadow: none;
}

body.theme-day.fold-cosmos .fold-rail__year {
  color: rgba(26, 35, 48, 0.42);
}

body.theme-day.fold-cosmos .fold-rail__year.is-active,
body.theme-day.fold-cosmos .fold-rail__year:hover {
  color: #122033;
  text-shadow: none;
}

body.theme-day.fold-cosmos .fold-rail__label {
  color: rgba(26, 35, 48, 0.45);
}

body.theme-day.fold-cosmos .fold-rail__svg path {
  stroke: #2a5a6e;
  filter: none;
}

body.theme-day.fold-cosmos .fold-rail__hub {
  border-color: rgba(42, 90, 110, 0.4);
  background: #fff;
  color: #2a5a6e;
  box-shadow: 0 4px 14px rgba(30, 45, 65, 0.1);
}

body.theme-day.fold-cosmos .fold-orbit__how,
body.theme-day.fold-cosmos .fold-orbit__hint,
body.theme-day.fold-cosmos .fold-orbit__foldline,
body.theme-day.fold-cosmos .fold-signals__lead {
  color: rgba(26, 35, 48, 0.68);
}

body.theme-day.fold-cosmos .fold-orbit__meta {
  color: rgba(26, 35, 48, 0.55);
}

body.theme-day.fold-cosmos .fold-signal__name {
  color: #2a5a6e;
}

body.theme-day.fold-cosmos .fold-signal__card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(30, 45, 65, 0.1);
  box-shadow: 0 6px 18px rgba(30, 45, 65, 0.06);
  color: #1a2330;
}

body.theme-day.fold-cosmos .fold-signal__node {
  background: #fff;
  border-color: #2a5a6e;
  box-shadow: none;
}

body.theme-day.fold-cosmos .fold-signal__connector {
  background: rgba(42, 90, 110, 0.35);
  box-shadow: none;
}

body.theme-day.fold-cosmos .fold-glass {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(18px) saturate(1.1) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.1) !important;
  box-shadow:
    0 0 0 1px rgba(30, 45, 65, 0.08),
    0 14px 36px rgba(30, 45, 65, 0.07) !important;
  color: #1a2330;
}

body.theme-day.fold-cosmos .fold-glass__metric-label,
body.theme-day.fold-cosmos .fold-glass__metric-sub,
body.theme-day.fold-cosmos .fold-glass__layers {
  color: rgba(26, 35, 48, 0.55);
}

body.theme-day.fold-cosmos .fold-months {
  background: linear-gradient(180deg, transparent, rgba(243, 245, 247, 0.92) 42%);
}

body.theme-day.fold-cosmos .fold-months__inner {
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 0 0 1px rgba(30, 45, 65, 0.08),
    0 10px 28px rgba(30, 45, 65, 0.08);
}

body.theme-day.fold-cosmos .fold-months__chip {
  background: transparent;
  border-color: transparent;
  color: rgba(26, 35, 48, 0.55);
}

body.theme-day.fold-cosmos .fold-months__chip.is-active {
  color: #fff;
  background: #1a3348;
  box-shadow: 0 6px 16px rgba(26, 51, 72, 0.22);
}
