/* chat-bg.css — 聊天背景特效（逻辑在 chat-bg.js）：好友是代码底纹 + 点空白泛起波纹，和 ta 是缎面 / 月下远山 / 墨梅一枝（随机一种）。
   背景层 .cb-wrap 插在 .ct-root 最前面：在消息、页头、输入栏下面，不挡点击。开关关掉 / 选了别的聊天背景时整层拿掉、.cb-on 去掉，和原来一样。 */

/* 开着时收起信纸横线（代码 / 金纹代替它）；关掉就回到原来的信纸。
   cb-enabled 在 <html> 上（开关开着就有）：默认背景（没有 bg-* 类）的聊天页从插进来的第一帧起就不画横线，不会先闪一下横线再变 */
.app-view.ct-root.cb-on,
:root.cb-enabled .app-view.ct-root:not([class*=" bg-"]) { background: var(--surface); }

/* 背景层淡入（打开聊天、换深浅重画时都柔一点） */
.cb-wrap { animation: cb-in .45s ease-out both; }
@keyframes cb-in { from { opacity: 0; } to { opacity: 1; } }
:root.reduce-motion .cb-wrap { animation: none; }

.cb-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cb-wrap > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }

/* 缎面：一层很淡的光极慢地从左上滑到右下（宽一倍的层只做 transform，不重画） */
.cb-wrap > .cb-sheen { left: -50%; width: 200%; background: linear-gradient(115deg, transparent 35%, var(--cb-sheen) 50%, transparent 65%); animation: cb-sheen 18s ease-in-out infinite alternate; }
@keyframes cb-sheen { from { transform: translateX(-22%); } to { transform: translateX(22%); } }
/* 月下远山：一条薄雾在山腰慢慢飘 */
.cb-wrap > .cb-mist { left: -20%; width: 140%; top: 58%; height: 20%; background: radial-gradient(ellipse 50% 50% at 50% 50%, var(--cb-mist), transparent 70%); animation: cb-drift 26s ease-in-out infinite alternate; }
@keyframes cb-drift { from { transform: translateX(-10%); } to { transform: translateX(10%); } }

/* 不在最上面 / 切到后台：CSS 动画也停；减少动态：完全不动 */
.cb-paused .cb-anim { animation-play-state: paused; }
:root.reduce-motion .cb-anim { animation: none; }
@media (prefers-reduced-motion: reduce) { .cb-anim, .cb-wrap { animation: none; } }

/* ---- 外观总成里的壁纸缩略图（关掉背景特效后才出现） ---- */
.wp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 8px; margin-top: 12px; }
.wp-sw { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.wp-pv { position: relative; width: 100%; max-width: 54px; aspect-ratio: 5 / 6; border-radius: 10px; background-color: var(--d); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s ease, transform .2s ease; }
:root[data-theme="dark"] .wp-pv:not(.wp-lined) { background-color: var(--n); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wp-pv:not(.wp-lined) { background-color: var(--n); } }
.wp-sw:active .wp-pv { transform: scale(.94); }
.wp-sw[aria-checked="true"] .wp-pv { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--clay); }
.wp-sw[aria-checked="true"] .wp-n { color: var(--ink); font-weight: 600; }
.wp-n { font-size: 11px; white-space: nowrap; }
.wp-xuan { background-image: radial-gradient(circle at 30% 30%, rgba(120, 95, 60, .10) 0 .8px, transparent 1.2px), radial-gradient(circle at 70% 60%, rgba(120, 95, 60, .08) 0 .6px, transparent 1px); background-size: 9px 11px, 13px 7px; }
.wp-bahang { background-image: repeating-linear-gradient(90deg, transparent 0 5.5px, rgba(190, 72, 56, .42) 5.5px 6.5px); background-clip: content-box; padding: 6px 5px; box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 4px var(--d), inset 0 0 0 5px rgba(190, 72, 56, .4); }
.wp-cloud { background-image: radial-gradient(circle at 50% 70%, transparent 3.5px, rgba(120, 95, 60, .16) 4px 4.8px, transparent 5.3px); background-size: 16px 14px; }
.wp-lined { background-image: repeating-linear-gradient(180deg, transparent 0 7px, rgba(31, 30, 29, .12) 7px 8px); }
