/*
  作者：三人团队制作
  策划：李子卓
  代码：戴宇航
  UI：吴炎烽
  ==========================================================================
   云帆Ai 统一样式系统 - 企业级深色主题（默认）+ 浅色主题切换
   ========================================================================== */

/* ---- 深色主题（默认） ---- */
:root,
[data-theme="dark"] {
  /* 背景层级（从深到浅） */
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-hover: #1c2230;
  --bg-active: #21262d;
  --bg-input: #0d1117;

  /* 边框 */
  --border: #30363d;
  --border-strong: #484f58;
  --border-subtle: #21262d;

  /* 文字 */
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;

  /* 强调色（即梦AI 紫蓝渐变） */
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-light: rgba(99, 102, 241, 0.14);
  --accent-glow: rgba(99, 102, 241, 0.42);

  /* 语义色 */
  --success: #3fb950;
  --success-light: rgba(63, 185, 80, 0.12);
  --warning: #d29922;
  --warning-light: rgba(210, 153, 34, 0.12);
  --danger: #f85149;
  --danger-light: rgba(248, 81, 73, 0.12);
  --info: #58a6ff;
  --info-light: rgba(88, 166, 255, 0.12);

  /* 聊天气泡 */
  --user-bubble: #6366f1;
  --user-text: #ffffff;
  --assistant-bubble: #161b22;

  /* 渐变 */
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  --gradient-bg: radial-gradient(ellipse at top, #1a1f2e 0%, #0d1117 60%);

  /* 阴影（深色下更柔和） */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* 玻璃态 */
  --glass-bg: rgba(22, 27, 34, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);

  color-scheme: dark;
}

/* ---- 浅色主题 ---- */
[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-elevated: #ffffff;
  --bg-hover: #f0f2f5;
  --bg-active: #e8ebf0;
  --bg-input: #ffffff;

  --border: #d0d7de;
  --border-strong: #afb8c1;
  --border-subtle: #eaeef2;

  --text: #1f2328;
  --text-secondary: #57606a;
  --text-tertiary: #8c959f;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.10);
  --accent-glow: rgba(99, 102, 241, 0.28);

  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0969da;
  --info-light: #ddf4ff;

  --user-bubble: #6366f1;
  --user-text: #ffffff;
  --assistant-bubble: #ffffff;

  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-bg: radial-gradient(ellipse at top, #ffffff 0%, #f6f8fa 60%);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 12px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.06);

  color-scheme: light;
}

/* 主题切换动画：平滑过渡所有颜色 */
:root,
[data-theme] {
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 0.22s;
  --duration-slow: 0.4s;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  transition: background-color var(--duration-slow) var(--ease), color var(--duration) var(--ease);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.6;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; }

a { color: var(--accent); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--accent-hover); }

/* 滚动条 - 企业级细窄风格 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 5px;
  border: 2px solid transparent; background-clip: padding-box;
  transition: background var(--duration) var(--ease);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: padding-box; border: 2px solid transparent; }

/* 选中文本配色 */
::selection { background: rgba(128, 144, 160, 0.35); color: inherit; }

/* 焦点可见性（无障碍） */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   主题切换按钮
   ========================================================================== */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius-full); background: var(--bg-elevated);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--accent); border-color: var(--accent);
  transform: rotate(15deg) scale(1.05);
  box-shadow: var(--shadow-glow);
}
.theme-toggle:active { transform: rotate(15deg) scale(0.95); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ==========================================================================
   按钮系统 - 企业级质感
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text); cursor: pointer;
  font-weight: 500; white-space: nowrap; user-select: none;
  transition: all var(--duration) var(--ease); position: relative; overflow: hidden;
}
.btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 50%);
  opacity: 0; transition: opacity var(--duration) var(--ease);
}
.btn:hover { background: var(--bg-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--gradient-accent); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover { background: var(--gradient-accent-hover); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #c53030; box-shadow: 0 4px 12px rgba(248,81,73,0.3); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* 按钮波纹点击效果 */
.btn::after {
  content: ""; position: absolute; width: 0; height: 0;
  border-radius: 50%; background: rgba(255,255,255,0.4);
  transform: translate(-50%, -50%); left: var(--ripple-x, 50%); top: var(--ripple-y, 50%);
  transition: width 0.5s var(--ease-out), height 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
  opacity: 0; pointer-events: none;
}
.btn:active::after { width: 300px; height: 300px; opacity: 0; transition: 0s; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); transform: scale(1.05); }
.icon-btn:active { transform: scale(0.95); }

/* ==========================================================================
   表单 - 企业级输入控件
   ========================================================================== */
.field { margin-bottom: 18px; }
.field > label:not(.switch-row):not(.terms-check) { display: block; margin-bottom: 7px; font-weight: 500; font-size: 14px; color: var(--text-secondary); }
.input, .textarea, .select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text);
  transition: all var(--duration) var(--ease); outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }

/* ==========================================================================
   聊天页面布局
   ========================================================================== */
.chat-app { display: flex; height: 100vh; overflow: hidden; }

/* 侧边栏 */
.sidebar {
  width: 270px; flex-shrink: 0; background: var(--bg-elevated);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transition: margin-left var(--duration) var(--ease);
}
.sidebar.collapsed { margin-left: -270px; }

.sidebar-header {
  padding: 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 800; box-shadow: var(--shadow-sm);
}

.new-chat-btn { margin: 12px; }

.session-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }

.session-item {
  padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer;
  margin-bottom: 3px; transition: all var(--duration) var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.session-item:hover { background: var(--bg-hover); }
.session-item.active { background: var(--accent-light); color: var(--accent); }
.session-item .session-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px;
}
.session-item .session-del {
  opacity: 0; transition: opacity var(--duration) var(--ease);
  border: none; background: transparent; color: var(--text-tertiary); cursor: pointer;
  padding: 4px; border-radius: 6px; line-height: 1;
}
.session-item:hover .session-del { opacity: 1; }
.session-item .session-del:hover { color: var(--danger); background: var(--danger-light); }

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px;
}
.sidebar-footer .btn { flex: 1; }

/* 主聊天区 */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.chat-header {
  padding: 12px clamp(12px,2vw,20px); border-bottom: 1px solid var(--border);
  background: var(--bg-elevated); display: flex; align-items: center; gap: 12px;
  z-index: 5;
}
.chat-header .menu-toggle { display: none; }
/* 桌面端：侧栏收起后显示菜单按钮，以便重新展开（修复收起后无法打开） */
.sidebar.collapsed ~ .chat-main .chat-header .menu-toggle { display: inline-flex; }
.chat-title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 模型选择器 */
.model-selector { position: relative; }
.model-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--bg-elevated); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all var(--duration) var(--ease); color: var(--text);
}
.model-btn:hover { border-color: var(--accent); color: var(--accent); }
.model-btn .model-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.model-btn .model-dot.off { background: var(--text-tertiary); }
.model-btn .chevron { transition: transform var(--duration) var(--ease); }
.model-btn.open .chevron { transform: rotate(180deg); }

.model-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; width: 320px; max-height: 380px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; display: none; flex-direction: column;
  z-index: 100;
}
.model-dropdown.open { display: flex; animation: dropIn 0.18s var(--ease-out); }
.model-search { padding: 10px 10px 10px 36px; border-bottom: 1px solid var(--border); position: relative; }
.model-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); width: 16px; height: 16px;
}
.model-search .search-icon svg { width: 16px; height: 16px; }
.model-hint {
  padding: 8px 14px; font-size: 12px; color: var(--text-tertiary);
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.model-hint svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--warning); }
.model-list { overflow-y: auto; }
.model-option {
  padding: 10px 14px; cursor: pointer; transition: background var(--duration) var(--ease);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.model-option:hover { background: var(--bg-hover); }
.model-option.selected { background: var(--accent-light); }
.model-option .m-id { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; min-width: 0; }
.model-option .m-id .ic { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-tertiary); }
.model-option.selected .m-id { color: var(--accent); }
.model-option.selected .m-id .ic { color: var(--accent); }
.model-option .m-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-option .m-tags { display: flex; gap: 4px; flex-shrink: 0; }
.m-tag {
  font-size: 10px; padding: 2px 7px; border-radius: var(--radius-full);
  background: var(--bg-active); color: var(--text-secondary); white-space: nowrap;
}
.m-tag-rec { background: var(--success-light); color: var(--success); font-weight: 600; }
.model-source-tag {
  padding: 8px 14px; font-size: 11px; color: var(--text-tertiary);
  border-top: 1px solid var(--border); background: var(--bg);
}

/* 消息区 */
.messages {
  flex: 1; overflow-y: auto; padding: clamp(16px,2vw,24px) 0; scroll-behavior: smooth;
}
.messages-inner { width: 100%; max-width: none; margin: 0; padding: 0 clamp(14px,2.5vw,24px); }

.message {
  display: flex; gap: 14px; margin-bottom: 28px;
  animation: msgIn 0.35s var(--ease-out);
}
.message.user { flex-direction: row-reverse; }

.avatar {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.message.assistant .avatar {
  background: var(--gradient-accent); color: #fff;
}
.message.user .avatar { background: var(--bg-active); color: var(--text-secondary); }

.bubble {
  max-width: 76%; padding: 12px 16px; border-radius: var(--radius-lg);
  line-height: 1.7; word-break: break-word; overflow-wrap: anywhere; position: relative;
}
.message.assistant .bubble {
  background: var(--assistant-bubble); border: 1px solid var(--border);
  border-top-left-radius: 4px; box-shadow: var(--shadow-sm);
}
.message.user .bubble {
  background: var(--user-bubble); color: var(--user-text);
  border-top-right-radius: 4px;
}
.bubble pre {
  background: #1e1e2e; color: #e4e4e7; padding: 14px 16px; border-radius: var(--radius-sm);
  overflow-x: auto; margin: 10px 0; font-size: 13px; line-height: 1.6;
}
.bubble code {
  font-family: "SF Mono", "Fira Code", Consolas, monospace; font-size: 13px;
}
.bubble p { margin: 0; }
.bubble p + p { margin-top: 10px; }
.bubble ul, .bubble ol { margin: 8px 0 8px 22px; }
/* 段落间空行用 <br><br> 时控制间距，避免过高 */
.bubble br + br { line-height: 1; }
.bubble h1, .bubble h2, .bubble h3 { margin: 14px 0 8px; line-height: 1.4; }
.bubble h1 { font-size: 18px; }
.bubble h2 { font-size: 16px; }
.bubble h3 { font-size: 15px; }
.bubble li { margin: 3px 0; }
.bubble strong { font-weight: 600; }
.bubble .md-code {
  background: var(--bg-active); padding: 2px 5px; border-radius: 4px; font-size: 12.5px;
}
.message.user .bubble .md-code { background: rgba(255,255,255,0.18); }

/* 打字光标 */
.typing-cursor {
  display: inline-block; width: 8px; height: 16px; background: var(--accent);
  border-radius: 2px; margin-left: 2px; vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}

/* 思考指示器 */
.thinking {
  display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 14px;
}
.thinking .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary);
  animation: bounce 1.4s infinite ease-in-out both;
}
.thinking .dot:nth-child(2) { animation-delay: 0.16s; }
.thinking .dot:nth-child(3) { animation-delay: 0.32s; }

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; text-align: center; color: var(--text-tertiary); padding: 40px;
}
.empty-state .empty-icon {
  position: relative;
  width: 84px; height: 84px; border-radius: 26px; margin-bottom: 24px;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.42), 0 4px 14px rgba(99, 102, 241, 0.24);
  animation: floaty 3s ease-in-out infinite;
}
/* 空状态图标外发光层：模糊渐变光晕 + 错峰 floaty，更灵动 */
.empty-state .empty-icon::after {
  content: ""; position: absolute; inset: -10px; border-radius: inherit;
  background: var(--gradient-accent); filter: blur(22px); opacity: 0.4;
  z-index: -1; pointer-events: none;
  animation: floaty 4.2s ease-in-out infinite;
}
.empty-state h2 { font-size: 22px; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.empty-state p { margin-bottom: 24px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 560px; }
.chip {
  padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated); cursor: pointer; font-size: 14px;
  transition: all var(--duration) var(--ease); text-align: left;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* 输入区 */
.composer {
  padding: 14px clamp(14px,2.5vw,24px) 20px; background: var(--bg); border-top: 1px solid var(--border);
}
.composer-inner {
  max-width: 820px; margin: 0 auto; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 8px 8px 8px 16px; display: flex; align-items: flex-end; gap: 8px;
  transition: all var(--duration) var(--ease); box-shadow: var(--shadow-sm);
}
.composer-inner.drag-over {
  border-color: var(--accent); background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.composer-inner:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.attach-btn { color: var(--text-tertiary); flex-shrink: 0; }
.attach-btn:hover { color: var(--accent); background: var(--accent-light); }
.composer textarea {
  flex: 1; border: none; outline: none; resize: none; background: transparent;
  padding: 8px 0; max-height: 160px; line-height: 1.6;
}
.send-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: #fff; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration) var(--ease);
}
.send-btn:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.05); }
.send-btn:disabled { background: var(--border-strong); cursor: not-allowed; }
.composer-hint { text-align: center; font-size: 12px; color: var(--text-tertiary); margin-top: 8px; max-width: 820px; margin-left: auto; margin-right: auto; }

/* 附件预览区（输入框上方） */
.attach-preview {
  max-width: 820px; margin: 0 auto 8px; display: none; flex-wrap: wrap; gap: 8px;
}
.att-item {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; animation: dropIn 0.2s var(--ease-out);
}
.att-item.att-img {
  padding: 4px; width: 64px; height: 64px;
}
.att-item.att-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.att-file-icon { font-size: 16px; }
.att-file-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file-size { color: var(--text-tertiary); font-size: 11px; }
.att-del {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: var(--danger); color: #fff;
  font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: transform var(--duration) var(--ease);
}
.att-del:hover { transform: scale(1.15); }

/* 消息气泡内的图片 / 文件 */
.bubble-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bubble-img {
  max-width: 200px; max-height: 200px; border-radius: var(--radius-sm);
  cursor: zoom-in; transition: transform 0.25s var(--ease-out); object-fit: cover;
}
.bubble-img:hover { transform: scale(1.02); }
.bubble-img.zoomed {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(2.5);
  z-index: 9999; max-width: 80vw; max-height: 80vh; cursor: zoom-out;
  box-shadow: var(--shadow-lg);
}
.message.user .bubble-img { border: 2px solid rgba(255,255,255,0.3); }
.bubble-files { margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.bubble-file {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--bg-hover); border-radius: var(--radius-sm); font-size: 13px;
}
.message.user .bubble-file { background: rgba(255,255,255,0.15); }
.bf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-size { opacity: 0.7; font-size: 11px; }

/* 视觉模型标识 */
.vision-tag { font-size: 13px; vertical-align: middle; }

/* ==========================================================================
   Toast 通知
   ========================================================================== */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  min-width: 280px; max-width: 420px; padding: 13px 16px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px; pointer-events: auto;
  animation: toastIn 0.3s var(--ease-out);
}
.toast.out { animation: toastOut 0.3s var(--ease) forwards; }
.toast .t-icon { font-size: 18px; flex-shrink: 0; }
.toast .t-content { flex: 1; font-size: 14px; }
.toast .t-title { font-weight: 600; margin-bottom: 2px; }
.toast .t-desc { color: var(--text-secondary); font-size: 13px; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--accent); }
.toast .t-close { cursor: pointer; color: var(--text-tertiary); padding: 2px; }

/* ==========================================================================
   管理后台
   ========================================================================== */
.admin-app { min-height: 100vh; background: var(--bg); }
.admin-header {
  background: var(--glass-bg); backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 32px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.admin-header .logo { font-size: 18px; }
.admin-nav { display: flex; gap: 4px; }
.admin-nav a {
  padding: 8px 16px; border-radius: var(--radius-sm); color: var(--text-secondary);
  font-weight: 500; transition: all var(--duration) var(--ease);
}
.admin-nav a:hover { background: var(--bg-hover); color: var(--text); }
.admin-nav a.active { background: var(--accent-light); color: var(--accent); }

.admin-body { max-width: 760px; margin: 0 auto; padding: 32px 24px 64px; }

.admin-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px,2vw,28px); margin-bottom: clamp(16px,1.5vw,20px); box-shadow: var(--shadow-sm);
  animation: cardIn 0.4s var(--ease-out);
}
.admin-card h2 { font-size: 18px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.admin-card .card-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
}
.status-badge.ok { background: var(--success-light); color: var(--success); }
.status-badge.err { background: var(--danger-light); color: var(--danger); }
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #eef1fe 0%, #f7f8fa 50%, #f3eefe 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--bg-elevated); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 20px 24px; animation: cardIn 0.5s var(--ease-out);
}
.login-card .logo { justify-content: center; margin-bottom: 10px; flex-direction: column; gap: 8px; }
.login-card h1 { font-size: 19px; text-align: center; }
.login-card .sub { text-align: center; color: var(--text-secondary); font-size: 12.5px; margin-bottom: 12px; }

/* ==========================================================================
   动画关键帧
   ========================================================================== */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px); }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}

/* ==========================================================================
   图标尺寸（兼容两种情况：Lucide <i data-lucide> 替换后生成的 svg，
   以及 JS 动态注入的内联 .ic svg。核心规则：一律作用于 svg，而不是 i 元素）
   ========================================================================== */

/* 1) SVG 全局基础尺寸：默认 16×16，由具体容器覆盖 */
svg.ic, svg.lucide { width: 16px; height: 16px; flex-shrink: 0; vertical-align: middle; }

/* 2) SVG 在不同容器中的尺寸覆盖（作用于 svg 本身，而不是父容器） */
.icon-btn svg { width: 20px; height: 20px; }
.attach-btn svg { width: 20px; height: 20px; }
.btn svg { width: 16px; height: 16px; }
.btn-lg svg { width: 18px; height: 18px; }
.empty-icon svg { width: 44px; height: 44px; color: #ffffff; stroke-width: 2.2; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.28)); }
.chip svg { width: 14px; height: 14px; }
.admin-card h2 svg { width: 18px; height: 18px; }
.composer-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.t-icon svg { width: 20px; height: 20px; }
.t-close svg { width: 14px; height: 14px; }
.bf-icon svg { width: 16px; height: 16px; }
.att-file-icon svg { width: 16px; height: 16px; }
.att-del svg { width: 10px; height: 10px; }
.modal-icon svg { width: 24px; height: 24px; }
.model-hint svg { width: 14px; height: 14px; }
.session-item svg.lucide,
.session-item svg.ic { width: 16px; height: 16px; opacity: 0.5; color: var(--text-tertiary); }
.session-del svg { width: 14px; height: 14px; }
.search-icon svg { width: 16px; height: 16px; }
.model-option svg { width: 15px; height: 15px; }

/* 3) 内联 SVG 基类：.ic 本身是 <svg>（JS 里直接注入 SVG 字符串），
   也可能是外层包裹容器（此时内部 svg 取 100% 自适应父容器） */
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { width: 100%; height: 100%; }

/* 4) 模型按钮（关键：强制内部图标不撑大按钮） */
.model-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--bg-elevated); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all var(--duration) var(--ease); color: var(--text);
  max-height: 40px; overflow: hidden;
}
.model-btn:hover { border-color: var(--accent); color: var(--accent); }
.model-btn .model-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.model-btn .model-dot.off { background: var(--text-tertiary); }
#modelLabel {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.2;
}
#modelLabel svg { width: 16px; height: 16px; flex-shrink: 0; }
.model-btn .chevron,
.model-btn .chevron-icon { width: 14px; height: 14px; transition: transform var(--duration) var(--ease); flex-shrink: 0; }
.model-btn.open .chevron,
.model-btn.open .chevron-icon { transform: rotate(180deg); }

/* ==========================================================================
   模态框（替代原生 confirm/alert）
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.4);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; transition: opacity var(--duration) var(--ease);
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal-card {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: 28px; max-width: 400px; width: 90%; box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease-out);
}
.modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--warning-light); color: var(--warning);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-title { font-size: 17px; font-weight: 600; }
.modal-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ==========================================================================
   输入提示条（支持 warn 态）
   ========================================================================== */
.composer-hint { display: flex; align-items: center; justify-content: center; gap: 6px; }
.composer-hint.warn { color: var(--warning); }

/* ==========================================================================
   会话列表图标
   ========================================================================== */
.session-item { display: flex; align-items: center; gap: 8px; }
.session-icon { display: flex; align-items: center; }
.session-del { display: flex; align-items: center; justify-content: center; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================================================
   响应式
   ========================================================================== */
/* 移动端侧栏遮罩（对话页，点击关闭侧栏） */
.chat-side-overlay {
  display: none; position: fixed; inset: 0; z-index: 45;
  background: rgba(0, 0, 0, 0.55); opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.chat-side-overlay.show { display: block; opacity: 1; }

@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
  .sidebar.collapsed { margin-left: -270px; }
  .chat-header .menu-toggle { display: inline-flex; }
  .composer-inner { padding: 0 14px; }
  .bubble { max-width: 88%; }
  .model-dropdown { width: 280px; }
  .admin-body { padding: 20px 14px 48px; }
  .admin-header { padding: 12px 16px; }
  /* 会话删除按钮常显（移动端无 hover，否则永远不可见） */
  .session-item .session-del { opacity: 1; }
  /* 触摸目标放大（移动端推荐 ≥40px，兼顾紧凑布局） */
  .icon-btn { width: 40px; height: 40px; }
  .ic-btn { width: 36px; height: 36px; }
  .ic-btn svg { width: 16px; height: 16px; }
}

/* 极窄屏：模型下拉防溢出左边界 */
@media (max-width: 480px) {
  .model-dropdown { width: min(280px, calc(100vw - 24px)); }
}

/* ==========================================================================
   官网首页（/ 路由）- 复用 :root 设计变量，.home- 前缀避免冲突
   ========================================================================== */
.home-body {
  background: var(--home-bg, #07070d);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
/* 首页专用配色变量（深空黑 + 荧光青科技风） */
.home-body {
  --home-bg: #0F0F12;
  --home-bg-2: #15151a;
  --home-card: rgba(255, 255, 255, 0.04);
  --home-card-strong: rgba(255, 255, 255, 0.06);
  --home-border: rgba(255, 255, 255, 0.08);
  --home-text: #F5FBFF;
  --home-text-dim: #8C99A0;
  --home-violet: #00CAE0;
  --home-indigo: #00CAE0;
  --home-cyan: #00CAE0;
  --home-accent: #00CAE0;
  --home-accent-soft: rgba(0, 202, 224, 0.12);
  --home-grad: linear-gradient(120deg, #00CAE0 0%, #22d3ee 100%);
}
[data-theme="light"] .home-body {
  --home-bg: #f7f8fc;
  --home-bg-2: #ffffff;
  --home-card: rgba(255, 255, 255, 0.75);
  --home-card-strong: rgba(255, 255, 255, 0.9);
  --home-border: rgba(15, 23, 42, 0.08);
  --home-text: #0f172a;
  --home-text-dim: #475569;
  --home-accent: #0891b2;
  --home-accent-soft: rgba(8, 145, 178, 0.1);
}

/* 布局：左侧边栏 + 主内容区（即梦AI 风格） */
.home-shell { display: flex; min-height: 100vh; align-items: stretch; }

/* 左侧边栏（抽屉式：桌面端与移动端一致，默认隐藏，点击菜单按钮展开） */
.home-sidebar {
  width: 248px; flex-shrink: 0; position: fixed; left: 0; top: 0; height: 100vh; z-index: 40;
  transform: translateX(-100%);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(12, 12, 24, 0.92), rgba(7, 7, 13, 0.96));
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-right: 1px solid var(--home-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  transition: transform var(--duration) var(--ease-out);
}
.home-sidebar.mobile-open { transform: translateX(0); }
[data-theme="light"] .home-sidebar {
  background: #ffffff;
  box-shadow: 1px 0 0 var(--home-border), 6px 0 24px rgba(15, 23, 42, 0.05);
}
.home-side-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 18px 20px; border-bottom: 1px solid var(--home-border);
}
.home-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--home-text); }
.home-brand:hover { color: var(--home-text); }
.home-brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--home-grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}
.home-brand-mark.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.home-brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.3px; color: var(--home-text); }
.home-side-close { display: inline-flex; }

/* 侧边栏菜单 */
.home-side-menu {
  flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin;
}
.home-side-menu a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: var(--home-text-dim); font-size: 14px; font-weight: 500; white-space: nowrap;
  border-left: 3px solid transparent; transition: all var(--duration) var(--ease);
}
.home-side-menu a svg { width: 18px; height: 18px; flex-shrink: 0; }
.home-side-menu a:hover { color: var(--home-text); background: rgba(255,255,255,0.05); }
[data-theme="light"] .home-side-menu a:hover { background: rgba(15,23,42,0.05); }
.home-side-menu a.active {
  color: var(--home-text); font-weight: 600;
  background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(139,92,246,0.06));
  border-left-color: #8b5cf6;
}

/* 侧边栏底部 */
.home-side-footer {
  padding: 14px 16px; border-top: 1px solid var(--home-border);
  display: flex; flex-direction: column; gap: 10px;
}
.home-side-actions { display: flex; align-items: center; gap: 8px; }
.home-side-user {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--home-text); font-size: 14px; font-weight: 500;
}
.home-side-user:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .home-side-user:hover { background: rgba(15,23,42,0.05); }
.home-side-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--home-grad); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.home-side-uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-side-login {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  color: var(--home-text-dim); font-size: 14px; font-weight: 500;
}
.home-side-login svg { width: 17px; height: 17px; }
.home-side-login:hover { color: var(--home-text); background: rgba(255,255,255,0.05); }
[data-theme="light"] .home-side-login:hover { background: rgba(15,23,42,0.05); }
.home-side-admin, .home-side-register { width: 100%; justify-content: center; }
.home-side-admin svg, .home-side-register svg { width: 16px; height: 16px; }

/* 遮罩（移动端） */
.home-side-overlay {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(0,0,0,0.55); opacity: 0; transition: opacity var(--duration) var(--ease);
}
.home-side-overlay.show { display: block; opacity: 1; }

/* 主内容区 */
.home-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-side-toggle {
  display: inline-flex; position: fixed; top: 16px; left: 16px; z-index: 45;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--home-border);
  background: var(--home-card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--home-text); align-items: center; justify-content: center; cursor: pointer;
}
.home-side-toggle svg { width: 20px; height: 20px; }

