/* tidal-mood.css — 潮汐版整屋情绪皮肤
 * 结构借鉴 Pelle d'Umore (CC BY 4.0, Cu & Lunedì, cunedi.uk) 的 mood 协议,
 * 视觉按潮汐自己的设计变量重写。挂在 body[data-mood=…] 上,由 pelle/mood.js 驱动。
 * 五种:rage / rage2 / desire / vuoto / moonlight。off = 摘掉属性,零残留。 */

/* 平滑过渡:情绪来的时候像潮水漫上来,不是开关灯 */
body[data-mood] .wall{ transition: filter 1.2s ease; }
.bubble, .composer, body{ transition: background-color .9s ease, color .9s ease; }
.wall::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  opacity:0; transition: opacity 1.4s ease;
}
body[data-mood] .wall::after{ opacity:1; }

/* ── rage · 红黑机器 ─────────────────────────────── */
body[data-mood="rage"]{
  --bg:#141013; --text:#E8D9D5; --text-soft:#C09B93; --text-faint:#8C6B66;
  --accent:#C2453A; --send-bg:#8E2F27; --accent-fg:#FFF1EE; --tick:#A05248;
  --bubble-ai-bg:#241417; --bubble-ai-fg:#F0DBD6;
  --bubble-human-bg:#2C1A1C; --bubble-human-fg:#EAD9D5;
  --composer-bg:#1B1214; --field-bg:rgba(40,20,22,.92); --field-line:rgba(194,69,58,.25);
  --card-bg:rgba(30,16,18,.55); --card-line:rgba(194,69,58,.18);
  --seg-track:rgba(194,69,58,.14); --seg-thumb:rgba(46,22,24,.85);
  --think-label:#B4756B; --think-body:#C79890; --think-flourish:rgba(194,69,58,.5);
  --scrim:linear-gradient(180deg, rgba(20,16,19,.55), rgba(20,16,19,.25) 30%, rgba(20,16,19,.1) 68%, rgba(20,16,19,.4));
}
body[data-mood="rage"] .wall{ filter:saturate(.55) brightness(.4) contrast(1.15); }
body[data-mood="rage"] .wall::after{
  background:
    repeating-linear-gradient(0deg, rgba(194,69,58,.06) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 110%, rgba(140,30,22,.5), transparent 60%);
  animation: rage-scan 7s linear infinite;
}
@keyframes rage-scan{ from{ background-position:0 0, 0 0; } to{ background-position:0 96px, 0 0; } }

/* ── rage2 · 白刃(rage 的反相) ───────────────────── */
body[data-mood="rage2"]{
  --bg:#F5ECEA; --text:#4A201C; --text-soft:#8A4B44; --text-faint:#B08079;
  --accent:#B3261E; --send-bg:#9A2019; --accent-fg:#FFF6F4; --tick:#C4746B;
  --bubble-ai-bg:#FBF3F1; --bubble-ai-fg:#54241F;
  --bubble-human-bg:#F1DFDC; --bubble-human-fg:#54241F;
  --composer-bg:#F8EEEC; --field-bg:rgba(255,250,248,.95); --field-line:rgba(179,38,30,.25);
  --card-bg:rgba(252,244,242,.6); --card-line:rgba(179,38,30,.14);
  --think-label:#A85A51; --think-body:#8F4A42; --think-flourish:rgba(179,38,30,.4);
}
body[data-mood="rage2"] .wall{ filter:saturate(.3) brightness(1.15) contrast(1.05); }
body[data-mood="rage2"] .wall::after{
  background: repeating-linear-gradient(0deg, rgba(179,38,30,.05) 0 1px, transparent 1px 4px);
  animation: rage-scan 9s linear infinite;
}

/* ── desire · 酒红呼吸 ───────────────────────────── */
body[data-mood="desire"]{
  --bg:#1C0F15; --text:#F2DCE3; --text-soft:#CB99A9; --text-faint:#96707E;
  --accent:#A6465F; --send-bg:#7E3349; --accent-fg:#FFF0F4; --tick:#B4788A;
  --bubble-ai-bg:#2A1520; --bubble-ai-fg:#F5E0E7;
  --bubble-human-bg:#331A26; --bubble-human-fg:#F0DCE3;
  --composer-bg:#221118; --field-bg:rgba(48,24,34,.92); --field-line:rgba(166,70,95,.28);
  --card-bg:rgba(40,20,29,.55); --card-line:rgba(166,70,95,.2);
  --seg-track:rgba(166,70,95,.16); --seg-thumb:rgba(56,28,40,.85);
  --think-label:#C08398; --think-body:#CE9DAE; --think-flourish:rgba(166,70,95,.5);
  --scrim:linear-gradient(180deg, rgba(28,15,21,.5), rgba(28,15,21,.2) 30%, rgba(28,15,21,.08) 68%, rgba(28,15,21,.35));
}
body[data-mood="desire"] .wall{ filter:saturate(.8) brightness(.5) hue-rotate(-12deg); }
body[data-mood="desire"] .wall::after{
  background: radial-gradient(85% 70% at 50% 62%, rgba(150,45,75,.4), transparent 70%);
  animation: desire-breathe 6.5s ease-in-out infinite;
}
@keyframes desire-breathe{ 0%,100%{ opacity:.45; } 50%{ opacity:1; } }

