/* ============================================================
 * cosmic-fx.css · 流体云雾动态背景 (v2 · liquid blobs)
 * V117.62 · 2026-11-17 · 【海鸥】
 * ============================================================
 * 用户反馈 v1 (粒子+HUD) 太难看, 要图二图三图四那种
 * 柔和蓝色流体云雾 (水彩晕开/液态玻璃) 的感觉.
 *
 * 实现:
 *   1) 全屏背景: canvas 画 8 个大 blob (低饱和蓝紫), blur 融合
 *   2) 视频预览框: canvas 画 6 个大 blob (青蓝色), blur + screen 融合
 *   3) 删掉所有粒子/能量球/扫描线/HUD 四角装饰
 * ============================================================ */

/* 【V117.69 · 2026-11-17】背景完全静态化 · 不再跑 canvas 流体, 不眩晕 */
/* Canvas 全部停掉 · 换成纯 CSS gradient */
#cosmic-bg, #cosmic-aurora {
  display: none !important;
}

/* body/html 透明让自定义 gradient 层露出 */
html, body {
  background: transparent !important;
  background-image: none !important;
}

/* 纯静态深色星云背景 · 多层径向 gradient · 不动 */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 18% 20%, rgba(96, 110, 180, 0.32) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 70%, rgba(150, 110, 200, 0.26) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 92%, rgba(70, 130, 180, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 75% 10%, rgba(88, 130, 200, 0.2) 0%, transparent 60%),
    linear-gradient(180deg, #0a0d22 0%, #060817 55%, #040612 100%);
}
/* 顶部暗化 vignette · 保证四角不发白 · 字清晰 */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 30%,
    rgba(3, 5, 14, 0.45) 75%,
    rgba(2, 3, 10, 0.75) 100%);
}

/* 老代码的静态 .aurora-bg 层也不要 */
.aurora-bg,
[class*="static-bg"],
[class*="bg-gradient"]:not(.btn):not(button) {
  display: none !important;
}

/* 面板通透但保可读 · 透明度拉回+强 blur 让文字不被背景干扰 */
.panel.glass {
  backdrop-filter: blur(32px) saturate(1.25) brightness(0.98);
  -webkit-backdrop-filter: blur(32px) saturate(1.25) brightness(0.98);
  background-color: rgba(12, 18, 38, 0.62) !important;
  border: 1px solid rgba(140, 180, 240, 0.18) !important;
}

/* 侧边栏 */
.sidebar-slot, .sidebar {
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  background: rgba(8, 12, 28, 0.66) !important;
}

/* 顶部 bar */
.topbar, header, .app-header {
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  background-color: rgba(10, 14, 30, 0.45);
}

/* 登录页卡片 */
.card, .login-card, .auth-card {
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  background-color: rgba(12, 18, 38, 0.66) !important;
  border: 1px solid rgba(140, 180, 240, 0.16) !important;
}

/* ============================================================
 * 字体可读性 · 全局加强
 * 流体背景虽美, 但文字是主角 · 核心是对比度和阴影托底
 * ============================================================ */

/* 1) 面板内文字基础加亮 + 轻微 text-shadow */
.panel.glass,
.card, .login-card, .auth-card,
.sidebar-slot, .sidebar {
  color: #ecf1ff;
}