/* Hero */
.home-hero { position: relative; overflow: hidden; padding: clamp(56px, 8vw, 88px) clamp(18px, 3vw, 24px) clamp(48px, 7vw, 80px); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.home-hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(640px 420px at 15% -8%, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(600px 380px at 88% 4%, rgba(139, 92, 246, 0.20), transparent 70%);
}
.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(48px); opacity: 0.42;
  animation: heroOrbFloat 14s ease-in-out infinite alternate;
}
.hero-orb.orb-1 { width: 320px; height: 320px; left: 8%; top: 12%;
  background: radial-gradient(circle, #6366f1, transparent 70%); }
.hero-orb.orb-2 { width: 380px; height: 380px; right: 6%; top: 4%;
  background: radial-gradient(circle, #8b5cf6, transparent 70%); animation-delay: -4s; }
.hero-orb.orb-3 { width: 260px; height: 260px; left: 42%; bottom: 6%;
  background: radial-gradient(circle, #22d3ee, transparent 70%); opacity: 0.32; animation-delay: -8s; }
@keyframes heroOrbFloat {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(0,-26px,0) scale(1.08); }
}
.hero-grid {
  position: absolute; inset: 0; opacity: 0.10;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}

/* 模型动态旋转圆环（仿 yt666vip 首页） */
.hero-orbit {
  position: absolute; left: 50%; top: 50%;
  width: clamp(320px, 62vw, 760px); height: clamp(320px, 62vw, 760px);
  transform: translate(-50%, -50%) translateZ(0);
  z-index: 0; pointer-events: none; opacity: 0.92;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.hero-orbit-track {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(139, 92, 246, 0.18);
  transform: translateZ(0); backface-visibility: hidden;
}
.hero-orbit-track.inner {
  inset: 26%; border-style: solid; border-width: 1px;
  border-color: rgba(34, 211, 238, 0.16); opacity: 0.55;
}
.hero-orbit-ring {
  position: absolute; inset: 0;
  /* 公转：10 等分更慢更有星轨感（之前 42s，现加长到 56s） */
  animation: orbitSpin 56s linear infinite;
  transform-origin: center;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.hero-orbit-ring.inner {
  inset: 26%;
  /* 内圈反向更慢（原 30s → 40s），与外圈差速更柔和 */
  animation: orbitSpin 40s linear infinite reverse;
}
.hero-orbit-item {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  /* 定位到圆周：转角度 → 向外平移半径 → 反转角度保持初始正立 · 10 等分 36° */
  transform: rotate(calc(var(--i) * 36deg)) translateY(calc(-1 * clamp(160px, 31vw, 380px))) translateZ(0);
  z-index: 1;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: z-index 0s linear; /* 让 hover 切 z-index 不触发合成层重建 */
}
.hero-orbit-item.is-active {
  /* 在同一 ring 堆叠上下文内提升到顶层，避免 chip 单独调 z-index 失败 */
  z-index: 20;
}
.hero-orbit-ring.inner .hero-orbit-item {
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  transform: rotate(calc(var(--i) * 36deg)) translateY(calc(-1 * clamp(78px, 15vw, 188px))) translateZ(0);
}
.hero-orbit-chip {
  width: 100%; height: 100%; border-radius: 14px;
  /* 提亮靠 background 叠加 + inset 内发光，不使用 filter（避免公转动画合成层降级引发抽搐） */
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)) padding-box,
    var(--home-card);
  border: 1px solid var(--home-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; letter-spacing: -0.3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* 反向自转抵消 ring 公转，使徽标始终正立（与外层 orbitSpin 同步） */
  animation: orbitSpin 56s linear infinite reverse;
  transition: box-shadow .25s ease, border-color .25s ease, background-color .25s ease;
}
.hero-orbit-chip.qwen     { color: #818cf8; }
.hero-orbit-chip.deepseek { color: #a78bfa; }
.hero-orbit-chip.llama    { color: #22d3ee; }
.hero-orbit-chip.flux     { color: #f472b6; }
.hero-orbit-chip.yi       { color: #34d399; }
.hero-orbit-chip.gemma    { color: #f59e0b; }
.hero-orbit-chip.claude   { color: #fb923c; }
.hero-orbit-chip.gemini   { color: #60a5fa; }
.hero-orbit-chip.mistral  { color: #fbbf24; }
.hero-orbit-chip.glm      { color: #00CAE0; }
.hero-orbit-chip.qwen-vl  { color: #c084fc; }
.hero-orbit-chip.coder    { color: #4ade80; }
.hero-orbit-chip.gpt      { color: #10A37F; } /* OpenAI 官方绿 */
.hero-orbit-chip.ernie    { color: #2932E1; } /* 百度 ERNIE 蓝紫渐变主色 */
.orbit-dot {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, var(--home-violet), transparent 70%);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.7);
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* 抵消内圈反向公转（与 inner 公转周期同步 40s） */
  animation: orbitSpin 40s linear infinite;
}
[data-theme="light"] .hero-orbit-chip {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)) padding-box,
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15,23,42,0.04) inset;
}
@keyframes orbitSpin {
  from { transform: rotate(0deg) translateZ(0); }
  to   { transform: rotate(360deg) translateZ(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-orbit-ring, .hero-orbit-chip, .orbit-dot { animation: none; }
}

/* ====== 星轨圆环：星轨拖尾画布 + 星空 + 徽标交互 + 介绍浮层 ====== */
.hero-trail-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
[data-theme="light"] .hero-trail-canvas { opacity: 0.22; }

/* 星空背景 */
.hero-starfield {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.hero-starfield .star {
  position: absolute; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: starTwinkle 3s ease-in-out infinite;
}
.hero-starfield .shooting-star {
  position: absolute; width: 130px; height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
  border-radius: 50%; opacity: 0;
  transform: rotate(-18deg);
  animation: shootingStar 9s ease-in infinite;
}
[data-theme="light"] .hero-starfield .star {
  background: #475569; box-shadow: 0 0 5px rgba(71, 85, 105, 0.5);
}
[data-theme="light"] .hero-starfield .shooting-star {
  background: linear-gradient(90deg, rgba(71, 85, 105, 0.7), transparent);
}
@keyframes starTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
@keyframes shootingStar {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(-18deg); }
  3%   { opacity: 1; }
  12%  { opacity: 0; transform: translate3d(280px, 90px, 0) rotate(-18deg); }
  100% { opacity: 0; transform: translate3d(280px, 90px, 0) rotate(-18deg); }
}

/* 增强轨道光晕（星轨感） */
.hero-orbit-track {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.08) inset;
}
.hero-orbit-track.inner {
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.10) inset;
}

/* 模型徽标可交互 */
.hero-orbit-chip {
  position: relative; pointer-events: auto; cursor: pointer;
  transition: box-shadow .25s ease, border-color .25s ease, background-color .25s ease, background-image .25s ease;
}
.hero-orbit-chip::before {
  content: ''; position: absolute; inset: -10px; border-radius: 18px; z-index: -1;
  background: radial-gradient(circle, currentColor, transparent 70%);
  opacity: 0; filter: blur(8px); transition: opacity .25s ease;
}
.hero-orbit-chip:hover,
.hero-orbit-chip:focus-visible,
.hero-orbit-chip.is-active {
  border-color: currentColor;
  /* 用 inset 渐变叠加模拟 1.15 亮度 & 1.2 饱和度，避免 filter 触发合成层重建引发抽搐 */
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04) 40%, rgba(255,255,255,0) 100%) padding-box,
    linear-gradient(0deg, rgba(255,255,255,0.02), rgba(255,255,255,0)) padding-box,
    var(--home-card);
  box-shadow: 0 0 0 1px currentColor, 0 0 24px rgba(139, 92, 246, 0.55),
              0 10px 26px rgba(0, 0, 0, 0.4),
              0 0 0 8px rgba(255,255,255,0.015) inset;
  /* z-index 提升交给父级 .hero-orbit-item.is-active 处理，避免同一 transform 子树下的合成层重建 */
}
.hero-orbit-chip:hover::before,
.hero-orbit-chip.is-active::before { opacity: 0.55; }
.hero-orbit-chip:focus-visible { outline: none; }
/* 激活时外环脉冲（挂在 chip 父级 item 上，确保脉冲不与 chip 反向自转动画冲突） */
.hero-orbit-item.is-active::after {
  content: ''; position: absolute; inset: -8px; border-radius: 16px;
  border: 1px solid currentColor; opacity: 0.6; pointer-events: none;
  animation: chipPulse 1.4s ease-out infinite;
  z-index: 0;
}
@keyframes chipPulse {
  0%   { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.4);  opacity: 0; }
}

/* 悬停时暂停公转（徽标停住便于阅读） */
.hero-orbit.is-paused .hero-orbit-ring,
.hero-orbit.is-paused .hero-orbit-chip,
.hero-orbit.is-paused .orbit-dot { animation-play-state: paused; }

/* 模型介绍浮层（fixed 定位，脱离 transform 祖主） */
.hero-orbit-tip {
  position: fixed; z-index: 60; pointer-events: none;
  min-width: 220px; max-width: 280px; padding: 14px 16px 14px 20px;
  border-radius: 14px;
  background: var(--home-card-strong);
  border: 1px solid var(--home-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  opacity: 0; transform: translateY(6px) scale(0.96);
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.hero-orbit-tip.show { opacity: 1; transform: translateY(0) scale(1); }
.hero-orbit-tip .tip-name {
  font-size: 15px; font-weight: 800; color: var(--home-text);
  letter-spacing: -0.2px; margin-bottom: 6px;
}
.hero-orbit-tip .tip-desc {
  font-size: 13px; line-height: 1.6; color: var(--home-text-dim);
}
.hero-orbit-tip .tip-hint {
  margin-top: 10px; font-size: 12px; font-weight: 600;
  color: var(--home-violet); letter-spacing: 0.3px;
}
/* 浮层左侧彩条按模型着色 */
.hero-orbit-tip::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: var(--home-violet);
}
.hero-orbit-tip.model-qwen::before     { background: #818cf8; }
.hero-orbit-tip.model-deepseek::before { background: #a78bfa; }
.hero-orbit-tip.model-llama::before    { background: #22d3ee; }
.hero-orbit-tip.model-flux::before     { background: #f472b6; }
.hero-orbit-tip.model-yi::before       { background: #34d399; }
.hero-orbit-tip.model-gemma::before    { background: #f59e0b; }
.hero-orbit-tip.model-claude::before   { background: #fb923c; }
.hero-orbit-tip.model-gemini::before   { background: #60a5fa; }
.hero-orbit-tip.model-gpt::before      { background: #10A37F; }
.hero-orbit-tip.model-ernie::before    { background: #2932E1; }
.hero-orbit-tip.model-mistral::before  { background: #fbbf24; }
.hero-orbit-tip.model-glm::before      { background: #00CAE0; }
.hero-orbit-tip.model-qwen-vl::before  { background: #c084fc; }
.hero-orbit-tip.model-coder::before    { background: #4ade80; }

[data-theme="light"] .hero-orbit-tip {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.04) inset;
}
@media (prefers-reduced-motion: reduce) {
  .hero-starfield .star, .hero-starfield .shooting-star { animation: none; }
  .hero-orbit-chip.is-active::after { animation: none; }
  .hero-orbit-tip { transition: opacity .15s linear; }
}

[data-theme="light"] .hero-grid { opacity: 0.10;
  background-image:
    linear-gradient(rgba(15,23,42,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px);
}
.home-hero-inner {
  position: relative; z-index: 1; max-width: 860px; margin: 0 auto; text-align: center;
}
.home-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius-full);
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--home-text-dim); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.home-badge svg { width: 14px; height: 14px; color: var(--home-violet); }
.home-title {
  margin-top: clamp(16px, 2.5vw, 24px); font-size: clamp(34px, 6.5vw, 60px); font-weight: 800; line-height: 1.1;
  letter-spacing: -0.8px; color: var(--home-text);
}
.home-title-grad {
  background: var(--home-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.home-subtitle {
  margin-top: clamp(12px, 1.8vw, 18px); font-size: clamp(15px, 1.6vw, 18px); color: var(--home-text-dim); line-height: 1.7;
}
.home-cta { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* 运行状态条 */
.home-status {
  margin: 44px auto 0; max-width: 560px;
  display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 22px; border-radius: var(--radius);
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm); font-size: 13px;
}
.home-status-item { display: inline-flex; align-items: center; gap: 8px; }
.home-status-item svg { width: 15px; height: 15px; color: var(--home-text-dim); }
.home-status-label { color: var(--home-text-dim); }
.home-status-value { color: var(--home-text); font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.home-status-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.home-status-dot.off { background: var(--home-text-dim); box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
.home-status-divider { width: 1px; height: 18px; background: var(--home-border); }

/* 通用区块 */
.home-section { max-width: 1200px; margin: 0 auto; padding: clamp(48px, 7vw, 84px) clamp(18px, 2.5vw, 24px) clamp(28px, 4vw, 40px); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.home-section-head { text-align: center; margin-bottom: clamp(28px, 4vw, 48px); }
.home-section-kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: var(--home-violet); margin-bottom: 12px;
  font-family: "SF Mono", Consolas, monospace;
}
.home-section-head h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.4px; color: var(--home-text); }
.home-section-head p { margin-top: 12px; color: var(--home-text-dim); font-size: 15px; }

/* 特性卡片网格 */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.feature-card {
  position: relative; overflow: hidden;
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg); padding: 30px 26px;
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.feature-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--home-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--duration) var(--ease);
  pointer-events: none;
}
.feature-card::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 60%; height: 1px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--home-violet), transparent);
  transition: opacity var(--duration) var(--ease);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(99, 102, 241, 0.18);
}
.feature-card:hover::before { opacity: 0.6; }
.feature-card:hover::after { opacity: 1; }
.feature-card h3 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; color: var(--home-text); }
.feature-card p { font-size: 14px; color: var(--home-text-dim); line-height: 1.7; }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.feature-icon svg { width: 22px; height: 22px; }
.fi-accent { background: rgba(99, 102, 241, 0.16); color: #818cf8; }
.fi-purple { background: rgba(139, 92, 246, 0.16); color: #a78bfa; }
.fi-green { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.fi-orange { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.fi-blue { background: rgba(34, 211, 238, 0.16); color: #22d3ee; }
.fi-red { background: rgba(244, 63, 94, 0.16); color: #fb7185; }

/* 行动召唤 */
.home-cta-section { max-width: 1200px; margin: 48px auto 0; padding: 0 24px 80px; }
.home-cta-card {
  position: relative; overflow: hidden; border-radius: 24px;
  padding: clamp(40px, 6vw, 64px) clamp(20px, 3.5vw, 32px); text-align: center;
}
.home-cta-card-bg {
  position: absolute; inset: 0; z-index: 0;
  background: var(--home-grad);
}
.home-cta-card-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(420px 220px at 80% 20%, rgba(255, 255, 255, 0.22), transparent 70%),
    radial-gradient(380px 200px at 15% 90%, rgba(34, 211, 238, 0.25), transparent 70%);
}
.home-cta-content { position: relative; z-index: 1; }
.home-cta-content h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.3px; }
.home-cta-content p { color: rgba(255, 255, 255, 0.9); margin-top: 10px; font-size: 15px; }
.home-cta-content .btn { margin-top: 26px; background: #fff; color: var(--home-indigo); border: none; }
.home-cta-content .btn:hover { background: #f0f2ff; transform: translateY(-1px); }
.home-cta-content .btn svg { width: 18px; height: 18px; }

/* 底部（简版，详细布局见下方 home-footer 区段） */
.home-footer { border-top: 1px solid var(--home-border); background: var(--home-bg-2); }
.home-footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--home-text); font-weight: 600; font-size: 14px; }
.home-footer-tech { color: var(--home-text-dim); font-size: 13px; }

/* 首页响应式（断点收敛：原 960 合并入 900） */
@media (max-width: 900px) {
  /* 卡片网格降为两列（标题/内边距已用 clamp 流式，无需断点覆盖） */
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  /* 移动端 hero 顶部为悬浮菜单按钮留出空间 */
  .home-hero { padding-top: 76px; }
  /* 页脚保持三列横排（与桌面端一致，仅缩小间距） */
  .home-footer-inner { grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .home-status { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .home-status-divider { display: none; }
  .home-status-value { max-width: none; }
  /* 底部移动端：三个容器横排（用户确认接受文字换行） */
  .home-footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding-bottom: 22px;
  }
  /* 三列窄布局：缩小标题/品牌/正文/列表项字号与间距，让三列塞下 */
  .home-footer-col h4 {
    display: flex; align-items: center; gap: 5px; margin-bottom: 8px; font-size: 11.5px;
  }
  .home-footer-col h4::before {
    content: ""; width: 5px; height: 5px; border-radius: 50%;
    background: var(--home-grad); flex-shrink: 0;
  }
  .home-footer-brand { font-size: 12.5px; margin-bottom: 6px; }
  .home-footer-desc { font-size: 10.5px; line-height: 1.5; }
  .home-footer-list { gap: 5px; }
  .home-footer-list li { display: flex; align-items: flex-start; font-size: 10.5px; line-height: 1.4; }
  .home-footer-list li svg { width: 11px; height: 11px; margin-top: 1px; }
  /* 底栏：紧凑居中 */
  .home-footer-bottom { padding-top: 16px; font-size: 10.5px; line-height: 1.6; }
}

/* ==========================================================================
   首页入场动画：boot-loader 关闭时由 body.boot-ready 触发，stagger 错开入场
   （用 backwards 填充模式：delay 期间隐藏，结束后回退到自然态，hover 不受影响）
   ========================================================================== */
body.boot-ready .home-badge        { animation: fadeInDown 0.5s var(--ease-out) backwards; animation-delay: .05s; }
body.boot-ready .hero-orbit        { animation: fadeIn 1s var(--ease) backwards; animation-delay: .15s; }
body.boot-ready .home-title        { animation: fadeInUp 0.6s var(--ease-out) backwards; animation-delay: .12s; }
body.boot-ready .home-subtitle     { animation: fadeInUp 0.6s var(--ease-out) backwards; animation-delay: .20s; }
body.boot-ready .home-cta          { animation: fadeInUp 0.6s var(--ease-out) backwards; animation-delay: .28s; }
body.boot-ready .home-status       { animation: fadeIn 0.6s var(--ease) backwards; animation-delay: .40s; }
body.boot-ready .home-section-head { animation: fadeInUp 0.5s var(--ease-out) backwards; animation-delay: .10s; }
body.boot-ready .feature-card      { animation: cardIn 0.5s var(--ease-out) backwards; }
body.boot-ready .feature-card:nth-child(1){animation-delay:.05s}
body.boot-ready .feature-card:nth-child(2){animation-delay:.13s}
body.boot-ready .feature-card:nth-child(3){animation-delay:.21s}
body.boot-ready .feature-card:nth-child(4){animation-delay:.29s}
body.boot-ready .feature-card:nth-child(5){animation-delay:.37s}
body.boot-ready .feature-card:nth-child(6){animation-delay:.45s}
body.boot-ready .home-cta-card     { animation: scaleIn 0.6s var(--ease-out) backwards; animation-delay: .15s; }

/* ==========================================================================
   首页侧边栏导航跳转动画：页面跳转淡出 / 锚点平滑滚动 + 目标高亮波纹
   ========================================================================== */
.home-main { transition: opacity .3s var(--ease), transform .3s var(--ease); }
.home-main.is-leaving { opacity: 0; transform: translateY(10px); pointer-events: none; }
@keyframes navTargetHighlight {
  0%   { box-shadow: inset 0 0 0 0 transparent, 0 0 0 0 transparent; }
  30%  { box-shadow: inset 0 0 0 2px var(--accent), 0 0 24px 4px var(--accent-glow); }
  100% { box-shadow: inset 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
.home-section.is-nav-target { animation: navTargetHighlight .9s var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .home-main { transition: none; }
  .home-section.is-nav-target { animation: none; }
}

/* ==========================================================================
   用户系统：通用组件（输入后缀 / 字段提示 / 角色徽章）
   ========================================================================== */
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .input { padding-right: 42px; }
.input-suffix {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-tertiary);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}
.input-suffix:hover { color: var(--text); background: var(--bg-hover); }
.input-suffix.btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.pwd-toggle svg { width: 18px; height: 18px; }

.field-hint { display: block; min-height: 16px; margin-top: 5px; font-size: 12px; color: var(--text-tertiary); transition: color var(--duration) var(--ease); }
.field-hint.err { color: var(--danger); animation: shake 0.32s var(--ease); }
.input.invalid { border-color: var(--danger); }
.input.invalid:focus { box-shadow: 0 0 0 3px var(--danger-light); }
.opt { color: var(--text-tertiary); font-weight: 400; font-size: 12px; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* 角色徽章 */
.role-badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.role-super_admin { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #7c2d12; }
.role-admin { background: var(--accent-light); color: var(--accent); }
.role-user { background: var(--success-light); color: var(--success); }
.role-guest { background: var(--bg-active); color: var(--text-secondary); }

/* ==========================================================================
   登录/注册页（auth）
   ========================================================================== */
.auth-body { overflow-x: hidden; }
.auth-wrap { position: relative; z-index: 1; }

/* 流动背景 */
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-blob {
  position: absolute; border-radius: 50%; filter: blur(64px); opacity: 0.5;
  animation: blobFloat 16s ease-in-out infinite;
}
[data-theme="dark"] .auth-blob { opacity: 0.35; }
.auth-blob.b1 { width: 380px; height: 380px; background: var(--accent); top: -80px; left: -60px; }
.auth-blob.b2 { width: 320px; height: 320px; background: #8b5cf6; bottom: -60px; right: -40px; animation-delay: -5s; }
.auth-blob.b3 { width: 260px; height: 260px; background: #22d3ee; top: 40%; left: 55%; animation-delay: -9s; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 40px) scale(0.92); }
}

.auth-card { max-width: 400px; border: 1px solid var(--border); }
.auth-brand { margin-bottom: 8px; }
.auth-logo-img {
  width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  box-shadow: 0 10px 30px var(--accent-glow);
}
.auth-copyright {
  margin-top: 6px; font-size: 11.5px; color: var(--text-tertiary); letter-spacing: 0.3px;
}

/* Tab */
.auth-tabs {
  position: relative; display: flex; background: var(--bg); border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 10px;
}
.auth-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 10px; border: none; background: transparent; color: var(--text-secondary);
  font-weight: 600; font-size: 13px; cursor: pointer; position: relative; z-index: 1;
  transition: color var(--duration) var(--ease);
}
.auth-tab.active { color: var(--accent); }
.auth-tab-ink {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0;
  background: var(--bg-elevated); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  transition: transform 0.32s var(--ease-out), width 0.32s var(--ease-out);
  z-index: 0;
}

/* 表单切换动画 */
.auth-form { display: none; flex-direction: column; animation: formIn 0.4s var(--ease-out); }
.auth-form.active { display: flex; }
@keyframes formIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 登录/注册表单：仅压缩间距，输入框尺寸保持全局默认 */
.auth-form .field { margin-bottom: 4px; }
.auth-form .field > label:not(.switch-row):not(.terms-check) { margin-bottom: 2px; font-size: 12px; }
.auth-form .input,
.auth-form .input-affix .input { padding: 11px 14px; font-size: 14px; }
.auth-form .input-affix .input { padding-right: 44px; }
.auth-form .terms-check-field { margin-bottom: 6px; }
.auth-form .field-hint { margin-top: 2px; font-size: 11px; line-height: 1.35; }

.auth-submit { width: 100%; margin-top: 4px; padding-top: 10px; padding-bottom: 10px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.auth-foot a { font-weight: 600; }

/* ==========================================================================
   个人中心（profile）
   ========================================================================== */
.profile-body { background: var(--bg); }
.profile-nav {
  background: var(--glass-bg); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 10;
}
.profile-nav-inner {
  max-width: 920px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.profile-nav-links { display: flex; align-items: center; gap: 6px; }
.profile-nav-links a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 500; font-size: 14px;
  transition: all var(--duration) var(--ease);
}
.profile-nav-links a:hover { background: var(--bg-hover); color: var(--text); }

.profile-main { max-width: 920px; margin: 0 auto; padding: clamp(20px,3vw,32px) clamp(16px,2.5vw,24px) clamp(40px,5vw,64px); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .profile-grid { grid-template-columns: 1fr; } }
/* 桌面端：宽屏适度加宽，导航与主区对齐 */
@media (min-width: 1100px) {
  .profile-main { max-width: 980px; }
  .profile-nav-inner { max-width: 980px; }
}
/* 桌面端：卡片悬停微浮 + 强调边框（触屏设备不触发） */
@media (hover: hover) and (min-width: 769px) {
  .profile-card { transition: transform var(--duration) var(--ease-out), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
  .profile-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,0.16); }
}

.profile-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px,2.5vw,28px); box-shadow: var(--shadow-sm); animation: cardIn 0.4s var(--ease-out);
}
.profile-card h2 { font-size: 18px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.profile-card .card-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; }

/* 顶部用户卡片 */
.user-card {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.user-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, transparent 60%);
  opacity: 0.6; pointer-events: none;
}
/* 用户卡右上角光晕：与 ::before 左上光形成双光源，质感更立体 */
.user-card::after {
  content: ""; position: absolute; top: -45%; right: -12%; width: 62%; height: 150%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 68%);
  opacity: 0.55; pointer-events: none; z-index: 0;
}
.user-avatar {
  width: clamp(56px,7vw,72px); height: clamp(56px,7vw,72px); border-radius: var(--radius-lg); flex-shrink: 0;
  background: var(--gradient-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: clamp(24px,3vw,30px); font-weight: 800;
  box-shadow: var(--shadow); position: relative; z-index: 1;
}
.user-meta { flex: 1; min-width: 0; position: relative; z-index: 1; }
.user-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-name-row h1 { font-size: clamp(18px,2.4vw,22px); }
.user-uid-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.uid-label { font-size: 11px; font-weight: 700; color: var(--text-tertiary); letter-spacing: 1px; }
.uid-value {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 14px; font-weight: 600;
  background: var(--bg); padding: 2px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  letter-spacing: 1px;
}
.copy-btn svg { width: 16px; height: 16px; }
.user-sub { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.admin-entry { position: relative; z-index: 1; flex-shrink: 0; }

/* ==========================================================================
   聊天侧栏用户卡片（user-card-mini）
   ========================================================================== */
.user-card-mini {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border-radius: var(--radius-sm); cursor: default;
  transition: background var(--duration) var(--ease);
}
.user-card-mini:hover { background: var(--bg-hover); }
.uc-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--gradient-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.uc-info { flex: 1; min-width: 0; }
.uc-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-info .role-badge { margin-top: 3px; font-size: 10px; }
.uc-menu-btn { flex-shrink: 0; }
.uc-menu-btn svg { width: 18px; height: 18px; }

.uc-menu {
  position: absolute; bottom: calc(100% + 6px); left: 10px; right: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 50;
}
.uc-menu.open { display: flex; animation: dropIn 0.2s var(--ease-out); }
.uc-menu a {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 500; transition: all var(--duration) var(--ease);
}
.uc-menu a:hover { background: var(--bg-hover); color: var(--accent); }
.uc-menu a svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 陌生人卡片 */
.guest-card { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.gc-text { font-size: 12px; color: var(--text-tertiary); text-align: center; }
.gc-actions { display: flex; gap: 8px; }
.gc-actions .btn { flex: 1; }

/* 页面入场动画 */
.profile-main > * { animation: cardIn 0.5s var(--ease-out) both; }
.profile-main > *:nth-child(2) { animation-delay: 0.08s; }
.profile-main > *:nth-child(3) { animation-delay: 0.16s; }

/* ==========================================================================
   后台 Tab 布局
   ========================================================================== */
.admin-tabs-wrap {
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 15;
}
.admin-tabs {
  max-width: 1040px; margin: 0 auto; padding: 0 clamp(14px,2vw,24px); display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 14px clamp(12px,1.4vw,16px);
  border: none; background: transparent; color: var(--text-secondary);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all var(--duration) var(--ease);
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-tab svg { width: 16px; height: 16px; }

.admin-panel { display: none; animation: cardIn 0.35s var(--ease-out); }
.admin-panel.active { display: block; }
.admin-body { max-width: 1040px; }

/* 开关行（checkbox） */
.switch-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.switch-line {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text); user-select: none;
}
.switch-line input[type="checkbox"] {
  appearance: none; width: 38px; height: 22px; border-radius: var(--radius-full);
  background: var(--border-strong); position: relative; cursor: pointer;
  transition: background var(--duration) var(--ease); flex-shrink: 0;
}
.switch-line input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease-out);
}
.switch-line input[type="checkbox"]:checked { background: var(--accent); }
.switch-line input[type="checkbox"]:checked::after { transform: translateX(16px); }

/* ==========================================================================
   用户管理 / 日志 表格
   ========================================================================== */
.um-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.um-search {
  position: relative; flex: 1; min-width: 200px;
}
.um-search svg { width: 16px; height: 16px; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.um-search .input { padding-left: 34px; }
.um-role-filter { width: auto; min-width: 130px; }

.um-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.um-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.um-table th {
  text-align: left; padding: 11px 14px; background: var(--bg); color: var(--text-secondary);
  font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.um-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.um-table tbody tr:last-child td { border-bottom: none; }
.um-table tbody tr { transition: background var(--duration) var(--ease); }
.um-table tbody tr:hover { background: var(--bg-hover); }

.um-uid {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 12px;
  background: var(--bg); padding: 2px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.um-user { display: flex; align-items: center; gap: 10px; }
.um-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--gradient-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.um-name { font-weight: 600; color: var(--text); }
.um-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.um-credit { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.um-time { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.um-detail { color: var(--text-secondary); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-actions { white-space: nowrap; }
.um-acts { display: inline-flex; gap: 4px; }
.ic-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated);
  cursor: pointer; transition: all var(--duration) var(--ease);
}
.ic-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.ic-btn svg { width: 15px; height: 15px; }
.um-empty { text-align: center; color: var(--text-tertiary); padding: 28px 14px !important; }
.um-error { color: var(--danger); }
.um-error svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tag svg { width: 11px; height: 11px; }
.tag-ok { background: var(--success-light); color: var(--success); }
.tag-ban { background: var(--danger-light); color: var(--danger); }
.tag-disabled { background: var(--bg-active); color: var(--text-secondary); }
.tag-action { background: var(--accent-light); color: var(--accent); }

/* 分页 */
.um-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.pager-info { font-size: 13px; color: var(--text-secondary); }

/* 日志子 Tab */
.logs-tabs { display: inline-flex; gap: 4px; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; }
.logs-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: none;
  background: transparent; color: var(--text-secondary); font-weight: 600; font-size: 13px;
  cursor: pointer; border-radius: var(--radius-sm); transition: all var(--duration) var(--ease);
}
.logs-tab svg { width: 14px; height: 14px; }
.logs-tab.active { background: var(--bg-elevated); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   站点统计
   ========================================================================== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
  transition: all var(--duration) var(--ease); animation: cardIn 0.4s var(--ease-out) backwards;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-val { font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
/* stat-card 10 张 stagger 入场（delay 补在 backwards 填充上，前 6 张错开，7+ 收尾并齐） */
.stat-card:nth-child(1){animation-delay:.04s}
.stat-card:nth-child(2){animation-delay:.10s}
.stat-card:nth-child(3){animation-delay:.16s}
.stat-card:nth-child(4){animation-delay:.22s}
.stat-card:nth-child(5){animation-delay:.28s}
.stat-card:nth-child(6){animation-delay:.34s}
.stat-card:nth-child(n+7){animation-delay:.40s}

/* ==========================================================================
   宽模态 / 表单
   ========================================================================== */
.modal-card-wide { max-width: 460px; width: calc(100% - 32px); }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form .field { margin: 0; }
.modal-form .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.modal-form .input, .modal-form .textarea { width: 100%; }
.modal-tip { font-size: 12px; color: var(--text-tertiary); display: flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.modal-tip svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.um-balance { font-size: 13px; color: var(--text-secondary); background: var(--bg); padding: 10px 12px; border-radius: var(--radius-sm); }
.um-balance strong { color: var(--accent); font-size: 15px; }

/* ==========================================================================
   聊天侧栏：积分芯片
   ========================================================================== */
.uc-meta-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.uc-meta-row .role-badge { margin-top: 0; }
.uc-credits {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: var(--radius-full);
  background: var(--accent-light); color: var(--accent); font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums; transition: all var(--duration) var(--ease);
}
.uc-credits svg { width: 11px; height: 11px; }
.uc-credits.low { background: var(--danger-light); color: var(--danger); animation: pulseLow 1.6s var(--ease) infinite; }
@keyframes pulseLow { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }

/* ==========================================================================
   个人中心：积分卡
   ========================================================================== */
.credits-card { position: relative; overflow: hidden; }
.credits-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, transparent 55%); opacity: 0.7; pointer-events: none;
}
.credits-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.credits-head h2 { font-size: 18px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.credits-head .card-desc { margin: 0; }
.credits-balance {
  font-size: clamp(26px,3.5vw,36px); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums;
  background: var(--bg-elevated); padding: 6px 18px; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.credits-cost { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; position: relative; z-index: 1; }
.cc-item {
  font-size: 12px; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: var(--radius-full); font-weight: 500;
}
.credits-tx { position: relative; z-index: 1; }
.credits-tx h3 { font-size: 14px; margin-bottom: 12px; color: var(--text); }
.credits-tx .um-table { font-size: 12px; }

/* 充值卡片 */
.recharge-presets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.recharge-preset-btn {
  padding: 8px 20px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s var(--ease-out);
}
.recharge-preset-btn:hover, .recharge-preset-btn.active {
  border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
}
.recharge-pay-type-label {
  padding: 6px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s var(--ease-out); display: inline-flex; align-items: center; gap: 6px;
}
.recharge-pay-type-label:hover, .recharge-pay-type-label.active {
  border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
}
.recharge-pay-type-label input { display: none; }
.recharge-paytype-btn {
  padding: 8px 20px; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--bg-elevated); color: var(--text-secondary); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s var(--ease-out);
}
.recharge-paytype-btn:hover {
  border-color: var(--accent); color: var(--text);
}
.recharge-paytype-btn.active {
  border-color: var(--accent); color: #fff; background: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
.recharge-input-row { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.recharge-input-row .input { flex: 1; max-width: 220px; }
.recharge-records h3 { font-size: 14px; margin-bottom: 12px; color: var(--text); }
.recharge-records .um-table { font-size: 12px; }
.status-tag { padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.status-tag.pending { color: #f59e0b; background: rgba(245,158,11,0.12); }
.status-tag.paid { color: #10b981; background: rgba(16,185,129,0.12); }
.status-tag.failed { color: #ef4444; background: rgba(239,68,68,0.12); }

/* 个人中心卡片 stagger 入场（覆盖 .profile-card 基础动画，补 delay + backwards） */
.user-card                              { animation: cardIn 0.4s var(--ease-out) .05s backwards; }
.profile-card.credits-card              { animation: cardIn 0.4s var(--ease-out) .15s backwards; }
.profile-grid .profile-card:nth-child(1){ animation: cardIn 0.4s var(--ease-out) .25s backwards; }
.profile-grid .profile-card:nth-child(2){ animation: cardIn 0.4s var(--ease-out) .33s backwards; }


@media (max-width: 768px) {
  .admin-body { padding: 20px 14px 48px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .credits-head { flex-direction: column; align-items: flex-start; }
  /* 表格窄屏紧凑化：缩单元格内边距 + 限制详情列宽，缓解横向溢出 */
  .um-table th { padding: 9px 10px; }
  .um-table td { padding: 10px 10px; }
  .um-detail { max-width: 140px; }
}

/* ==========================================================================
   P3：WebSocket 实时推送相关样式
   ========================================================================== */
/* 顶栏实时连接状态指示 */
.ws-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-tertiary);
  margin-left: 10px; padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--bg); border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
}
.ws-status .ws-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary);
  transition: background var(--duration) var(--ease);
}
.ws-status.connecting .ws-dot { background: var(--warning); animation: pulse 1.2s infinite; }
.ws-status.connecting { color: var(--warning); border-color: var(--warning-light); }
.ws-status.online .ws-dot { background: var(--success); animation: pulse 2s infinite; }
.ws-status.online { color: var(--success); border-color: var(--success-light); background: var(--success-light); }
.ws-status.offline .ws-dot { background: var(--danger); }
.ws-status.offline { color: var(--danger); border-color: var(--danger-light); }

/* 实时徽章 */
.rt-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: var(--radius-full); margin-left: 8px;
  background: var(--success-light); color: var(--success); vertical-align: middle;
}
.rt-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

/* 实时统计卡闪烁动画 */
.stat-card.rt { position: relative; }
.stat-card.flash::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: var(--accent-light); opacity: 0.5; pointer-events: none;
  animation: statFlash 0.8s var(--ease-out);
}
@keyframes statFlash {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* 用户管理提示行 */
.um-hint {
  font-size: 12px; color: var(--text-tertiary); margin-top: 10px;
  display: flex; align-items: center; gap: 5px;
}
.um-hint svg { width: 13px; height: 13px; }
.um-name-link { color: var(--text); cursor: pointer; transition: color var(--duration) var(--ease); }
.um-name-link:hover { color: var(--accent); text-decoration: underline; }

/* ==========================================================================
   企业级动画关键帧库
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px var(--accent-glow); }
  50% { box-shadow: 0 0 32px var(--accent-glow); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes badgePop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* 渐入工具类 */
.fade-in { animation: fadeIn var(--duration-slow) var(--ease-out) both; }
.fade-in-up { animation: fadeInUp var(--duration-slow) var(--ease-out) both; }
.fade-in-down { animation: fadeInDown var(--duration-slow) var(--ease-out) both; }
.scale-in { animation: scaleIn var(--duration) var(--ease-spring) both; }

/* 错开渐入（用于列表/卡片） */
.stagger > * { animation: fadeInUp var(--duration-slow) var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* 骨架屏加载占位 */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-hover) 0%,
    var(--bg-active) 50%,
    var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* 玻璃态卡片 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border);
}

/* 流光边框（用于高亮卡片） */
.glow-border {
  position: relative;
}
.glow-border::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px; background: var(--gradient-accent);
  background-size: 200% 200%; animation: gradientShift 3s var(--ease) infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: 0.6;
}

/* 响应 prefers-reduced-motion（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 日志路径筛选框 */
.logs-search { position: relative; flex: 1; min-width: 180px; max-width: 260px; }
.logs-search svg { width: 16px; height: 16px; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.logs-search .input { padding-left: 34px; }

/* ==========================================================================
   P4：用户详情抽屉
   ========================================================================== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.35);
  backdrop-filter: blur(3px); display: none; z-index: 1100;
  opacity: 0; transition: opacity var(--duration) var(--ease);
}
.drawer-overlay.show { display: block; opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--bg-elevated); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform 0.3s var(--ease-out); z-index: 1101;
}
.drawer-overlay.show .drawer { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.drawer-title svg { width: 18px; height: 18px; color: var(--accent); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-loading { display: flex; align-items: center; gap: 10px; color: var(--text-tertiary); padding: 20px 0; }
.drawer-user-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.drawer-user-head .d-username { font-size: 20px; font-weight: 700; color: var(--text); }
.um-avatar.lg { width: 52px; height: 52px; font-size: 22px; border-radius: var(--radius); }
.drawer-section { margin-bottom: 24px; }
.drawer-section .ds-title {
  font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.ds-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--bg-hover); font-size: 13px;
}
.ds-row:last-child { border-bottom: none; }
.ds-label { color: var(--text-tertiary); font-weight: 500; flex-shrink: 0; }
.ds-row .um-credit { font-size: 15px; }

/* ==========================================================================
   P5：通知配置
   ========================================================================== */
.notify-mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.notify-mode-card { cursor: pointer; }
.notify-mode-card input[type="radio"] { display: none; }
.nmc-inner {
  border: 2px solid var(--border); border-radius: var(--radius); padding: 18px 16px;
  text-align: center; transition: all var(--duration) var(--ease); background: var(--bg-elevated);
}
.nmc-inner svg { width: 26px; height: 26px; color: var(--text-tertiary); margin-bottom: 10px; transition: color var(--duration) var(--ease); }
.nmc-name { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.nmc-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }
.notify-mode-card input[type="radio"]:checked + .nmc-inner {
  border-color: var(--accent); background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.notify-mode-card input[type="radio"]:checked + .nmc-inner svg { color: var(--accent); }
.notify-mode-card:hover .nmc-inner { border-color: var(--border-strong); transform: translateY(-2px); }

/* ==========================================================================
   后台：API 服务商切换卡片（provider-grid）
   ========================================================================== */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.provider-card {
  position: relative; cursor: pointer; text-align: left;
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; background: var(--bg-elevated);
  transition: all var(--duration) var(--ease);
  display: flex; flex-direction: column; gap: 6px;
}
.provider-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.provider-card.active {
  border-color: var(--accent); background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.provider-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.provider-card-name { font-weight: 600; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.provider-card-name svg { width: 18px; height: 18px; color: var(--accent); }
.provider-card.active .provider-card-name svg { color: var(--accent); }
.provider-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: #fff; white-space: nowrap;
}
.provider-badge.muted { background: var(--bg-active); color: var(--text-secondary); }
.provider-card-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }
.provider-card-url {
  font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono, monospace);
  word-break: break-all; background: var(--bg-active); padding: 4px 8px; border-radius: 6px;
}
.provider-card-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.provider-card-actions {
  display: flex; gap: 8px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.provider-action-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  background: var(--bg-active); color: var(--text-secondary);
  border: 1px solid var(--border); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all var(--duration) var(--ease);
}
.provider-action-btn:hover { background: var(--border-strong); color: var(--text); }
.provider-action-btn svg { width: 14px; height: 14px; }
.provider-action-btn.danger { color: var(--danger, #e74c3c); }
.provider-action-btn.danger:hover { background: rgba(231, 76, 60, 0.15); border-color: var(--danger, #e74c3c); color: var(--danger, #e74c3c); }
.provider-tip {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--accent-light); color: var(--text-secondary);
  font-size: 13px; line-height: 1.6; border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 8px;
}
.provider-tip svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.provider-tip a { color: var(--accent); text-decoration: underline; }
@media (max-width: 768px) { .provider-grid { grid-template-columns: 1fr; } }

/* 抽屉响应式（断点收敛：720 → 768） */
@media (max-width: 768px) {
  .drawer { width: 92vw; }
  .notify-mode-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   后台：侧边栏布局（admin-shell）
   ========================================================================== */
.admin-shell { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  width: 240px; flex-shrink: 0; background: var(--bg-elevated);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30;
  transition: width var(--duration) var(--ease), transform var(--duration) var(--ease-out);
}
.admin-sidebar.collapsed { width: 64px; }
.admin-sidebar.collapsed .sidebar-brand,
.admin-sidebar.collapsed .sidebar-group-title,
.admin-sidebar.collapsed .sidebar-item span { display: none; }
.admin-sidebar.collapsed .sidebar-item { justify-content: center; padding: 12px 0; }
.admin-sidebar.collapsed .sidebar-header { justify-content: center; }
.admin-sidebar.collapsed .sidebar-header .logo .logo-mark { margin: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); gap: 8px;
}
.sidebar-header .logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--gradient-accent); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.logo-mark-img {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
  object-fit: cover; box-shadow: 0 4px 12px var(--accent-glow);
}
.sidebar-brand { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.sidebar-collapse-btn { flex-shrink: 0; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 14px 0; scrollbar-width: thin; }
.sidebar-group { margin-bottom: 18px; }
.sidebar-group-title {
  padding: 0 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  color: var(--text-secondary); font-size: 14px; font-weight: 500; cursor: pointer;
  border-left: 3px solid transparent; transition: all var(--duration) var(--ease);
  white-space: nowrap;
}
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-item:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-item.active {
  background: var(--accent-light); color: var(--accent);
  border-left-color: var(--accent); font-weight: 600;
}

.sidebar-footer { padding: 12px 18px; border-top: 1px solid var(--border); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; padding: 12px clamp(14px,2vw,24px); border-bottom: 1px solid var(--border);
  background: var(--glass-bg); backdrop-filter: blur(12px) saturate(160%);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-breadcrumb { font-size: 16px; font-weight: 700; color: var(--text); }
.sidebar-mobile-toggle { display: none; }
.admin-nav { display: flex; align-items: center; gap: 14px; }
.admin-nav a, .admin-nav button {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; background: none; border: none; cursor: pointer;
  transition: color var(--duration) var(--ease);
}
.admin-nav a:hover, .admin-nav button:hover { color: var(--accent); }
.admin-nav svg { width: 16px; height: 16px; }
.admin-content { flex: 1; padding: clamp(16px,2vw,24px); max-width: 1180px; width: 100%; margin: 0 auto; }
/* 超宽屏：后台内容区适度加宽，充分利用横向空间 */
@media (min-width: 1440px) { .admin-content { max-width: 1320px; } }

/* 侧边栏移动端遮罩 */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 35; opacity: 0; transition: opacity var(--duration) var(--ease);
}
.sidebar-overlay.show { display: block; opacity: 1; }

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%); height: 100vh;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .admin-sidebar.mobile-open { transform: translateX(0); }
  .admin-sidebar.collapsed { width: 240px; }
  .admin-sidebar.collapsed .sidebar-brand,
  .admin-sidebar.collapsed .sidebar-group-title,
  .admin-sidebar.collapsed .sidebar-item span { display: inline; }
  .admin-sidebar.collapsed .sidebar-item { justify-content: flex-start; padding: 10px 20px; }
  .sidebar-mobile-toggle { display: inline-flex; }
  .sidebar-collapse-btn { display: none; }
}

/* ==========================================================================
   中控台（dashboard）
   ========================================================================== */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.metric-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 14px;
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease);
  position: relative; overflow: hidden;
}
.metric-card::before {
  content: ""; position: absolute; inset: 0; background: var(--gradient-bg);
  opacity: 0; transition: opacity var(--duration) var(--ease); pointer-events: none;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.metric-icon svg { width: 22px; height: 22px; }
.metric-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-label { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.metric-card.flash { animation: flashPulse 0.8s var(--ease-out); }
@keyframes flashPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-light); }
  50% { box-shadow: 0 0 0 6px var(--accent-light); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.system-status-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px;
  padding: 12px 14px; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.ss-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--radius-full); font-weight: 600; font-size: 12px; border: 1px solid;
}
.ss-badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.ss-badge.ok { color: var(--success); border-color: var(--success-light); background: var(--success-light); }
.ss-badge.ok .dot { background: var(--success); }
.ss-badge.err { color: var(--danger); border-color: var(--danger-light); background: var(--danger-light); }
.ss-badge.err .dot { background: var(--danger); }
.ss-badge.muted { color: var(--text-tertiary); border-color: var(--border); background: var(--bg-hover); }
.ss-badge.muted .dot { background: var(--text-tertiary); }
.ss-item { color: var(--text-secondary); }
.ss-item .ss-k { color: var(--text-tertiary); margin-right: 5px; font-size: 12px; }
.ss-item strong { color: var(--text); }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-actions .btn svg { width: 15px; height: 15px; }

/* ==========================================================================
   自检中心（diagnostic）
   ========================================================================== */
.diag-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 20px;
  background: var(--warning-light); border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; line-height: 1.6;
}
.diag-banner svg { width: 20px; height: 20px; color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.diag-banner .hl { color: var(--warning); font-weight: 700; }

.diag-toggle-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.diag-toggle-info { flex: 1; }
.diag-toggle-info h2 { margin-bottom: 4px; }
.diag-toggle-info .card-desc { margin-bottom: 0; }
.hl-on { color: var(--success); font-weight: 700; }
.hl-off { color: var(--text-tertiary); font-weight: 700; }

/* 自检专用开关（与 .switch-line 风格一致但更大） */
.diag-switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.diag-switch input { opacity: 0; width: 0; height: 0; }
.diag-slider {
  position: absolute; cursor: pointer; inset: 0; border-radius: var(--radius-full);
  background: var(--border-strong); transition: background var(--duration) var(--ease);
}
.diag-slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform var(--duration) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.diag-switch input:checked + .diag-slider { background: var(--accent); }
.diag-switch input:checked + .diag-slider::before { transform: translateX(24px); }

.diag-content { animation: cardIn 0.35s var(--ease-out); }
.diag-disabled-mask {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; gap: 8px;
  background: var(--bg-elevated); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.diag-disabled-mask svg { width: 40px; height: 40px; color: var(--text-tertiary); margin-bottom: 8px; }
.diag-disabled-mask p { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; }

.diag-health-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.health-gauge { width: 140px; height: 140px; position: relative; flex-shrink: 0; }
.gauge-svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge-bg { fill: none; stroke: var(--border); stroke-width: 12; }
.gauge-fg {
  fill: none; stroke: var(--success); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-out), stroke var(--duration) var(--ease);
}
.gauge-val {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 30px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums;
}
.diag-actions { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.diag-progress { width: 100%; }
.diag-progress-bar {
  width: 100%; height: 8px; background: var(--bg-hover); border-radius: var(--radius-full);
  overflow: hidden; margin-bottom: 6px;
}
.diag-progress-fill {
  height: 100%; width: 0%; background: var(--gradient-accent); border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}
.diag-progress-text { font-size: 12px; color: var(--text-secondary); }

.diag-issues { display: flex; flex-direction: column; gap: 12px; }
.diag-no-issue {
  display: flex; align-items: center; gap: 12px; padding: 18px;
  background: var(--success-light); border-radius: var(--radius); color: var(--success);
}
.diag-no-issue svg { width: 28px; height: 28px; flex-shrink: 0; }
.diag-no-issue strong { color: var(--text); font-size: 15px; }
.diag-issue {
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-elevated); border-left: 4px solid var(--text-tertiary);
}
.diag-issue.severity-critical { border-left-color: var(--danger); background: var(--danger-light); }
.diag-issue.severity-warning { border-left-color: var(--warning); }
.diag-issue.severity-info { border-left-color: var(--info); }
.di-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.di-title { font-size: 14px; font-weight: 600; color: var(--text); }
.di-detail { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.di-suggest {
  display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text-secondary);
  background: var(--bg); padding: 8px 10px; border-radius: var(--radius-sm); margin-bottom: 10px;
}
.di-suggest svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--warning); margin-top: 1px; }
.tag-warn { background: var(--warning-light); color: var(--warning); }

.backup-list, .diag-reports-list { display: flex; flex-direction: column; gap: 10px; }
.backup-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
}
.backup-item:hover { border-color: var(--border-strong); transform: translateX(2px); }
.bi-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bi-icon svg { width: 18px; height: 18px; }
.bi-info { flex: 1; min-width: 0; }
.bi-name { font-size: 13px; font-weight: 600; color: var(--text); font-family: "SF Mono", Consolas, monospace; word-break: break-all; }
.bi-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.report-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all var(--duration) var(--ease); cursor: default;
}
.report-item:hover { border-color: var(--border-strong); }
.ri-score {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.ri-score.score-ok { background: var(--success-light); color: var(--success); }
.ri-score.score-warn { background: var(--warning-light); color: var(--warning); }
.ri-score.score-bad { background: var(--danger-light); color: var(--danger); }
.ri-info { flex: 1; min-width: 0; }
.ri-time { font-size: 12px; color: var(--text-tertiary); }
.ri-summary { font-size: 13px; color: var(--text); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .metric-card.flash, .diag-content, .gauge-fg, .diag-progress-fill { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   项目日志查看器（中控台）
   ========================================================================== */
.log-viewer-card { display: flex; flex-direction: column; }
.log-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.log-file-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: 13px; min-width: 220px;
  cursor: pointer; transition: border-color var(--duration) var(--ease);
  font-family: "SF Mono", Consolas, monospace;
}
.log-file-select:hover { border-color: var(--border-strong); }
.log-file-select:focus { outline: none; border-color: var(--accent); }
.log-meta { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.log-toolbar-spacer { flex: 1; }
.log-auto-refresh {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-secondary); cursor: pointer; user-select: none;
}
.log-auto-refresh input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }

.log-terminal {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; max-height: 460px; overflow-y: auto; font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; scrollbar-width: thin;
}
.log-terminal::-webkit-scrollbar { width: 8px; }
.log-terminal::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.log-line {
  display: flex; align-items: baseline; gap: 8px; padding: 2px 4px; border-radius: 3px;
  white-space: nowrap; transition: background var(--duration) var(--ease);
}
.log-line:hover { background: var(--bg-hover); }
.log-time { color: var(--text-tertiary); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.log-level {
  flex-shrink: 0; min-width: 56px; text-align: center; padding: 1px 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
}
.log-lvl-error { background: var(--danger-light); color: var(--danger); }
.log-lvl-warn { background: var(--warning-light); color: var(--warning); }
.log-lvl-info { background: var(--info-light); color: var(--info); }
.log-lvl-debug { background: var(--bg-active); color: var(--text-secondary); }
.log-lvl-other { background: var(--bg-active); color: var(--text-secondary); }
/* 错误级别整行左侧高亮 */
.log-line.log-lvl-error { border-left: 2px solid var(--danger); padding-left: 6px; }
.log-line.log-lvl-warn { border-left: 2px solid var(--warning); padding-left: 6px; }
.log-logger { color: var(--accent); flex-shrink: 0; opacity: 0.85; }
.log-msg { color: var(--text); white-space: pre-wrap; word-break: break-word; min-width: 0; }

.log-empty, .log-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 50px 20px; gap: 10px; color: var(--text-tertiary); text-align: center;
}
.log-empty svg { width: 36px; height: 36px; opacity: 0.5; }
.log-empty p { font-size: 14px; margin: 0; }
.log-loading { flex-direction: row; font-size: 13px; }

/* ============ 危险操作区 / UID 重置 ============ */
.danger-zone {
  border: 1px solid var(--danger);
  background: linear-gradient(180deg, var(--danger-light) 0%, transparent 60%);
  position: relative;
}
.danger-zone::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--danger); border-radius: var(--radius) 0 0 var(--radius);
}
.danger-zone h2 { color: var(--danger); }
.danger-zone-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px;
}
.danger-zone-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--warning);
}
.danger-zone-hint svg { width: 14px; height: 14px; }

/* 系统初始化 */
.sys-init-list {
  list-style: none;
  padding: 10px 0;
  margin: 8px 0 14px;
}
.sys-init-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.sys-init-list li svg {
  width: 16px;
  height: 16px;
  color: var(--accent, #6366f1);
}
.sys-init-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sys-init-step label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.sys-init-step label svg {
  width: 14px;
  height: 14px;
}
.sys-init-step input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: var(--radius, 8px);
  color: var(--text);
  font-size: 14px;
  transition: border-color .2s;
}
.sys-init-step input:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.sys-init-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============ 模态框：警告提示与列表 ============ */
.modal-tip-warn {
  color: var(--warning); background: var(--warning-light);
  padding: 10px 12px; border-radius: var(--radius); border-left: 3px solid var(--warning);
  margin-bottom: 12px;
}
.modal-list {
  margin: 8px 0 14px; padding-left: 20px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.9;
}
.modal-list li { list-style: disc; }
.modal-list code {
  background: var(--bg-active); padding: 1px 5px; border-radius: 3px;
  font-family: "SF Mono", "Consolas", monospace; font-size: 12px;
}

/* ============ 错误页 / 未开放页 / 条款页 ============ */
.error-body, .terms-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; position: relative; overflow-x: hidden;
}
.error-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.error-blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35;
  animation: blobFloat 14s ease-in-out infinite;
}
.error-blob.b1 { width: 420px; height: 420px; background: var(--accent); top: -10%; left: -8%; }
.error-blob.b2 { width: 360px; height: 360px; background: #7c5cf6; bottom: -12%; right: -6%; animation-delay: -7s; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.08); }
}
.error-wrap, .terms-wrap { position: relative; z-index: 1; width: 100%; max-width: 560px; }
.terms-wrap { max-width: 720px; }
.error-card, .terms-card {
  padding: clamp(32px,4vw,48px) clamp(20px,3.5vw,40px); border-radius: var(--radius-lg); text-align: center;
  animation: scaleIn 0.5s var(--ease-spring) both;
}
.error-code {
  font-size: clamp(64px,12vw,96px); font-weight: 800; line-height: 1; letter-spacing: -2px;
  background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text;
  color: transparent; margin-bottom: 8px;
  animation: glowPulse 3s ease-in-out infinite;
}
.error-icon {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-light); color: var(--accent);
}
.error-icon svg { width: 32px; height: 32px; }
.error-icon-warn { background: var(--warning-light); color: var(--warning); }
.error-title, .terms-title {
  font-size: clamp(20px,2.5vw,24px); font-weight: 700; margin: 0 0 10px; color: var(--text);
}
.error-desc, .terms-sub { font-size: 14px; color: var(--text-secondary); margin: 0 0 28px; line-height: 1.7; }
.error-actions, .terms-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px;
}
.unavailable-reason {
  font-size: 15px; color: var(--text); line-height: 1.8; margin: 0 0 20px;
  padding: 16px 20px; background: var(--bg-active); border-radius: var(--radius);
  border-left: 3px solid var(--accent); text-align: left;
}
.unavailable-reason:empty { display: none; }

/* 条款页 */
.terms-head { margin-bottom: 24px; }
.terms-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-light); color: var(--accent);
}
.terms-icon svg { width: 28px; height: 28px; }
.terms-content {
  text-align: left; font-size: clamp(13.5px,1.4vw,14.5px); line-height: 1.85; color: var(--text);
  padding: 20px 24px; background: var(--bg-active); border-radius: var(--radius);
  max-height: 50vh; overflow-y: auto; margin-bottom: 28px;
}
.terms-content h3 { font-size: 17px; margin: 0 0 12px; color: var(--text); }
.terms-content p { margin: 0 0 12px; }
.terms-content ol { padding-left: 22px; margin: 0 0 12px; }
.terms-content li { margin-bottom: 8px; }

/* ============ 登录页：服务条款勾选框 ============ */
.terms-check-field { margin-bottom: 18px; }
.terms-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none;
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.6;
  position: relative;
}
.terms-check input[type="checkbox"] {
  position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer;
  width: auto; height: auto;
}
.terms-check-box {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong);
  background: var(--bg-input); flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease-spring);
}
.terms-check-box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(0.5); transition: all 0.2s var(--ease-spring); }
.terms-check input:checked + .terms-check-box {
  background: var(--accent); border-color: var(--accent);
}
.terms-check input:checked + .terms-check-box svg { opacity: 1; transform: scale(1); }
.terms-check input:focus-visible + .terms-check-box { box-shadow: 0 0 0 3px var(--accent-light); }
.terms-check-text a { color: var(--accent); text-decoration: none; }
.terms-check-text a:hover { text-decoration: underline; }

/* ============ 开关组件（switch-row） ============ */
.switch-row {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none;
  font-size: 13.5px; color: var(--text-secondary); position: relative; margin: 0;
  padding: 4px 0; width: 100%;
}
.switch-row input[type="checkbox"] {
  position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer;
  width: auto; height: auto; z-index: 1;
}
.switch-track {
  width: 40px; height: 22px; border-radius: 11px; background: var(--bg-active);
  border: 1px solid var(--border-strong); position: relative; flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.25s var(--ease-spring);
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-secondary);
  transition: all 0.25s var(--ease-spring);
}
.switch-row input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .switch-track::after { left: 20px; background: #fff; }
.switch-label { line-height: 1.55; flex: 1; min-width: 0; word-break: break-word; }

/* ============ 辅助样式 ============ */
.textarea-code {
  font-family: "SF Mono", "Consolas", "Monaco", monospace; font-size: 13px;
  line-height: 1.7; resize: vertical; min-height: 120px;
}
.inline-link {
  display: inline-flex; align-items: center; gap: 3px; color: var(--accent);
  text-decoration: none; font-size: 13px; margin-left: 6px;
}
.inline-link:hover { text-decoration: underline; }
.inline-link svg { width: 13px; height: 13px; }
.field-tip {
  display: flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--text-tertiary); margin-top: 6px;
}
.field-tip svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ==========================================================================
   云帆Ai：标签 (.dev-tag)
   ========================================================================== */
.dev-tag {
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 700; font-size: 10.5px;
  padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff; letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
  animation: devTagPulse 2.4s ease-in-out infinite;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.3;
}
.chat-title .dev-tag,
.sidebar-brand .dev-tag,
.logo span .dev-tag {
  font-size: 9.5px; padding: 1.5px 6px;
}
.home-brand-name .dev-tag { font-size: 11px; }
@keyframes devTagPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35); transform: scale(1); }
  50%      { box-shadow: 0 2px 14px rgba(245, 158, 11, 0.55); transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .dev-tag { animation: none; }
}

/* ==========================================================================
   智能体项目：启动加载遮罩（高级酷炫流式动画）
   ========================================================================== */
/* 会话内已播放过启动动画：CSS 立即隐藏遮罩，避免手机端闪现转圈 */
html.boot-skip .boot-loader { display: none !important; }
html.boot-skip body { /* 跳过动画时立即解锁页面交互 */ }

.boot-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: radial-gradient(ellipse at top, #1a1f2e 0%, #0d1117 45%, #05070c 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: opacity 0.55s var(--ease-out), visibility 0.55s;
}
.boot-loader::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.24), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.24), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.12), transparent 60%);
  animation: bootBgShift 8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes bootBgShift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-3%, 2%, 0) scale(1.08); }
}
.boot-loader.is-done { opacity: 0; visibility: hidden; }
.boot-loader-inner {
  position: relative; width: min(520px, 88vw);
  background: rgba(22, 27, 34, 0.7);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(99,102,241,0.12) inset,
    0 0 60px rgba(99,102,241,0.18);
  padding: 32px 30px 26px;
  animation: bootCardIn 0.5s var(--ease-out);
}
@keyframes bootCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
/* 圆环旋转转圈（模仿 yt666vip 进入转圈：多层圆环 + 中心品牌标识） */
.boot-spinner {
  position: relative; width: 96px; height: 96px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.boot-logo-mark {
  position: relative; z-index: 2;
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #d946ef);
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 8px 22px rgba(99, 102, 241, 0.55),
    0 0 0 1px rgba(255,255,255,0.18) inset;
  letter-spacing: 0.5px;
}
.boot-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid transparent; pointer-events: none;
}
.boot-ring-1 {
  inset: 0;
  border-top-color: #6366f1; border-right-color: rgba(139, 92, 246, 0.55);
  animation: bootRing 1.1s linear infinite;
}
.boot-ring-2 {
  inset: 10px; border-width: 1.5px;
  border-top-color: transparent; border-left-color: #8b5cf6; border-bottom-color: rgba(217, 70, 239, 0.5);
  animation: bootRing 1.7s linear infinite reverse;
}
.boot-ring-3 {
  inset: 20px; border-width: 1.5px;
  border-top-color: #22d3ee; border-right-color: transparent;
  border-left-color: rgba(34, 211, 238, 0.4);
  animation: bootRing 2.4s linear infinite; opacity: 0.8;
}
@keyframes bootRing {
  to { transform: rotate(360deg); }
}
.boot-title {
  text-align: center; font-size: 22px; font-weight: 700; color: #e6edf3;
  margin-bottom: 4px; letter-spacing: 0.5px;
}
.boot-title .boot-tag {
  display: inline-block; margin-left: 6px;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff;
  vertical-align: middle; letter-spacing: 0.3px;
}
.boot-sub {
  text-align: center; font-size: 12.5px; color: rgba(230,237,243,0.55);
  margin-bottom: 20px; letter-spacing: 1.2px; font-family: "SF Mono", Consolas, monospace;
}
.boot-bar {
  position: relative; width: 100%; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.07); overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.boot-bar::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.35), transparent);
  animation: bootBarShine 1.6s linear infinite;
}
@keyframes bootBarShine {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.boot-bar-fill {
  position: relative; z-index: 1;
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #22d3ee);
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
  transition: width 0.12s linear;
  animation: bootBarGradient 2.5s linear infinite;
}
@keyframes bootBarGradient {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.boot-logs {
  background: rgba(5, 7, 12, 0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 170px; overflow-y: auto;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 12px; line-height: 1.65; color: #a6b0bd;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) inset;
}
.boot-logs::-webkit-scrollbar { width: 5px; }
.boot-logs::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 999px; }
.boot-log {
  display: flex; align-items: flex-start; gap: 8px;
  opacity: 1; transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.boot-log.boot-log-in { opacity: 0; transform: translateY(-4px); }
.boot-log .b-ts { color: #6e7681; flex-shrink: 0; letter-spacing: 0.5px; }
.boot-log .b-ok { color: #3fb950; flex-shrink: 0; font-weight: 700; }

/* ==========================================================================
   首页底部：版权归属 + 大模型来源（三列布局）
   ========================================================================== */
.home-footer { padding: clamp(36px, 5vw, 64px) clamp(18px, 2.5vw, 24px) 30px; background: var(--home-bg-2); }
.home-footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--home-border);
}
.home-footer-col h4 {
  font-size: 14px; font-weight: 700; color: var(--home-text);
  margin: 0 0 14px; letter-spacing: 0.3px;
}
.home-footer-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--home-text);
  margin-bottom: 12px;
}
.home-footer-desc {
  margin: 0; font-size: 13px; line-height: 1.75; color: var(--home-text-dim);
}
.home-footer-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 9px;
}
.home-footer-list li {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--home-text-dim); line-height: 1.5;
}
.home-footer-list li svg {
  width: 14px; height: 14px; flex-shrink: 0; color: var(--home-violet);
}
.home-footer-list li a { color: var(--home-violet); text-decoration: none; }
.home-footer-list li a:hover { text-decoration: underline; }
.home-footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding-top: 20px; text-align: center;
  font-size: 12px; color: var(--home-text-dim); letter-spacing: 0.5px;
}
@media (max-width: 640px) {
  .boot-loader-inner { padding: 26px 20px 22px; }
  .boot-title { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-loader::before, .boot-logo-ring, .boot-bar::before, .boot-bar-fill { animation: none; }
}

/* ==========================================================================
   首页 · yt666vip 风格（lk- 前缀）—— 固定顶部导航 + Hero圆环 + 各 section
   复用 .home-body 上的 --home-* 配色变量（深空黑 #0F0F12 + 荧光青 #00CAE0）
   ========================================================================== */
.lk-main { display: flex; flex-direction: column; }

/* ---------- 顶部固定玻璃态导航 ---------- */
.lk-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  border-bottom: 1px solid transparent;
}
.lk-header.scrolled {
  background: var(--home-card-strong); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--home-border); box-shadow: 0 6px 24px rgba(0,0,0,0.28);
}
[data-theme="light"] .lk-header.scrolled { background: rgba(255,255,255,0.85); box-shadow: 0 6px 24px rgba(15,23,42,0.06); }
.lk-header-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px clamp(16px, 3vw, 28px);
  display: flex; align-items: center; gap: 18px;
}
.lk-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--home-text); flex-shrink: 0; }
.lk-brand:hover { color: var(--home-text); }
.lk-brand-logo {
  width: 32px; height: 32px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.lk-brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.3px; color: var(--home-text); display: inline-flex; align-items: center; gap: 6px; }