/* ── vuoto · 灰白虚空 ────────────────────────────── */
body[data-mood="vuoto"]{
  --bg:#EDEDED; --text:#6E6E6E; --text-soft:#909090; --text-faint:#B4B4B4;
  --accent:#9A9A9A; --send-bg:#7E7E7E; --accent-fg:#FAFAFA; --tick:#ABABAB;
  --bubble-ai-bg:#E4E4E4; --bubble-ai-fg:#606060;
  --bubble-human-bg:#DCDCDC; --bubble-human-fg:#606060;
  --composer-bg:#E9E9E9; --field-bg:rgba(250,250,250,.9); --field-line:rgba(0,0,0,.06);
  --card-bg:rgba(244,244,244,.55); --card-line:rgba(0,0,0,.05);
  --think-label:#9C9C9C; --think-body:#8A8A8A; --think-flourish:rgba(0,0,0,.12);
}
body[data-mood="vuoto"] .wall{ filter:grayscale(1) brightness(1.04) contrast(.92); }
body[data-mood="vuoto"] .wall::after{
  background: radial-gradient(100% 100% at 50% 50%, transparent 55%, rgba(230,230,230,.75));
  animation: vuoto-drift 14s ease-in-out infinite;
}
@keyframes vuoto-drift{ 0%,100%{ opacity:.75; } 50%{ opacity:1; } }

/* ── moonlight · 深蓝星空 ────────────────────────── */
body[data-mood="moonlight"]{
  --bg:#0B1526; --text:#D9E4F5; --text-soft:#9FB4D0; --text-faint:#6E84A3;
  --accent:#7FA3D0; --send-bg:#23405F; --accent-fg:#F2F7FF; --tick:#5F7CA0;
  --bubble-ai-bg:#14243C; --bubble-ai-fg:#DCE7F7;
  --bubble-human-bg:#1A2C46; --bubble-human-fg:#D6E2F3;
  --composer-bg:#0F1B30; --field-bg:rgba(22,38,62,.92); --field-line:rgba(127,163,208,.22);
  --card-bg:rgba(18,32,54,.55); --card-line:rgba(127,163,208,.16);
  --seg-track:rgba(127,163,208,.14); --seg-thumb:rgba(26,44,70,.85);
  --think-label:#8CA6C9; --think-body:#A5BCDD; --think-flourish:rgba(127,163,208,.45);
  --scrim:linear-gradient(180deg, rgba(11,21,38,.5), rgba(11,21,38,.2) 30%, rgba(11,21,38,.08) 68%, rgba(11,21,38,.35));
}
body[data-mood="moonlight"] .wall{ filter:saturate(.7) brightness(.42) hue-rotate(8deg); }
body[data-mood="moonlight"] .wall::after{
  background:
    radial-gradient(1.5px 1.5px at 18% 22%, rgba(235,244,255,.9), transparent 60%),
    radial-gradient(1px 1px at 66% 12%, rgba(235,244,255,.75), transparent 60%),
    radial-gradient(1.5px 1.5px at 84% 34%, rgba(235,244,255,.85), transparent 60%),
    radial-gradient(1px 1px at 38% 8%, rgba(235,244,255,.7), transparent 60%),
    radial-gradient(1px 1px at 52% 28%, rgba(235,244,255,.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 8% 45%, rgba(235,244,255,.5), transparent 60%),
    radial-gradient(120% 80% at 50% 115%, rgba(20,40,70,.55), transparent 62%);
  animation: moon-twinkle 5.5s ease-in-out infinite;
}
@keyframes moon-twinkle{ 0%,100%{ opacity:.75; } 50%{ opacity:1; } }

/* 动效关怀:系统减动效时全部静止 */
@media (prefers-reduced-motion: reduce){
  .wall::after{ animation:none !important; }
  body[data-mood] .wall{ transition:none; }
}