.panel.glass h1, .panel.glass h2, .panel.glass h3, .panel.glass h4,
.card h1, .card h2, .card h3, .card h4,
.panel.glass .section-title, .panel.glass .title, .panel.glass label {
  color: #f6f9ff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 2) 次要/提示文字 (var(--text-2) / var(--text-dim)) 托底加亮 */
.panel.glass small, .panel.glass .hint, .panel.glass .muted, .panel.glass .note,
.panel.glass .caption, .panel.glass .desc, .panel.glass .subtitle,
.card small, .card .hint, .card .muted {
  color: rgba(205, 220, 250, 0.88) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* 3) 普通 p / span / div 在面板内加微阴影保证背景过亮时仍可读 */
.panel.glass p, .panel.glass span, .panel.glass div,
.card p, .card span, .card div {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* 4) 侧边栏 nav 文字 */
.sidebar-slot .nav-item, .sidebar .nav-item {
  color: #e8edff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* 5) 输入框/文本框底色加深 + 边框加亮 → 保证输入内容可读 */
.panel.glass input[type="text"],
.panel.glass input[type="email"],
.panel.glass input[type="password"],
.panel.glass input[type="number"],
.panel.glass textarea,
.panel.glass select,
.card input, .card textarea, .card select,
.login-card input, .auth-card input {
  background-color: rgba(6, 12, 28, 0.72) !important;
  border-color: rgba(140, 180, 240, 0.28) !important;
  color: #f0f4ff !important;
  text-shadow: none;
}
.panel.glass input:focus, .panel.glass textarea:focus,
.card input:focus, .login-card input:focus, .auth-card input:focus {
  background-color: rgba(8, 16, 36, 0.85) !important;
  border-color: rgba(120, 180, 255, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(80, 140, 255, 0.18) !important;
}

/* 6) 模型卡片 (选择模型区域) 底色加深 · 独立可读区 */
.model-card, [class*="model-card"], .model-tile, .model-item,
[data-model-id], .selectable-card, .choice-card {
  background-color: rgba(10, 16, 36, 0.60) !important;
  border: 1px solid rgba(140, 180, 240, 0.18) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.model-card.active, .model-card.selected, .selectable-card.active,
[class*="model-card"].active, [class*="model-card"].selected {
  background-color: rgba(18, 28, 60, 0.78) !important;
  border-color: rgba(120, 180, 255, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(120, 180, 255, 0.2), 0 4px 18px rgba(80, 140, 255, 0.22);
}

/* 7) 标签/徽章 (720p 支持出声 等) 加深背景 */
.badge, .tag, .pill, .chip, [class*="badge"], [class*="tag-"] {
  text-shadow: none;
}

/* 8) 公告面板的字 */
[class*="announce"], [class*="notice"], .ann-list, .gen-ann, .gen-ann-list {
  color: #e8edff !important;
}

/* V117.69: canvas 已 display:none, 以下旧 filter 规则不再生效, 保留以防样式回退 */
#cosmic-bg { filter: none; }
#cosmic-aurora { filter: none; opacity: 0; }

/* ============================================================
 * 【V117.65】顶部跑马灯公告栏
 * 只在 is_marquee=true 的公告上滚, 其他公告仍只在"公告动态"页显示
 * 位置: 在 header 下方, content 之上 · 横幅式贴顶
 * ============================================================ */
.marquee-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: linear-gradient(90deg,
    rgba(80, 140, 255, 0.14),
    rgba(180, 100, 255, 0.12),
    rgba(0, 220, 200, 0.14));
  border-bottom: 1px solid rgba(140, 180, 240, 0.22);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  color: #ecf1ff;
  font-size: 13px;
  position: relative;
  overflow: hidden;
  min-height: 42px;
  z-index: 10;
}

.marquee-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: rgba(130, 200, 255, 0.95);
  filter: drop-shadow(0 0 6px rgba(100, 180, 255, 0.5));
  animation: marquee-icon-pulse 2.4s ease-in-out infinite;
}
@keyframes marquee-icon-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.75; }
}

.marquee-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 22px;
  mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

.marquee-track {
  display: inline-flex;
  gap: 60px;
  white-space: nowrap;
  animation: marquee-scroll linear infinite;
  animation-duration: 40s;
  will-change: transform;
  padding-left: 10px;
}
.marquee-viewport:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ecf1ff;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, text-shadow 0.2s;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.marquee-item:hover {
  color: #7bdcff;
  text-shadow: 0 1px 6px rgba(123, 220, 255, 0.5);
}
.marquee-item::before {
  content: "●";
  color: rgba(120, 200, 255, 0.55);
  margin-right: 4px;
  font-size: 9px;
  vertical-align: middle;
}
.marquee-item.marquee-pinned::before {
  content: "📌";
  font-size: 11px;
  color: rgba(255, 190, 90, 0.95);
}
/* 标题加亮 · 内容稍淡形成层次 */
.marquee-item .marquee-title {
  font-weight: 700;
  color: #ffffff;
}
.marquee-item .marquee-sep {
  color: rgba(130, 180, 240, 0.6);
  margin: 0 4px;
}
.marquee-item .marquee-body {
  color: rgba(220, 230, 250, 0.82);
  font-weight: 400;
}
.marquee-item:hover .marquee-title { color: #7bdcff; }
.marquee-item:hover .marquee-body { color: rgba(230, 240, 255, 0.95); }

.marquee-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: rgba(200, 220, 250, 0.55);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s;
}
.marquee-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* 移动端: 跑马灯更紧凑 */
@media (max-width: 768px) {
  .marquee-bar { padding: 7px 10px; font-size: 12px; min-height: 36px; }
  .marquee-track { animation-duration: 28s; gap: 36px; }
}

/* 全屏 Aurora 极光层 · 在 cosmic-bg 上面, 面板下面 · 加强可见度 */
#cosmic-aurora {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(10px) saturate(1.4);
  -webkit-filter: blur(10px) saturate(1.4);
  opacity: 1.0;
}

/* ---------- 2) 视频预览流体容器 ---------- */
.preview-box {
  position: relative;
  /* 深色基底, canvas 画流体云雾叠在上面 */
  background: #050912 !important;
  border: 1px solid rgba(80, 140, 200, 0.18) !important;
  box-shadow:
    0 0 0 1px rgba(80, 140, 200, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  border-radius: var(--radius-md, 12px);
}

/* 真视频播放时隐藏流体 */
.preview-box.has-video #cosmic-preview-canvas {
  display: none !important;
}

/* 预览框内部的流体 canvas · blur 制造水彩晕开感 */
#cosmic-preview-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  filter: blur(6px) saturate(1.15);
  -webkit-filter: blur(6px) saturate(1.15);
  will-change: filter;
}

/* 全屏背景加轻微 blur 让 blob 边缘融合更自然 */
#cosmic-bg {
  filter: blur(4px);
  -webkit-filter: blur(4px);
  will-change: filter;
}

/* preview-placeholder / 生成中文字 · 抬到最上层 */
#preview-placeholder,
.preview-box .gen-progress,
.preview-box .gen-stage {
  position: relative;
  z-index: 4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
#preview-placeholder {
  color: rgba(220, 235, 255, 0.92) !important;
}
#preview-placeholder svg {
  opacity: 0.8 !important;
  filter: drop-shadow(0 0 10px rgba(100, 180, 255, 0.5));
}

/* ---------- 3) 导航项轻量 hover (保留) ---------- */
.nav-item {
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.nav-item:hover {
  background: rgba(80, 140, 220, 0.08);
}
.nav-item.active {
  background: rgba(80, 140, 220, 0.14);
  box-shadow: inset 2px 0 0 rgba(120, 180, 255, 0.6);
}

/* ---------- 4) 性能/无障碍降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  #cosmic-bg, #cosmic-preview-canvas { opacity: 0.6; }
}

@media (max-width: 768px) {
  #cosmic-bg { opacity: 0.75; }
}