.lk-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.lk-nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--home-text-dim);
  font-size: 14px; font-weight: 500; transition: all var(--duration) var(--ease); white-space: nowrap;
}
.lk-nav a:hover { color: var(--home-text); background: var(--home-card); }
.lk-nav a.active { color: var(--home-text); background: var(--home-accent-soft); }
.lk-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lk-link { color: var(--home-text-dim); font-size: 14px; font-weight: 500; padding: 8px 6px; }
.lk-link:hover { color: var(--home-text); }
.lk-user {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--home-grad); color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,202,224,0.35);
}
.lk-btn-admin, .lk-btn-reg { white-space: nowrap; }
.lk-btn-admin svg, .lk-btn-reg svg { width: 15px; height: 15px; }
.lk-nav-toggle, .lk-nav-close { display: none; }
.lk-nav-overlay { display: none; }

/* ---------- Hero ---------- */
.lk-hero {
  position: relative; overflow: visible; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px clamp(18px, 4vw, 32px) 80px;
  z-index: 1;
}
/* hero 内部的背景、星轨允许溢出到下一节上方；内容/导航侧绝对定位溢出裁剪独立控制 */
.lk-hero .lk-hero-bg,
.lk-hero .hero-orb,
.lk-hero .hero-grid,
.lk-hero .lk-stream { overflow: visible; }
.lk-main { position: relative; }
.lk-hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(640px 420px at 15% -8%, rgba(0, 202, 224, 0.18), transparent 70%),
    radial-gradient(600px 380px at 88% 4%, rgba(139, 92, 246, 0.16), transparent 70%);
}

