@charset "UTF-8";
/* ============================================================
   moonwater.css —— 全站动态背景「月在水上」六层（11-29 品牌定稿）

   基准件＝工作区根 `潺月居_网站风格背景.html`。本文件把它拆成：
     1. 月晕（.mw-glow-outer > .mw-glow）：外层吃视差与滚动，内层做 12s 呼吸；
     2. 宣纸微纹（.mw-paper）：data-URI SVG 噪声，无外链图片；
     3. 三弦水纹（.mw-w1/.mw-w2/.mw-w3 > .mw-shift > .mw-bob > svg）：
        外层吃视差、中层反向漂移（26/34/44s）、内层纵向微伏（9/11/13s），
        三层嵌套分离，互不抢 transform；
     4. 月影碎银（.mw-refl）：约 45s 一次"风过"，静默期占 86%，事件感靠长静默。

   工程纪律（照搬基准件，不许破）：
     · 只用 transform/opacity 动画，不动 width/top/background；
     · 朱砂不进任何背景层：光晕与碎银只用月白—雾青的中性色；
     · prefers-reduced-motion 时全部停为静态构图（文件末尾）；
     · 层一律 z-index:-1，压在正文之下、body 底色之上，
       不参与内容层的堆叠上下文，页面不必为它改 z-index。

   这些 DOM 由 js/moonwater.js 建，页面正文不需要手写结构。
   ============================================================ */

:root{
  --mw-glow: rgba(255,253,246,.85);  /* 月晕：牙白纸上反出来的那点亮，不用冷白 */
  --mw-refl: rgba(255,253,246,.10);  /* 碎银 */
  --mw-wave: var(--ink);             /* 水纹描边＝松烟，跟字色同族 */
  --mw-paper-op: .5;
}
html[data-theme="night"]{
  --mw-glow: rgba(228,229,218,.13);  /* 乌金上只能有一层很淡的月白，再亮就刺眼 */
  --mw-refl: rgba(228,229,218,.07);
  --mw-paper-op: .28;
}

.mw-layer{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* ── 1. 月晕：外层跟随鼠标/滚动，内层做呼吸 ── */
.mw-glow-outer{
  transform: translate3d(calc(var(--mx, 0) * 30px), calc(var(--my, 0) * 30px + var(--sy, 0) * 0.05px), 0);
  transition: transform 1.2s ease-out;
}
.mw-glow{
  position: absolute;
  inset: 0;
  background: radial-gradient(42vmax 42vmax at 82% -8%, var(--mw-glow), transparent 60%);
  animation: mw-breathe 12s ease-in-out infinite;
}
@keyframes mw-breathe{
  0%,100%{ transform: scale(1); opacity: 1; }
  50%{ transform: scale(1.08); opacity: .82; }
}

/* ── 2. 宣纸微纹 ── */
.mw-paper{
  opacity: var(--mw-paper-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ── 3. 三弦水纹 ── */
.mw-waves{
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26vh;
  min-height: 150px;
}
.mw-wlayer{ position: absolute; left: 0; right: 0; }
.mw-w1{
  bottom: 38%; opacity: .10;
  transform: translate3d(calc(var(--mx, 0) * -6px), calc(var(--sy, 0) * -0.02px), 0);
  transition: transform 1.4s ease-out;
}
.mw-w2{
  bottom: 20%; opacity: .07;
  transform: translate3d(calc(var(--mx, 0) * 12px), calc(var(--sy, 0) * -0.05px), 0);
  transition: transform 1.4s ease-out;
}
.mw-w3{
  bottom: 4%; opacity: .05;
  transform: translate3d(calc(var(--mx, 0) * -20px), calc(var(--sy, 0) * -0.08px), 0);
  transition: transform 1.6s ease-out;
}
.mw-shift{
  width: min(1400px, 120vw);
  margin-left: 50%;
  transform: translateX(-50%);
}
.mw-w1 .mw-shift{ animation: mw-driftL 26s linear infinite alternate; }
.mw-w2 .mw-shift{ animation: mw-driftR 34s linear infinite alternate; }
.mw-w3 .mw-shift{ animation: mw-driftL 44s linear infinite alternate; }
@keyframes mw-driftL{
  from{ transform: translateX(-50%); }
  to{ transform: translateX(calc(-50% - 40px)); }
}
@keyframes mw-driftR{
  from{ transform: translateX(calc(-50% - 40px)); }
  to{ transform: translateX(-50%); }
}
.mw-bob{ animation: mw-bob 9s ease-in-out infinite; }
.mw-w2 .mw-bob{ animation-duration: 11s; animation-delay: -3s; }
.mw-w3 .mw-bob{ animation-duration: 13s; animation-delay: -6s; }
@keyframes mw-bob{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-3px); }
}
.mw-shift svg{ display: block; }
.mw-waves path{
  fill: none;
  stroke: var(--mw-wave);
  stroke-linecap: round;
  transition: stroke 2.5s ease;
}

/* ── 4. 月影碎银：约 45s 一次"风过" ── */
.mw-refl{
  inset: auto;
  left: 64%;
  bottom: 16%;
  width: 16vmax;
  height: 4.5vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--mw-refl), transparent);
  animation: mw-shimmer 45s ease-in-out infinite;
}
@keyframes mw-shimmer{
  0%,86%,100%{ opacity: .9; transform: scaleX(1); }
  90%{ opacity: .25; transform: scaleX(1.25) translateX(4px); }
  93%{ opacity: .6; transform: scaleX(1.08) translateX(-3px); }
  96%{ opacity: .3; transform: scaleX(1.18) translateX(2px); }
}

/* ── 昼夜翻面时背景跟着渐变，和 body 底色同节奏 ── */
.mw-glow, .mw-refl, .mw-paper{ transition: background 2.5s ease, opacity 2.5s ease; }

/* ============ 降级 ============ */
/* 触屏没有鼠标视差：只留呼吸与漂移，省掉跟随鼠标的两层 transition */
@media (hover: none){
  .mw-glow-outer, .mw-w1, .mw-w2, .mw-w3{ transition: none; }
}
/* 窄屏（手机）只保留月晕呼吸＋两层水纹：碎银与第三根弦在 360px 宽上
   会挤成一条糊线，反而脏。DOM 由 js 侧同样少建，见 moonwater.js。 */
@media (max-width: 640px){
  .mw-refl, .mw-w3{ display: none; }
}

/* ── 无障碍：减少动态时全部停为静态构图（层还在，画面仍是"月在水上"） ── */
/* 注意特异性：漂移动画挂在 .mw-w1/.mw-w2/.mw-w3 的 .mw-shift 上（0,2,0），
   只写 .mw-shift{animation:none}（0,1,0）盖不住，实测会漏掉三根弦的水纹漂移。
   基准件 `潺月居_网站风格背景.html` 就是漏在这一条上，这里按同特异性逐个点名。 */
@media (prefers-reduced-motion: reduce){
  .mw-glow, .mw-bob, .mw-refl{ animation: none; }
  .mw-w1 .mw-shift, .mw-w2 .mw-shift, .mw-w3 .mw-shift{ animation: none; }
  .mw-glow-outer, .mw-w1, .mw-w2, .mw-w3{ transition: none; }
}