/* ---------- 第二页（AI Agents）顶部玻璃头：玻璃只属于第二页，Hero 底部保持原样 ---------- */
main.lk-main > section.lk-section:first-of-type {
  position: relative;
  overflow: visible; /* 允许玻璃头向上溢出到 hero/section 交界处 */
  /* 最顶部 110px 完全透明：让 hero 溢出的星轨下半圆直接可见；
     110–220px 渐变为实色：既衔接卡片实色背景不穿帮，又过渡自然；
     220px 以下：完全实色 = 原 home-bg（body 背景不再直接露上来盖白） */
  background:
    linear-gradient(180deg,
      rgba(15, 15, 18, 0)    0px,
      rgba(15, 15, 18, 0)    110px,
      rgba(15, 15, 18, 0.82) 180px,
      var(--home-bg, #0F0F12) 240px);
}
[data-theme="light"] main.lk-main > section.lk-section:first-of-type {
  background:
    linear-gradient(180deg,
      rgba(247, 248, 252, 0)    0px,
      rgba(247, 248, 252, 0)    110px,
      rgba(247, 248, 252, 0.82) 180px,
      var(--home-bg, #f7f8fc) 240px);
}
/* 第二节内部所有内容都在玻璃层之上，避免文字被玻璃蒙住颜色 */
main.lk-main > section.lk-section:first-of-type > *:not(.lk-section-glass-head) {
  position: relative;
  z-index: 1;
}
.lk-section-glass-head {
  position: absolute;
  top: -110px; left: 0; right: 0;
  height: 110px;
  pointer-events: none;
  z-index: 0;
  /* 渐变：上 = 完全透明（星轨露出） → 中 = 玻璃半透明（强 blur 区） → 下 = 几乎不透明（衔接第二节实色） */
  background:
    linear-gradient(180deg,
      rgba(15, 15, 18, 0)    0%,
      rgba(15, 15, 18, 0.22) 30%,
      rgba(15, 15, 18, 0.56) 62%,
      rgba(15, 15, 18, 0.98) 100%);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border-top: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .lk-section-glass-head {
  background:
    linear-gradient(180deg,
      rgba(247, 248, 252, 0)    0%,
      rgba(247, 248, 252, 0.26) 30%,
      rgba(247, 248, 252, 0.64) 62%,
      rgba(247, 248, 252, 0.99) 100%);
  border-top-color: rgba(15,23,42,0.06);
}
@media (max-width: 640px) {
  .lk-section-glass-head { top: -82px; height: 82px; }
  main.lk-main > section.lk-section:first-of-type {
    background:
      linear-gradient(180deg,
        rgba(15, 15, 18, 0)    0px,
        rgba(15, 15, 18, 0)    82px,
        rgba(15, 15, 18, 0.82) 140px,
        var(--home-bg, #0F0F12) 200px);
  }
  [data-theme="light"] main.lk-main > section.lk-section:first-of-type {
    background:
      linear-gradient(180deg,
        rgba(247, 248, 252, 0)    0px,
        rgba(247, 248, 252, 0)    82px,
        rgba(247, 248, 252, 0.82) 140px,
        var(--home-bg, #f7f8fc) 200px);
  }
}
.lk-hero-inner { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; text-align: center; }
/* 标题背板：柔光暗化，让文字从圆环/星空中浮出 */
.lk-hero-inner::before {
  content: ''; position: absolute; left: 50%; top: 50%; z-index: -1;
  width: 130%; height: 150%; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 55% 45% at 50% 50%, rgba(7,7,13,0.55), transparent 70%);
  pointer-events: none;
}
[data-theme="light"] .lk-hero-inner::before {
  background: radial-gradient(ellipse 55% 45% at 50% 50%, rgba(255,255,255,0.55), transparent 70%);
}
.lk-hero-title {
  margin-top: clamp(16px, 2.5vw, 24px);
  font-size: clamp(36px, 6.8vw, 68px); font-weight: 800; line-height: 1.08;
  letter-spacing: -1px; color: var(--home-text);
}
.lk-hero-sub {
  margin-top: clamp(14px, 2vw, 20px);
  font-size: clamp(15px, 1.8vw, 19px); color: var(--home-text-dim); line-height: 1.7;
}
.lk-hero-cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.lk-ghost-light { color: var(--home-text); border-color: var(--home-border); background: var(--home-card); backdrop-filter: blur(8px); }
.lk-ghost-light:hover { border-color: var(--home-violet); color: var(--home-violet); }

/* 统计数据 */
.lk-stats {
  margin: 56px auto 0; display: inline-flex; align-items: center; gap: clamp(20px, 4vw, 56px);
  padding: 20px 32px; border-radius: 20px;
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.lk-hero-scroll { display: none; }
.lk-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lk-stat-num {
  font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1;
  background: var(--home-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.lk-stat-num em { font-style: normal; font-size: 0.7em; }
.lk-stat-label { font-size: 13px; color: var(--home-text-dim); letter-spacing: 0.5px; }
.lk-stat-sep { width: 1px; height: 36px; background: var(--home-border); }

/* ---------- 两侧竖向模型流 ---------- */
.lk-stream {
  position: absolute; top: 0; bottom: 0; width: 130px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 8%, #000 26%, #000 74%, transparent 92%);
          mask-image: linear-gradient(to bottom, transparent 8%, #000 26%, #000 74%, transparent 92%);
}
.lk-stream-left { left: 3%; }
.lk-stream-right { right: 3%; }
.lk-stream-track { display: flex; flex-direction: column; gap: 14px; padding: 30px 0; animation: lkStreamUp 20s linear infinite; }
.lk-stream-right .lk-stream-track { animation: lkStreamDown 24s linear infinite; }
.lk-stream-chip {
  flex-shrink: 0; width: 118px; padding: 11px 12px; border-radius: 13px;
  background: var(--home-card-strong); border: 1px solid var(--home-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-align: center; font-size: 13px; font-weight: 600; color: var(--home-text);
  box-shadow: 0 6px 16px rgba(0,0,0,0.28);
}
.lk-stream-chip.qwen { color: #818cf8; } .lk-stream-chip.deepseek { color: #a78bfa; }
.lk-stream-chip.llama { color: #22d3ee; } .lk-stream-chip.flux { color: #f472b6; }
.lk-stream-chip.yi { color: #34d399; } .lk-stream-chip.gemma { color: #f59e0b; }
.lk-stream-chip.claude { color: #fb923c; } .lk-stream-chip.gemini { color: #60a5fa; }
.lk-stream-chip.mistral { color: #fbbf24; } .lk-stream-chip.glm { color: #00CAE0; }
.lk-stream-chip.qwen-vl { color: #c084fc; } .lk-stream-chip.coder { color: #4ade80; }
.lk-stream-chip.gpt { color: #10A37F; } .lk-stream-chip.ernie { color: #2932E1; }
@keyframes lkStreamUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes lkStreamDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }

/* ---------- 通用 section（仅交界处做玻璃，节本身恢复实色，不与 hero 直接重叠） ---------- */
.lk-section { max-width: 1240px; margin: 0 auto; padding: clamp(64px, 9vw, 110px) clamp(18px, 3vw, 28px); width: 100%; }
.lk-section-alt { max-width: none; background: var(--home-card); border-top: 1px solid var(--home-border); border-bottom: 1px solid var(--home-border); }
.lk-section-alt > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.lk-section-head { text-align: center; margin-bottom: clamp(36px, 5vw, 56px); }
.lk-section-kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: var(--home-violet); padding: 5px 14px; border-radius: 999px;
  background: var(--home-accent-soft); border: 1px solid rgba(0,202,224,0.25); margin-bottom: 16px;
}
.lk-section-head h2 {
  font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; color: var(--home-text);
  letter-spacing: -0.8px; line-height: 1.2;
}
.lk-head-sub { display: block; margin-top: 6px; font-size: 0.82em; color: var(--home-text-dim); font-weight: 600; }
.lk-section-head p { margin-top: 14px; font-size: clamp(14px, 1.6vw, 16px); color: var(--home-text-dim); line-height: 1.7; }

/* ---------- AI Agents 四列卡片 ---------- */
.lk-agent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lk-agent-card {
  position: relative; padding: 28px 24px 26px; border-radius: 20px; overflow: hidden;
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform var(--duration) var(--ease-out), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.lk-agent-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 20px; opacity: 0;
  background: radial-gradient(420px 200px at 50% 0%, rgba(0,202,224,0.14), transparent 70%);
  transition: opacity var(--duration) var(--ease); pointer-events: none;
}
.lk-agent-card:hover { transform: translateY(-6px); border-color: rgba(0,202,224,0.4); box-shadow: 0 16px 40px rgba(0,0,0,0.35); }
.lk-agent-card:hover::before { opacity: 1; }
/* 顶部渐变强调线（悬停浮现） */
.lk-agent-card::after {
  content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--home-cyan, #00CAE0), var(--home-violet, #8b5cf6));
  border-radius: 0 0 2px 2px; opacity: 0; transition: opacity var(--duration) var(--ease);
  pointer-events: none;
}
.lk-agent-card:hover::after { opacity: 1; }
.lk-agent-icon { transition: transform .35s var(--ease-out), box-shadow .35s var(--ease); }
.lk-agent-card:hover .lk-agent-icon { transform: scale(1.08) rotate(-4deg); box-shadow: 0 12px 28px rgba(0,202,224,0.42); }
.lk-agent-num {
  font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--home-violet);
  background: var(--home-accent-soft); padding: 3px 10px; border-radius: 999px;
}
.lk-agent-icon {
  width: 52px; height: 52px; border-radius: 14px; margin: 18px 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--home-grad); color: #fff;
  box-shadow: 0 8px 20px rgba(0,202,224,0.32);
}
.lk-agent-icon svg { width: 24px; height: 24px; }
.lk-agent-card h3 { font-size: 18px; font-weight: 700; color: var(--home-text); margin-bottom: 10px; }
.lk-agent-card p { font-size: 14px; color: var(--home-text-dim); line-height: 1.7; }
.lk-agent-link {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 18px;
  font-size: 13px; font-weight: 600; color: var(--home-violet);
}
.lk-agent-link svg { width: 15px; height: 15px; transition: transform var(--duration) var(--ease); }
.lk-agent-link:hover svg { transform: translateX(3px); }

/* ---------- 核心能力 2×2 ---------- */
.lk-cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.lk-cap-card {
  display: flex; align-items: flex-start; gap: 22px; padding: 30px 28px; border-radius: 22px;
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform var(--duration) var(--ease-out), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.lk-cap-card:hover { transform: translateY(-4px); border-color: rgba(0,202,224,0.35); box-shadow: 0 14px 36px rgba(0,0,0,0.3); }
.lk-cap-icon {
  flex-shrink: 0; width: 58px; height: 58px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.lk-cap-icon svg { width: 26px; height: 26px; }
.lk-cap-icon { transition: transform .35s var(--ease-out); }
.lk-cap-card:hover .lk-cap-icon { transform: scale(1.1) rotate(-3deg); }
.lk-cap-icon.fi-cyan { background: rgba(0,202,224,0.14); color: #22d3ee; }
.lk-cap-icon.fi-purple { background: rgba(139,92,246,0.14); color: #a78bfa; }
.lk-cap-icon.fi-pink { background: rgba(244,114,182,0.14); color: #f472b6; }
.lk-cap-icon.fi-green { background: rgba(52,211,153,0.14); color: #34d399; }
.lk-cap-card h3 { font-size: 20px; font-weight: 700; color: var(--home-text); margin-bottom: 8px; }
.lk-cap-card p { font-size: 14px; color: var(--home-text-dim); line-height: 1.7; }

/* ---------- 技术架构 3×2 ---------- */
.lk-tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lk-tech-card {
  padding: 26px 24px; border-radius: 18px;
  background: var(--home-card); border: 1px solid var(--home-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform var(--duration) var(--ease-out), border-color var(--duration) var(--ease);
}
.lk-tech-card:hover { transform: translateY(-4px); border-color: rgba(0,202,224,0.3); }
.lk-tech-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--home-accent-soft); color: var(--home-violet);
}
.lk-tech-icon svg { width: 22px; height: 22px; }
.lk-tech-icon { transition: transform .35s var(--ease-out), background .35s var(--ease); }
.lk-tech-card:hover .lk-tech-icon { transform: translateY(-3px) scale(1.06); }
.lk-tech-card h3 { font-size: 16px; font-weight: 700; color: var(--home-text); margin-bottom: 8px; }
.lk-tech-card p { font-size: 13.5px; color: var(--home-text-dim); line-height: 1.7; }

/* ---------- CTA ---------- */
.lk-cta { position: relative; overflow: hidden; padding: clamp(70px, 10vw, 120px) 24px; text-align: center; }
.lk-cta-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(0,202,224,0.22), transparent 70%),
    radial-gradient(500px 260px at 50% 120%, rgba(139,92,246,0.18), transparent 70%),
    var(--home-card);
  border-top: 1px solid var(--home-border); border-bottom: 1px solid var(--home-border);
}
.lk-cta-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.lk-cta-inner h2 {
  font-size: clamp(30px, 5vw, 48px); font-weight: 800; color: var(--home-text); letter-spacing: -1px; line-height: 1.2;
}
.lk-cta-inner h2 span { display: block; background: var(--home-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.lk-cta-inner p { margin-top: 16px; font-size: clamp(15px, 1.8vw, 18px); color: var(--home-text-dim); }
.lk-cta-btn { margin-top: 32px; padding: 14px 32px; font-size: 16px; }
.lk-cta-btn svg { width: 18px; height: 18px; }

/* ---------- Footer ---------- */
.lk-footer {
  padding: clamp(56px, 7vw, 80px) clamp(18px, 3vw, 28px) 0;
  border-top: 1px solid var(--home-border);
  background: var(--home-bg-2);
}
.lk-footer-inner {
  max-width: 1240px; margin: 0 auto; padding-bottom: 36px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px;
}
.lk-footer-brand-row { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--home-text); font-weight: 700; font-size: 16px; }
.lk-footer-logo {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  box-shadow: 0 6px 18px var(--accent-glow); flex-shrink: 0;
}
.lk-footer-brand-text {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.lk-footer-brand-title { color: var(--home-text); font-weight: 700; font-size: 16px; }
.lk-footer-brand-sub { color: var(--home-text-dim); font-weight: 500; font-size: 12px; }
.lk-footer-brand p { font-size: 13px; line-height: 1.75; color: var(--home-text-dim); max-width: 380px; }
.lk-footer-col h4 { font-size: 14px; font-weight: 700; color: var(--home-text); margin-bottom: 16px; letter-spacing: 0.5px; }
.lk-footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.lk-footer-list li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--home-text-dim); }
.lk-footer-list li svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--home-violet); }
.lk-footer-list li a { color: var(--home-violet); }
.lk-footer-list li a:hover { text-decoration: underline; }
.lk-footer-bottom { max-width: 1240px; margin: 0 auto; padding: 20px 0; text-align: center; font-size: 12px; color: var(--home-text-dim); letter-spacing: 0.5px; border-top: 1px solid var(--home-border); }

/* ---------- 首页入场动画（lk-） ---------- */
body.boot-ready .lk-header        { animation: fadeInDown 0.6s var(--ease-out) backwards; animation-delay: .05s; }
body.boot-ready .home-badge       { animation: fadeInDown 0.5s var(--ease-out) backwards; animation-delay: .10s; }
body.boot-ready .lk-hero-title    { animation: fadeInUp 0.6s var(--ease-out) backwards; animation-delay: .18s; }
body.boot-ready .lk-hero-sub      { animation: fadeInUp 0.6s var(--ease-out) backwards; animation-delay: .26s; }
body.boot-ready .lk-hero-cta      { animation: fadeInUp 0.6s var(--ease-out) backwards; animation-delay: .34s; }
body.boot-ready .lk-stats         { animation: fadeIn 0.7s var(--ease) backwards; animation-delay: .46s; }
body.boot-ready .hero-orbit       { animation: fadeIn 1s var(--ease) backwards; animation-delay: .20s; }
body.boot-ready .lk-stream        { animation: fadeIn 1.2s var(--ease) backwards; animation-delay: .30s; }
/* 下方分区卡片/标题改为滚动入场，不再随 boot-ready 一次性播放 */

/* 下方分区：滚动入场（IntersectionObserver 触发，见 home-orbit.js；html.js 门控，无 JS 自动可见）
   注意：in-view 加在网格容器上，避免横向轮播卡片因水平出屏而不触发。 */
html.js .lk-section-head,
html.js .lk-cta-inner,
html.js .lk-footer-inner,
html.js .lk-agent-card,
html.js .lk-cap-card,
html.js .lk-tech-card {
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  will-change: opacity, transform;
}
html.js .lk-section-head.in-view,
html.js .lk-cta-inner.in-view,
html.js .lk-footer-inner.in-view,
html.js .lk-agent-grid.in-view .lk-agent-card,
html.js .lk-cap-grid.in-view .lk-cap-card,
html.js .lk-tech-grid.in-view .lk-tech-card { opacity: 1; transform: none; }
html.js .lk-agent-grid.in-view .lk-agent-card:nth-child(2) { transition-delay: .08s; }
html.js .lk-agent-grid.in-view .lk-agent-card:nth-child(3) { transition-delay: .16s; }
html.js .lk-agent-grid.in-view .lk-agent-card:nth-child(4) { transition-delay: .24s; }
html.js .lk-cap-grid.in-view .lk-cap-card:nth-child(2) { transition-delay: .08s; }
html.js .lk-cap-grid.in-view .lk-cap-card:nth-child(3) { transition-delay: .16s; }
html.js .lk-cap-grid.in-view .lk-cap-card:nth-child(4) { transition-delay: .24s; }
html.js .lk-tech-grid.in-view .lk-tech-card:nth-child(2) { transition-delay: .06s; }
html.js .lk-tech-grid.in-view .lk-tech-card:nth-child(3) { transition-delay: .12s; }
html.js .lk-tech-grid.in-view .lk-tech-card:nth-child(4) { transition-delay: .18s; }
html.js .lk-tech-grid.in-view .lk-tech-card:nth-child(5) { transition-delay: .24s; }
html.js .lk-tech-grid.in-view .lk-tech-card:nth-child(6) { transition-delay: .30s; }
@media (prefers-reduced-motion: reduce) {
  html.js .lk-section-head, html.js .lk-cta-inner, html.js .lk-footer-inner,
  html.js .lk-agent-card, html.js .lk-cap-card, html.js .lk-tech-card {
    opacity: 1 !important; transform: none !important; transition: none;
  }
}

/* 导航目标高亮波纹 */
.is-nav-target { animation: lkNavPulse 0.9s var(--ease); }
@keyframes lkNavPulse {
  0% { box-shadow: 0 0 0 0 rgba(0,202,224,0.5); }
  100% { box-shadow: 0 0 0 24px rgba(0,202,224,0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .lk-stream { display: none; }
}
@media (max-width: 980px) {
  .lk-agent-grid { grid-template-columns: repeat(2, 1fr); }
  .lk-tech-grid { grid-template-columns: repeat(2, 1fr); }
  .lk-cap-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .lk-nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--home-border); background: var(--home-card); color: var(--home-text); cursor: pointer; margin-left: auto; }
  .lk-nav-toggle svg { width: 20px; height: 20px; }
  .lk-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: 280px; max-width: 84vw;
    flex-direction: column; align-items: stretch; gap: 6px; margin: 0;
    padding: 80px 20px 24px;
    background: linear-gradient(180deg, rgba(12,12,24,0.96), rgba(7,7,13,0.98));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--home-border); box-shadow: -8px 0 32px rgba(0,0,0,0.5);
    transform: translateX(100%); transition: transform var(--duration) var(--ease-out); z-index: 60;
  }
  .lk-nav.open { transform: translateX(0); }
  .lk-nav a { padding: 12px 16px; border-radius: 12px; font-size: 15px; }
  .lk-nav-close { display: none; position: fixed; top: 18px; right: 18px; z-index: 61; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--home-border); background: var(--home-card); color: var(--home-text); cursor: pointer; align-items: center; justify-content: center; }
  .lk-nav-close.show { display: inline-flex; }
  .lk-nav-close svg { width: 20px; height: 20px; }
  .lk-nav-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,0.55); opacity: 0; transition: opacity var(--duration) var(--ease); }
  .lk-nav-overlay.show { display: block; opacity: 1; }
  .lk-actions .lk-link, .lk-actions .lk-btn-admin { display: none; }
  .lk-actions .lk-btn-reg { padding: 7px 12px; font-size: 13px; }
  .lk-brand-name { font-size: 15px; }
}
/* ≤640 规则已并入下方“首页移动端重构”区块，避免重复覆盖 */
@media (prefers-reduced-motion: reduce) {
  .lk-stream-track, .hero-orbit-ring, .hero-orbit-chip, .orbit-dot { animation: none; }
}

/* ---------- 移动端横向模型流（替代旋转圆环） ---------- */
.lk-model-marquee { display: none; }
.lk-model-marquee-track {
  display: flex; width: max-content;
  animation: mmScroll 30s linear infinite;
}
.lk-model-marquee:hover .lk-model-marquee-track,
.lk-model-marquee:focus-within .lk-model-marquee-track { animation-play-state: paused; }
.lk-mm-chip {
  flex-shrink: 0; margin-right: 10px; padding: 9px 16px; border-radius: 999px;
  background: var(--home-card-strong); border: 1px solid var(--home-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 600; color: var(--home-text);
  text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease-out), border-color .2s;
}
.lk-mm-chip:active { transform: scale(0.96); }
.lk-mm-chip.qwen{color:#818cf8} .lk-mm-chip.deepseek{color:#a78bfa}
.lk-mm-chip.llama{color:#22d3ee} .lk-mm-chip.flux{color:#f472b6}
.lk-mm-chip.yi{color:#34d399} .lk-mm-chip.gemma{color:#f59e0b}
.lk-mm-chip.claude{color:#fb923c} .lk-mm-chip.gemini{color:#60a5fa}
.lk-mm-chip.mistral{color:#fbbf24} .lk-mm-chip.glm{color:#00CAE0}
.lk-mm-chip.qwen-vl{color:#c084fc} .lk-mm-chip.coder{color:#4ade80}
.lk-mm-chip.gpt{color:#10A37F} .lk-mm-chip.ernie{color:#2932E1}
/* margin-right 使每项含尾随间距，translateX(-50%) 恰好平移一组，无缝循环 */
@keyframes mmScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   首页 · 移动端重构（≤768 / ≤640 / ≤480）
   独立精致移动体验：通透、紧凑、触感友好
   同时支持 JS 检测的 body.is-mobile 类（容器模拟场景）
   ============================================================ */
@media (max-width: 768px), body.is-mobile {
  /* 全局防横向溢出 + 去除点击高亮 */
  .home-body, .lk-main { overflow-x: hidden; }
  .home-body { -webkit-tap-highlight-color: transparent; }

  /* 移动端容器宽度限制，防止内容溢出 */
  .lk-main, .lk-hero-inner, .lk-section, .lk-cta-inner, .lk-footer-inner {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* 顶栏：移动端默认启用玻璃背景，不依赖滚动状态 */
  .lk-header {
    padding-top: env(safe-area-inset-top);
    background: var(--home-card-strong);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--home-border);
    box-shadow: 0 2px 14px rgba(0,0,0,0.22);
  }
  [data-theme="light"] .lk-header {
    background: rgba(255,255,255,0.82);
    box-shadow: 0 2px 14px rgba(15,23,42,0.08);
  }
  .lk-header-inner { padding: 10px 14px; gap: 8px; }
  .lk-brand { gap: 8px; }
  .lk-brand .dev-tag { font-size: 10px; padding: 1px 6px; }
  .lk-actions { gap: 6px; }
  .lk-actions .lk-btn-reg { padding: 6px 10px; font-size: 12px; }

  /* Hero：移动端占满首屏，内容自然滚动 */
  .lk-hero {
    padding: calc(96px + env(safe-area-inset-top)) 16px 32px;
    min-height: 100vh;
    position: relative;
  }
  .lk-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  /* 隐藏桌面端装饰：栅格/圆环/拖尾/两侧模型流，仅保留柔和光晕与星空 */
  .hero-grid, .hero-orbit, .hero-trail-canvas, .lk-stream { display: none; }
  .hero-orb { opacity: 0.45; }
  .hero-orb.orb-1 { width: 220px; height: 220px; }
  .hero-orb.orb-2 { width: 260px; height: 260px; }
  .hero-orb.orb-3 { width: 180px; height: 180px; }

  .home-badge { font-size: 11.5px; padding: 5px 11px; margin-bottom: 12px; }
  .lk-hero-title {
    font-size: clamp(30px, 8.5vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.5px;
  }
  .lk-hero-sub {
    font-size: 14px; line-height: 1.7;
    max-width: 320px; margin: 12px auto 0;
    word-break: break-word;
  }

  /* CTA：两按钮并排等宽，紧凑适配小屏，彻底覆盖桌面端基础样式 */
  .lk-hero-cta {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    margin-top: 20px !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .lk-hero-cta .btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: calc(50% - 3px) !important;
    width: auto !important;
    padding: 8px 6px !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    border-width: 1px !important;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .lk-hero-cta .btn svg {
    flex-shrink: 0 !important;
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
  }
  .lk-hero-cta .btn-primary {
    box-shadow: 0 6px 18px var(--accent-glow);
    background: var(--gradient-accent);
    border: none !important;
  }
  .lk-hero-cta .btn-primary:active {
    box-shadow: 0 8px 22px var(--accent-glow);
    transform: scale(0.97);
  }
  .lk-hero-cta .btn-ghost:active {
    transform: scale(0.97);
  }
  .lk-hero-cta .btn span { display: inline !important; }

  /* 横向模型流 + 两侧渐隐 */
  .lk-model-marquee {
    display: block; margin-top: 24px; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  }
  .lk-mm-chip { padding: 8px 14px; font-size: 12.5px; }

  /* 统计：玻璃胶囊三列横排，与上方 CTA 拉开间距，带微妙分隔 */
  .lk-stats {
    margin: 24px auto 40px; flex-direction: row;
    gap: clamp(6px, 2vw, 16px); padding: 12px 14px;
    border-radius: 14px;
    background: var(--home-card-strong);
    border: 1px solid var(--home-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .lk-stat-sep { width: 1px; height: 24px; background: var(--home-border); }
  .lk-stat-num { font-size: 22px; font-weight: 700; }
  .lk-stat-label { font-size: 11px; color: var(--home-text-soft); }

  /* 移动端下滑指示器 */
  .lk-hero-scroll {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 28px auto 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--home-card-strong);
    border: 1px solid var(--home-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--home-text-soft);
    font-size: 12px;
    text-decoration: none;
    animation: scrollBounce 2s ease-in-out infinite;
  }
  .lk-scroll-hint { letter-spacing: 0.5px; }
  .lk-scroll-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: chevronFloat 2s ease-in-out infinite;
  }
  .lk-scroll-chevron svg { width: 16px; height: 16px; }

  @keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
  }
  @keyframes chevronFloat {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(4px); opacity: 1; }
  }

  /* 区块节奏 */
  .lk-section { padding: 48px 16px; overflow: hidden; }
  .lk-section-head { margin-bottom: 28px; }
  .lk-section-kicker { font-size: 11px; letter-spacing: 2px; padding: 4px 12px; }
  .lk-section-head h2 { font-size: clamp(24px, 6.5vw, 30px); }
  .lk-section-head p { font-size: 14px; }

  /* 核心能力：纵向卡片，图标置顶 + 彩色强调 */
  .lk-cap-grid { grid-template-columns: 1fr; gap: 14px; }
  .lk-cap-card {
    flex-direction: column; align-items: flex-start; gap: 14px;
    padding: 22px 20px; border-radius: 18px;
  }
  .lk-cap-icon { width: 50px; height: 50px; border-radius: 14px; }

  /* 移动端：禁用桌面端 hover 动画，避免触屏粘性触发跳动 */
  .lk-agent-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .lk-agent-card::before { opacity: 0 !important; }
  .lk-agent-card::after { opacity: 0 !important; }
  .lk-agent-card:hover .lk-agent-icon { transform: none; box-shadow: none; }
  .lk-cap-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .lk-cap-card:hover .lk-cap-icon { transform: none; }
  .lk-tech-card:hover { transform: none; }
  .lk-tech-card:hover .lk-tech-icon { transform: none; }
  /* 触感反馈：卡片按下微缩（替代 hover 效果） */
  .lk-agent-card:active,
  .lk-cap-card:active,
  .lk-tech-card:active { transform: scale(0.985); }

  /* CTA 区 */
  .lk-cta { padding: 56px 18px; }
  .lk-cta-inner h2 { font-size: clamp(26px, 7vw, 32px); }
  .lk-cta-btn { width: 100%; margin-top: 22px; }

  /* Footer */
  .lk-footer { padding: 44px 16px 0; }
  .lk-footer-inner { grid-template-columns: 1fr; gap: 24px; padding-bottom: 26px; }
  .lk-footer-brand p { max-width: none; }
}

@media (max-width: 640px), body.is-mobile {
  /* Agent 卡片：横向滑动轮播（带下一张预览） */
  .lk-agent-grid {
    display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scroll-padding-left: 16px;
    padding: 4px 16px 14px; margin: 0 -16px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .lk-agent-grid::-webkit-scrollbar { display: none; }
  .lk-agent-card { flex: 0 0 86%; max-width: 86%; scroll-snap-align: center; }

  /* 技术架构：两列紧凑 */
  .lk-tech-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lk-tech-card { padding: 18px 14px; }
  .lk-tech-icon { width: 38px; height: 38px; border-radius: 10px; margin-bottom: 10px; }
  .lk-tech-icon svg { width: 19px; height: 19px; }
  .lk-tech-card h3 { font-size: 14.5px; }
  .lk-tech-card p { font-size: 12px; line-height: 1.6; }
}

@media (max-width: 480px), body.is-mobile {
  /* Hero 极窄屏：字号与留白 */
  .lk-hero { padding: calc(84px + env(safe-area-inset-top)) 14px 44px; }
  .lk-hero-title { font-size: clamp(26px, 9vw, 32px); }
  .lk-hero-cta .btn { padding: 8px 5px !important; font-size: 12.5px !important; }
  .lk-model-marquee-track { animation-duration: 24s; }

  /* 区块进一步收紧 */
  .lk-section { padding: 40px 14px; }
  .lk-section-head { margin-bottom: 24px; }
  .lk-agent-card { flex: 0 0 88%; max-width: 88%; padding: 20px 16px 18px; }
  .lk-cap-card { padding: 20px 16px; }
  .lk-cap-icon { width: 46px; height: 46px; }

  /* 统计极窄 */
  .lk-stats { gap: 6px; padding: 12px; margin: 24px auto 40px; }
  .lk-stat-num { font-size: 20px; }

  /* CTA / Footer */
  .lk-cta { padding: 48px 14px; }
  .lk-footer { padding: 36px 14px 0; }

  /* 顶栏极窄屏：仅保留 AI 标识 + 注册 + 菜单 */
  .lk-brand-name { display: none; }
  .lk-actions .lk-btn-reg { padding: 6px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .lk-model-marquee-track { animation: none; }
}

/* ============================================================
   侧边栏 · 功能分类导航（解剧本 / 漫剧 / 生图）
   ============================================================ */
.cat-nav {
  display: flex; gap: 6px; padding: 10px 10px 4px;
  border-bottom: 1px solid var(--border);
}
.cat-item {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all var(--duration) var(--ease);
  white-space: nowrap; overflow: hidden;
}
.cat-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.cat-item .cat-label { overflow: hidden; text-overflow: ellipsis; }
.cat-item:hover { background: var(--bg-hover); color: var(--text); }
.cat-item.active {
  background: var(--accent-light); color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.sidebar.collapsed .cat-nav { display: none; }

/* ============================================================
   生图工作台（workspace）
   ============================================================ */
.workspace {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--bg); overflow: hidden;
}
.workspace[hidden] { display: none; }

.ws-header {
  padding: 12px clamp(12px,2vw,20px); border-bottom: 1px solid var(--border);
  background: var(--bg-elevated); display: flex; align-items: center; gap: 12px; z-index: 5;
}
.ws-header .menu-toggle { display: none; }
.ws-title { font-weight: 600; flex: 1; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.ws-title svg { width: 18px; height: 18px; color: var(--accent); }

/* ws-body：画廊主体区域，底部不留 padding，让画廊背景容器延伸到 ws-image 底部（包含 Dock 栏） */
.ws-body {
  flex: 1; min-height: 0;
  overflow: hidden;
  padding: 18px 18px 0;
  position: relative;
}

/* === 全屏画廊主体（占满 ws-body，背景容器延伸到 ws-image 底部，包含 Dock 栏） === */
.studio-gallery {
  height: 100%;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 280px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
  scroll-behavior: smooth;
}
/* 旧 id=studioResult 同时具备 .studio-result 旧类，这里覆盖其背景/边框（该类已不再使用网格布局） */
.studio-result#studioResult {
  height: 100%;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 280px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
/* 画廊网格（用于生成结果） */
.studio-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  align-content: start;
}
/* 由于生成项直接挂在 studioResult 下（没有外层 grid），直接让 studioResult 自己变成 grid */
.studio-gallery,
.studio-result#studioResult {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-content: start;
}
/* 空状态需要独占整个区域（取消 grid 定位对其影响） */
.studio-gallery > .gen-empty,
.studio-result#studioResult > .gen-empty {
  grid-column: 1 / -1;
  min-height: 320px;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.studio-gallery > *,
.studio-result#studioResult > * {
  min-width: 0;
}

/* === 生成图片卡片（画廊项） === */
.gallery-item.studio-gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
  animation: msgIn 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
}
.gallery-item.studio-gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.gallery-item.studio-gallery-item .gi-img-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  /* 保持原图比例，不留白，让图片更突出作为主体 */
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item.studio-gallery-item .gi-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.35s var(--ease);
}
.gallery-item.studio-gallery-item:hover .gi-img-wrap img {
  transform: scale(1.04);
}
/* 悬浮放大按钮遮罩 */
.gallery-item.studio-gallery-item .gi-hover {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 55%);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  pointer-events: none;
}
.gallery-item.studio-gallery-item:hover .gi-hover {
  opacity: 1;
  pointer-events: auto;
}
.gi-zoom-btn {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.gi-zoom-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.06);
}
.gi-zoom-btn svg { width: 18px; height: 18px; }
/* 卡片底部 meta */
.gallery-item.studio-gallery-item .gi-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-secondary);
}
.gallery-item.studio-gallery-item .gi-seed {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.gallery-item.studio-gallery-item .gi-dl {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.gallery-item.studio-gallery-item .gi-dl:hover {
  color: var(--accent);
  background: var(--accent-light);
}
.gallery-item.studio-gallery-item .gi-dl svg { width: 14px; height: 14px; }

/* === 底部 Dock 栏（macOS Dock 风格紧凑悬浮） === */
.ws-image {
  position: relative;
}
.studio-dock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-width: min(720px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  width: fit-content;
  background: rgba(var(--bg-elevated-rgb, 30, 30, 38), 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 2px 10px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: box-shadow 0.22s, transform 0.22s, padding 0.22s;
}
/* 弹层/大面板打开时给 dock 顶部多一道高光 */
.studio-dock.has-pop,
.studio-dock.is-panel-open {
  box-shadow: 0 16px 52px rgba(0,0,0,0.45), 0 2px 10px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ====== 上方浮动输入大面板（Dock 其余元素完全不变，仅这块弹出） ====== */
.dock-input-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 18;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle, rgba(128,128,128,0.18));
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 4px 16px rgba(0,0,0,0.18);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  animation: dipIn 0.18s var(--ease-out);
}
.dock-input-panel[hidden] { display: none !important; }
@keyframes dipIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 指向 Dock 上紧凑输入框的小箭头 */
.dip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* 大面板 textarea */
.dip-textarea {
  width: 100%;
  min-height: 160px;
  max-height: 320px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.58;
  resize: none;
  outline: none;
  overflow-y: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.dip-textarea::placeholder { color: var(--text-tertiary); }
.dip-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 99, 102, 241), 0.12);
}
body.lb-open {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Dock 分组 */
.dock-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dock-group-right { gap: 6px; }

/* Dock 按钮 */
.dock-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s, border-color 0.15s;
  white-space: nowrap;
}
.dock-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.dock-btn:active {
  transform: scale(0.96);
}
.dock-btn svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.dock-btn .dock-label {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 激活态（弹层打开时由 JS 加 .is-active） */
.dock-btn.is-active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb, 99, 102, 241), 0.25);
}

/* 参考图小徽标 */
.dock-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px var(--accent-glow);
}

/* 中间提示词输入 */
.dock-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.dock-input {
  width: 100%;
  height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  max-height: 120px;
  overflow-y: auto;
}
.dock-input::placeholder { color: var(--text-tertiary); }
.dock-input:focus {
  border-color: var(--accent);
  background: rgba(0,0,0,0.28);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 99, 102, 241), 0.12);
}

/* 生成按钮（强调样式） */
.dock-btn.dock-gen-btn {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  padding: 8px 18px;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.dock-btn.dock-gen-btn:hover {
  background: var(--accent-strong, #7c7cf0);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow);
}
.dock-btn.dock-gen-btn:active {
  transform: translateY(0) scale(0.97);
}
.dock-btn.dock-gen-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.dock-btn.dock-gen-btn svg { width: 16px; height: 16px; }

/* === 浅色模式下 Dock 栏适配 === */
[data-theme="light"] .studio-dock {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.12), 0 2px 8px rgba(16, 24, 40, 0.06), inset 0 1px 0 rgba(255,255,255,0.6);
}
[data-theme="light"] .studio-dock.has-pop,
[data-theme="light"] .studio-dock.is-panel-open {
  box-shadow: 0 12px 36px rgba(16, 24, 40, 0.16), 0 2px 8px rgba(16, 24, 40, 0.06), inset 0 1px 0 rgba(255,255,255,0.7);
}
[data-theme="light"] .dock-btn { color: var(--text-secondary); }
[data-theme="light"] .dock-btn:hover {
  background: rgba(16, 24, 40, 0.06);
  color: var(--text);
}
[data-theme="light"] .dock-btn.dock-gen-btn {
  color: #fff;
}
[data-theme="light"] .dock-btn.dock-gen-btn:hover {
  color: #fff;
}
[data-theme="light"] .dock-input {
  background: rgba(16, 24, 40, 0.04);
  color: var(--text);
}
[data-theme="light"] .dock-input::placeholder { color: var(--text-tertiary); }
[data-theme="light"] .dock-input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
[data-theme="light"] .dock-input-panel {
  background: var(--bg-elevated);
  border-color: var(--border);
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.16), 0 4px 12px rgba(16, 24, 40, 0.08);
}
[data-theme="light"] .dip-textarea {
  background: rgba(16, 24, 40, 0.03);
  color: var(--text);
}
[data-theme="light"] .dock-pop {
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16), 0 4px 12px rgba(16, 24, 40, 0.08);
}

/* === Dock 弹层（小卡片，从 dock 上方弹出） === */
.dock-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 12px;
  z-index: 20;
  min-width: 240px;
  max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: dockPopIn 0.18s var(--ease-out);
}
.dock-pop[hidden] { display: none !important; }
.dock-pop-wide { min-width: 360px; max-width: 420px; }
@keyframes dockPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 弹层下方箭头（指向触发按钮） */
.dock-pop .dp-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dock-pop .dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}
.dock-pop .dp-head span { text-transform: uppercase; }
.dock-pop .dp-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 24px; height: 24px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.dock-pop .dp-close:hover { background: var(--bg-hover); color: var(--text); }
.dock-pop .dp-close svg { width: 14px; height: 14px; }
.dock-pop .dp-body {
  padding: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

/* 弹层 - 风格 chips */
.dock-pop .style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dock-pop .style-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.dock-pop .style-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.dock-pop .style-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.dock-pop .style-chip .sc-desc { display: none; }

/* 弹层 - 模型列表 */
.dock-pop .dp-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dock-pop .dp-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.dock-pop .dp-model-item:hover {
  background: var(--bg-hover);
}
.dock-pop .dp-model-item.is-active {
  background: var(--accent-light);
  border-color: rgba(var(--accent-rgb, 99, 102, 241), 0.25);
  color: var(--accent);
  font-weight: 600;
}
.dock-pop .dp-model-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

/* 弹层 - 参考图区 */
.dock-pop .ref-upload.ref-upload-compact {
  padding: 18px 12px;
  font-size: 12.5px;
  flex-direction: column;
  gap: 8px;
}
.dock-pop .ref-upload.ref-upload-compact svg { width: 22px; height: 22px; }
.dock-pop .ref-preview.ref-preview-compact {
  max-width: 100%;
  display: block;
}
.dock-pop .ref-preview.ref-preview-compact img {
  max-height: 200px;
  border-radius: var(--radius-sm);
}

/* 弹层 - 高级参数 */
.dock-pop .adv-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.dock-pop .adv-row:last-child { margin-bottom: 0; }
.dock-pop .adv-row .field { flex: 1; min-width: 0; }
.dock-pop .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dock-pop .field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}
.dock-pop .field .input,
.dock-pop .field .textarea {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
}
.dock-pop .field .textarea { resize: vertical; min-height: 50px; }

/* === 空状态适配 === */
.gen-empty { width: 100%; }

/* 工作室 section 通用 */
.studio-section { display: flex; flex-direction: column; gap: 7px; }
.studio-section .studio-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* 风格 chips 默认（也兼容原 select 风格） */
.style-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.style-chip {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--bg); color: var(--text-secondary); cursor: pointer;
  font-size: 13px; transition: all var(--duration) var(--ease);
}
.style-chip:hover { border-color: var(--accent); color: var(--accent); }
.style-chip.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.style-chip .sc-desc { font-size: 11px; opacity: 0.7; margin-left: 4px; }

/* 参考图上传（保留兼容） */
.ref-upload {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 22px 12px; text-align: center; cursor: pointer; color: var(--text-tertiary);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all var(--duration) var(--ease);
}
.ref-upload svg { width: 26px; height: 26px; }
.ref-upload:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.ref-upload.dragover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.ref-preview { position: relative; display: inline-block; max-width: 100%; }
.ref-preview img {
  max-width: 100%; max-height: 220px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); display: block;
}
.ref-preview .ref-del {
  position: absolute; top: 6px; right: 6px; background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.ref-preview .ref-del:hover { color: var(--danger); }

/* 高级参数折叠（保留兼容） */
.advanced-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-secondary); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all var(--duration) var(--ease);
}
.advanced-toggle svg { width: 16px; height: 16px; }
.advanced-toggle .adv-chev { margin-left: auto; transition: transform var(--duration) var(--ease); }
.advanced-toggle:hover { background: var(--bg-hover); color: var(--text); }
.advanced-toggle.open .adv-chev { transform: rotate(180deg); }
.advanced-body {
  display: none; flex-direction: column; gap: 10px;
  padding-top: 4px;
}
.advanced-body.open { display: flex; animation: dropIn 0.18s var(--ease-out); }
.adv-row { display: flex; gap: 10px; }
.adv-row .field { flex: 1; min-width: 0; }

/* === 图片 Lightbox（非全屏，居中弹框） === */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  animation: lbFadeIn 0.2s ease;
}
.img-lightbox[hidden] { display: none !important; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.il-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  z-index: 0;
}
/* Lightbox 卡片容器（非全屏，居中显示） */
.il-card {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  height: min(780px, 100%);
  max-height: calc(100vh - 48px);
  background: #15171b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: lbCardIn 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes lbCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.il-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.il-close:hover { background: rgba(255,255,255,0.18); transform: scale(1.05); }
.il-close svg { width: 18px; height: 18px; }

/* 工具栏（顶部居中） */
.il-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  color: #fff;
}
.il-tbtn {
  width: 34px; height: 34px;
  border-radius: 10px;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.il-tbtn:hover { background: rgba(255,255,255,0.14); }
.il-tbtn:active { background: rgba(255,255,255,0.22); }
.il-tbtn svg { width: 18px; height: 18px; }
.il-zoom-val {
  min-width: 56px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  color: rgba(255,255,255,0.85);
}
.il-tsep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.18);
  margin: 0 2px;
}

/* 图片舞台：占满卡片内部区域，留顶部/底部间距给工具栏/提示 */
.il-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 60px 20px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: grab;
  touch-action: none; /* 关键：关闭默认触摸滚动 / 双指手势，让 JS 处理 */
}
.il-stage:active { cursor: grabbing; }
.il-img {
  max-width: 100%;
  max-height: 100%;
  /* 关键：不要用 object-fit（它与 transform scale 叠加会出问题），使用自然尺寸 */
  transform-origin: center center;
  -webkit-user-drag: none;
  user-select: none;
  will-change: transform;
  transition: filter 0.15s;
  border-radius: 8px;
}
.il-img.is-dragging {
  filter: brightness(0.95);
  cursor: grabbing !important;
}

/* 底部提示 */
.il-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 5px 13px;
  border-radius: 999px;
  pointer-events: none;
  transition: opacity 0.25s;
}
.il-hint.il-hidden {
  opacity: 0;
}

/* Lightbox 重新生成按钮（右下角） */
.il-regen-btn {
  position: absolute;
  bottom: 18px;
  right: 18px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent, #6366f1);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
}
.il-regen-btn:hover {
  background: var(--accent-hover, #7c7ff5);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,.5);
}
.il-regen-btn svg { width: 16px; height: 16px; }
.il-regen-btn[hidden] { display: none; }

/* 生成按钮（保留兼容） */
.studio-gen-btn {
  margin-top: 4px; padding: 12px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.studio-gen-btn svg { width: 18px; height: 18px; }

/* 结果区空态（兼容保留定义） */
.gen-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 320px; gap: 8px; color: var(--text-tertiary); text-align: center;
}
.gen-empty svg { width: 48px; height: 48px; opacity: 0.5; }
.gen-empty p { margin: 0; font-size: 14px; }
.gen-empty .card-desc { font-size: 12px; }

/* 生成元信息行（兼容保留） */
.gen-meta {
  padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
}
.gen-meta strong { color: var(--accent); font-weight: 600; }

/* 图片画廊（兼容保留：.image-gallery 与 .gallery-item 基础类） */
.image-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.gallery-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  animation: msgIn 0.35s var(--ease-out);
}
.gallery-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gallery-item img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; display: block; cursor: zoom-in; }
.gallery-item.zoomed img { max-height: none; object-fit: contain; }
.gallery-meta {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff; font-size: 11px;
}
.gallery-meta .seed { opacity: 0.85; }
.gallery-meta .dl-btn {
  color: #fff; padding: 4px; border-radius: 6px; text-decoration: none;
  display: inline-flex; align-items: center;
}
.gallery-meta .dl-btn:hover { background: rgba(255,255,255,0.18); }
.gallery-meta .dl-btn svg { width: 15px; height: 15px; }

/* ============================================================
   管理后台 · 功能模块面板（风格 / 模型清单行）
   ============================================================ */
.style-list { display: flex; flex-direction: column; gap: 10px; }
.style-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color var(--duration) var(--ease);
}
.style-row:hover { border-color: var(--border-strong); }
.style-row .input { flex: 1; min-width: 0; }
.style-row .style-id { flex: 0 0 130px; }
.style-row .style-name { flex: 0 0 150px; }
.style-chk {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.style-chk input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}
.style-row .style-del { flex-shrink: 0; color: var(--text-tertiary); }
.style-row .style-del:hover { color: var(--danger); background: var(--danger-light); }

/* 后台风格配置：带预览图的新版一行布局 */
.style-row-image {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.style-preview {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  border-radius: 8px;
  background-color: var(--bg-elevated, #18191c);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-subtle, #2a2c33);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #9ea0aa);
  flex-shrink: 0;
}
.style-preview svg { width: 24px; height: 24px; opacity: .6; }
.style-row-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.srf-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.srf-line .style-id { flex: 0 0 130px; }
.srf-line .style-name { flex: 0 0 150px; }
.srf-line .style-suffix { flex: 1; }
.srf-line .style-preview-url { flex: 1; }

/* ============================================================
   生图工作台 · 响应式
   ============================================================ */
@media (max-width: 1100px) {
  .studio-gallery,
  .studio-result#studioResult {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
@media (max-width: 900px) {
  .ws-body { padding: 12px 12px 0; overflow-y: auto; }
  .ws-header .menu-toggle { display: inline-flex; }
  .studio-gallery,
  .studio-result#studioResult {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 12px 12px 280px;
  }
  .gallery-item.studio-gallery-item { aspect-ratio: 3 / 4; }
  /* Dock 栏：窄屏下隐藏按钮的文字 label，只保留图标，给提示词腾空间 */
  .dock-btn .dock-label { display: none; }
  .dock-btn { padding: 8px 10px; }
  .studio-dock {
    min-width: calc(100vw - 24px);
    bottom: 12px;
    padding: 6px 8px;
    gap: 4px;
  }
  .dock-gen-btn span { display: none; }
  .dock-gen-btn { padding: 8px 12px; }
  .dock-pop-wide { min-width: 280px; max-width: calc(100vw - 32px); }
  .dock-pop { max-width: calc(100vw - 32px); }
  /* 小屏大面板：高度略降低，内边距减小 */
  .dock-input-panel { padding: 12px; bottom: calc(100% + 8px); }
  .dip-textarea { min-height: 130px; max-height: 260px; font-size: 13.5px; padding: 10px 12px; }
}
@media (max-width: 640px) {
  .cat-nav { padding: 8px 8px 4px; }
  .cat-item { padding: 8px 4px; font-size: 12px; }
  .cat-item .cat-label { display: none; }
  .cat-item svg { width: 18px; height: 18px; }
  .style-row { flex-wrap: wrap; }
  .style-row .style-id, .style-row .style-name { flex: 1 1 100%; }
  .studio-gallery,
  .studio-result#studioResult {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 10px 280px;
  }
  .gallery-item.studio-gallery-item { aspect-ratio: 3 / 4; border-radius: 10px; }
  .gallery-item.studio-gallery-item .gi-meta {
    padding: 6px 8px;
    font-size: 10.5px;
  }
  .dock-pop .adv-row { flex-direction: column; gap: 8px; }
}

/* ============================================================
   Muse AI 风格 · 极窄图标侧栏（覆盖旧 .sidebar/.cat-nav）
   ============================================================ */
.chat-app.muse-layout { display: flex; height: 100vh; min-height: 100vh; width: 100%; overflow: hidden; background: var(--bg); }
.sidebar.muse-rail {
  width: 64px; min-width: 64px; max-width: 64px; flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; gap: 8px;
  position: relative; z-index: 20;
}
.sidebar.muse-rail .rail-brand { width: 100%; display: flex; flex-direction: column; align-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; position: relative; }
.rail-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gradient-accent); color: #fff;
  font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.rail-logo-img {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.rail-group {
  width: 100%; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 6px 0;
}
.sidebar.muse-rail .rail-bottom {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}

/* rail-btn：图标按钮 + tooltip 气泡 */
.rail-btn {
  position: relative;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent; color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--duration) var(--ease);
  padding: 0;
}
.rail-btn:hover, .rail-btn:focus-visible {
  background: var(--bg-hover); color: var(--text); border-color: var(--border);
}
.rail-btn.is-active, .rail-cat-btn.is-active {
  background: var(--accent-light); color: var(--accent-hover); border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.rail-btn.is-active svg, .rail-cat-btn.is-active svg { color: var(--accent-hover); }
.rail-btn svg { width: 20px; height: 20px; color: inherit; }
.rail-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gradient-accent); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 侧边栏积分按钮：图标在上 + 数字在下 */
.rail-credits-btn {
  flex-direction: column;
  gap: 1px;
}
.rail-credits-btn svg {
  width: 16px; height: 16px;
  color: #f5b301;
}
.rail-credits-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* tooltip 气泡（Muse 风格 · 出现在按钮右侧） */
.rail-tooltip {
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 120px; max-width: 240px;
  color: var(--text); font-size: 12.5px; line-height: 1.5;
  white-space: nowrap;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
  z-index: 999;
}
.rail-tooltip::before {
  content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.rail-tooltip strong { display: block; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.rail-tooltip span { display: block; color: var(--text-secondary); font-size: 11.5px; }
.brand-tip { font-weight: 700; color: var(--accent-hover) !important; }
.rail-btn:hover .rail-tooltip,
.rail-btn:focus-visible .rail-tooltip {
  opacity: 1; visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* 旧的 cat-nav / sidebar 样式被覆盖：保证新的 muse-rail 生效 */
.chat-app .sidebar:not(.muse-rail) { width: 260px; }
.muse-layout .cat-nav { display: none !important; }

/* ============================================================
   历史对话卡片（无当前会话时在消息区展示）
   ============================================================ */
.history-cards[hidden] { display: none !important; }
.history-cards {
  max-width: 760px; margin: 0 auto; padding: 8px 0 24px; width: 100%;
}
.hc-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 14px; padding: 0 4px;
}
.hc-title-left { display: inline-flex; align-items: center; gap: 8px; }
.hc-title-right { display: inline-flex; align-items: center; gap: 6px; }
.hc-title svg { width: 16px; height: 16px; }
.hc-manage-btn { font-size: 12.5px; }
.hc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.hc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.hc-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover, var(--bg-elevated));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
/* 批量模式 */
.hc-card.is-batch { cursor: default; }
.hc-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.hc-check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-radius: 6px;
  z-index: 1;
}
.hc-check.is-checked { color: var(--accent); }
.hc-check svg, .hc-check i { width: 18px; height: 18px; }
.hc-card.is-batch .hc-card-head { padding-right: 26px; }
/* 批量操作栏 */
.hc-batch-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: sticky; bottom: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.hc-batch-bar .hc-batch-count {
  flex: 1; font-size: 13px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.hc-batch-bar .hc-batch-all { color: var(--text-secondary); }
.hc-batch-bar .hc-batch-all:hover { color: var(--accent); background: var(--accent-light); }
.hc-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-secondary);
}
.hc-cat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  font-weight: 500;
}
.hc-cat svg { width: 12px; height: 12px; }
.hc-time { opacity: 0.7; font-size: 11px; }
.hc-card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hc-card-preview {
  font-size: 12px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.4;
}

/* ============================================================
   聊天气泡 & Markdown 排版
   ============================================================ */
.messages-inner {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px clamp(14px,2.5vw,24px) 32px !important;
  width: 100% !important; max-width: none !important; margin: 0 !important;
}
.msg {
  display: flex; width: 100%;
  margin: 0; animation: msgIn 0.2s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-user { justify-content: flex-end; }
.msg-assistant { justify-content: flex-start; }
.msg-bubble {
  max-width: 80%; padding: 11px 15px; border-radius: 14px;
  font-size: 14px; line-height: 1.65; word-break: break-word; position: relative;
}
.msg-user .msg-bubble {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-assistant .msg-bubble {
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
/* AI 回复底部：meta + 复制按钮同一行 */
.msg-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 6px;
  border-top: 1px solid var(--border);
}
.msg-meta {
  flex: 1; min-width: 0;
  font-size: 11px; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  user-select: none;
}
.msg-meta-cost {
  display: inline-flex; align-items: center; gap: 3px;
}
.msg-meta-cost svg, .msg-meta-cost i { width: 12px; height: 12px; color: var(--info); }
.msg-meta-balance {
  display: inline-flex; align-items: center; gap: 3px;
}
.msg-meta-balance svg, .msg-meta-balance i { width: 12px; height: 12px; color: var(--info); }
/* AI 回复复制按钮 */
.msg-copy {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
  padding: 3px 8px;
  border: none; background: transparent;
  color: var(--text-tertiary); cursor: pointer;
  border-radius: 6px; font-size: 11px;
  transition: background 0.15s, color 0.15s;
}
.msg-copy svg, .msg-copy i { width: 13px; height: 13px; }
.msg-copy:hover { background: var(--bg-hover); color: var(--text); }
.msg-bubble.is-loading .msg-footer { display: none; }
.msg-assistant .msg-bubble.is-loading { min-height: 36px; }
.msg-text > *:first-child { margin-top: 0; }
.msg-text > *:last-child { margin-bottom: 0; }
.msg-text p { margin: 0 0 8px; }
.msg-text p:last-child { margin-bottom: 0; }

/* Markdown 元素 */
.msg-text strong { font-weight: 650; }
.msg-user .msg-text strong { color: #fff; }
.msg-text em { font-style: italic; }
.msg-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg-user .msg-text a { color: #fff; opacity: 0.9; }

.msg-text .md-h1, .msg-text .md-h2, .msg-text .md-h3 {
  font-weight: 650; margin: 12px 0 6px; line-height: 1.3;
}
.msg-text .md-h1 { font-size: 18px; }
.msg-text .md-h2 { font-size: 16px; }
.msg-text .md-h3 { font-size: 15px; }

.msg-text .md-ul { list-style: none; padding-left: 0; margin: 6px 0; }
.msg-text .md-ul li {
  position: relative; padding-left: 16px; margin-bottom: 3px;
}
.msg-text .md-ul li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-secondary);
}
.msg-user .msg-text .md-ul li::before { background: rgba(255,255,255,0.7); }

.msg-text .md-pre {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 13px; margin: 8px 0;
  overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.msg-text .md-pre code {
  font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
  color: var(--text); background: none; padding: 0; font-size: 13px;
}
.msg-text .md-code {
  font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
  font-size: 13px; background: var(--bg); padding: 1px 5px;
  border-radius: 4px; border: 1px solid var(--border);
}
.msg-user .msg-text .md-code { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2); color: #fff; }
.msg-user .msg-text .md-pre { background: rgba(0,0,0,0.2); border-color: rgba(255,255,255,0.15); }

/* Markdown 表格 */
.msg-text .md-table-wrap {
  overflow-x: auto; margin: 8px 0; border-radius: 8px;
  border: 1px solid var(--border); -webkit-overflow-scrolling: touch;
}
.msg-text .md-table {
  width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5;
  white-space: nowrap;
}
.msg-text .md-table thead { background: var(--bg); }
.msg-text .md-table th {
  padding: 8px 12px; text-align: left; font-weight: 650; font-size: 12.5px;
  color: var(--text); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
.msg-text .md-table td {
  padding: 7px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: top;
}
.msg-text .md-table tbody tr:last-child td { border-bottom: none; }
.msg-text .md-table tbody tr:nth-child(even) { background: rgba(128,128,128,0.06); }
.msg-text .md-table tbody tr:hover { background: rgba(128,128,128,0.10); }
.msg-text .md-table strong { font-weight: 650; }
/* 用户消息内的表格适配 */
.msg-user .msg-text .md-table-wrap { border-color: rgba(255,255,255,0.2); }
.msg-user .msg-text .md-table thead { background: rgba(0,0,0,0.18); }
.msg-user .msg-text .md-table th { color: #fff; border-bottom-color: rgba(255,255,255,0.2); }
.msg-user .msg-text .md-table td { color: #fff; border-bottom-color: rgba(255,255,255,0.15); }
.msg-user .msg-text .md-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.08); }
.msg-user .msg-text .md-table tbody tr:hover { background: rgba(255,255,255,0.12); }

/* 附件 */
.msg-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-att {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; transition: all var(--duration) var(--ease);
}
.msg-att:hover { border-color: var(--accent); }
.msg-user .msg-att { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2); color: #fff; }

/* AI 加载动画（思考中） */
.msg-loading {
  display: flex; align-items: center; gap: 5px; padding: 6px 2px;
  color: var(--text-secondary); font-size: 13px;
}
.msg-loading span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-secondary);
  animation: msgBounce 1.2s infinite ease-in-out;
}
.msg-loading span:nth-child(2) { animation-delay: 0.15s; }
.msg-loading span:nth-child(3) { animation-delay: 0.3s; }
.msg-loading em {
  font-style: normal; margin-right: 6px; font-size: 13px;
  background: linear-gradient(90deg, var(--text-tertiary), var(--text-secondary), var(--text-tertiary));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: thinkShimmer 1.8s infinite linear;
}
@keyframes thinkShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes msgBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ============================================================
   流式输出进度条（拆解剧本/分镜时显示，随机 1→100% 缓慢递增）
   ============================================================ */
.msg-text .stream-progress {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 12px; padding: 0 2px;
}
.msg-text .sp-track {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--border); overflow: hidden; position: relative;
}
.msg-text .sp-fill {
  height: 100%; width: 1%; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #6366f1);
  background-size: 200% 100%;
  animation: spShimmer 1.8s linear infinite;
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
  position: relative; box-shadow: 0 0 8px rgba(99, 102, 241, 0.45);
}
.msg-text .sp-fill::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  background-size: 200% 100%;
  animation: spSweep 1.5s linear infinite;
}
.msg-text .sp-label {
  font-size: 12px; color: var(--text-secondary); white-space: nowrap;
  font-variant-numeric: tabular-nums; min-width: 86px; text-align: right;
  letter-spacing: 0.2px;
}
.msg-text .sp-text { min-height: 0; }
.msg-text .sp-text:empty { display: none; }
.msg-user .msg-text .sp-track { background: rgba(255, 255, 255, 0.2); }
.msg-user .msg-text .sp-label { color: rgba(255, 255, 255, 0.85); }
@keyframes spShimmer {
  0% { background-position: 0 0; }
  100% { background-position: 200% 0; }
}
@keyframes spSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   分镜段落标题横幅（=====【第N条｜15秒独立漫剧】===== → 彩色卡片标识）
   Muse 风格分镜卡外观
   ============================================================ */
.msg-text .md-scene-title {
  margin: 14px 0 10px; padding: 9px 16px;
  font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 10px; display: block;
  letter-spacing: 0.5px; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.msg-text .md-scene-title:first-child { margin-top: 2px; }

/* 分镜表格 Muse 风格增强（在原有 .md-table 基础上叠加） */
.msg-text .md-table-wrap {
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.msg-text .md-table {
  white-space: normal; word-break: break-word;
}
.msg-text .md-table thead {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}
.msg-text .md-table th {
  color: #fff; font-size: 12px; letter-spacing: 0.3px;
  border-bottom: none; text-transform: none;
}
.msg-text .md-table tbody tr {
  transition: background var(--duration) var(--ease);
}
.msg-text .md-table tbody tr:nth-child(even) { background: rgba(99, 102, 241, 0.04); }
.msg-text .md-table tbody tr:hover { background: rgba(99, 102, 241, 0.1); }
.msg-text .md-table td { font-size: 12.5px; line-height: 1.55; }
/* 暗色主题下分镜表格适配 */
html[data-theme="dark"] .msg-text .md-table-wrap { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
html[data-theme="dark"] .msg-text .md-table tbody tr:nth-child(even) { background: rgba(99, 102, 241, 0.08); }

/* ============================================================
   主区域容器（chat-body 包裹 chat-main / ws-image）
   ============================================================ */
.muse-layout .chat-body {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: row;
  height: 100%; overflow: hidden;
  background: var(--bg);
}
.muse-layout .chat-main {
  flex: 1; min-width: 0; min-height: 0;
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.muse-layout .messages { flex: 1; min-height: 0; }
.muse-layout .ws-image {
  flex: 1; min-width: 0; min-height: 0;
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.muse-layout .ws-image[hidden] { display: none !important; }
.muse-layout .ws-body { flex: 1; min-height: 0; overflow: hidden; }

/* ============================================================
   二级模型菜单 · picker-pop
   ============================================================ */
.picker-pop[hidden] { display: none !important; }
.picker-pop {
  position: fixed; z-index: 500;
  width: 360px; max-width: calc(100vw - 40px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.55);
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pickerIn 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pickerIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.picker-arrow {
  position: absolute; top: 30px; left: -7px;
  width: 14px; height: 14px; transform: rotate(45deg);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
.picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.picker-cat { display: flex; align-items: center; gap: 10px; }
.picker-cat-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-light); color: var(--accent-hover);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.picker-cat-icon svg { width: 18px; height: 18px; }
.picker-cat-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.picker-cat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.picker-close { color: var(--text-secondary); }
.picker-close:hover { background: var(--bg-hover); color: var(--text); }

.picker-list {
  max-height: 420px; overflow-y: auto;
  padding: 8px;
}
.picker-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border-radius: 12px;
  background: transparent; color: var(--text);
  border: 1px solid transparent;
  cursor: pointer; transition: all var(--duration) var(--ease);
  text-align: left;
}
.picker-item + .picker-item { margin-top: 2px; }
.picker-item:hover { background: var(--bg-hover); border-color: var(--border); }
.picker-item.is-active {
  background: var(--accent-light); border-color: var(--accent);
}
.pi-radio {
  width: 18px; height: 18px; min-width: 18px; min-height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration) var(--ease);
}
.pi-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  opacity: 0; transform: scale(0.5);
  transition: all var(--duration) var(--ease);
}
.picker-item.is-active .pi-radio { border-color: var(--accent); }
.picker-item.is-active .pi-dot { opacity: 1; transform: scale(1); }
.pi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pi-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.pi-id { font-size: 11px; color: var(--text-tertiary); font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }
.pi-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pi-tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: var(--bg-active); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.picker-item.is-active .pi-tag { background: rgba(255,255,255,0.05); border-color: var(--accent); color: var(--accent-hover); }

.picker-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  gap: 12px;
  font-size: 11.5px; color: var(--text-secondary);
  background: rgba(0,0,0,0.18);
}
.picker-new-chat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.picker-new-chat:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
.picker-new-chat:active { transform: translateY(0); }
.picker-new-chat svg { width: 15px; height: 15px; flex-shrink: 0; }
.picker-foot-tip {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center;
  gap: 8px;
}
.picker-foot-tip > span:last-child {
  min-width: 0;
  line-height: 1.4;
}
.picker-foot-tag {
  display: inline-flex; align-items: center;
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent-hover);
  border: 1px solid var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   聊天头部 · 模型胶囊
   ============================================================ */
.chat-header { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.chat-header-spacer { flex: 1; min-width: 16px; }
.chat-model-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12.5px;
  cursor: pointer; transition: all var(--duration) var(--ease);
}
.chat-model-chip:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.chat-model-chip svg { width: 14px; height: 14px; color: inherit; }
.cmc-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-light);
  flex-shrink: 0;
}
.cmc-dot.is-vision { background: var(--info); box-shadow: 0 0 0 3px var(--info-light); }
.cmc-label { font-weight: 500; color: var(--text); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-subtitle { font-size: 12px; }

/* ============================================================
   会话列表抽屉（从左侧滑入，Muse 风格）
   ============================================================ */
.sessions-drawer-overlay {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms;
}
.sessions-drawer-overlay.open { opacity: 1; visibility: visible; }

.sessions-drawer {
  position: fixed; top: 0; left: 0; z-index: 999;
  width: 320px; max-width: 85vw; height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 40px rgba(0,0,0,0.4);
  transform: translateX(-105%);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column;
}
.sessions-drawer.open { transform: translateX(0); }

.sd-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.sd-title { flex: 1; font-size: 15px; font-weight: 600; margin: 0; }
.sd-close { color: var(--text-secondary); }
.sd-close:hover { background: var(--bg-hover); color: var(--text); }

.sd-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px;
}
.sd-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 8px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
  align-items: center;
}
.sd-item + .sd-item { margin-top: 2px; }
.sd-item:hover { background: var(--bg-hover); border-color: var(--border); }
.sd-item.is-current { background: var(--accent-light); border-color: var(--accent); }
.sd-item-title {
  grid-column: 1 / -1;
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sd-item-date { font-size: 10.5px; color: var(--text-tertiary); justify-self: start; }
.sd-del { color: var(--text-tertiary); }
.sd-del:hover { color: var(--danger); background: var(--danger-light); }
.sd-empty { padding: 28px 16px; text-align: center; color: var(--text-tertiary); font-size: 12.5px; }

/* ---------- 会话批量管理 ---------- */
.sd-batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.sd-batch-bar[hidden] { display: none !important; }
.sd-batch-bar .sd-batch-count {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.sd-batch-bar .sd-batch-all {
  color: var(--text-secondary);
}
.sd-batch-bar .sd-batch-all:hover { color: var(--accent); background: var(--accent-light); }
.sd-batch-bar .sd-batch-del { flex-shrink: 0; }
.sd-batch-bar .sd-batch-cancel { flex-shrink: 0; }

/* 批量模式下的列表项 */
.sd-list.is-batch .sd-item {
  grid-template-columns: auto 1fr auto;
  cursor: default;
}
.sd-list.is-batch .sd-item:hover { background: var(--bg-hover); }
.sd-list.is-batch .sd-item.is-selected {
  background: var(--accent-light);
  border-color: var(--accent);
}
.sd-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color 0.15s;
}
.sd-check.is-checked { color: var(--accent); }
.sd-check svg, .sd-check i { width: 18px; height: 18px; }
.sd-item.is-batch .sd-item-title { grid-column: auto; }

.sd-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.18);
  position: relative;
}
.sd-footer .uc-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-accent); color: #fff;
  font-weight: 700; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sd-user-info { flex: 1; min-width: 0; }
.sd-user-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-user-role { font-size: 11.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.uc-credits { font-size: 11px; color: var(--info); }
.uc-credits-header {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--info);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.uc-credits-header:hover {
  background: var(--bg-hover);
  border-color: var(--info);
  transform: translateY(-1px);
}
.uc-credits-header:active { transform: translateY(0); }
.uc-credits-header svg, .uc-credits-header i { width: 15px; height: 15px; color: var(--info); }

/* 公告按钮 + 红点 */
.ann-btn { position: relative; }
.ann-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger, #ef4444); border: 2px solid var(--bg-card, #fff);
  animation: ann-pulse 1.6s ease-in-out infinite;
}
@keyframes ann-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .7; }
}
/* 公告弹窗 */
.ann-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: ann-fade .2s ease;
}
@keyframes ann-fade { from { opacity: 0; } to { opacity: 1; } }
.ann-modal {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  animation: ann-pop .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes ann-pop { from { transform: scale(.92) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.ann-modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.ann-modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.ann-modal-head .ann-close { margin-left: auto; }
.ann-modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.ann-modal-body .ann-content { line-height: 1.7; font-size: 14px; color: var(--text); }
.ann-modal-body .ann-content h1,.ann-modal-body .ann-content h2,.ann-modal-body .ann-content h3 { margin: 12px 0 8px; }
.ann-modal-body .ann-content p { margin: 8px 0; }
.ann-modal-body .ann-content ul,.ann-modal-body .ann-content ol { margin: 8px 0; padding-left: 22px; }
.ann-modal-body .ann-content a { color: var(--accent); }
.ann-modal-body .ann-content img { max-width: 100%; border-radius: 8px; }
.ann-modal-body .ann-content code { background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.ann-modal-body .ann-meta { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-tertiary); }
/* 历史公告列表 */
.ann-list-item { padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.ann-list-item:hover { background: var(--bg-hover); }
.ann-list-item:last-child { border-bottom: none; }
.ann-list-item .ann-li-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.ann-list-item .ann-li-time { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.ann-list-item .ann-li-preview { font-size: 13px; color: var(--text-secondary); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-pinned-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* 积分明细弹窗 */
.credits-detail-modal { max-width: 880px; width: calc(100% - 32px); max-height: 85vh; display: flex; flex-direction: column; }
.credits-detail-modal .modal-header { margin-bottom: 16px; flex-shrink: 0; }
.credits-detail-modal .cd-close { margin-left: auto; }
.credits-detail { padding: 0; overflow-y: auto; flex: 1; }
.credits-detail-loading, .credits-detail-error {
  padding: 32px; text-align: center; color: var(--text-secondary);
}
.credits-detail-error { color: var(--danger); }
.credits-detail .cd-summary {
  display: flex; gap: 16px; padding: 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 14px;
}
.credits-detail .cd-summary-item { flex: 1; }
.credits-detail .cd-summary-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.credits-detail .cd-summary-value { font-size: 20px; font-weight: 600; color: var(--info); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.credits-detail .cd-pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; font-size: 12px; color: var(--text-secondary);
}
.credits-detail .cd-pagination button {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); cursor: pointer;
  font-size: 12px; transition: background .2s var(--ease);
}
.credits-detail .cd-pagination button:hover { background: var(--bg-hover); }
.credits-detail .cd-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* 积分明细弹窗内充值面板 */
.cd-recharge-entry { display: flex; align-items: center; justify-content: flex-end; }
.cd-recharge-btn { white-space: nowrap; }
.cd-recharge-panel {
  padding: 16px; margin-bottom: 14px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); animation: cdRechargeSlide .25s var(--ease-out);
}
@keyframes cdRechargeSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.cd-recharge-rate { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.cd-recharge-rate strong { color: var(--accent); font-weight: 600; }
.cd-recharge-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cd-preset-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  background: var(--bg-surface); border: 1.5px solid var(--border);
  transition: all .2s var(--ease); font-family: inherit;
}
.cd-preset-btn:hover { border-color: var(--accent); }
.cd-preset-btn.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.cd-preset-amount { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cd-preset-credits { font-size: 11px; color: var(--text-secondary); }
.cd-recharge-custom { display: flex; flex-direction: column; gap: 10px; }
.cd-recharge-input-row { display: flex; align-items: center; gap: 8px; }
.cd-recharge-prefix { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.cd-recharge-input { flex: 1; max-width: 180px; }
.cd-recharge-preview { font-size: 13px; color: var(--accent); font-weight: 500; white-space: nowrap; }
.cd-recharge-submit { align-self: flex-start; }

/* 积分明细弹窗内卡密兑换 */
.cd-redeem-entry { display: flex; align-items: center; justify-content: flex-end; }
.cd-redeem-btn { white-space: nowrap; }
.cd-redeem-panel {
  padding: 16px; margin-bottom: 14px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); animation: cdRechargeSlide .25s var(--ease-out);
}
.cd-redeem-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.cd-redeem-input-row { display: flex; gap: 10px; align-items: center; }
.cd-redeem-input { flex: 1; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; letter-spacing: 1px; }
.cd-redeem-submit { white-space: nowrap; }

/* 积分明细：类型标签 + 模型列 + 详情列 */
.credits-detail-table { table-layout: fixed; width: 100%; }
.credits-detail-table th:nth-child(1) { width: 140px; }  /* 时间 */
.credits-detail-table th:nth-child(2) { width: 62px; }   /* 类型 */
.credits-detail-table th:nth-child(3) { width: 130px; }  /* 模型 */
.credits-detail-table th:nth-child(4) { width: 72px; }   /* 变动 */
.credits-detail-table th:nth-child(5) { width: 80px; }   /* 余额 */
.credits-detail-table th:nth-child(6) { width: auto; }   /* 详情（剩余） */
.cd-type {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  white-space: nowrap;
}
.cd-type-img      { background: rgba(236,72,153,0.12); color: #ec4899; }
.cd-type-chat     { background: rgba(59,130,246,0.12); color: #3b82f6; }
.cd-type-script   { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.cd-type-recharge { background: rgba(16,185,129,0.12); color: #10b981; }
.cd-type-cardkey  { background: rgba(245,158,11,0.12); color: #f59e0b; }
.cd-type-register { background: rgba(20,184,166,0.12); color: #14b8a6; }
.cd-type-refund   { background: rgba(6,182,212,0.12);  color: #06b6d4; }
.cd-type-admin    { background: rgba(239,68,68,0.12);  color: #ef4444; }
.cd-type-default  { background: rgba(107,114,128,0.12); color: #6b7280; }
.cd-model {
  font-size: 12px; color: var(--text); font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-model .um-empty-cell { color: var(--text-tertiary); }
.cd-detail {
  font-size: 12px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}

/* ============================================================
   卡密管理面板样式（admin）
   ============================================================ */
.ck-stats-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px;
}
.ck-stat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 20px; border-radius: 10px;
  background: var(--bg-surface); border: 1px solid var(--border);
  min-width: 80px;
}
.ck-stat b { font-size: 22px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ck-stat em { font-size: 11px; color: var(--text-secondary); font-style: normal; }
.ck-stat.ck-unused b { color: var(--success); }
.ck-stat.ck-used b { color: var(--info); }
.ck-stat.ck-disabled b { color: var(--text-secondary); }
.ck-stat.ck-redeemed b { color: var(--accent); }

.ck-key-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px; background: var(--bg-surface); padding: 2px 6px;
  border-radius: 4px; border: 1px solid var(--border);
}

.ck-gen-result {
  margin-top: 14px; padding: 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ck-gen-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 13px; color: var(--text-secondary);
}
.ck-gen-header span { font-weight: 500; }

/* 卡密批量操作栏 */
.ck-batch-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--danger) 6%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--danger) 20%, var(--border));
  border-radius: var(--radius);
  animation: ckBatchSlide .2s var(--ease-out);
}
@keyframes ckBatchSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.ck-batch-check-all {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13px; color: var(--text); user-select: none;
}
.ck-batch-check-all input[type="checkbox"] { accent-color: var(--danger); width: 15px; height: 15px; cursor: pointer; }
.ck-batch-count { font-size: 13px; color: var(--danger); font-weight: 600; }
.ck-batch-actions { display: flex; gap: 8px; margin-left: auto; }

.sd-guest-text { flex: 1; color: var(--text-secondary); font-size: 12.5px; }
.sd-guest-actions { display: flex; gap: 6px; }

.uc-menu {
  position: absolute; right: 12px; bottom: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 4px; min-width: 160px;
  box-shadow: 0 14px 48px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(6px);
  transition: all var(--duration) var(--ease);
  z-index: 20;
}
.uc-menu.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.uc-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 13px;
  transition: all var(--duration) var(--ease);
}
.uc-menu a:hover { background: var(--bg-hover); color: var(--accent-hover); }
.uc-menu a svg { width: 16px; height: 16px; }

body.no-scroll { overflow: hidden; }

/* 进一步收紧响应式（窄屏时 rail 更窄） */
@media (max-width: 640px) {
  .sidebar.muse-rail { width: 56px; min-width: 56px; max-width: 56px; }
  .rail-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .rail-logo { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; }
  .picker-pop { width: 320px; }
}

/* ============================================================
   云帆Ai 产品文档页（/docs）样式
   ============================================================ */

/* ---- 基础布局 ---- */
.docs-body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航覆盖修复 */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-subtle);
}
.docs-header .lk-nav a.active {
  color: var(--accent);
}

/* ---- Hero 区 ---- */
.docs-hero {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
}
.docs-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.docs-hero-content { max-width: 560px; }
.docs-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-light);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.docs-hero-badge i { width: 14px; height: 14px; }
.docs-hero-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-hero-title .docs-hero-sub {
  display: block;
  font-size: 28px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 36px;
}
.docs-hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.docs-hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}
.docs-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.docs-stat span {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* Hero 背景装饰 */
.docs-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.dh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: dhFloat 8s ease-in-out infinite;
}
.dh-blob.b1 {
  width: 600px; height: 600px;
  top: -200px; left: -100px;
  background: var(--accent);
}
.dh-blob.b2 {
  width: 400px; height: 400px;
  bottom: -100px; right: 100px;
  background: var(--secondary, #8b5cf6);
  animation-delay: -3s;
}
.dh-blob.b3 {
  width: 300px; height: 300px;
  top: 40%; right: 25%;
  background: var(--primary, #06b6d4);
  animation-delay: -5s;
}
@keyframes dhFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
}
.dh-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
}

/* Hero 视觉窗口 */
.docs-hero-visual {
  display: flex;
  justify-content: center;
}
.docs-hero-window {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.15);
  overflow: hidden;
  animation: dhWindowFloat 4s ease-in-out infinite;
}
@keyframes dhWindowFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.dh-win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-subtle);
}
.dh-dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.dh-dot.r { background: #ff5f57; }
.dh-dot.y { background: #febc2e; }
.dh-dot.g { background: #28c840; }
.dh-win-title {
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.dh-win-body {
  padding: 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dh-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 90%;
}
.dh-user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.dh-ai {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.dh-ai-bubble { margin-bottom: 8px; }
.dh-msg-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.dh-cost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--info);
}
.dh-cost i { width: 11px; height: 11px; }
.dh-img-gen {
  margin-top: 4px;
}
.dh-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}
.dh-img-placeholder i {
  width: 24px; height: 24px;
  color: var(--accent);
  animation: dhPulse 1.5s ease-in-out infinite;
}
@keyframes dhPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.dh-img-bar {
  width: 80%;
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.dh-img-bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  animation: dhBar 1.5s ease-in-out infinite;
}
@keyframes dhBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ---- 通用 Section ---- */
.docs-section {
  padding: 100px 0;
  position: relative;
}
.docs-section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.docs-section-head {
  text-align: center;
  margin-bottom: 64px;
}
.docs-section-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.docs-section-head h2 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--text);
}
.docs-section-head p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
}
.docs-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* ---- 功能卡片 ---- */
.docs-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.docs-feature-card {
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.docs-feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.docs-feature-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.docs-feature-card:hover::before { opacity: 1; }
.df-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: var(--accent-light);
  color: var(--accent);
  position: relative;
  transition: transform 0.3s var(--ease);
}
.df-icon svg { width: 28px; height: 28px; }
.docs-feature-card:hover .df-icon { transform: scale(1.08); }
.df-icon-1 { background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.08)); color: #818cf8; }
.df-icon-2 { background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(6,182,212,0.08)); color: #22d3ee; }
.df-icon-3 { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.08)); color: #fbbf24; }
.df-icon-4 { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.08)); color: #34d399; }
.df-icon-5 { background: linear-gradient(135deg, rgba(88,166,255,0.2), rgba(88,166,255,0.08)); color: #58a6ff; }
.df-icon-6 { background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.08)); color: #f87171; }
.docs-feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
}
.docs-feature-card > p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
}
.df-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.df-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.df-list li i {
  width: 14px; height: 14px;
  color: var(--success);
  flex-shrink: 0;
}

/* ---- 应用场景卡片 ---- */
.docs-scene-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.docs-scene {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.docs-scene:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.ds-visual {
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg));
  border-bottom: 1px solid var(--border-subtle);
}
.ds-visual svg {
  width: 100%;
  height: auto;
  display: block;
}
.ds-info { padding: 24px; }
.ds-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}
.ds-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.ds-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ---- 技术架构 ---- */
.docs-arch-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.arch-layer {
  flex: 1;
  min-width: 180px;
  max-width: 240px;
  padding: 28px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.arch-layer:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.arch-layer-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.arch-layer-label i { width: 20px; height: 20px; color: var(--accent); }
.arch-techs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.arch-tech {
  display: inline-block;
  padding: 5px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.arch-layer:hover .arch-tech {
  color: var(--text);
  border-color: var(--border);
}
.arch-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 20px;
}
.arch-arrow-line {
  width: 2px;
  height: 30px;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  opacity: 0.5;
}
.arch-arrow i { width: 16px; height: 16px; color: var(--accent); }

/* ---- 快速上手 ---- */
.docs-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
.docs-quick-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  position: relative;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.docs-quick-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.dq-number {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 48px;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
}
.dq-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: var(--accent-light);
  color: var(--accent);
}
.dq-icon i { width: 28px; height: 28px; }
.docs-quick-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
}
.docs-quick-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.docs-quick-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ---- 团队介绍 ---- */
.docs-team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.docs-team-card {
  padding: 32px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.docs-team-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.dt-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}
.dt-avatar-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.dt-avatar-2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.dt-avatar-3 { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.dt-info h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.dt-role {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
.dt-info p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ---- 页脚 ---- */
.docs-footer {
  padding: 48px 0 32px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}
.docs-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.docs-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.docs-footer-brand img {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.docs-footer-brand strong {
  display: block;
  font-size: 16px;
  color: var(--text);
}
.docs-footer-brand span {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
}
.docs-footer-links {
  display: flex;
  gap: 24px;
}
.docs-footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.docs-footer-links a:hover { color: var(--accent); }

/* ---- 动画：reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
  .docs-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .docs-hero-content { max-width: 100%; }
  .docs-hero-actions,
  .docs-hero-stats { justify-content: center; }
  .docs-feature-grid,
  .docs-scene-grid,
  .docs-quick-grid,
  .docs-team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .docs-hero-title { font-size: 44px; }
}
@media (max-width: 768px) {
  .docs-hero { padding: 60px 0 80px; }
  .docs-section { padding: 64px 0; }
  .docs-feature-grid,
  .docs-scene-grid,
  .docs-quick-grid,
  .docs-team-grid {
    grid-template-columns: 1fr;
  }
  .docs-hero-title { font-size: 36px; }
  .docs-hero-title .docs-hero-sub { font-size: 20px; }
  .docs-section-head h2 { font-size: 28px; }
  .docs-hero-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
  .arch-arrow {
    flex-direction: row;
    padding: 8px 0;
  }
  .arch-arrow-line {
    width: 40px;
    height: 2px;
  }
  .docs-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ---- 浅色主题覆盖 ---- */
[data-theme="light"] .docs-hero-window {
  box-shadow: 0 25px 80px rgba(0,0,0,0.12), 0 0 0 1px rgba(99,102,241,0.08);
}
[data-theme="light"] .dh-msg-meta { color: var(--text-tertiary); }
[data-theme="light"] .docs-feature-card:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}
[data-theme="light"] .dt-info p { color: var(--text-secondary); }

/* =============================================================
 * 剧本工作台（Script Studio） · 暗色沉浸式风格
 * ============================================================= */
.script-studio {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
.script-studio[hidden] { display: none; }

/* ---- 通用视图容器 ---- */
.ss-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  animation: ssFadeIn .35s var(--ease) both;
}
.ss-view[hidden] { display: none; }
@keyframes ssFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
 * 视图 1：剧集仪表盘（Dashboard）
 * ============================================================= */
.ss-dashboard { padding: 0; }
.ss-hero {
  position: relative;
  padding: 56px 48px 44px;
  overflow: hidden;
}
.ss-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(99,102,241,.22), transparent 60%),
    radial-gradient(900px 360px at 110% 10%, rgba(236,72,153,.16), transparent 55%),
    radial-gradient(700px 300px at 50% 120%, rgba(16,185,129,.12), transparent 55%),
    linear-gradient(180deg, #0a0b14 0%, #0e1118 60%, var(--bg) 100%);
}
html[data-theme="light"] .ss-hero-bg {
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(99,102,241,.14), transparent 60%),
    radial-gradient(900px 360px at 110% 10%, rgba(236,72,153,.10), transparent 55%),
    linear-gradient(180deg, #f5f6fb 0%, #eef0f7 60%, var(--bg) 100%);
}
.ss-hero-title, .ss-hero-sub, .ss-new-project-btn {
  position: relative; z-index: 1;
}
.ss-hero-title {
  margin: 0 0 10px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.3px;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 45%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .ss-hero-title {
  background: linear-gradient(135deg, #1f2937 0%, #4f46e5 45%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ss-hero-sub {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--text-secondary);
}
.ss-new-project-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99,102,241,.35), inset 0 1px 0 rgba(255,255,255,.2);
  transition: all .2s var(--ease);
}
.ss-new-project-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(99,102,241,.5), inset 0 1px 0 rgba(255,255,255,.25);
}
.ss-new-project-btn:active { transform: translateY(0); }
.ss-new-project-btn svg { width: 16px; height: 16px; }

/* 剧集卡片网格 */
.ss-project-grid {
  padding: 32px 48px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.ss-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-tertiary);
}
.ss-empty svg {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  opacity: .6;
  color: var(--accent);
}
.ss-empty p { margin: 0; font-size: 14px; }

.ss-project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.ss-project-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, rgba(99,102,241,.25) 60%, rgba(236,72,153,.2) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.ss-project-card:hover {
  border-color: var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(99,102,241,.15);
}
.ss-project-card:hover::before { opacity: 1; }

.ss-card-body { padding: 22px 20px 18px; }
.ss-card-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.ss-card-intro {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  min-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-card-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.ss-card-meta > span {
  display: inline-flex; align-items: center; gap: 5px;
}
.ss-card-meta svg { width: 13px; height: 13px; }

.ss-card-del {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(239, 68, 68, .08);
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.ss-project-card:hover .ss-card-del { opacity: 1; }
.ss-card-del:hover {
  background: rgba(239, 68, 68, .18);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .3);
}
.ss-card-del svg { width: 14px; height: 14px; }

/* =============================================================
 * 视图 2：剧集详情
 * ============================================================= */
.ss-detail-header {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  position: sticky; top: 0; z-index: 10;
}
.ss-detail-info { flex: 1; min-width: 0; }
.ss-back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.ss-back-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.ss-back-btn svg { width: 14px; height: 14px; }
.ss-detail-info { flex: 1; min-width: 0; }
.ss-project-name {
  margin: 0 0 3px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.ss-project-intro {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ss-project-details {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.ss-new-chapter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.ss-new-chapter-btn:hover {
  background: var(--accent);
  color: #fff;
}
.ss-new-chapter-btn svg { width: 14px; height: 14px; }

/* 批量管理按钮 */
.ss-detail-header-actions { display: flex; gap: 8px; align-items: center; }
.ss-batch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.ss-batch-btn:hover { border-color: var(--accent); color: var(--accent); }
.ss-batch-btn.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* 批量操作栏 */
.ss-batch-bar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 36px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  animation: slideDown .2s ease;
}
.ss-batch-bar[hidden] { display: none !important; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.ss-batch-select-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.ss-batch-select-all input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ss-batch-count { font-size: 13px; color: var(--text-muted); }
.ss-batch-actions { margin-left: auto; display: flex; gap: 8px; }
.ss-batch-btn-cancel, .ss-batch-btn-delete {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.ss-batch-btn-cancel { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); }
.ss-batch-btn-cancel:hover { border-color: var(--text-muted); }
.ss-batch-btn-delete { border: 1px solid #fee2e2; background: #fef2f2; color: #dc2626; }
.ss-batch-btn-delete:hover { background: #fee2e2; }
.ss-batch-btn-delete:disabled { opacity: .5; cursor: not-allowed; }

/* 批量模式下的章节卡片 */
.ss-chapter-card.is-batch-mode { cursor: pointer; }
.ss-chapter-card.is-batch-mode.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.ss-chapter-card .ss-chapter-checkbox {
  display: none;
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.ss-chapter-card.is-batch-mode .ss-chapter-checkbox { display: block; }
.ss-chapter-card.is-batch-mode .ss-chapter-actions { display: none; }
.ss-chapter-card.is-batch-mode .ss-chapter-body { pointer-events: none; }

/* 章节列表 */
.ss-chapter-list {
  padding: 24px 36px 48px;
  display: flex; flex-direction: column; gap: 12px;
}
.ss-chapter-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color .2s ease, background .2s ease;
}
.ss-chapter-card:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}
.ss-chapter-card.is-decomposed,
.ss-chapter-card.is-draft { cursor: pointer; }
.ss-chapter-body { flex: 1; min-width: 0; }
.ss-chapter-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 5px;
}
.ss-chapter-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px; font-weight: 700;
}
.ss-chapter-title {
  margin: 0;
  font-size: 15px; font-weight: 600;
  color: var(--text);
  flex: 1;
}
.ss-chapter-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.ss-status-draft {
  background: rgba(251, 191, 36, .12);
  color: #f59e0b;
}
.ss-status-done {
  background: rgba(16, 185, 129, .12);
  color: #10b981;
}
.ss-chapter-time {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; gap: 5px;
}
.ss-chapter-time svg { width: 12px; height: 12px; }

.ss-chapter-actions { display: flex; gap: 8px; }
.ss-chapter-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.ss-chapter-action:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.ss-chapter-action svg { width: 13px; height: 13px; }

/* =============================================================
 * 视图 3：章节拆解 / 视图 4：分镜详情（共用头部与内容区）
 * ============================================================= */
.ss-decompose { overflow: hidden; }
.ss-decompose-header,
.ss-storyboard-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.ss-decompose-header h2,
.ss-storyboard-header h2 {
  margin: 0;
  font-size: 18px; font-weight: 700;
  color: var(--text);
}
.ss-decompose-body {
  flex: 1;
  min-height: 0;
  padding: 24px 36px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 进度条（Muse 风格，浮空感） */
.ss-stream-progress {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: rgba(99, 102, 241, .08);
  border: 1px solid rgba(99, 102, 241, .2);
  border-radius: 12px;
}
.ss-stream-progress .sp-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.ss-stream-progress .sp-fill {
  height: 100%;
  width: 1%;
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(99,102,241,.5);
}
.ss-stream-progress .sp-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hover);
  white-space: nowrap;
  min-width: 78px;
}

/* 流式文本区（浮空表格样式） */
.ss-stream-text {
  flex: 1 0 auto;
  padding: 26px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  line-height: 1.65;
  font-size: 14px;
  color: var(--text);
  min-height: 200px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
/* 流式阶段：用 textContent 逐 token 追加，需要 pre-wrap 保留换行 */
.ss-stream-text.ss-streaming {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 文本区内 Markdown 元素覆盖（更暗更沉浸） */
.ss-stream-text h1,
.ss-stream-text h2,
.ss-stream-text h3 {
  margin: 22px 0 12px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.2px;
}
.ss-stream-text h1 { font-size: 22px; }
.ss-stream-text h2 { font-size: 18px; }
.ss-stream-text h3 { font-size: 15.5px; }
.ss-stream-text p { margin: 0 0 12px; }

/* 分镜场景标题横幅（Muse 风格彩色卡片标识） */
.ss-stream-text .md-scene-title {
  margin: 22px 0 14px;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.18) 0%, rgba(236,72,153,.14) 100%);
  border: 1px solid rgba(99,102,241,.25);
  color: #e9d5ff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(99,102,241,.15);
}
html[data-theme="light"] .ss-stream-text .md-scene-title {
  color: #6d28d9;
}
.ss-stream-text .md-scene-title::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ec4899);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* 浮空表格（Muse 风格增强 · 暗色沉浸版） */
.ss-stream-text .md-table-wrap {
  margin: 14px 0 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 8px 30px rgba(0,0,0,.28);
}
.ss-stream-text .md-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.ss-stream-text .md-table thead {
  background: linear-gradient(180deg, rgba(99,102,241,.18), rgba(99,102,241,.08));
}
.ss-stream-text .md-table th {
  padding: 10px 12px;
  text-align: left;
  color: #e0e7ff;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: .2px;
  white-space: nowrap;
}
html[data-theme="light"] .ss-stream-text .md-table th {
  color: #4338ca;
}
.ss-stream-text .md-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  line-height: 1.55;
  vertical-align: top;
}
.ss-stream-text .md-table tbody tr:last-child td { border-bottom: none; }
.ss-stream-text .md-table tbody tr:nth-child(even) {
  background: rgba(99, 102, 241, .05);
}
.ss-stream-text .md-table tbody tr:hover {
  background: rgba(99, 102, 241, .1);
}
/* 暗色模式下进一步强调对比度 */
html[data-theme="dark"] .ss-stream-text .md-table-wrap {
  border-color: rgba(99,102,241,.25);
  box-shadow: 0 8px 30px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.03);
}
html[data-theme="dark"] .ss-stream-text .md-table thead {
  background: linear-gradient(180deg, rgba(99,102,241,.25), rgba(99,102,241,.10));
}
html[data-theme="dark"] .ss-stream-text .md-table th {
  border-bottom-color: rgba(99,102,241,.3);
}
html[data-theme="dark"] .ss-stream-text .md-table tbody tr:nth-child(even) {
  background: rgba(99, 102, 241, .07);
}

/* 错误提示 */
.ss-error {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px; font-weight: 500;
}
.ss-error svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 操作区（创建分镜按钮） */
.ss-decompose-actions {
  padding: 18px 36px 28px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, transparent, rgba(99,102,241,.04));
  flex-shrink: 0;
}
.ss-create-storyboard-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
  transition: all .2s;
}
.ss-create-storyboard-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(99,102,241,.5);
}
.ss-create-storyboard-btn svg { width: 16px; height: 16px; }

/* =============================================================
 * 视图 4：分镜详情（独立卡片流）
 * ============================================================= */
.ss-storyboard { overflow: hidden; }
.ss-storyboard-content {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 22px 28px 48px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}
.ss-storyboard-content[hidden] { display: none !important; }

/* 流式阶段 Markdown 预览：与最终卡片风格保持一致，确保内容完全在容器内 */
.ss-storyboard-stream-preview {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 20px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  white-space: pre-wrap;
}
.ss-storyboard-stream-preview > *:first-child { margin-top: 0; }
.ss-storyboard-stream-preview > *:last-child  { margin-bottom: 0; }
.ss-storyboard-stream-preview pre,
.ss-storyboard-stream-preview code {
  word-break: break-all;
  white-space: pre-wrap;
}
.ss-storyboard-stream-preview table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.ss-storyboard-stream-preview th,
.ss-storyboard-stream-preview td {
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  vertical-align: top;
  line-height: 1.6;
  font-size: 13px;
}
.ss-storyboard-stream-preview th {
  background: rgba(99,102,241,.08);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.ss-storyboard-block {
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

/* 分镜卡片 · 分层玻璃态 */
.ss-storyboard-card,
.muse-shot-card {
  position: relative;
  isolation: isolate;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color .2s ease, box-shadow .22s ease;
  box-shadow: 0 6px 22px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.02) inset;
  /* ⚠️ 修复卡片内部高度链：让 head + body 通过 flex 纵向分配，
     避免 grid-body 高度不受控时内部内容溢出被 overflow:hidden 裁掉一半 */
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* 顶部渐变描边（常显） */
.ss-storyboard-card::before,
.muse-shot-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(99,102,241,.55) 35%, rgba(236,72,153,.55) 70%, transparent 100%);
  z-index: 1;
  pointer-events: none;
  opacity: .9;
}
/* 外层高光扫光（悬停时触发） */
.ss-storyboard-card::after,
.muse-shot-card::after {
  content: "";
  position: absolute;
  top: -60%; left: -40%;
  width: 40%; height: 220%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.10) 50%, transparent 60%);
  transform: translateX(-160%) skewX(-15deg);
  transition: transform .75s ease;
  pointer-events: none;
  z-index: 2;
}
.ss-storyboard-card:hover,
.muse-shot-card:hover {
  border-color: rgba(99,102,241,.42);
  box-shadow: 0 14px 44px rgba(0,0,0,.34), 0 0 0 1px rgba(99,102,241,.18),
              0 0 24px rgba(99,102,241,.12);
}
.ss-storyboard-card:hover::after,
.muse-shot-card:hover::after { transform: translateX(420%) skewX(-15deg); }

.ss-storyboard-head,
.muse-shot-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent),
    linear-gradient(135deg, rgba(99,102,241,.18), rgba(236,72,153,.12));
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  flex-shrink: 0;   /* ⚠️ 卡片是 flex-col 后，头部固定不压缩 */
  width: 100%;
  box-sizing: border-box;
}
.ss-storyboard-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: 14px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(99,102,241,.45), inset 0 1px 0 rgba(255,255,255,.2);
}
.muse-shot-idx {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.muse-shot-idx svg { width: 13px; height: 13px; color: var(--accent); }

.ss-storyboard-title {
  flex: 1; min-width: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.ss-storyboard-duration {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, .14);
  border: 1px solid rgba(16, 185, 129, .32);
  color: #34d399;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .3px;
}
.ss-storyboard-body {
  padding: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ss-storyboard-body .md-table-wrap { margin: 0; }

/* 所有分镜卡片（结构化 / muse / ss）内部内容溢出保护 */
.ss-storyboard-body,
.muse-shot-body,
.muse-structured-body,
.muse-scene-col,
.muse-shots-col,
.muse-assets-col {
  /* 子元素不会撑破父容器宽度 */
  min-width: 0;
}
.ss-storyboard-body > *,
.muse-shot-body > *,
.muse-structured-body > *,
.muse-scene-col > *,
.muse-shots-col > *,
.muse-assets-col > * {
  max-width: 100%;
}
/* 长表格：列头 sticky，支持横向滚动 */
.ss-storyboard-body table,
.muse-shot-body table,
.muse-structured-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ss-storyboard-body th, .ss-storyboard-body td,
.muse-shot-body th, .muse-shot-body td,
.muse-structured-body th, .muse-structured-body td {
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  vertical-align: top;
  line-height: 1.6;
  font-size: 13px;
  word-break: break-word;
}
.ss-storyboard-body th,
.muse-shot-body th,
.muse-structured-body th {
  background: rgba(99,102,241,.08);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.ss-storyboard-body pre,
.ss-storyboard-body code,
.muse-shot-body pre,
.muse-shot-body code,
.muse-structured-body pre,
.muse-structured-body code {
  word-break: break-all;
  white-space: pre-wrap;
}

/* =============================================================
 * 分镜编辑表单样式（分层玻璃态 · 分区排版）
 * ============================================================= */
.ss-modal-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(0deg, rgba(99,102,241,.05), transparent);
}
.ss-modal-foot .btn-ghost,
.ss-modal-foot .btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-secondary);
}
.ss-modal-foot .btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.ss-modal-foot .btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(99,102,241,.40);
}
.ss-modal-foot .btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 12px 30px rgba(99,102,241,.55);
}
.ss-modal-foot .btn-primary:active { transform: translateY(0); }

/* 模态框 body 补内边距（原模板 ss-modal-body 未定义） */
.ss-modal-body {
  padding: 22px 22px 4px;
}

.muse-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding: 4px 2px 14px;
}
.muse-edit-field {
  display: flex; flex-direction: column; gap: 5px;
  position: relative;
}
.muse-edit-field > label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .15px;
}
.muse-edit-field > label::before {
  content: "";
  width: 3px; height: 11px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ec4899);
  box-shadow: 0 0 6px var(--accent-glow);
}
.muse-edit-field input,
.muse-edit-field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.55;
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  box-sizing: border-box;
}
.muse-edit-field input:focus,
.muse-edit-field textarea:focus {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--accent-light), 0 4px 14px rgba(99,102,241,.08);
}
.muse-edit-field textarea {
  resize: vertical;
  min-height: 74px;
}
.muse-edit-field:nth-child(4),
.muse-edit-field:nth-child(5),
.muse-edit-field:nth-child(6),
.muse-edit-field:nth-child(9),
.muse-edit-field:nth-child(10),
.muse-edit-field:nth-child(11),
.muse-edit-field:nth-child(12) {
  grid-column: 1 / -1;
}

/* =============================================================
 * Muse 式分镜卡片（三栏布局：角色/内容/预览）
 * ============================================================= */
.muse-sb-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

.muse-shot-card {
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.muse-shot-card:hover { border-color: var(--accent-dim, #3a3d7a); }

.muse-shot-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
}
.muse-shot-idx {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  color: var(--text, #e8e9ee);
  line-height: 1.4;
}
.muse-shot-idx svg { width: 12px; height: 12px; color: var(--accent, #8b8cff); }

.muse-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 999px;
  color: var(--text-muted, #9ea0aa);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
  user-select: none;
}
.muse-copy-btn svg { width: 13px; height: 13px; }
.muse-copy-btn:hover {
  border-color: var(--accent, #8b8cff);
  color: var(--accent, #8b8cff);
  background: rgba(139,140,255,.08);
}
.muse-copy-btn:active { transform: translateY(1px); }

.muse-shot-body {
  display: grid;
  grid-template-columns: 290px 1fr 300px;
  gap: 16px;
  padding: 16px 18px 18px;
  /* ⚠️ 在卡片 flex-col 里占剩余高度 */
  flex: 1;
  min-height: 0;
  min-width: 0;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* 结构化分镜卡片（新模板：场景分析/分镜承接/镜头N/资产对照表）—— 分层玻璃态三栏深色布局 */
.muse-structured-body {
  display: grid;
  grid-template-columns: 290px 1fr 300px;
  gap: 0;
  padding: 0;
  /* ⚠️ 让 grid 子元素的 overflow-y:auto 能够正确工作 */
  min-height: 0;
  min-width: 0;
  align-items: stretch;
  justify-items: stretch;
  /* ⚠️ 在卡片 flex-col 里占剩余高度 */
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}
.muse-structured-col {
  padding: 18px 18px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  /* ⚠️ grid 子元素强制铺满 cell 高度：保证内部 flex:1 + overflow-y 触发条件满足 */
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
}
.muse-structured-col + .muse-structured-col {
  border-left: 1px solid var(--border, #30363d);
}
/* 中栏内容左边多留 4px 呼吸空间，避免紧贴分隔线 */
.muse-structured-col.muse-structured-middle {
  padding-left: 22px;
}

/* 左栏：角色/道具/场景 卡片网格 */
.muse-structured-left {
  background:
    linear-gradient(180deg, rgba(139,140,255,.05), transparent),
    rgba(255,255,255,.015);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;      /* ⚠️ flex 链：允许内部 overflow-y 滚动 */
  box-sizing: border-box;
  height: 100%;       /* ⚠️ 兜底：强制 grid cell 高度完全充满 */
}
.muse-structured-left-title,
.muse-structured-right-title {
  font-size: 10.5px; font-weight: 800; color: var(--text-muted, #9ea0aa);
  letter-spacing: .8px; text-transform: uppercase;
  padding-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.muse-structured-left-title::before,
.muse-structured-right-title::before {
  content: "";
  width: 4px; height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ec4899);
  box-shadow: 0 0 6px var(--accent-glow);
}
.muse-structured-refs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.muse-structured-ref {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 9px 6px 7px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
  cursor: pointer;
  text-align: center;
  position: relative;
}
.muse-structured-ref:hover {
  border-color: rgba(139,140,255,.55);
  box-shadow: 0 8px 22px rgba(99,102,241,.18);
}
.muse-structured-ref-thumb {
  width: 54px; height: 54px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  color: #fff;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 4px 12px rgba(0,0,0,.24);
}
.muse-structured-ref-name {
  font-size: 11.5px; font-weight: 600;
  color: var(--text, #e8e9ee);
  line-height: 1.3;
}

/* 中栏：镜头详情 */
.muse-structured-middle {
  display: flex; flex-direction: column; gap: 0;
}
.muse-structured-section {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
}
.muse-structured-section-title {
  font-size: 11.5px; font-weight: 800;
  color: var(--accent, #8b8cff);
  letter-spacing: .4px;
  margin-bottom: 5px;
  display: flex; align-items: center; gap: 6px;
}
.muse-structured-section-title::before {
  content: "";
  width: 2px; height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ec4899);
}
.muse-structured-section-text {
  font-size: 12.5px; line-height: 1.65;
  color: var(--text, #e8e9ee);
  white-space: pre-wrap;
}
.muse-structured-shot-block {
  padding: 4px 0 12px;
  border-bottom: 1px dashed var(--border-subtle, #2a2c33);
}
.muse-structured-shot-block:last-child { border-bottom: none; }
.muse-structured-shot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 13px;
  background: linear-gradient(135deg, rgba(139,140,255,.10), rgba(236,72,153,.08));
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(139,140,255,.18);
}
.muse-structured-shot-title {
  font-size: 13px; font-weight: 800;
  color: var(--accent, #8b8cff);
}
.muse-structured-shot-title .shot-time {
  color: var(--text-muted, #9ea0aa);
  font-weight: 500;
  margin-left: 8px;
  font-size: 12px;
}
.muse-structured-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.muse-structured-field {
  display: flex; flex-direction: column;
  gap: 3px;
  font-size: 12.5px; line-height: 1.6;
  color: var(--text, #e8e9ee);
}
.muse-structured-field-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted, #9ea0aa);
  letter-spacing: .2px;
  display: flex; align-items: center; gap: 4px;
}
.muse-structured-field-label::before {
  content: "·";
  color: var(--accent);
  font-weight: 900;
  margin-right: 2px;
}
.muse-structured-field-value {
  flex: 1;
  color: var(--text, #e8e9ee);
  word-break: break-word;
}
.muse-structured-field.full { grid-column: 1 / -1; }
.muse-structured-field .dialogue {
  color: var(--accent, #8b8cff);
  font-weight: 700;
}

/* 右栏：预览 */
.muse-structured-right {
  background:
    linear-gradient(180deg, rgba(236,72,153,.04), transparent),
    rgba(255,255,255,.015);
  display: flex; flex-direction: column; gap: 10px;
}
.muse-structured-preview {
  flex: 1;
  min-height: 148px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    rgba(255,255,255,.025);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.muse-structured-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(236,72,153,.06));
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.muse-structured-preview:hover {
  border-color: rgba(139,140,255,.55);
  transform: translateY(-1.5px);
  box-shadow: 0 10px 28px rgba(99,102,241,.20);
}
.muse-structured-preview:hover::before { opacity: 1; }
.muse-structured-preview svg { width: 28px; height: 28px; color: var(--text-muted, #9ea0aa); }
.muse-structured-preview-text {
  font-size: 12px; color: var(--text-muted, #9ea0aa);
  text-align: center; padding: 0 10px;
  position: relative;
}
.muse-structured-asset {
  font-size: 11.5px; line-height: 1.6;
  color: var(--text-muted, #9ea0aa);
  padding: 9px 11px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
}
.muse-structured-asset strong { color: var(--accent, #8b8cff); font-weight: 700; }

/* 编辑分镜按钮（胶囊 + 渐变描边） */
.muse-structured-edit {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(16,185,129,.06));
  border: 1px solid rgba(34,197,94,.40);
  border-radius: 999px;
  color: #22c55e;
  font-size: 11.5px; font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.muse-structured-edit:hover {
  background: linear-gradient(135deg, rgba(34,197,94,.24), rgba(16,185,129,.08));
  transform: translateY(-0.5px);
  box-shadow: 0 6px 18px rgba(34,197,94,.18);
}
.muse-structured-edit svg { width: 12px; height: 12px; }

/* Muse 式三栏查看分镜 body 升级 */
.muse-shot-body {
  display: grid;
  grid-template-columns: 290px 1fr 300px;
  gap: 18px;
  padding: 18px 20px 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.015), transparent);
  min-height: 0;   /* ⚠️ 让 grid 子元素能够 flex 收缩 + overflow 滚动 */
  /* ⚠️ 卡片 flex-col：body 占剩余高度 */
  flex: 1;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* 人物头像可点击 + 加载动画 */
.muse-structured-ref { cursor: pointer; position: relative; }
.muse-structured-ref.is-generated .muse-structured-ref-thumb {
  background: none !important;
  padding: 0;
  overflow: hidden;
}
.muse-structured-ref.is-generated .muse-structured-ref-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.muse-structured-ref.is-loading .muse-structured-ref-thumb {
  position: relative;
}
.muse-structured-ref.is-loading .muse-structured-ref-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  border-radius: 8px;
  z-index: 0;
}
.muse-structured-ref.is-loading .muse-structured-ref-thumb .spin-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.muse-structured-ref.is-loading .muse-structured-ref-thumb .spin-loader svg {
  width: 20px; height: 20px;
  color: #fff;
  animation: spin 0.8s linear infinite;
}

/* 人物信息模态框 */
.muse-char-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.muse-char-modal-overlay.show {
  opacity: 1; visibility: visible;
}
.muse-char-modal {
  width: 440px; max-width: 92vw;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 14px;
  overflow: hidden;
  transform: scale(.95);
  transition: transform .2s ease;
}
.muse-char-modal-overlay.show .muse-char-modal {
  transform: scale(1);
}
.muse-char-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
}
.muse-char-modal-title {
  font-size: 14px; font-weight: 700;
  color: var(--text, #e8e9ee);
}
.muse-char-modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: var(--text-muted, #9ea0aa);
  cursor: pointer; border-radius: 6px;
  transition: all .12s ease;
}
.muse-char-modal-close:hover {
  background: rgba(255,255,255,.08);
  color: var(--text, #e8e9ee);
}
.muse-char-modal-body {
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.muse-char-avatar-wrap {
  display: flex; gap: 16px; align-items: flex-start;
}
.muse-char-avatar {
  width: 80px; height: 80px;
  border-radius: 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  cursor: zoom-in;
  position: relative;
}
.muse-char-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.muse-char-avatar .char-initial {
  font-size: 32px; font-weight: 700; color: #fff;
}
.muse-char-avatar.is-loading::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  border-radius: 12px;
  z-index: 0;
}
.muse-char-avatar.is-loading .spin-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.muse-char-avatar.is-loading .spin-loader svg {
  width: 28px; height: 28px;
  color: #fff;
  animation: spin .8s linear infinite;
}
.muse-char-info {
  flex: 1; min-width: 0;
}
.muse-char-info-name {
  font-size: 16px; font-weight: 700;
  color: var(--text, #e8e9ee);
  margin-bottom: 4px;
}
.muse-char-info-ref {
  font-size: 12px; color: var(--text-muted, #9ea0aa);
  margin-bottom: 8px;
}
.muse-char-info-desc {
  font-size: 13px; line-height: 1.6;
  color: var(--text, #e8e9ee);
  padding: 10px 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 8px;
  max-height: 120px; overflow-y: auto;
}
.muse-char-modal-actions {
  display: flex; gap: 8px;
  padding-top: 4px;
}
.muse-char-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
  border: 1px solid transparent;
}
.muse-char-btn svg { width: 14px; height: 14px; }
.muse-char-btn-primary {
  background: var(--accent, #8b8cff);
  color: #fff;
}
.muse-char-btn-primary:hover {
  background: var(--accent-hover, #7a7bff);
}
.muse-char-btn-secondary {
  background: rgba(255,255,255,.05);
  border-color: var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
}
.muse-char-btn-secondary:hover {
  background: rgba(255,255,255,.1);
}
.muse-char-btn-regen {
  background: rgba(245,158,11,.15);
  border-color: rgba(245,158,11,.4);
  color: #f59e0b;
}
.muse-char-btn-regen:hover {
  background: rgba(245,158,11,.25);
}
.muse-char-btn:disabled {
  opacity: .6; cursor: not-allowed;
}

/* 图片放大预览模态 */
.muse-img-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.muse-img-lightbox img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* 图片选择器（顶部缩略图 + 下方大图预览） */
.muse-img-picker {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9600;
  display: flex; flex-direction: column;
  padding: 24px 32px 32px 32px;
  box-sizing: border-box;
}
.muse-img-picker-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-shrink: 0;
}
.muse-img-picker-title {
  color: #fff; font-size: 18px; font-weight: 600;
}
.muse-img-picker-close {
  width: 36px; height: 36px; border: none; cursor: pointer;
  border-radius: 8px; background: rgba(255,255,255,.15);
  color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.muse-img-picker-close:hover { background: rgba(255,255,255,.3); }

/* 下方：缩略图 + 应用按钮 的横向列表 */
.muse-img-picker-thumbs {
  display: flex; flex-direction: row;
  gap: 14px;
  overflow-x: auto;
  padding: 16px 4px 8px 4px;
  flex-shrink: 0;
  justify-content: center;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.muse-img-picker-thumbs::-webkit-scrollbar { height: 8px; }
.muse-img-picker-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.25); border-radius: 4px;
}
.muse-img-picker-thumbs::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06); border-radius: 4px;
}
.muse-img-picker-item {
  display: flex; flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 160px;
}
.muse-img-picker-item .picker-thumb {
  position: relative;
  width: 160px; height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.05);
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .2s, transform .2s;
}
.muse-img-picker-item .picker-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.muse-img-picker-item.is-current .picker-thumb {
  border-color: #22c55e;
}
.muse-img-picker-item.is-current .picker-thumb::after {
  content: '✓ 当前';
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border-radius: 4px;
  background: #22c55e; color: #fff;
  font-size: 11px; font-weight: 600;
}
.muse-img-picker-item .picker-thumb:hover {
  transform: translateY(-2px);
}

/* 每个缩略图下方的操作按钮（应用） */
.muse-img-picker-item .picker-actions {
  display: flex; gap: 6px;
  padding: 0;
  background: none;
}
.muse-img-picker-item .picker-apply {
  flex: 1; padding: 7px 10px;
  border: none; cursor: pointer;
  border-radius: 6px;
  background: var(--accent, #6366f1);
  color: #fff; font-size: 13px; font-weight: 600;
  transition: opacity .2s;
}
.muse-img-picker-item .picker-apply:hover { opacity: .85; }
.muse-img-picker-item .picker-apply.is-applied {
  background: #22c55e;
}

/* 下方：大图预览区域 */
.muse-img-picker-preview {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  padding: 8px;
}
.muse-img-picker-preview img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  cursor: zoom-in;
}
.muse-img-picker-preview-placeholder {
  color: rgba(255,255,255,.45); font-size: 15px;
  text-align: center;
}
.muse-img-picker-empty {
  color: rgba(255,255,255,.5); font-size: 15px;
  text-align: center; padding: 60px 20px;
  margin: auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 通用 spin-loader 基础样式 */
.spin-loader {
  display: flex; align-items: center; justify-content: center;
}
.spin-loader svg {
  animation: spin 0.8s linear infinite;
}

/* 三列通用 */
.muse-shot-col {
  min-width: 0;
  min-height: 0;   /* ⚠️ flex/grid 子元素允许收缩，否则 overflow-y 不生效会被外容器裁 */
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  /* ⚠️ grid 子元素强制铺满 cell 高度 */
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
}
.muse-shot-col-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted, #9ea0aa);
  letter-spacing: .6px; text-transform: uppercase;
  padding-bottom: 4px;
}
.muse-shot-col-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0;
}

/* 左栏：角色/场景/道具 参考卡 */
.muse-refs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.muse-ref-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 8px 6px 6px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
  transition: transform .1s ease, border-color .1s ease;
  cursor: default;
}
.muse-ref-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent-dim, #3a3d7a);
}
.muse-ref-thumb {
  width: 56px; height: 64px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.muse-ref-avatar {
  color: #fff;
  font-size: 18px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  letter-spacing: 1px;
}
.muse-ref-label {
  font-size: 11px; color: var(--text-muted, #9ea0aa);
  max-width: 72px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center;
}

/* 中栏：tabs + 场景分析 + 字数 */
.muse-shot-tabs {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
}
.muse-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, #2a2c33);
  background: transparent;
  color: var(--text-muted, #9ea0aa);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.muse-tab svg { width: 14px; height: 14px; }
.muse-tab.is-active {
  background: var(--accent, #8b8cff);
  color: #fff;
  border-color: var(--accent, #8b8cff);
}
.muse-tab:hover:not(.is-active) {
  color: var(--text, #e8e9ee);
  border-color: var(--accent-dim, #3a3d7a);
}
.muse-shot-spacer { flex: 1; }
.muse-shot-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted, #9ea0aa);
}
.muse-shot-more:hover {
  background: rgba(255,255,255,.05);
  color: var(--text, #e8e9ee);
}
.muse-shot-more svg { width: 15px; height: 15px; }

.muse-shot-detail {
  background: rgba(255,255,255,.015);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px; line-height: 1.75;
  color: var(--text, #e8e9ee);
}
.muse-sa-block {
  font-weight: 700;
  color: var(--accent, #8b8cff);
  font-size: 12px;
  padding-bottom: 6px;
  margin-bottom: 2px;
}
.muse-sa-row {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 2px 0;
}
.muse-sa-key {
  flex-shrink: 0;
  color: var(--text-muted, #9ea0aa);
  font-weight: 600;
  font-size: 12px;
}
.muse-sa-val {
  color: var(--text, #e8e9ee);
  font-size: 12.5px;
  word-break: break-word;
}

.muse-shot-char-count {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-muted, #9ea0aa);
  letter-spacing: .3px;
  padding-right: 2px;
}

/* 右栏：预览占位 */
.muse-edit-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--text, #e8e9ee);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 8px;
  cursor: pointer;
  transition: all .1s ease;
}
.muse-edit-btn:hover {
  background: rgba(139,140,255,.12);
  border-color: var(--accent-dim, #3a3d7a);
  color: #fff;
}
.muse-edit-btn svg { width: 12px; height: 12px; }

.muse-shot-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 130px;
  background: #1e1f24;
  border: 1px dashed var(--border-subtle, #2a2c33);
  border-radius: 10px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s ease, background .15s ease;
}
.muse-shot-preview:hover {
  border-color: var(--accent-dim, #3a3d7a);
  background: #202228;
}
.muse-shot-preview-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 0 16px;
  color: var(--text-muted, #9ea0aa);
}
.muse-shot-preview-placeholder i {
  width: 36px; height: 36px;
  opacity: .6;
}
.muse-shot-preview-text {
  font-size: 11.5px;
  line-height: 1.5;
  max-width: 220px;
}

/* 分页条 */
.muse-sb-pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px;
  padding: 14px 6px 4px;
  color: var(--text-muted, #9ea0aa);
  font-size: 12px;
}
.muse-sb-pg-total { font-weight: 600; }
.muse-sb-pg-limit {
  padding: 4px 8px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.muse-sb-pg-limit:hover,
.muse-sb-pg-limit:focus { border-color: var(--accent-dim, #3a3d7a); }

.muse-sb-pg-btns { display: inline-flex; align-items: center; gap: 4px; }
.muse-sb-pg-btns button {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: all .1s ease;
}
.muse-sb-pg-btns button:hover:not(:disabled) {
  border-color: var(--accent-dim, #3a3d7a);
}
.muse-sb-pg-btns button.is-active {
  background: var(--accent, #8b8cff);
  color: #fff;
  border-color: var(--accent, #8b8cff);
}
.muse-sb-pg-btns button:disabled {
  opacity: .45; cursor: not-allowed;
}
.muse-sb-pg-btns button svg { width: 14px; height: 14px; }
.muse-pg-ellipsis {
  padding: 0 4px;
  color: var(--text-muted, #9ea0aa);
  font-size: 12px;
}

/* 响应式：窄屏时中栏堆叠 / 右栏下移 */
@media (max-width: 1280px) {
  .muse-shot-body,
  .muse-structured-body {
    grid-template-columns: 170px 1fr 240px;
  }
}
@media (max-width: 1024px) {
  .muse-shot-body,
  .muse-structured-body {
    grid-template-columns: 160px 1fr;
  }
  .muse-shot-right,
  .muse-assets-col {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .muse-shot-body,
  .muse-structured-body {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 14px 16px;
  }
  .muse-refs { grid-template-columns: repeat(4, 1fr); }
  .muse-shot-head { padding: 8px 14px; }
}

/* =============================================================
 * 模态框（新建剧集 / 新建章节）
 * ============================================================= */
.ss-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: ssOverlayIn .2s ease;
}
.ss-modal-overlay[hidden] { display: none; }
@keyframes ssOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.ss-modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.02);
  overflow: hidden;
  animation: ssModalIn .3s cubic-bezier(.4,0,.2,1);
}
.ss-modal.ss-modal-wide { max-width: 620px; }
@keyframes ssModalIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ss-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(99,102,241,.08), transparent);
}
.ss-modal-head h3 {
  margin: 0;
  font-size: 17px; font-weight: 700;
  color: var(--text);
}
.ss-modal-close {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.ss-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.ss-modal-close svg { width: 15px; height: 15px; }

.ss-form { padding: 22px 22px 24px; }
.ss-form-group { margin-bottom: 18px; }
.ss-form-group:last-of-type { margin-bottom: 22px; }
.ss-form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.ss-required { color: #ef4444; font-weight: 700; }
.ss-form-group input[type="text"],
.ss-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all .2s;
  resize: vertical;
  box-sizing: border-box;
}
.ss-form-group input[type="text"]:focus,
.ss-form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.ss-form-group textarea { min-height: 160px; line-height: 1.6; }
.ss-char-count {
  margin-top: 6px;
  text-align: right;
  font-size: 12px;
  color: var(--text-tertiary);
}
.ss-char-count.is-max { color: #f59e0b; font-weight: 600; }

.ss-create-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
  transition: all .2s;
  letter-spacing: .5px;
}
.ss-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(99,102,241,.5);
}
.ss-create-btn:active { transform: translateY(0); }
.ss-create-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 分镜生成中的进度条（在分镜视图里显示） */
.ss-sb-progress-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 20px 16px;
  background: rgba(168,85,247,.1);
  border: 1px solid rgba(168,85,247,.25);
  border-radius: 12px;
}
.ss-sb-progress-wrap .ss-stream-progress {
  position: static;
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
}
.ss-sb-progress-info {
  margin: 14px 0 0;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  max-height: 220px;
  overflow: auto;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* 响应式：窄屏 */
@media (max-width: 820px) {
  .ss-hero { padding: 40px 20px 32px; }
  .ss-hero-title { font-size: 28px; }
  .ss-project-grid { padding: 20px; }
  .ss-detail-header,
  .ss-decompose-header,
  .ss-storyboard-header { padding: 16px 20px; }
  .ss-chapter-list { padding: 18px 20px 32px; }
  .ss-decompose-body { padding: 18px 20px; }
  .ss-decompose-actions { padding: 16px 20px 24px; }
  .ss-storyboard-content { padding: 20px; }
  .ss-stream-text { padding: 18px; }
  .ss-modal { max-width: 100%; }
  .ss-modal.ss-modal-wide { max-width: 100%; }
  .ss-top-tabs { display: none; }
  .ss-sub-tabs { overflow-x: auto; }
  .ss-asset-modal {
    width: calc(100vw - 20px);
    max-height: 90vh;
  }
  .ss-asset-grid {
    padding: 14px;
    gap: 10px;
  }
  .ss-asset-group-grid {
    grid-template-columns: 1fr;
  }
  .ss-asset-card-top {
    flex-direction: column;
  }
  .ss-asset-avatar {
    width: 56px;
    height: 56px;
  }
  .ss-asset-name { font-size: 12px; }
  .ss-asset-ref { font-size: 9px; }
  .ss-asset-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ss-asset-actions {
    margin-left: 0;
    width: 100%;
  }
  .ss-btn-batch-gen {
    flex: 1;
    justify-content: center;
  }
}

/* =============================================================
 * 顶级Tab切换（分镜展示 / 角色场景分类）
 * ============================================================= */
.ss-top-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 24px;
}
.ss-top-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 999px;
  color: var(--text-muted, #9ea0aa);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.ss-top-tab svg { width: 14px; height: 14px; }
.ss-top-tab:hover:not(.is-active) {
  color: var(--text, #e8e9ee);
  border-color: var(--accent-dim, #3a3d7a);
}
.ss-top-tab.is-active {
  background: var(--accent, #6366f1);
  color: #fff;
  border-color: var(--accent, #6366f1);
}

/* =============================================================
 * 角色/场景分类视图（内嵌，切换分镜页面内容）
 * ============================================================= */
.ss-asset-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  animation: ssAssetIn .2s ease;
}
.ss-asset-view[hidden] { display: none !important; }
@keyframes ssAssetIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 子分类Tab */
.ss-sub-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 28px 12px;
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}
.ss-sub-tab-batch {
  background: rgba(99,102,241,.08);
  border-color: rgba(99,102,241,.3);
  color: var(--accent, #6366f1);
}
.ss-sub-tab-batch:hover {
  background: rgba(99,102,241,.15);
}
/* 当批量按钮在工具栏内时，取消 margin-left:auto，让它与其他工具栏元素左对齐 */
.ss-asset-toolbar .ss-sub-tab-batch {
  margin-left: 0;
}

/* 工具栏通用按钮样式（用于非批量生图类按钮，如批量选择入口） */
.ss-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 8px;
  color: var(--text, #e8e9ee);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.ss-toolbar-btn svg { width: 15px; height: 15px; }
.ss-toolbar-btn:hover {
  background: rgba(99,102,241,.15);
  border-color: rgba(99,102,241,.5);
  color: var(--accent, #8b8cff);
}

.ss-sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
  color: var(--text-muted, #9ea0aa);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.ss-sub-tab svg { width: 14px; height: 14px; }
.ss-sub-tab:hover:not(.is-active) {
  color: var(--text, #e8e9ee);
  border-color: var(--accent-dim, #3a3d7a);
}
.ss-sub-tab.is-active {
  background: var(--accent, #6366f1);
  color: #fff;
  border-color: var(--accent, #6366f1);
}

/* 批量选择入口条（始终可见，独立于会隐藏的 toolbar） */
.ss-asset-entry-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 28px;
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}

/* 批量操作工具栏 */
.ss-asset-toolbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 10px 28px;
  background: rgba(99,102,241,.06);
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}
.ss-asset-toolbar.is-select-mode {
  display: flex;
}
.ss-asset-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e8e9ee);
  cursor: pointer;
  user-select: none;
}
.ss-asset-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #6366f1);
  cursor: pointer;
}
.ss-asset-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #9ea0aa);
}
.ss-asset-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ss-btn-batch-gen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.ss-btn-batch-gen svg { width: 15px; height: 15px; }
.ss-btn-batch-gen:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
}
.ss-btn-batch-gen:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}
.ss-btn-batch-cancel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
  color: var(--text-muted, #9ea0aa);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.ss-btn-batch-cancel:hover {
  color: var(--text, #e8e9ee);
  border-color: var(--accent-dim, #3a3d7a);
}

/* 宫格卡片区域 */
.ss-asset-grid {
  flex: 1;
  overflow-y: auto;
  /* 【三类同页】纵向堆叠三个分类分组，不再只显示当前选中类 */
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 28px;
}

/* 三类同页：每个分类一个分组（标题 + 网格） */
.ss-asset-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 8px;   /* sub-tab 锚点滚动时留出顶部呼吸空间 */
}
.ss-asset-group.is-flash {
  animation: ss-group-flash 1.2s ease;
}
@keyframes ss-group-flash {
  0%   { background-color: rgba(99,102,241,.18); }
  100% { background-color: transparent; }
}
.ss-asset-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #e6edf3);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--accent, #6366f1);
  background-color: var(--bg-elevated, #18191c);
  background-image: linear-gradient(90deg, rgba(99,102,241,.12), transparent);
  position: sticky;        /* 滚动长列表时分组标题吸顶，始终可见当前分类 */
  top: 0;
  z-index: 2;
}
.ss-asset-group-title svg {
  width: 15px;
  height: 15px;
  color: var(--accent, #6366f1);
}
.ss-asset-group-count {
  color: var(--text-muted, #9ea0aa);
  font-weight: 500;
  font-size: 12px;
}
.ss-asset-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-content: start;
}
.ss-asset-empty {
  width: 100%;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #9ea0aa);
}
.ss-asset-empty i {
  width: 48px;
  height: 48px;
  opacity: .5;
  margin-bottom: 12px;
}
.ss-asset-empty p {
  font-size: 14px;
  margin: 0;
}

/* 宫格卡片 */
.ss-asset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  background: var(--bg-elevated, #18191c);
  border: 2px solid var(--border-subtle, #2a2c33);
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.ss-asset-card:hover {
  border-color: var(--accent-dim, #3a3d7a);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.ss-asset-card.is-selected {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2), 0 8px 24px rgba(99,102,241,.25);
}
.ss-asset-card.is-selected::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: var(--accent, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 10px 10px;
  background-repeat: no-repeat;
  background-position: center;
}
.ss-asset-card.is-generating {
  opacity: .75;
  pointer-events: none;
}

/* 扩展版卡片顶部（头像 + 信息区横向排列） */
.ss-asset-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ss-asset-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 卡片名称 */
.ss-asset-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #e8e9ee);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 描述 textarea */
.ss-asset-desc {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
  background: var(--bg, #141518);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
.ss-asset-desc:hover { border-color: var(--border-strong); }
.ss-asset-desc:focus { border-color: var(--accent); }
.ss-asset-desc::placeholder { color: var(--text-tertiary, #6b7280); }

/* 旧版卡片仍保留 */
.ss-asset-ref {
  font-size: 10px;
  color: var(--text-muted, #9ea0aa);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  text-align: center;
}

/* 卡片头像 */
.ss-asset-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  position: relative;
  transition: all .2s ease;
}
.ss-asset-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ss-asset-avatar-clickable {
  cursor: zoom-in;
}
.ss-asset-avatar-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.ss-asset-avatar-mask svg { width: 20px; height: 20px; color: #fff; }
.ss-asset-avatar-clickable:hover .ss-asset-avatar-mask {
  opacity: 1;
}
.ss-asset-avatar.is-loading {
  background: rgba(255,255,255,.05) !important;
}
.ss-asset-avatar.is-loading .spin-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 卡片名称和描述 */
.ss-asset-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #e8e9ee);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-asset-ref {
  font-size: 10px;
  color: var(--text-muted, #9ea0aa);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* 批量选择 checkbox */
.ss-asset-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #6366f1);
  cursor: pointer;
  z-index: 2;
}
/* 非选择模式下隐藏 checkbox */
.ss-asset-card:not(.ss-asset-select-mode) .ss-asset-checkbox {
  display: none;
}
.ss-asset-card:not(.ss-asset-select-mode) {
  cursor: default;
}

/* 分类颜色变体 */
.ss-asset-card.ss-cat-roles .ss-asset-avatar { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ss-asset-card.ss-cat-scenes .ss-asset-avatar { background: linear-gradient(135deg, #0ea5e9, #14b8a6); }
.ss-asset-card.ss-cat-props .ss-asset-avatar { background: linear-gradient(135deg, #f59e0b, #ef4444); }

/* 卡片操作栏 */
.ss-asset-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ss-asset-regen-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--bg, #141518);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text-secondary, #c4c6cc);
  cursor: pointer;
  transition: all .15s ease;
  width: 100%;
  justify-content: center;
}
.ss-asset-regen-btn:hover {
  border-color: var(--accent, #6366f1);
  color: var(--accent, #6366f1);
  background: rgba(99,102,241,.08);
}
.ss-asset-regen-btn svg { width: 14px; height: 14px; }

/* 缩略图条 */
.ss-asset-thumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle, #2a2c33);
}
.ss-asset-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s ease;
  position: relative;
}
.ss-asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ss-asset-thumb:hover {
  border-color: var(--accent-dim, #3a3d7a);
}
.ss-asset-thumb.is-selected {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 2px rgba(99,102,241,.25);
}
.ss-asset-thumb.is-selected::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--accent, #6366f1);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: center;
}

/* 空状态（分类视图内） */
.ss-asset-empty-cat {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #9ea0aa);
}
.ss-asset-empty-cat i {
  width: 40px;
  height: 40px;
  opacity: .4;
  margin-bottom: 10px;
}
.ss-asset-empty-cat p {
  font-size: 13px;
  margin: 4px 0;
}

/* =============================================================
 * 批量生图工作台弹窗
 * ============================================================= */
.ss-batch-workbench {
  width: 720px;
  max-width: calc(100vw - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ss-batch-workbench .ss-modal-head {
  flex-shrink: 0;
}
.ss-batch-workbench .ss-modal-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ss-batch-workbench .ss-modal-head h3 svg { width: 18px; height: 18px; }

/* 工作台信息栏 */
.ss-batch-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}
.ss-batch-cat {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 6px;
  color: var(--accent, #6366f1);
  font-size: 12px;
  font-weight: 700;
}
.ss-batch-total {
  font-size: 13px;
  color: var(--text-muted, #9ea0aa);
  font-weight: 600;
}

/* 模型选择横条（替换原3列配置区） */
.ss-batch-modelbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 8px;
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}
.ss-batch-modelbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #c4c6cc);
  white-space: nowrap;
}
.ss-batch-modelbar label svg { width: 14px; height: 14px; }
.ss-batch-modelbar select {
  width: auto;
  flex: 1;
  max-width: 360px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
  outline: none;
  transition: border-color .15s ease;
}
.ss-batch-modelbar select:focus { border-color: var(--accent, #6366f1); }

/* 风格分类 Tab */
.ss-batch-style-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 22px 8px;
  flex-shrink: 0;
}
.sb-st-tab {
  padding: 5px 14px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted, #9ea0aa);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.sb-st-tab:hover {
  color: var(--text, #e8e9ee);
}
.sb-st-tab.is-active {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.4);
  color: var(--accent, #6366f1);
}

/* 风格卡片网格（模仿 Muse AI · 4列横向排列） */
.ss-batch-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 22px 14px;
  flex-shrink: 0;
}
.sb-style-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px;
  border: 2px solid transparent;
  transition: all .15s ease;
  background: transparent;
}
.sb-style-card:hover {
  border-color: var(--accent-dim, #3a3d7a);
}
.sb-style-card.is-active {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 2px rgba(99,102,241,.2);
}
.sb-style-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: #2a2c33;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.sb-style-thumb-blank {
  background: linear-gradient(135deg, #4b5563, #1f2937);
}

/* ==========================================================================
   全站美化增强 + 微交互优化（增量覆盖，不删原有规则）
   原则：对比度够、毛玻璃分层、动效微交互为主、排版密度与留白提升
   ========================================================================== */

/* ---- 1. 扩展设计令牌（空间尺度 + 分层玻璃态） ---- */
:root,[data-theme]{
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:20px;
  --space-6:24px; --space-7:32px; --space-8:40px; --space-9:48px; --space-10:64px;
  /* 分层玻璃：外层低透明高 blur（背景层），内层高透明低 blur（内容层，保证可读） */
  --glass-outer-bg:     rgba(22,27,34,0.55);
  --glass-outer-blur:   12px;
  --glass-inner-bg:     rgba(22,27,34,0.86);
  --glass-inner-blur:   6px;
  --glass-border-soft:  rgba(255,255,255,0.10);
  --glass-ring:         0 0 0 1px var(--glass-border-soft);
  /* 内层卡片 4 角高光线（subtle） */
  --card-shine: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 40%);
  --ring-accent: 0 0 0 3px rgba(99,102,241,0.18);
}
[data-theme="light"]{
  --glass-outer-bg:     rgba(255,255,255,0.55);
  --glass-inner-bg:     rgba(255,255,255,0.88);
  --glass-border-soft:  rgba(15,23,42,0.08);
  --card-shine:         linear-gradient(180deg, rgba(255,255,255,0.7), transparent 40%);
}

/* ---- 2. 全局基础优化 ---- */
body{
  background-attachment: fixed;
  /* 文本更锐利、行距略松 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
}
/* 选中文本更有品牌感 */
::selection{ background: rgba(99,102,241,0.28); color: inherit; }

/* 滚动条 → 更细、更贴、更滑 */
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{
  background: rgba(128,144,160,0.45);
  border:2px solid transparent; background-clip:padding-box;
  border-radius:999px;
}
::-webkit-scrollbar-thumb:hover{
  background: rgba(128,144,160,0.72);
  background-clip:padding-box; border:2px solid transparent;
}

/* ---- 3. 按钮系统（微交互 + 对比度提升） ---- */
.btn{
  border-radius: var(--radius);
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn:hover{
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(16,24,40,0.16), inset 0 1px 0 rgba(255,255,255,0.08);
  border-color: rgba(99,102,241,0.38);
}
.btn:active{ transform: translateY(0) scale(0.985); }
.btn-primary{
  background: var(--gradient-accent);
  background-size: 120% 120%;
  background-position: 0% 0%;
  box-shadow: 0 6px 18px rgba(99,102,241,0.35), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: all var(--duration) var(--ease-out), background-position 0.5s var(--ease-out);
}
.btn-primary:hover{
  background-position: 100% 100%;
  box-shadow: 0 10px 28px rgba(99,102,241,0.42), inset 0 1px 0 rgba(255,255,255,0.26);
}
.btn-ghost{
  background: rgba(255,255,255,0.02);
}
.icon-btn{
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease-spring);
}
.icon-btn:hover{
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-1px) scale(1.04);
}

/* ---- 4. 输入 / 表单（聚焦 ring + 微内发光） ---- */
.input,.textarea,select,input[type=text],input[type=password],input[type=email],input[type=number]{
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease-out);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.08);
}
.input:focus,.textarea:focus,select:focus,
input[type=text]:focus,input[type=password]:focus,input[type=email]:focus,input[type=number]:focus{
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: var(--ring-accent), 0 0 0 1px var(--accent), inset 0 1px 0 rgba(255,255,255,0.03);
  outline: none;
}
textarea{ resize: vertical; line-height:1.7; }
.field > label:not(.switch-row):not(.terms-check){
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* ---- 5. 卡片统一质感（双层阴影 + 高光 + 分层毛玻璃） ---- */
.admin-card,.profile-card,.auth-card,.error-card,.terms-card,
.metric-card,.stat-card,.feature-card,.home-cta-card,.user-card,
.chat-export-card,.ss-project-card,.ss-chapter-card,.muse-shot-card,
.card,.modal-card{
  background:
    var(--card-shine),
    var(--glass-inner-bg);
  backdrop-filter: blur(var(--glass-inner-blur));
  -webkit-backdrop-filter: blur(var(--glass-inner-blur));
  border: 1px solid var(--glass-border-soft);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 2px 6px rgba(0,0,0,0.10),
    0 18px 40px -12px rgba(0,0,0,0.35);
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.admin-card:hover,.profile-card:hover,.metric-card:hover,.stat-card:hover,
.feature-card:hover{
  transform: translateY(-2px);
  border-color: rgba(99,102,241,0.30);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 6px 18px rgba(16,24,40,0.16),
    0 26px 52px -14px rgba(99,102,241,0.20);
}
/* 卡片四角 subtle 高光 */
.admin-card::before,.profile-card::before,.auth-card::before,
.feature-card::before,.metric-card::before,.stat-card::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(120px 80px at 0% 0%,     rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(120px 80px at 100% 100%, rgba(99,102,241,0.10),  transparent 60%);
  border-radius: inherit;
}

/* ---- 6. 模态框 / Toast（弹层分层） ---- */
.modal-overlay,.toast-container ~ .modal-overlay{
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-card{
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.5vw, 28px);
  animation: modalIn 0.28s var(--ease-out) both;
}
@keyframes modalIn{
  from{ opacity:0; transform: scale(0.94) translateY(6px); }
  to  { opacity:1; transform: scale(1)    translateY(0);   }
}
/* Toast → 分层毛玻璃 + 阴影升级 */
.toast{
  background: var(--glass-inner-bg) !important;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid var(--glass-border-soft) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 14px 40px -8px rgba(0,0,0,0.55) !important;
  border-radius: var(--radius) !important;
  padding: 12px 16px !important;
  animation: toastIn 0.32s var(--ease-out) both;
}
@keyframes toastIn{
  from{ opacity:0; transform: translateY(-8px) scale(0.98); }
  to  { opacity:1; transform: translateY(0)    scale(1);    }
}

/* ---- 7. 表格（斑马纹 + 行悬浮柔和 + 表头分层） ---- */
table.um-table,table.admin-table,.um-table table{
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.um-table thead th,.admin-table thead th{
  background: var(--glass-outer-bg);
  backdrop-filter: blur(6px);
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.um-table tbody td,.admin-table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration) var(--ease);
}
.um-table tbody tr:hover td,.admin-table tbody tr:hover td{
  background: var(--accent-light);
}

/* ---- 8. 标签 / 徽章（圆润 + 悬浮） ---- */
.tag,.badge,.pill,
.ss-status-draft,.ss-status-done,.chat-badge-role,.credits-badge-num{
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ss-status-draft{ background: var(--warning-light); color: var(--warning); border: 1px solid rgba(210,153,34,0.25); }
.ss-status-done { background: var(--success-light); color: var(--success); border: 1px solid rgba(63,185,80,0.25);  }

/* ---- 9. 开关 / checkbox（更精致） ---- */
.switch,.switch-row input[type=checkbox]{
  transition: all var(--duration) var(--ease-out);
}

/* ---- 10. 各页面容器（分层玻璃外层 + 内容内层） ---- */
/* 登录/注册 */
.auth-wrap{
  background:
    radial-gradient(800px 500px at 10% 0%,  rgba(99,102,241,0.18), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(139,92,246,0.16), transparent 60%),
    var(--gradient-bg);
}
.auth-card{
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 40px);
}
.auth-card .auth-title{ font-weight: 700; letter-spacing: 0.01em; }
.auth-card .auth-subtitle{ color: var(--text-secondary); line-height: 1.7; }

/* 聊天页 */
.chat-header,.chat-topbar,.admin-topbar,.profile-topbar{
  background: var(--glass-outer-bg);
  backdrop-filter: blur(var(--glass-outer-blur));
  -webkit-backdrop-filter: blur(var(--glass-outer-blur));
  border-bottom: 1px solid var(--glass-border-soft);
}
.sidebar,.chat-side,.admin-sidebar,.home-sidebar{
  background: var(--glass-outer-bg);
  backdrop-filter: blur(var(--glass-outer-blur));
  -webkit-backdrop-filter: blur(var(--glass-outer-blur));
  border-right: 1px solid var(--glass-border-soft);
}
/* 会话列表项 → 微交互 */
.session-item{
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease-out);
}
.session-item:hover{
  background: var(--bg-hover);
  transform: translateX(2px);
}
.session-item.is-active{
  background: var(--accent-light);
  border: 1px solid rgba(99,102,241,0.35);
  box-shadow: inset 2px 0 0 var(--accent);
}
/* 气泡 → 更柔 */
.bubble{
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  line-height: 1.75;
}
.user-bubble{
  background: var(--gradient-accent);
  background-size: 120% 120%;
  box-shadow: 0 6px 18px rgba(99,102,241,0.32), inset 0 1px 0 rgba(255,255,255,0.22);
}
.composer{
  background: var(--glass-outer-bg);
  backdrop-filter: blur(var(--glass-outer-blur));
  -webkit-backdrop-filter: blur(var(--glass-outer-blur));
  border-top: 1px solid var(--glass-border-soft);
}
.composer-inner,.composer-box{
  border-radius: var(--radius-lg) !important;
  background: var(--glass-inner-bg);
  border: 1px solid var(--glass-border-soft);
  transition: all var(--duration) var(--ease-out);
}
.composer-inner:focus-within,.composer-box:focus-within{
  border-color: var(--accent);
  box-shadow: var(--ring-accent);
}

/* 首页 hero + 卡片 */
.home-body{
  background:
    radial-gradient(800px 520px at 15% -5%,  rgba(139,92,246,0.20), transparent 60%),
    radial-gradient(700px 480px at 95% 10%,  rgba(217,70,239,0.14), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(99,102,241,0.18), transparent 60%),
    var(--gradient-bg);
}
.home-hero{
  background:
    radial-gradient(400px 200px at 80% 0%, rgba(99,102,241,0.20), transparent 70%);
}
.feature-card,.home-cta-card{
  border-radius: var(--radius-lg) !important;
}

/* 个人中心 */
.profile-main{
  background:
    radial-gradient(600px 400px at 0% 0%,    rgba(99,102,241,0.16), transparent 60%),
    radial-gradient(600px 400px at 100% 10%, rgba(139,92,246,0.16), transparent 60%);
}
.user-card{
  border-radius: var(--radius-lg) !important;
}
.user-card::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(300px 180px at 100% 0%, rgba(99,102,241,0.18), transparent 60%);
}

/* 剧本工作台 */
#scriptStudio{
  background:
    radial-gradient(700px 460px at 0% 0%,   rgba(99,102,241,0.14), transparent 60%),
    radial-gradient(700px 460px at 100% 10%, rgba(139,92,246,0.14), transparent 60%);
}
.muse-shot-card{
  border-radius: var(--radius-lg);
}
/* 角色缩略卡 hover */
.muse-structured-ref{
  transition: all var(--duration) var(--ease-spring);
}
.muse-structured-ref:hover{
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 6px 12px rgba(99,102,241,0.25));
}

/* 错误 / 条款页 */
.error-wrap,.terms-wrap{
  background:
    radial-gradient(600px 420px at 50% 0%, rgba(99,102,241,0.16), transparent 60%),
    var(--gradient-bg);
}
.error-code{
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 20px rgba(99,102,241,0.35));
  letter-spacing: 0.02em;
}

/* ---- 11. 统一入场 stagger（复用已有关键帧，仅补 delay） ---- */
.metric-card,.stat-card,.feature-card,
.profile-card,.admin-card,.ss-project-card,.ss-chapter-card{
  animation: cardIn 0.45s var(--ease-out) both;
}
.metric-card:nth-child(1),.stat-card:nth-child(1),.feature-card:nth-child(1),.profile-grid .profile-card:nth-child(1){ animation-delay:.03s; }
.metric-card:nth-child(2),.stat-card:nth-child(2),.feature-card:nth-child(2),.profile-grid .profile-card:nth-child(2){ animation-delay:.10s; }
.metric-card:nth-child(3),.stat-card:nth-child(3),.feature-card:nth-child(3){ animation-delay:.17s; }
.metric-card:nth-child(4),.stat-card:nth-child(4),.feature-card:nth-child(4){ animation-delay:.24s; }
.feature-card:nth-child(5),.stat-card:nth-child(5){ animation-delay:.31s; }
.feature-card:nth-child(6),.stat-card:nth-child(6){ animation-delay:.38s; }

/* ---- 12. 减少动画偏好兼容（系统级无障碍） ---- */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover,.admin-card:hover,.profile-card:hover,.feature-card:hover,
  .metric-card:hover,.stat-card:hover,.icon-btn:hover,
  .session-item:hover,.muse-structured-ref:hover,
  .ss-project-card:hover,.ss-chapter-card:hover{
    transform: none !important;
  }
}

/* ---- 13. 桌面细腻化：更大的悬浮阴影；移动端：保留紧凑，放大触摸 ---- */
@media (min-width: 900px){
  body{ font-size: 15px; }
  .btn{ padding: 10px 22px; }
}
@media (max-width: 768px){
  ::-webkit-scrollbar{ width:6px; height:6px; }
  /* 移动端卡片去掉 heavy 阴影，更轻 */
  .admin-card,.profile-card,.auth-card,.feature-card,.metric-card,.stat-card{
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 10px 24px -10px rgba(0,0,0,0.25);
  }
}

/* ==========================================================================
   首页星轨：模型图片展示（替代原文字徽标）
   ========================================================================== */
.hero-orbit-chip {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #0f1424;
}
.hero-orbit-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
/* 浅色主题下模型图保持一致的卡片观感 */
[data-theme="light"] .hero-orbit-chip {
  background: #ffffff;
}

/* 移动端跑马灯 chip：左侧小图标 + 右侧文字 */
.lk-mm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 14px;
}
.lk-mm-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.25);
}
.sb-style-thumb-blank svg {
  width: 28px; height: 28px; opacity: .6;
}
.sb-style-init {
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.sb-style-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #c4c6cc);
  text-align: center;
  padding: 2px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-style-card.is-active .sb-style-name {
  color: var(--accent, #6366f1);
}

/* 参数区（紧凑横向排列，模仿 Muse AI） */
.ss-batch-params {
  border-top: 1px solid var(--border-subtle, #2a2c33);
  border-bottom: 1px solid var(--border-subtle, #2a2c33);
  padding: 10px 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ss-batch-params label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #9ea0aa);
  white-space: nowrap;
}
.ss-batch-params label svg { width: 12px; height: 12px; }
.ss-batch-params select {
  width: auto;
  flex: 0 0 auto;
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
  outline: none;
}
.ss-batch-params-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ss-batch-params-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #9ea0aa);
  white-space: nowrap;
}
.ss-batch-params-row label svg { width: 12px; height: 12px; }
.ss-batch-params-row select {
  width: auto;
  flex: 0 0 auto;
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  color: var(--text, #e8e9ee);
  outline: none;
}
.ss-batch-params-item {
  width: 100%;
  margin-top: 4px;
}
.ss-batch-param-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #c4c6cc);
}
.ss-btn-cost {
  font-size: 12px;
  font-weight: 500;
  opacity: .9;
  margin-left: 2px;
}

/* 待生成元素列表 */
.ss-batch-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 单个待生成项 */
.ss-batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-elevated, #18191c);
  border: 1px solid var(--border-subtle, #2a2c33);
  border-radius: 10px;
  transition: all .15s ease;
}
.ss-batch-item:hover {
  border-color: var(--accent-dim, #3a3d7a);
}
.ss-batch-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  overflow: hidden;
  flex-shrink: 0;
}
.ss-batch-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ss-batch-item-info {
  flex: 1;
  min-width: 0;
}
.ss-batch-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #e8e9ee);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-batch-item-ref {
  font-size: 11px;
  color: var(--text-muted, #9ea0aa);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 状态图标 */
.ss-batch-item-status {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ss-batch-item-status svg { width: 18px; height: 18px; }
.ss-batch-item-status[data-status="pending"] { color: var(--text-muted, #9ea0aa); }
.ss-batch-item-status[data-status="loading"] { color: var(--accent, #6366f1); }
.ss-batch-item-status[data-status="done"] { color: #22c55e; }
.ss-batch-item-status[data-status="error"] { color: #ef4444; }

/* 底部操作栏 */
.ss-batch-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}
.ss-btn-start-gen {
  padding: 9px 22px;
}

/* 进度条区域 */
.ss-batch-progress {
  padding: 12px 22px;
  border-top: 1px solid var(--border-subtle, #2a2c33);
  flex-shrink: 0;
}
.ss-batch-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ss-batch-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e8e9ee);
}
.ss-batch-progress-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #6366f1);
}
.ss-batch-progress-bar {
  height: 6px;
  background: var(--bg-elevated, #18191c);
  border-radius: 3px;
  overflow: hidden;
}
.ss-batch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #6366f1), var(--accent-hover, #7c7ff5));
  border-radius: 3px;
  transition: width .3s ease;
}
/* 进度条区域：下载按钮 */
.ss-batch-download-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--accent, #6366f1);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s ease, opacity .2s ease;
}
.ss-batch-download-btn:hover:not(:disabled) {
  background: var(--accent-hover, #7c7ff5);
}
.ss-batch-download-btn:disabled {
  opacity: .65;
  cursor: progress;
}

/* 后台生成指示器 */
.ss-bg-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #6366f1, #7c7ff5);
  color: #fff;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(99, 102, 241, .45);
  cursor: default;
  animation: ss-bg-pulse 2s ease-in-out infinite;
}
.ss-bg-indicator i {
  animation: spin 1s linear infinite;
}
.ss-bg-indicator .ss-bg-count {
  background: rgba(255, 255, 255, .25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.ss-bg-indicator .ss-bg-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  cursor: pointer;
  transition: background .15s ease;
}
.ss-bg-indicator .ss-bg-close:hover {
  background: rgba(255, 255, 255, .4);
}
.ss-bg-indicator .ss-bg-close i {
  width: 12px;
  height: 12px;
  animation: none;
}
@keyframes ss-bg-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, .45); }
  50% { box-shadow: 0 4px 30px rgba(99, 102, 241, .7); }
}

/* 全局浮动生图进度指示器 */
.ss-global-gen-progress {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  width: 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  padding: 16px 18px 14px;
  font-size: 13px;
  color: #334155;
  animation: ss-ggp-in .3s ease-out;
}
.ss-global-gen-progress[hidden] { display: none !important; }
.ss-ggp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
}
.ss-ggp-header i { color: #6366f1; }
.ss-ggp-header i.spin { animation: spin 1s linear infinite; }
.ss-ggp-title { flex: 1; font-size: 13px; }
.ss-ggp-close {
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #94a3b8;
  transition: all .2s;
}
.ss-ggp-close:hover { background: #f1f5f9; color: #334155; }
.ss-ggp-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ss-ggp-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  width: 0;
  transition: width .4s ease;
}
.ss-ggp-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}
.ss-ggp-done {
  font-weight: 600;
  color: #334155;
}
.ss-ggp-detail { font-size: 11px; }
.ss-ggp-detail .✓ { color: #10b981; }
.ss-ggp-detail .✗ { color: #ef4444; }
.ss-ggp-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
}
.ss-ggp-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #6366f1, #7c7ff5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.ss-ggp-download:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, .35); }
@keyframes ss-ggp-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 移动端工作台适配 */
@media (max-width: 820px) {
  .ss-batch-workbench {
    width: calc(100vw - 20px);
    max-height: 85vh;
  }
  .ss-batch-modelbar {
    padding: 10px 14px 8px;
  }
  .ss-batch-style-tabs {
    padding: 10px 14px 6px;
  }
  .ss-batch-style-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 14px 10px;
    gap: 8px;
  }
  .ss-batch-params {
    padding: 8px 14px;
    gap: 6px;
  }
  .ss-batch-list {
    padding: 10px 14px;
  }
  .ss-batch-info {
    padding: 10px 14px;
  }
  .ss-batch-footer {
    padding: 12px 14px;
  }
  /* 后台风格配置：移动端预览图自适应 */
  .style-row-image { flex-direction: column; align-items: flex-start; }
  .style-preview { flex: 0 0 64px; width: 64px; height: 64px; }
}

/* ============================================================
   首页 UI · 克制增量优化 · 2026-08-13
   仅做视觉增强，不改业务结构；与现有 home 变量/类兼容。
   ============================================================ */

/* 1) 顶栏滚动：高度微缩 + 更精致玻璃感 */
.lk-header { transition: background .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease), padding-top .4s var(--ease), padding-bottom .4s var(--ease); }
.lk-header.scrolled {
  padding-top: 8px;
  padding-bottom: 8px;
  background: var(--home-card-strong);
}
.lk-header.scrolled .lk-brand-name { letter-spacing: 0.1px; }
.lk-nav a { position: relative; }
.lk-nav a::after {
  content:''; position:absolute; left: 50%; right: 50%; bottom: 2px; height: 2px;
  background: linear-gradient(90deg, var(--home-cyan), var(--home-violet));
  border-radius: 2px; opacity: 0; transition: left .35s var(--ease-out), right .35s var(--ease-out), opacity .25s;
}
.lk-nav a:hover::after,
.lk-nav a.active::after { left: 16px; right: 16px; opacity: 0.9; }

/* 2) Hero：更具冲击力的视觉表达 */
.home-badge {
  position: relative;
  animation: homeBadgeBreath 3.2s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(0,202,224,0.25) inset,
    0 6px 22px rgba(0,202,224,0.22);
  border: 1px solid rgba(139,92,246,0.22) !important;
}
.home-badge::before {
  content:''; position:absolute; inset:-1px; border-radius: inherit; padding:1px;
  background: linear-gradient(135deg, rgba(0,202,224,0.55), rgba(139,92,246,0.55) 55%, rgba(244,114,182,0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events:none; opacity:.75;
}
@keyframes homeBadgeBreath {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,202,224,0.25) inset, 0 6px 22px rgba(0,202,224,0.20); transform: translateY(0); }
  50%      { box-shadow: 0 0 0 1px rgba(139,92,246,0.30) inset, 0 8px 30px rgba(139,92,246,0.28); transform: translateY(-1px); }
}

.lk-hero-title {
  letter-spacing: -1.4px;
  text-shadow: 0 4px 42px rgba(0,202,224,0.08);
}
.home-title-grad {
  background: linear-gradient(135deg, #35F2FF 0%, #00CAE0 28%, #8b5cf6 64%, #f472b6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 6px 26px rgba(0,202,224,0.18));
  position: relative;
}
.lk-hero-sub {
  position: relative; padding-left: 0;
}
.lk-hero-sub::before {
  content:''; display:block; width: 44px; height: 2px; margin: 0 auto 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,202,224,0.6) 50%, transparent);
  opacity: .9;
}

/* CTA 主按钮：3D 多层质感 */
.lk-hero-cta .btn {
  position: relative; overflow: hidden;
}
.lk-hero-cta .btn-primary {
  box-shadow:
    0 12px 30px rgba(0,202,224,0.30),
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 1px 0 rgba(255,255,255,0.25) inset;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), filter .35s;
}
.lk-hero-cta .btn-primary:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 18px 40px rgba(0,202,224,0.38),
    0 0 0 1px rgba(255,255,255,0.09) inset,
    0 1px 0 rgba(255,255,255,0.32) inset;
  filter: saturate(1.15);
}
.lk-hero-cta .btn-primary:active { transform: translateY(0) scale(0.99); }
/* 高光扫光 */
.lk-hero-cta .btn-primary::before {
  content:''; position:absolute; top:0; left:-80%; width:55%; height:100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg); transition: left .9s var(--ease-out); pointer-events:none;
}
.lk-hero-cta .btn-primary:hover::before { left: 130%; }

.lk-hero-cta .btn-ghost.lk-ghost-light {
  box-shadow: 0 10px 26px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.05) inset;
  transition: transform .35s var(--ease-out), border-color .35s var(--ease-out), color .3s, background .3s;
}
.lk-hero-cta .btn-ghost.lk-ghost-light:hover {
  transform: translateY(-2px);
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.45);
}

/* 统计胶囊：柔光内阴影 */
.lk-stats {
  position: relative;
  box-shadow:
    0 18px 48px rgba(0,0,0,0.32),
    0 0 0 1px rgba(0,202,224,0.12) inset;
}
.lk-stats::before {
  content:''; position:absolute; inset:0; border-radius: inherit; pointer-events:none;
  background: radial-gradient(180px 80px at 20% 0%, rgba(0,202,224,0.12), transparent 70%),
              radial-gradient(200px 90px at 80% 100%, rgba(139,92,246,0.12), transparent 70%);
}
.lk-stat-num { letter-spacing: -0.5px; text-shadow: 0 4px 22px rgba(0,202,224,0.25); }

/* 3) 两侧竖向模型流 chip：升级为左侧图标+品牌色背景胶囊 */
.lk-stream-chip {
  width: 144px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  text-align: left;
  position: relative; overflow: hidden;
  font-weight: 600;
}
.lk-stream-chip::before {
  content:''; position:absolute; inset:0; opacity:.16;
  background: currentColor; pointer-events:none;
  mask: radial-gradient(120px 60px at 0% 0%, #000 0%, transparent 70%);
}
.lk-stream-chip img {
  width: 24px; height: 24px; flex-shrink: 0;
  object-fit: contain; -webkit-user-drag: none; user-select: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.28));
}
.lk-stream-chip { border: 1px solid rgba(255,255,255,0.06); }
.lk-stream-chip.qwen     { background: linear-gradient(135deg, rgba(129,140,248,0.14), rgba(129,140,248,0.04)); }
.lk-stream-chip.deepseek { background: linear-gradient(135deg, rgba(167,139,250,0.14), rgba(167,139,250,0.04)); }
.lk-stream-chip.llama    { background: linear-gradient(135deg, rgba(34,211,238,0.14), rgba(34,211,238,0.04)); }
.lk-stream-chip.flux     { background: linear-gradient(135deg, rgba(244,114,182,0.14), rgba(244,114,182,0.04)); }
.lk-stream-chip.yi       { background: linear-gradient(135deg, rgba(52,211,153,0.14), rgba(52,211,153,0.04)); }
.lk-stream-chip.gemma    { background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(245,158,11,0.04)); }
.lk-stream-chip.claude   { background: linear-gradient(135deg, rgba(251,146,60,0.14), rgba(251,146,60,0.04)); }
.lk-stream-chip.gemini   { background: linear-gradient(135deg, rgba(96,165,250,0.14), rgba(96,165,250,0.04)); }
.lk-stream-chip.mistral  { background: linear-gradient(135deg, rgba(251,191,36,0.14), rgba(251,191,36,0.04)); }
.lk-stream-chip.glm      { background: linear-gradient(135deg, rgba(0,202,224,0.14), rgba(0,202,224,0.04)); }
.lk-stream-chip.qwen-vl  { background: linear-gradient(135deg, rgba(192,132,252,0.14), rgba(192,132,252,0.04)); }
.lk-stream-chip.coder    { background: linear-gradient(135deg, rgba(74,222,128,0.14), rgba(74,222,128,0.04)); }
.lk-stream-chip.gpt      { background: linear-gradient(135deg, rgba(16,163,127,0.16), rgba(16,163,127,0.04)); }
.lk-stream-chip.ernie    { background: linear-gradient(135deg, rgba(41,50,225,0.16), rgba(41,50,225,0.04)); }

/* 4) Agent 卡片：玻璃态分层 + 顶部渐变常显 + 编号大字装饰 */
.lk-agent-card {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)) padding-box,
    var(--home-card);
}
.lk-agent-card::before {
  background:
    radial-gradient(500px 260px at 50% -20%, rgba(0,202,224,0.18), transparent 65%),
    radial-gradient(300px 200px at 100% 100%, rgba(139,92,246,0.14), transparent 70%);
  opacity: 1;
}
.lk-agent-card:hover {
  box-shadow:
    0 22px 56px rgba(0,0,0,0.38),
    0 0 0 1px rgba(0,202,224,0.22) inset;
}
/* 顶部渐变光带（弱常显 + hover 强显） */
.lk-agent-card::after {
  left: 18px; right: 18px; top: 0; height: 2px;
  opacity: 0.35;
  background: linear-gradient(90deg, transparent, var(--home-cyan) 40%, var(--home-violet) 60%, transparent);
}
.lk-agent-card:hover::after {
  opacity: 1; height: 3px;
  box-shadow: 0 0 24px rgba(0,202,224,0.55);
}
/* 编号大字背景装饰（不挡文字） */
.lk-agent-num {
  position: relative; z-index: 1;
  display: inline-block;
}
.lk-agent-card h3 + p {
  position: relative; z-index: 1;
}
.lk-agent-icon {
  position: relative; z-index: 1;
  box-shadow:
    0 10px 26px rgba(0,202,224,0.30),
    0 0 0 1px rgba(255,255,255,0.08) inset;
  overflow: hidden;
}
.lk-agent-icon::after {
  content:''; position:absolute; inset:0; border-radius: inherit; pointer-events:none;
  background: radial-gradient(60% 60% at 25% 20%, rgba(255,255,255,0.35), transparent 70%);
  opacity: .9;
}
.lk-agent-card:hover .lk-agent-icon {
  box-shadow:
    0 16px 38px rgba(0,202,224,0.46),
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0 0 36px rgba(139,92,246,0.25);
}
.lk-agent-link::after {
  content:''; display:block; width:0; height:1px; background: currentColor;
  transition: width .3s var(--ease-out); margin-top: -3px;
}
.lk-agent-link:hover::after { width: calc(100% - 20px); }

/* 5) 核心能力 Cap 2×2：品牌色光环 + 渐变描边 */
.lk-cap-card {
  position: relative; overflow: hidden; isolation: isolate;
}
.lk-cap-card::before {
  content:''; position:absolute; inset:-1px; z-index:-1; border-radius: inherit; padding:1px;
  background: linear-gradient(135deg, rgba(0,202,224,0.00), rgba(0,202,224,0.22), rgba(139,92,246,0.22), rgba(0,202,224,0.00));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity:.35; transition: opacity .4s;
}
.lk-cap-card:hover::before { opacity: 1; }
.lk-cap-card:hover {
  box-shadow:
    0 22px 52px rgba(0,0,0,0.34),
    0 0 0 1px rgba(0,202,224,0.10) inset;
}
.lk-cap-icon {
  position: relative; overflow: hidden;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.lk-cap-icon::after {
  content:''; position:absolute; inset:0; border-radius: inherit; pointer-events:none;
  background: radial-gradient(60% 60% at 25% 20%, rgba(255,255,255,0.35), transparent 70%);
  opacity:.85;
}
.lk-cap-card:hover .lk-cap-icon {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 10px 30px rgba(0,202,224,0.22);
}
.lk-cap-icon.fi-cyan    { box-shadow: 0 0 0 1px rgba(34,211,238,0.30) inset, 0 0 30px rgba(0,202,224,0.18); }
.lk-cap-icon.fi-purple  { box-shadow: 0 0 0 1px rgba(167,139,250,0.30) inset, 0 0 30px rgba(139,92,246,0.18); }
.lk-cap-icon.fi-pink    { box-shadow: 0 0 0 1px rgba(244,114,182,0.30) inset, 0 0 30px rgba(244,114,182,0.18); }
.lk-cap-icon.fi-green   { box-shadow: 0 0 0 1px rgba(52,211,153,0.30) inset, 0 0 30px rgba(52,211,153,0.18); }

/* 6) 技术架构 6 卡片：左侧品牌色小条带 + 悬停微光晕 */
.lk-tech-card { position: relative; overflow: hidden; }
.lk-tech-card::before {
  content:''; position:absolute; left:0; top:24px; bottom:24px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--home-cyan), var(--home-violet)); opacity:.7;
  transition: width .35s var(--ease-out), opacity .35s;
}
.lk-tech-card:hover::before { width: 4px; opacity:1; box-shadow: 0 0 18px rgba(0,202,224,0.45); }
.lk-tech-card:hover {
  border-color: rgba(0,202,224,0.32);
  box-shadow:
    0 18px 42px rgba(0,0,0,0.30),
    0 0 0 1px rgba(0,202,224,0.08) inset;
}
.lk-tech-icon {
  box-shadow:
    0 0 0 1px rgba(139,92,246,0.22) inset,
    0 8px 20px rgba(139,92,246,0.18);
  overflow: hidden;
}
.lk-tech-icon::after {
  content:''; position:absolute; inset:0; border-radius: inherit; pointer-events:none;
  background: radial-gradient(60% 60% at 25% 20%, rgba(255,255,255,0.3), transparent 70%);
}
/* 为每张 tech 卡片分配专属品牌色条带 */
.lk-tech-grid .lk-tech-card:nth-child(1)::before { background: linear-gradient(180deg, #22d3ee, #3b82f6); }
.lk-tech-grid .lk-tech-card:nth-child(2)::before { background: linear-gradient(180deg, #a78bfa, #8b5cf6); }
.lk-tech-grid .lk-tech-card:nth-child(3)::before { background: linear-gradient(180deg, #f472b6, #f59e0b); }
.lk-tech-grid .lk-tech-card:nth-child(4)::before { background: linear-gradient(180deg, #34d399, #00CAE0); }
.lk-tech-grid .lk-tech-card:nth-child(5)::before { background: linear-gradient(180deg, #fbbf24, #f97316); }
.lk-tech-grid .lk-tech-card:nth-child(6)::before { background: linear-gradient(180deg, #60a5fa, #a78bfa); }

/* 7) CTA：背景光点漫游动画 + 霓虹按钮 */
.lk-cta-bg {
  background-image:
    radial-gradient(600px 300px at 50% 0%, rgba(0,202,224,0.26), transparent 70%),
    radial-gradient(500px 260px at 50% 120%, rgba(139,92,246,0.22), transparent 70%),
    linear-gradient(180deg, transparent, transparent),
    var(--home-card);
}
.lk-cta-bg::before, .lk-cta-bg::after {
  content:''; position:absolute; border-radius: 50%; pointer-events:none;
  filter: blur(60px); opacity: .55;
  animation: ctaOrb 14s ease-in-out infinite;
}
.lk-cta-bg::before { width: 420px; height: 420px; left: -120px; top: 40%;
  background: radial-gradient(circle, rgba(0,202,224,0.45), transparent 65%); }
.lk-cta-bg::after  { width: 520px; height: 520px; right: -160px; top: -30%; animation-delay: -5s;
  background: radial-gradient(circle, rgba(139,92,246,0.42), transparent 65%); }
@keyframes ctaOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -22px) scale(1.08); }
}
.lk-cta-inner p {
  position: relative;
}
.lk-cta-inner p::before {
  content:''; display:block; width: 56px; height: 2px; margin: 0 auto 16px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.6) 50%, transparent);
}
.lk-cta-btn {
  position: relative; overflow: hidden;
  box-shadow:
    0 18px 44px rgba(0,202,224,0.32),
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 1px 0 rgba(255,255,255,0.28) inset;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), filter .35s;
}
.lk-cta-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 26px 58px rgba(0,202,224,0.42),
    0 0 0 1px rgba(255,255,255,0.10) inset,
    0 0 52px rgba(139,92,246,0.30);
  filter: saturate(1.15);
}
.lk-cta-btn::before {
  content:''; position:absolute; top:0; left:-80%; width:55%; height:100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-20deg); transition: left 1.1s var(--ease-out); pointer-events:none;
}
.lk-cta-btn:hover::before { left: 130%; }

/* 8) 页脚：顶部分隔渐变条 + 链接下划线滑入 */
.lk-footer { position: relative; }
.lk-footer::before {
  content:''; position:absolute; left:0; right:0; top:0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,202,224,0.5) 25%, rgba(139,92,246,0.5) 75%, transparent);
}
.lk-footer-list li a {
  position: relative; text-decoration: none;
}
.lk-footer-list li a::after {
  content:''; position:absolute; left:0; right:100%; bottom:-2px; height: 1px;
  background: linear-gradient(90deg, var(--home-cyan), var(--home-violet));
  transition: right .35s var(--ease-out);
}
.lk-footer-list li a:hover::after { right: 0; }

/* 9) Section kicker 轻微发光 + 顶部装饰线 */
.lk-section-kicker {
  position: relative;
  box-shadow: 0 6px 22px rgba(0,202,224,0.18), 0 0 0 1px rgba(0,202,224,0.12) inset;
}
.lk-section-head h2 {
  position: relative; padding-top: 0;
}
/* 副标题（小字两行排版下的主标题装饰点） */
.lk-head-sub {
  margin-top: 10px;
  background: linear-gradient(90deg, var(--home-violet), var(--home-cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  letter-spacing: 1px;
}

/* 10) 移动端：统计胶囊与CTA保持移动友好，不新增横向溢出 */
@media (max-width: 768px), body.is-mobile {
  .lk-stream { display: none; } /* 避免 stream 里加了 img 后移动仍渲染 */
  .lk-nav a::after { display: none; } /* 移动不显示下划线滑入 */
  .lk-agent-card::after { height: 2px; opacity: 0.45; }
  .lk-tech-card::before { width: 3px; top: 20px; bottom: 20px; }
  .lk-cta-btn::before { display: none; }
}

/* ==========================================================================
 * 分镜卡片资产视图切换：本分镜资产 / 全章总资产
 * ========================================================================== */

/* ---- 结构化分镜左栏头 ---- */
.muse-structured-left-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.muse-structured-left-title {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #8b949e);
  letter-spacing: 0.3px;
  margin: 0;
}

/* ---- 资产切换按钮组 ---- */
.muse-asset-switcher {
  display: flex;
  background: var(--bg-elevated, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.muse-asset-switcher-sm {
  border-radius: 6px;
  padding: 2px;
}

.muse-asset-switch-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #8b949e);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muse-asset-switcher-sm .muse-asset-switch-btn {
  padding: 5px 6px;
  font-size: 11px;
  border-radius: 5px;
  gap: 2px;
}

.muse-asset-switch-btn:hover {
  background: var(--bg-hover, #1c2230);
  color: var(--text, #e6edf3);
}

.muse-asset-switch-btn.is-active {
  background: var(--accent, #6366f1);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.muse-asset-switch-btn.is-active:hover {
  background: var(--accent-hover, #818cf8);
}

.muse-asset-switch-btn svg {
  width: 13px;
  height: 13px;
}

.muse-asset-switch-count {
  font-size: 11px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

/* ---- 图例说明 ---- */
.muse-asset-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--bg-hover, #1c2230);
  border: 1px dashed var(--border, #30363d);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary, #8b949e);
}

.muse-asset-legend-sm {
  padding: 4px 8px;
  font-size: 10px;
  gap: 10px;
  margin-bottom: 6px;
}

.muse-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.muse-legend-inshot {
  background: var(--accent, #6366f1);
  box-shadow: 0 0 0 2px var(--accent-light, rgba(99,102,241,0.14));
}

.muse-legend-others {
  background: var(--text-tertiary, #6e7681);
  opacity: 0.4;
}

/* ---- 左栏头 + 切换控件 ---- */
.muse-structured-left-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ---- 资产展示区 wrapper ---- */
.muse-structured-refs-wrapper {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;   /* ⚠️ flex 子元素允许收缩：否则 overflow-y:auto 无效，内容直接被外容器裁 */
  padding-right: 2px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* ⚠️ 终极兜底：无论父链高度如何，本 wrapper 最大高度不会超过视口 70%，
     从物理上保证内容不会跑到卡片 overflow:hidden 外面被切一半 */
  max-height: 70vh;
  /* 深色主题细滚动条（webkit 内核） */
  scrollbar-width: thin;
  scrollbar-color: #30363d transparent;
}
.muse-structured-refs-wrapper::-webkit-scrollbar { width: 6px; }
.muse-structured-refs-wrapper::-webkit-scrollbar-track { background: transparent; }
.muse-structured-refs-wrapper::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 3px;
}
.muse-structured-refs-wrapper::-webkit-scrollbar-thumb:hover { background: #484f58; }

.muse-structured-empty {
  text-align: center;
  padding: 20px 8px;
  color: var(--text-tertiary, #6e7681);
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* ---- 资产分组（人物/场景/道具分类显示） ---- */
.muse-structured-asset-group {
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.muse-structured-asset-group:last-child {
  margin-bottom: 0;
}

.muse-structured-asset-group-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #8b949e);
  padding: 4px 2px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle, #21262d);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.muse-structured-asset-group-title svg {
  width: 12px;
  height: 12px;
  color: var(--accent, #6366f1);
  flex-shrink: 0;
}

.muse-asset-group-count {
  font-size: 10px;
  color: var(--text-tertiary, #6e7681);
  font-weight: 400;
  margin-left: auto;
  flex-shrink: 0;
}

.muse-structured-refs-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 3→2 列：每列更宽，名字有更多显示空间 */
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 窄屏保持 2 列（与桌面一致，避免名字被裁） */
@media (max-width: 768px), body.is-mobile {
  .muse-structured-refs-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 资产缩略卡：横向布局（缩略图左 + 名字右），名字占比增大 */
.muse-structured-refs-group .muse-structured-ref {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 7px 8px;
  /* 覆盖基础 .muse-structured-ref 的纵向居中：改横向，名字与缩略图并列 */
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.muse-structured-refs-group .muse-structured-ref .muse-structured-ref-thumb {
  width: 40px;      /* 56→40：缩小缩略图，把空间让给名字 */
  height: 40px;
  flex-shrink: 0;
}
/* 名字：占满剩余宽度，允许 2 行换行（长名字完整显示，超长才省略号） */
.muse-structured-refs-group .muse-structured-ref .muse-structured-ref-name {
  flex: 1;
  min-width: 0;          /* flex 子元素允许收缩，overflow 才生效 */
  max-width: 100%;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  /* 允许 2 行换行：覆盖原 nowrap，长名字不再被省略号硬截 */
  white-space: normal;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* 横向布局下隐藏 subtitle（文件路径噪音），让名字独占右侧空间 */
.muse-structured-refs-group .muse-structured-ref > div[style*="max-width:80px"] {
  display: none;
}

/* ---- 资产缩略卡基础状态：添加过渡 + GPU加速，防止暗色hover闪烁 ---- */
.muse-structured-ref {
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1),
              filter 0.25s cubic-bezier(.4,0,.2,1),
              transform 0.18s cubic-bezier(.4,0,.2,1),
              border-color 0.18s ease,
              box-shadow 0.18s ease,
              background 0.18s ease;
  will-change: opacity, transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ---- 资产缩略卡状态（高亮/淡化） ---- */
.muse-structured-ref.muse-ref-inshot {
  border: 1.5px solid var(--accent, #6366f1);
  background: var(--accent-light, rgba(99, 102, 241, 0.10));
  box-shadow: 0 0 0 1px var(--accent-light, rgba(99,102,241,0.14));
}

.muse-structured-ref.muse-ref-dim {
  opacity: 0.5;
  filter: saturate(0.75);
  border: 1px dashed var(--border, #30363d);
}

.muse-structured-ref.muse-ref-dim:hover {
  opacity: 0.78;
  filter: saturate(0.9);
}

/* 小角标徽章 */
.muse-ref-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-elevated, #161b22);
}

.muse-badge-inshot {
  background: var(--accent, #6366f1);
  box-shadow: 0 0 4px rgba(99, 102, 241, 0.6);
}

.muse-badge-other {
  background: var(--text-tertiary, #6e7681);
  opacity: 0.5;
}

/* ---- 旧版 12 列格式分镜资产展示 ---- */
.muse-shot-col-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

.muse-refs-expanded {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  flex: 1;          /* ⚠️ 配合 muse-shot-col flex，占满除 header 外的剩余空间 */
  min-height: 0;    /* ⚠️ flex 子元素允许收缩：overflow-y 才生效 */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* ⚠️ 终极兜底：最大高度不超过视口 70%，内容绝对不会被卡片圆角裁掉一半 */
  max-height: 70vh;
  /* 深色主题细滚动条 */
  scrollbar-width: thin;
  scrollbar-color: #30363d transparent;
}
.muse-refs-expanded::-webkit-scrollbar { width: 6px; }
.muse-refs-expanded::-webkit-scrollbar-track { background: transparent; }
.muse-refs-expanded::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 3px;
}
.muse-refs-expanded::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* 迷你资产分组 */
.muse-mini-asset-group {
  margin-bottom: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.muse-mini-asset-group-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #8b949e);
  padding: 3px 0;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border-subtle, #21262d);
  width: 100%;
  box-sizing: border-box;
}

.muse-mini-asset-group-title svg {
  width: 11px;
  height: 11px;
  color: var(--accent, #6366f1);
}

.muse-mini-asset-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 单个迷你资产卡 */
.muse-mini-asset {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 5px 5px;   /* 略加 padding，栏宽更宽了 */
  background: var(--bg-elevated, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 7px;
  /* 拆分过渡：opacity/filter 用较长缓动防止闪烁；transform/border用较短时间 */
  transition: opacity 0.28s cubic-bezier(.4,0,.2,1),
              filter 0.28s cubic-bezier(.4,0,.2,1),
              transform 0.16s cubic-bezier(.4,0,.2,1),
              border-color 0.16s ease,
              box-shadow 0.16s ease,
              background 0.16s ease;
  will-change: opacity, transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.muse-mini-asset:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #6366f1);
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.muse-mini-asset.muse-mini-dim {
  opacity: 0.52;
  filter: saturate(0.75);
  border-style: dashed;
}

.muse-mini-asset.muse-mini-dim:hover {
  opacity: 0.8;
  filter: saturate(0.92);
}

.muse-mini-thumb {
  width: 44px;    /* 栏宽从 200→290，缩略图从 38 放大到 44，更清晰 */
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;  /* 15→16 */
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.muse-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.muse-mini-name {
  font-size: 11px;    /* 10→11 栏宽了可以稍大 */
  color: var(--text, #e6edf3);
  line-height: 1.25;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.muse-mini-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-elevated, #161b22);
}


