﻿/* ============================================================
 * 断点策略（v4.1.5 收敛 · 见 docs/交互语法手册-2026-11-24.md §五）
 *   布局档位：只有 768 一个（移动 / 桌面）。480/520/560/640 这些碎片已全部并入 768。
 *   能力阈值：1100 —— 不是布局档位，而是"能不能双源并排/三栏"的物理下限
 *             （左栏 220 + 右栏 360 + 对话流 ≥400 ≈ 980，取整 1100）。
 *   设备标记：body.is-mobile 为布局主判据（历史上 768 在某些 WebView 里不生效），
 *             视口断点只做微调——两者分工写清，避免"两套标准打架"。
 * ============================================================ */
﻿/* ============================================================
   墨匣 InkBox · app.css — 深色默认 + 浅色可切 · 桌面侧栏 / 移动底部Tab
   ============================================================ */

  /* v4.1.49 补齐：这 4 个变量此前**只在 var() 里被引用、从未定义**（浏览器静默回落，样式静默失真）。
   * 由 check-css.mjs 全量扫描发现（4 个 / 命名沿用旧代码，值对齐现有调色板语义）。 */
:root, [data-theme="dark"] {
  --bg: #0f1014; --panel: #16171d; --card: #1b1d24; --card2: #20222b;
  --border: #2a2d37; --text: #e9ebf1; --sub: #9aa0ae;
  --primary: #e5484d; --primary-soft: rgba(229, 72, 77, .16);
  --ok: #2fbf71; --warn: #f5a524; --err: #f04747; --info: #4c8dff;
  --line: #2a2d37; --danger: #f04747; --gold: #d08a30; --nc: #9aa0ae;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
}
[data-theme="light"] {
  --bg: #f5f6f8; --panel: #ffffff; --card: #ffffff; --card2: #f6f7f9;
  --border: #e3e6ec; --text: #1a1c22; --sub: #6b7280;
  --primary: #d9383d; --primary-soft: rgba(217, 56, 61, .1);
  --ok: #1e9e5a; --warn: #c77c0a; --err: #d9383d; --info: #2f6fe4;
  --line: #e3e6ec; --danger: #d9383d; --gold: #b3761f; --nc: #6b7280;
  --shadow: 0 8px 24px rgba(20,24,38,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); height: 100vh; overflow: hidden;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
.flex1 { flex: 1; }
code { background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- 布局骨架 ---------- */
#app { display: flex; height: 100vh; padding-bottom: 20px; box-sizing: border-box; }
#sidebar {
  width: 216px; min-width: 216px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 12px; z-index: 30;
}
#sidebar.collapsed { display: none; }
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 18px;
  border-bottom: 1px solid var(--border); background: var(--panel);
}
#topbar h1 { font-size: 1.05rem; font-weight: 700; }
#page-view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 品牌 / 模式 / 导航 ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 8px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #a3262b); color: #fff; font-size: 1.25rem; font-weight: 800;
  box-shadow: 0 4px 14px rgba(229,72,77,.35);
}
.brand-name { font-weight: 800; font-size: 1.02rem; }
.brand-sub { font-size: .72rem; color: var(--sub); }

.mode-switch { display: flex; background: var(--card2); border-radius: 12px; padding: 3px; gap: 2px; }
.mode-btn {
  flex: 1; padding: 7px 2px; border-radius: 9px; font-size: .78rem; color: var(--sub); transition: all .18s;
  white-space: nowrap;
}
.mode-btn.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

#side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  color: var(--sub); font-size: .95rem; transition: all .15s; text-align: left;
}
.nav-item:hover { background: var(--card2); color: var(--text); }
.nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-ico { font-size: 1.05rem; width: 22px; text-align: center; }
.sidebar-foot { padding-top: 8px; border-top: 1px solid var(--border); }
.ghost-btn { width: 100%; padding: 9px; border-radius: 10px; color: var(--sub); font-size: .88rem; text-align: left; }

/* ---------- 底部 Tab（移动） ---------- */
#tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--panel); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; color: var(--sub); }
.tab-item.on { color: var(--primary); }
.tab-ico { font-size: 1.2rem; }
.tab-label { font-size: .66rem; }

/* ---------- 页面容器 ---------- */
.page { max-width: 860px; margin: 0 auto; padding: 18px 16px 90px; }
.page-loading { padding: 60px; text-align: center; color: var(--sub); }
.empty { padding: 26px 14px; text-align: center; color: var(--sub); font-size: .92rem; }
.hint { color: var(--sub); font-size: .8rem; line-height: 1.6; margin-top: 10px; }

/* ---------- 统计卡 / 快捷 ---------- */
.hello { margin-bottom: 16px; }
.hello-main { font-size: 1.15rem; font-weight: 700; }
.hello-sub { color: var(--sub); font-size: .82rem; margin-top: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 12px;
  cursor: pointer; transition: transform .15s; text-align: center;
}
.stat-card:active { transform: scale(.97); }
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .76rem; color: var(--sub); margin-top: 3px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.quick-btn {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 13px 6px;
  font-size: .86rem; font-weight: 600; transition: all .15s;
}
.quick-btn:active { transform: scale(.96); border-color: var(--primary); }

/* ---------- 区块 / 列表 ---------- */
.section { margin-bottom: 20px; }
.section-title { font-weight: 800; font-size: .98rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-title small { color: var(--sub); font-weight: 400; font-size: .76rem; }
.list-item {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; cursor: pointer; transition: all .15s;
}
.list-item:active { border-color: var(--primary); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.li-main b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { color: var(--sub); font-size: .78rem; }
.rating-grid { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.rating-grid span { display: inline-flex; align-items: baseline; gap: 4px; }
.rating-grid i { font-style: normal; font-size: .68rem; opacity: .7; }
.tpl-grid { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.tpl-grid .tpl-dao-item, .tpl-grid .tpl-rating-item { display: inline-flex; align-items: baseline; gap: 4px; font-size: .72rem; color: var(--text); }
.tpl-grid .tpl-dao-item i { font-style: normal; color: var(--primary); }
.tpl-grid .tpl-rating-item i { font-style: normal; color: var(--sub); }
.tag-ok { color: var(--ok); border-color: var(--ok); }
.tag-off { color: var(--sub); border-color: var(--border); opacity: .7; }
.li-side { display: flex; gap: 6px; align-items: center; }
.sparse-tip {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--warn);
  padding: 12px 14px; border-radius: 12px; font-size: .86rem; line-height: 1.7;
}
.sparse-tip.ok { border-left-color: var(--ok); }
.section-title button { margin-left: auto; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-note { color: var(--sub); font-size: .8rem; }

/* ---------- 卡片 ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px;
  cursor: pointer; transition: all .15s;
}
.card:active { border-color: var(--primary); }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--sub); font-size: .78rem; }
.seed-digest { color: var(--sub); font-size: .85rem; line-height: 1.55; }
.coord-label {
  display: inline-block; background: var(--card2); border-radius: 8px; padding: 3px 9px;
  font-size: .78rem; color: var(--sub);
}
.progress { height: 5px; background: var(--card2); border-radius: 3px; margin: 10px 0 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #f5a524); border-radius: 3px; transition: width .4s; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 9px 16px; border-radius: 11px; background: var(--card2); border: 1px solid var(--border);
  font-size: .88rem; font-weight: 600; transition: all .15s; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(229,72,77,.3); }
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-danger { color: var(--err); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn-sm { padding: 5px 10px; font-size: .78rem; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.field-label { font-size: .82rem; color: var(--sub); margin: 12px 0 6px; font-weight: 600; }
.field-label:first-child { margin-top: 0; }
.input, .select, .textarea {
  width: 100%; background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); padding: 10px 13px; font-size: .92rem; outline: none; transition: border .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { resize: vertical; line-height: 1.7; min-height: 130px; }
.textarea-lg { min-height: 260px; }
.input-title { font-size: 1.15rem; font-weight: 700; padding: 8px 12px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }
select.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- 密码可见切换（v2.0.0 门页体验） ---------- */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 42px; }
.pwd-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--sub); font-size: 1.05rem;
  cursor: pointer; border-radius: 8px; padding: 0; line-height: 1;
}
.pwd-eye:hover { color: var(--text); background: var(--card2); }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 8px; font-size: .72rem; background: var(--card2); color: var(--sub); white-space: nowrap; }
.tag-pass { background: rgba(47,191,113,.14); color: var(--ok); }
.tag-warn { background: rgba(245,165,36,.14); color: var(--warn); }
.tag-fail { background: rgba(240,71,71,.14); color: var(--err); }
.tag-info { background: rgba(76,141,255,.14); color: var(--info); }

/* ---------- chips（母体打标） ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
/* v3.x 窄屏（手机）：chip 组横向滑动，不换行不遮挡（市场/媒介/受众/情绪标签一行滑完） */
@media (max-width: 768px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .chips .chip { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- 横向滑动选择（v3.9.323 · 全系统基础操作） ----------
 * 手机端左右滑选标签/能力/转换类型的统一工具类，替代各处散落的 overflow-x:auto
 * （chips/tabs/steps/chat-chips 逐步收拢）。特性：隐藏滚动条 + iOS 惯性滑动 +
 * 只允许横向触摸（touch-action:pan-x 不抢页面纵向滚动）。 */
.hscroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;              /* Firefox 隐藏滚动条 */
  -ms-overflow-style: none;           /* IE/旧 Edge 隐藏滚动条 */
  -webkit-overflow-scrolling: touch;  /* iOS 惯性滑动 */
  padding-bottom: 4px;
  touch-action: pan-x;                /* 只允许横向触摸，不抢纵向滚动 */
  scroll-snap-type: x proximity;      /* 轻量吸附 */
}
.hscroll::-webkit-scrollbar { display: none; }  /* Chrome/Safari 隐藏滚动条 */
.hscroll > * { flex: 0 0 auto; scroll-snap-align: start; }
.chip {
  padding: 6px 13px; border-radius: 999px; background: var(--card2); border: 1px solid var(--border);
  font-size: .82rem; color: var(--sub); transition: all .15s; cursor: pointer;
}
.chip-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.chip-static { cursor: default; display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.chip-x { color: var(--err); font-weight: 700; cursor: pointer; padding: 0 3px; }
/* 🎼 谱编辑器（v4.0 第二期）：改和弦选择器网格（常用和弦 chips 横排换行，可滚动） */
.score-chord-grid { display: flex; flex-wrap: wrap; gap: 7px; max-height: 300px; overflow-y: auto; padding: 2px; }
.req { color: var(--err); }

.mx-group { margin-bottom: 14px; }
.mx-group-title { font-weight: 700; font-size: .86rem; margin-bottom: 8px; }
.mx-group-title small { color: var(--sub); font-weight: 400; margin-left: 6px; }
.mx-axis { margin-bottom: 10px; }
.mx-axis-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mx-axis-label { font-size: .84rem; font-weight: 600; }
.mx-axis-key { font-size: .7rem; color: var(--sub); font-family: monospace; }
.mx-manage { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px; margin-bottom: 10px; }
.mx-manage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

/* ---------- 密度盘 ---------- */
.density { display: flex; flex-direction: column; gap: 14px; }
.dn-axis { }
.dn-axis-name { font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--sub); }
.dn-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dn-val { width: 84px; font-size: .78rem; text-align: right; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-track { flex: 1; height: 12px; background: var(--card2); border-radius: 6px; overflow: hidden; }
.dn-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #f5a524); border-radius: 6px; }
.dn-fill.zero { background: var(--err); opacity: .6; }
.dn-count { width: 24px; font-size: .74rem; color: var(--sub); }

/* ---------- 六拍步骤条 ---------- */
.work-head { margin-bottom: 14px; }
.coord-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.step {
  min-width: 86px; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 10px 6px;
  transition: all .15s; color: var(--sub);
}
.step-cur { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.step-done .step-state { color: var(--ok); }
.step-locked { opacity: .5; }
.step-ico { font-size: 1.1rem; }
.step-label { font-size: .8rem; font-weight: 700; }
.step-state { font-size: .68rem; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.panel-title { font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pre { white-space: pre-wrap; background: var(--card2); border-radius: 12px; padding: 12px 14px; font-size: .88rem; line-height: 1.7; }
.pre-soft { color: var(--sub); margin-top: 10px; }

/* ---------- 生成过程 UI ---------- */
.gen-think { margin-top: 10px; }
.gen-think details { background: var(--card2); border-radius: 12px; padding: 10px 14px; }
.gen-think summary { cursor: pointer; color: var(--sub); font-size: .82rem; }
.think-body { color: var(--sub); font-size: .8rem; line-height: 1.6; white-space: pre-wrap; max-height: 180px; overflow-y: auto; margin-top: 8px; }
.gen-loading { padding: 18px; text-align: center; color: var(--sub); line-height: 1.8; }
.gen-error { padding: 12px 14px; background: rgba(240,71,71,.1); border-radius: 12px; color: var(--err); font-size: .84rem; line-height: 1.6; }

/* ---------- 三查报告 ---------- */
.chk-sect { margin-bottom: 14px; background: var(--card2); border-radius: 14px; padding: 13px 15px; }
.chk-sect-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9rem; }
.chk-sect-body { display: flex; flex-direction: column; gap: 7px; }
.chk-item { font-size: .84rem; line-height: 1.65; padding: 9px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.chk-item.fail { border-left: 3px solid var(--err); }
.chk-item.warn { border-left: 3px solid var(--warn); }
.chk-item.ok { border-left: 3px solid var(--ok); }
.chk-lines { display: inline-block; color: var(--sub); font-size: .76rem; margin-left: 6px; }
.chk-sample { color: var(--err); font-size: .76rem; margin-top: 3px; font-family: monospace; }
.chk-claim { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.chk-claim-head { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; cursor: pointer; line-height: 1.55; }
.chk-claim-head input { margin-top: 3px; }
.conf { font-weight: 800; padding: 1px 7px; border-radius: 7px; font-size: .72rem; }
.conf.low { background: rgba(240,71,71,.16); color: var(--err); }
.conf.mid { background: rgba(245,165,36,.16); color: var(--warn); }
.chk-claim-sub { color: var(--sub); font-size: .76rem; margin-top: 5px; padding-left: 26px; line-height: 1.6; }

/* ---------- 交付 ---------- */
.deliver-grid { display: flex; flex-direction: column; gap: 16px; }
.deliver-item { background: var(--card2); border-radius: 14px; padding: 14px; }

/* ---------- 指标 ---------- */
.metrics-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.metric { display: flex; flex-direction: column; background: var(--card2); border-radius: 10px; padding: 7px 12px; min-width: 74px; }
.metric i { font-style: normal; color: var(--sub); font-size: .7rem; }
.metric b { font-size: .95rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric-field { display: flex; flex-direction: column; gap: 4px; font-size: .76rem; color: var(--sub); }
.metric-field .input { padding: 8px 10px; }

/* ---------- Toast / 模态 ---------- */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1400; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: 92vw; }
.toast {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 11px 18px; border-radius: 13px; font-size: .86rem; box-shadow: var(--shadow);
  animation: tin .25s; max-width: 92vw; line-height: 1.5;
}
.toast-ok { border-color: var(--ok); }
.toast-error { border-color: var(--err); }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1300;
  display: flex; align-items: flex-end; justify-content: center; animation: fin .2s;
}
@keyframes fin { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: 22px 22px 0 0; width: 100%; max-width: 640px; max-height: 88vh;
  /* v4.1.85 修横向溢出：原来只写了 overflow-y:auto（横向默认 visible）→ 内容超宽就出横向滚动条，
     弹窗里出现「一排字被挤 + 底部横向滚动条」。横向裁掉 + 内部元素自己换行。 */
  overflow-y: auto; overflow-x: hidden; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: mup .25s;
  position: relative;
}
/* 弹窗右下角缩放柄（v3.9.336 自由拖拽缩放）：拖这个角改变宽高，右下斜线视觉提示 */
.modal-resize {
  position: absolute; right: 0; bottom: 0; width: 22px; height: 22px;
  cursor: nwse-resize; z-index: 6; touch-action: none;
}
.modal-resize::after {
  content: ''; position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px;
  border-right: 2px solid var(--sub, #8a8f9c); border-bottom: 2px solid var(--sub, #8a8f9c);
  border-bottom-right-radius: 2px; opacity: .55;
}
@keyframes mup { from { transform: translateY(40px); opacity: .4; } }
.modal-head { font-size: 1.02rem; margin-bottom: 8px; }
.modal-sub { color: var(--sub); font-size: .8rem; margin-top: 4px; font-weight: 400; }
.modal-body { margin: 6px 0 4px; }
.modal-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
/* 长表单（资产建档这种）：底部按钮 sticky —— 不然一打开就看不到「保存」，得滚到底 */
/* 长表单的正文要给自己留出 sticky 按钮条的位置，否则最后一行会被盖住 */
.modal-body.is-longform { padding-bottom: 54px; }
.modal-foot.is-sticky {
  position: sticky; bottom: -20px; z-index: 2;
  background: var(--panel, #16171d);
  padding: 12px 0 6px; margin-top: 12px;
  border-top: 1px solid var(--border, #2a2d37);
  /* 一道向上的软阴影：让「下面是还藏着内容」看得出来，而不是像把文字切断了 */
  box-shadow: 0 -12px 18px -14px rgba(0, 0, 0, .85);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #tabbar { display: flex; }
  #page-view { padding-bottom: 0; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { border-radius: 22px 22px 0 0; }
  .dn-val { width: 64px; }
  /* v1.60 手机交互重排：对话头部换行 + 模式开关整行 + 工具钮收起（#chat-panel 前缀提权，压过排在后面的基础样式） */
  #chat-panel .chat-head { flex-wrap: wrap; }
  #chat-panel .chat-head .chat-sub { display: none; }
  #chat-panel #chat-more { display: flex; align-items: center; justify-content: center; }
  #chat-panel .chat-drag { display: none; }
  /* v3.9.359 移动端精细化（去桌面端痕迹）：抽屉全宽 + 消息卡占满 + 字号放大 */
  .chat-drawer { width: 86%; max-width: none; }
  .chat-msg { max-width: 92%; font-size: 14px; }
  .chat-card-title { font-size: 14px; }
  .chat-card-row { font-size: 13.5px; }
  /* v3.9.359 登录页 + 输入框字号放大（原 li-sub .78rem=12.5px 手机上偏小不可读） */
  .auth-hero .li-sub { font-size: 14px; }
  .auth-page .li-sub { font-size: 13px; }
  .chat-input textarea { font-size: 15px; line-height: 1.5; }
  /* 登录页输入框触控友好：手机端点按区域放大 */
  .auth-page .input { padding: 13px 14px; font-size: 15px; }
  .auth-hero { margin: 18px 0 14px; }
  /* 聊天主界面：快捷片（技能/风格模板）+ 状态标签字号放大（触控友好） */
  .chat-chip { font-size: 13px; padding: 7px 13px; }
  .chat-state-tag { font-size: 11px; }
  /* 会员页/设置页等页面副文字放大（li-sub .78rem=12.5px 手机偏小） */
  .page .li-sub { font-size: 13px; }
  .page .card-foot { font-size: 13px; }
  /* 弹窗：副标题/内部列表副文字放大（.8rem=12.8px 手机偏小） */
  .modal-sub { font-size: 13px; }
  .modal .li-sub { font-size: 13px; }
  /* 卡片按钮组换行：完成卡/歌词卡「生成旋律·一键编曲·下载·采集声音」等横排按钮，手机换行不挤压 */
  .chat-card-actions { flex-wrap: wrap; }
  .chat-card-actions .btn { white-space: nowrap; flex-shrink: 0; }
  /* 卡片内标签组（题材/模式/受众/情绪等）横向滑动，不换行堆叠 */
  .chat-card .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
/* 移动设备兜底（v3.9.364）：UA 识别为手机但视口>768（部分浏览器「在浏览器打开」以桌面 UA 打开，视口 980）
 * 导致 @media 768 不生效 → 走桌面布局。此处用 body.is-mobile 锁手机布局，不依赖视口宽度。 */
body.is-mobile #sidebar { display: none; }
body.is-mobile #tabbar { display: flex; }
body.is-mobile #page-view { padding-bottom: 0; }
body.is-mobile .chat-drawer { width: 86%; max-width: none; }
body.is-mobile .chat-msg { max-width: 92%; font-size: 14px; }
body.is-mobile .chat-card { padding: 12px; border-radius: 12px; }
body.is-mobile .chat-card-title { font-size: 14.5px; }
body.is-mobile .chat-card-row { font-size: 14px; line-height: 1.6; }
body.is-mobile .chat-input textarea { font-size: 15px; line-height: 1.5; }
body.is-mobile .chat-input textarea::placeholder { font-size: 14px; color: var(--sub, #9aa3b5); opacity: .7; }
body.is-mobile .chat-chip { font-size: 13px; padding: 7px 13px; }
body.is-mobile .chat-state-tag { font-size: 11px; }
body.is-mobile .chat-card-actions { flex-wrap: wrap; }
body.is-mobile .chat-card-actions .btn { white-space: nowrap; flex-shrink: 0; }
body.is-mobile .chat-card .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
body.is-mobile .chips .chip { white-space: nowrap; flex: 0 0 auto; }
body.is-mobile #chat-panel .chat-head { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
body.is-mobile #chat-panel .chat-head b { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 手机端精简顶部栏：＋新建（drawer 里有）与 ×关闭（drawer 里有）隐藏，只留标题+状态+模型+榜单+菜单 */
body.is-mobile #chat-panel .chat-head #chat-new-session,
body.is-mobile #chat-panel .chat-head .chat-close { display: none; }
body.is-mobile #chat-panel .chat-head .chat-sub { display: none; }
body.is-mobile #chat-panel .chat-drag { display: none; }
body.is-mobile .auth-hero .li-sub { font-size: 14px; }
body.is-mobile .auth-page .li-sub { font-size: 13px; }
body.is-mobile .auth-page .input { padding: 13px 14px; font-size: 15px; }
body.is-mobile .page .li-sub { font-size: 13px; }
body.is-mobile .modal .li-sub { font-size: 13px; }
/* 主编审阅手机布局：左右并排 → 上下堆叠，集列表在上（折叠）、内容+批注在下 */
body.is-mobile #rv-split { flex-direction: column; gap: 8px; max-height: none; overflow: visible; }
body.is-mobile #rv-left { flex: none; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 8px; }
body.is-mobile #rv-right { flex: none; }
/* v3.9.378 触屏内容宽度（撤 zoom/--app-width hack）：手机窄屏自然撑满、平板放宽到上限，不写死留白。
 * 桌面（非触屏）不受影响，仍走 .auth-page/.page 默认上限。 */
body.is-mobile .auth-page { max-width: 600px; }
body.is-mobile .page { max-width: 100%; }
@media (min-width: 769px) {
  /* v4.1.88 桌面端弹窗：宽度**自适应内容**（内容少不空、内容多不挤），上限 90vw。
     原来固定 max-width:640px → 桌面宽屏上内容一多就挤成一行（师兄反馈"弹窗不能自由缩放"的真场景）。
     手机端仍是底部抽屉满宽（在基础规则里，不受这里影响）。 */
  .modal { border-radius: 22px; margin-bottom: 10vh; align-self: center;
           width: fit-content; min-width: 420px; max-width: min(90vw, 900px); }
  .modal-mask { align-items: flex-start; padding-top: 8vh; }
  /* v1.14 P1-2 电脑版 ➕ 参考按钮：桌面断点补显示（与手机断点对齐，修 display:none 漏接） */
  #chat-panel #chat-more { display: flex; align-items: center; justify-content: center; }
}

/* ---------- 四库 tab 切换 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.tab-btn { padding: 8px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); color: var(--sub); font-size: .84rem; white-space: nowrap; transition: all .15s; }
.tab-btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 700; }

/* ---------- 工作台会员状态条 ---------- */
.member-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary); cursor: pointer; margin-bottom: 14px; transition: all .15s; }
.member-strip:hover { filter: brightness(1.03); }
.member-strip .flex1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-strip-sub { color: var(--sub); font-size: .82rem; white-space: nowrap; }

/* ---------- 数据看板：横向条形图 ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.bar-label { width: 96px; flex-shrink: 0; font-size: .84rem; font-weight: 600; display: flex; flex-direction: column; }
.bar-sub { font-weight: 400; font-size: .72rem; color: var(--sub); }
.bar-track { flex: 1; height: 14px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--primary), #ff6b6b); min-width: 2px; transition: width .3s; }
.bar-val { width: 84px; flex-shrink: 0; text-align: right; font-size: .84rem; font-weight: 700; color: var(--primary); }

/* ---------- 上传按钮（全宽） ---------- */
.btn-block { display: block; width: 100%; margin-bottom: 12px; padding: 10px; border: 1px dashed var(--primary); background: var(--primary-soft); color: var(--primary); border-radius: 10px; font-weight: 600; transition: all .15s; }
.btn-block:hover { background: var(--primary); color: #fff; }

/* ---------- 自由对话框（三模式通用 · 对话式创作入口） ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--primary, #5b9dff), #a78bfa); border: none; font-size: 24px; cursor: pointer; touch-action: none; box-shadow: 0 4px 16px rgba(91,157,255,.4); z-index: 999; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.chat-fab:hover { transform: scale(1.08); }
.chat-fab.docked { opacity: 0.45; }
.chat-fab.docked:hover { opacity: 1; }

/* ---------- 血缘树（v1.7 第三刀 · 超管沙盘） ---------- */
.lin-tree { display: flex; flex-direction: column; gap: 6px; }
.lin-node { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--card2, #1e2230); cursor: pointer; border-left: 3px solid transparent; transition: transform .12s; }
.lin-node:hover { transform: translateX(2px); }
.lin-icon { font-size: 16px; }
.lin-title { font-weight: 600; font-size: 14px; }
.lin-sub { font-size: 11px; color: var(--sub, #9aa3b5); }
.lin-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.lin-tag-normal { background: var(--border, #2a3040); color: var(--sub, #9aa3b5); }
.lin-tag-verified { background: rgba(255,180,60,.18); color: #ffb43c; }
.lin-tag-candidate { background: rgba(91,157,255,.18); color: #7ab0ff; }
.lin-tag-dead { background: rgba(120,120,120,.15); color: #8a8a8a; text-decoration: line-through; }
.lin-verified { border-left-color: #ffb43c; }
.lin-candidate { border-left-color: #5b9dff; border-left-style: dashed; }
.lin-dead { opacity: 0.5; }
.chat-panel { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; background: var(--card, #171a23); border: none; border-radius: 0; box-shadow: none; z-index: 1000; display: flex; flex-direction: column; overflow: hidden; }
@supports (height: 100dvh) { .chat-panel { height: 100dvh; } }
body.chat-open { overflow: hidden; }
.chat-panel.hidden { display: none; }
.chat-msgs { min-height: 0; max-height: none; }
.chat-fab.panel-open { opacity: 0; pointer-events: none; }
.chat-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--card2, #1e2230); }
.chat-head b { font-size: 14px; }
.chat-head .chat-sub { font-size: 11px; color: var(--sub, #9aa3b5); flex: 1; }
.chat-close { background: none; border: none; color: var(--sub, #9aa3b5); font-size: 20px; cursor: pointer; line-height: 1; }
#chat-menu { background: none; border: none; color: var(--sub, #9aa3b5); font-size: 18px; cursor: pointer; line-height: 1; }
#chat-rank { background: none; border: none; color: var(--sub, #9aa3b5); font-size: 16px; cursor: pointer; line-height: 1; }
/* 榜单灯视图（会员只读 · 弹层） */
.rank-body { max-height: 58vh; overflow-y: auto; }
.rank-loading, .rank-empty { padding: 26px 10px; text-align: center; color: var(--sub); font-size: .9rem; }
.rank-group { margin-bottom: 16px; }
/* v3.x 风向标参考信号卡：主题色高亮，一眼看到「什么正在火」 */
.rank-signal { background: var(--primary-soft, rgba(90,130,255,.08)); border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; }
.rank-signal .rank-row { border-bottom: none; padding: 3px 0; }
.rank-signal .rank-title { white-space: normal; }
.rank-group-title { font-size: .86rem; font-weight: 600; color: var(--primary); margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.rank-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: .86rem; border-bottom: 1px dashed var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-no { flex: 0 0 22px; text-align: center; font-weight: 700; color: var(--sub); font-size: .78rem; }
.rank-title { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-sub { flex: 0 0 auto; font-size: .72rem; color: var(--sub); }
/* v1.30.1 新建聊天钮：顶栏主动作，主题色醒目（v1.29.0 裸奔黑字隐身修复） */
#chat-new-session { background: none; border: 1px solid var(--primary, #5b9dff); border-radius: 8px; color: var(--primary, #5b9dff); font-size: 15px; font-weight: 700; line-height: 1; padding: 4px 9px; cursor: pointer; min-height: 30px; }
.chat-menu-pop { display: none; }
/* v1.2 左侧抽屉栏（触屏优先）：点 ☰ 从左侧滑出，遮罩可收 */
.chat-drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1200; }
.chat-drawer-mask.hidden { display: none; }
.chat-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 78%; max-width: 320px; background: var(--card2, #1e2230); z-index: 1210; display: flex; flex-direction: column; box-shadow: 2px 0 24px rgba(0,0,0,.4); transition: transform .22s ease; }
.chat-drawer.hidden { transform: translateX(-100%); }
.drawer-head { padding: 16px 14px 10px; border-bottom: 1px solid var(--border, #2a2f3e); }
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-brand-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary, #5b9dff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.drawer-brand-name { font-size: 15px; font-weight: 700; }
.drawer-brand-sub { font-size: 11px; color: var(--sub, #9aa3b5); }
.drawer-new { margin: 12px 14px 2px; background: var(--primary, #5b9dff); color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
.drawer-sec { padding: 14px 14px 6px; font-size: 12px; color: var(--sub, #9aa3b5); font-weight: 600; }
/* v1.29.0 抽屉双签：💬 聊天 / 📁 作品 */
.drawer-tabs { display: flex; gap: 6px; padding: 10px 14px 6px; }
.drawer-tabs button { flex: 1; border: 1px solid var(--border, #2a2f3e); background: transparent; color: var(--sub, #9aa3b5); font-size: 12.5px; padding: 7px 0; border-radius: 9px; cursor: pointer; }
.drawer-tabs button.on { background: var(--card2, #1e2230); color: var(--text, #e9ebf1); border-color: var(--primary, #5b9dff); }
/* 📚 资料库媒介分类 tab（道·全部/剧本/歌曲） */
.drawer-media-tabs { display: flex; gap: 6px; padding: 6px 8px 2px; }
.drawer-media-tabs button { flex: 1; border: 1px solid var(--border, #2a2f3e); background: transparent; color: var(--sub, #9aa3b5); font-size: 12px; padding: 6px 0; border-radius: 8px; cursor: pointer; }
.drawer-media-tabs button.on { background: var(--card2, #1e2230); color: var(--text, #e9ebf1); border-color: var(--primary, #5b9dff); }
.drawer-sessions { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.drawer-sess { padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.drawer-sess:active { background: var(--card2, #1e2230); }
.drawer-sess.on { background: var(--card2, #1e2230); border-color: var(--primary, #5b9dff); }
.drawer-sess-title { font-size: 13px; font-weight: 600; color: var(--text, #e9ebf1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-sess-sub { font-size: 11px; color: var(--sub, #9aa3b5); margin-top: 2px; }
.drawer-sec-count { color: var(--sub, #9aa3b5); font-weight: 400; }
.drawer-works { flex: 1; overflow-y: auto; padding: 0 8px; }
.drawer-work { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; }
.drawer-work:active { background: var(--card, #171a23); }
.drawer-work-title { flex: 1; min-width: 0; font-size: 13px; color: var(--text, #e8eaf0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-work-sub { font-size: 11px; color: var(--sub, #9aa3b5); }
.drawer-work-actions { display: flex; gap: 2px; }
.drawer-work-actions button { background: none; border: none; font-size: 15px; padding: 8px; cursor: pointer; min-width: 40px; min-height: 40px; border-radius: 8px; }
.drawer-work-actions button:active { background: var(--card, #171a23); }
.drawer-empty { padding: 18px 8px; font-size: 12px; color: var(--sub, #9aa3b5); text-align: center; }
/* v1.25.0 左侧栏收纳脸：文件夹分组折叠 */
.drawer-folder { margin-top: 4px; }
.drawer-folder-head { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; font-size: 13px; color: var(--text, #e8eaf0); cursor: pointer; user-select: none; }
.drawer-folder-head:active { background: var(--card, #171a23); }
.drawer-folder-arrow { width: 14px; color: var(--sub, #9aa3b5); }
.drawer-folder-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.drawer-folder-count { font-size: 11px; color: var(--sub, #9aa3b5); }
.drawer-folder-ops button { background: none; border: none; font-size: 13px; padding: 2px 3px; cursor: pointer; }
.drawer-folder-body { padding-left: 12px; }
.drawer-folder-body.hidden { display: none; }
.drawer-folder-new { margin: 6px 8px 2px; padding: 7px 8px; border: 1px dashed var(--line, #2a2f3d); border-radius: 10px; font-size: 12px; color: var(--sub, #9aa3b5); text-align: center; cursor: pointer; }
.drawer-folder-new:active { background: var(--card, #171a23); }
.drawer-foot { border-top: 1px solid var(--border, #2a2f3e); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.drawer-foot button { background: none; border: none; color: var(--text, #e8eaf0); font-size: 14px; padding: 12px 8px; text-align: left; cursor: pointer; min-height: 44px; border-radius: 10px; }
.drawer-foot button:active { background: var(--card, #171a23); }
/* 三模式开关（v1.49.4 · 对话框头部，与顶栏 mode-switch 双向同步） */
.chat-modes { display: flex; gap: 3px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 2px; }
.chat-mode-btn { border: none; background: none; color: var(--sub, #9aa3b5); font-size: 12px; width: auto; height: auto; padding: 4px 9px; border-radius: 6px; cursor: pointer; line-height: 1; white-space: nowrap; }
.chat-mode-btn.on { background: var(--primary, #5b9dff); color: #fff; }
/* 四态状态机（v1.49.5）：状态标签 + 停止按钮变形 */
.chat-state-tag { font-size: 10px; padding: 1px 7px; border-radius: 8px; background: rgba(255,255,255,.08); color: var(--sub, #9aa3b5); white-space: nowrap; }
.chat-state-tag.tag-pass { color: var(--ok, #4ade80); }
.chat-state-tag.tag-info { color: var(--primary, #5b9dff); }
.chat-state-tag.tag-warn { color: var(--warn, #facc15); }
.chat-state-tag.tag-fail { color: var(--danger, #f87171); }
#chat-send.btn-danger { background: var(--danger, #f87171); border-color: var(--danger, #f87171); color: #fff; }
#chat-pause { min-width: 34px; }
#chat-attach:disabled { opacity: .4; cursor: not-allowed; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-msg { position: relative; max-width: 86%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.6; word-break: break-word; }
/* v1.28.1 消息操作条：长按/右键唤出，平时界面零按钮（主权动作唤之即来） */
.chat-msg-bar { position: fixed; display: flex; gap: 2px; background: var(--card2, #1e2230); border-radius: 14px; padding: 3px 5px; box-shadow: 0 2px 10px rgba(0,0,0,.45); z-index: 9990; }
.chat-msg-bar button { border: none; background: transparent; color: var(--text, #e9ebf1); font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.chat-msg-bar button:active { background: rgba(255,255,255,.12); }
/* 多选模式：消息整体可点，选中高亮+勾 */
.chat-sel-mode .chat-msg { cursor: pointer; }
.chat-sel-mode .chat-msg::before { content: '○'; position: absolute; left: 2px; top: -7px; font-size: 13px; line-height: 1; color: var(--sub, #9aa3b5); background: var(--bg, #12151d); border-radius: 50%; z-index: 5; }
.chat-sel-mode .chat-msg.sel::before { content: '●'; color: var(--primary, #5b9dff); }
.chat-sel-mode .chat-msg.sel { outline: 1px solid var(--primary, #5b9dff); outline-offset: 1px; border-radius: 8px; }
.chat-sel-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--card2, #1e2230); border-top: 1px solid rgba(255,255,255,.08); z-index: 25; font-size: 13px; }
.chat-sel-bar span { flex: 1; color: var(--sub, #9aa3b5); }
.chat-sel-bar button { border: none; border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; background: rgba(255,255,255,.08); color: var(--text, #e9ebf1); }
.chat-sel-bar .sel-del { background: var(--danger, #e5534b); color: #fff; }
.chat-sel-bar .sel-del:disabled { opacity: .4; }
.chat-user { align-self: flex-end; background: var(--primary, #5b9dff); color: #fff; border-bottom-right-radius: 4px; }
.chat-sys { align-self: flex-start; background: var(--card2, #1e2230); border: 1px solid var(--border, #2a2f3e); color: var(--text, #e8eaf0); border-bottom-left-radius: 4px; }
.chat-card { background: var(--card2, #1e2230); border: 1px solid var(--border, #2a2f3e); border-radius: 10px; padding: 10px; }
.chat-card-title { font-weight: 700; margin-bottom: 6px; font-size: 13px; }
.chat-card-row { font-size: 12.5px; margin: 3px 0; color: var(--text, #e8eaf0); }
.chat-card-actions { margin-top: 9px; display: flex; gap: 8px; }
/* 🎛 音乐工作台（v4.0 · 成曲卡收编）：11 个工具按钮收进就地展开的分组面板，成曲卡回归「下载原曲 + 工作台」两键 */
.music-workbench { margin-top: 9px; display: flex; flex-direction: column; gap: 8px; }
.music-wb-sec { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--card, var(--card2, #1e2230)); border: 1px solid var(--border, #2a2f3e); border-radius: 8px; padding: 8px 9px; }
.music-wb-t { flex: 1 1 100%; font-size: 11px; color: var(--sub, #9aa3b5); font-weight: 600; margin-bottom: 2px; }
.music-wb-sec .btn { flex: 0 0 auto; white-space: nowrap; }
.melody-wb-mount { margin-top: 4px; }
.melody-wb-mount.hidden { display: none; }
.wave-wb-mount { margin-top: 6px; }
.wave-wb-mount.hidden { display: none; }
.step-wb-mount { margin-top: 6px; }
.step-wb-mount.hidden { display: none; }
/* 🎵 音乐播放器（M-12 L0 视图）：播放/停止/进度/时间，内联在卡片或工作台里 */
.mp { display: flex; align-items: center; gap: 8px; width: 100%; }
.mp-btn { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border, #2a2f3e); background: var(--card2, #1e2230); color: var(--text, #e8eaf0); cursor: pointer; font-size: 14px; }
.mp-btn:hover { border-color: var(--primary, #5b9dff); }
.mp-time { font-size: 12px; color: var(--sub, #9aa3b5); white-space: nowrap; min-width: 84px; text-align: center; font-variant-numeric: tabular-nums; }
.mp-seek { flex: 1; min-width: 0; cursor: pointer; accent-color: var(--primary, #5b9dff); }
.chat-chips { display: flex; gap: 6px; padding: 8px 10px 2px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; flex-shrink: 0; }
.chat-chips::-webkit-scrollbar { display: none; }
/* v1.26.0 决策带：三面分段钉左 + 快捷片横滑右渐隐（手机窄屏不折叠，44px 触达） */
.chat-strip { display: flex; align-items: center; gap: 8px; padding-right: 4px; flex-shrink: 0; }
.chat-strip .chat-chips { flex: 1; min-width: 0; padding-left: 2px;
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
.chat-chip { display: inline-block; background: var(--card2, #1e2230); border: 1px solid var(--border, #2a2f3e); color: var(--sub, #9aa3b5); font-size: 11px; padding: 5px 11px; border-radius: 14px; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.chat-chip:active { transform: scale(.96); }
.chat-chip-track { background: #2a2414; border-color: #4a3d1c; color: var(--gold, #f5b84d); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border, #2a2f3e); }
.chat-input textarea { flex: 1; background: var(--card2, #1e2230); border: 1px solid var(--border, #2a2f3e); border-radius: 8px; padding: 8px 10px; color: var(--text, #e8eaf0); font-size: 13px; outline: none; resize: none; line-height: 1.45; min-height: 36px; max-height: var(--chat-input-max, 120px); overflow-y: auto; font-family: inherit; }
.chat-input textarea:focus { border-color: var(--primary, #5b9dff); }
/* v1.61 拖拽条（调节输入区高度） */
.chat-drag { height: 26px; display: flex; align-items: center; justify-content: center; cursor: ns-resize; touch-action: none; flex-shrink: 0; }
.chat-drag::before { content: ''; width: 52px; height: 5px; border-radius: 3px; background: var(--border, #2a2f3e); }
/* v1.61 段落索引条（长剧本右侧竖条） */
#chat-index { position: absolute; right: 3px; top: 60px; bottom: 150px; display: none; flex-direction: column; gap: 2px; overflow-y: auto; z-index: 10; scrollbar-width: none; }
#chat-index::-webkit-scrollbar { display: none; }
#chat-index button { width: 24px; height: 18px; font-size: 9px; border: none; background: rgba(255,255,255,.08); color: var(--sub, #9aa3b5); border-radius: 4px; cursor: pointer; padding: 0; flex-shrink: 0; }
#chat-index button:active { background: var(--primary, #5b9dff); color: #fff; }
#chat-panel.has-index .chat-msgs { padding-right: 32px; }
.chat-input button { background: var(--primary, #5b9dff); border: none; color: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; }
/* ➕ 底部动作面板（v1.61：拍照/相册/文件/参考源库/修改模式） */
.chat-sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1200; display: flex; align-items: flex-end; }
.chat-sheet-mask.hidden { display: none; }
.chat-sheet { width: 100%; background: var(--card2, #1e2230); border-radius: 18px 18px 0 0; padding: 14px 14px 20px; box-sizing: border-box; }
.chat-sheet-title { font-size: 13px; color: var(--sub, #9aa3b5); margin-bottom: 12px; text-align: center; }
.chat-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.chat-sheet-grid button { background: var(--card, #171a23); border: 1px solid var(--border, #2a2f3e); border-radius: 12px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.chat-sheet-grid button i { font-size: 22px; font-style: normal; }
.chat-sheet-grid button span { font-size: 11px; color: var(--text, #e8eaf0); }
.chat-sheet-cancel { width: 100%; background: var(--card, #171a23); border: 1px solid var(--border, #2a2f3e); border-radius: 12px; padding: 12px; color: var(--sub, #9aa3b5); font-size: 14px; cursor: pointer; }
/* 🏁 赛道选择卡（v1.61） */
.track-item { border: 1px solid var(--border, #2a2f3e); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--card, #171a23); }
.track-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.track-item-head b { font-size: 14px; }
.track-item-sub { font-size: 12px; color: var(--sub, #9aa3b5); margin-top: 4px; }
#chat-more { display: none; background: var(--card2, #1e2230); border: 1px solid var(--border, #2a2f3e); color: var(--sub, #9aa3b5); border-radius: 8px; padding: 8px 11px; cursor: pointer; font-size: 15px; line-height: 1; flex-shrink: 0; }

/* ---------- 对话框需求预填（新建作品弹窗 · 来自创作助手） ---------- */
.chat-prefill { background: var(--card2, #1e2230); border: 1px solid var(--border, #2a2f3e); border-left: 3px solid var(--primary, #5b9dff); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.chat-prefill-demand { font-size: 13px; color: var(--text, #e8eaf0); font-style: italic; margin-bottom: 4px; }
.chat-prefill-match { font-size: 12px; color: var(--primary, #5b9dff); }

/* ---------- 能量域总览（七能量源整合能量池） ---------- */
.energy-sect { margin-bottom: 22px; }
.energy-sect-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.energy-sect-title .li-sub { font-weight: 400; }
.energy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.energy-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all .15s; }
.energy-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.energy-icon { font-size: 26px; margin-bottom: 6px; }
.energy-num { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.energy-name { font-size: 13px; font-weight: 700; margin-top: 4px; }
.energy-sub { font-size: 11px; color: var(--sub); margin-top: 4px; line-height: 1.4; }
.energy-flow-cards { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.flow-node { flex: 1; min-width: 130px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px; text-align: center; }
.flow-num { font-size: 24px; font-weight: 800; color: var(--primary); }
.flow-name { font-size: 13px; font-weight: 700; margin-top: 4px; }
.flow-sub { font-size: 11px; color: var(--sub); margin-top: 4px; }
.flow-arrow { display: flex; align-items: center; color: var(--sub); font-size: 18px; font-weight: 700; }
.energy-hint { margin-top: 12px; font-size: 12.5px; color: var(--sub); background: var(--card2); border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 10px 10px 0; line-height: 1.6; }
.energy-dist { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.dist-name { width: 90px; flex-shrink: 0; font-size: 13px; }
.dist-track { flex: 1; height: 14px; background: var(--card2); border-radius: 7px; overflow: hidden; }
.dist-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #f5a524); border-radius: 7px; }
.dist-count { width: 40px; text-align: right; font-size: 13px; font-weight: 700; color: var(--primary); }

/* v1.30.0 积分脸：我的页积分入口 + 详情弹窗 */
.points-entry { cursor: pointer; }
.points-num { font-size: 17px; color: var(--primary, #5b9dff); margin-right: 4px; }
.points-hero { text-align: center; padding: 14px 0 6px; }
.points-hero-num { font-size: 34px; font-weight: 800; color: var(--primary, #5b9dff); line-height: 1.1; }

/* ========== v1.31.0 📖 帮助页（使用说明/用户协议/隐私政策） ========== */
.help-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.help-sec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.help-sec-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; background: none; border: none; color: var(--text, #e9ebf1); font-size: .95rem; font-weight: 600; text-align: left; cursor: pointer; }
.help-arrow { color: var(--sub); transition: transform .18s; font-size: 1.05rem; }
.help-sec-body { padding: 0 14px 13px; font-size: .88rem; line-height: 1.85; color: var(--text, #e9ebf1); }
.help-sec-body p { margin: 0 0 8px; }
.help-doc { padding: 16px; font-size: .88rem; line-height: 1.9; }
.help-doc p { margin: 0 0 12px; }

/* ========== v1.33.0 🔑 门页（登录/注册） ========== */
.auth-page { max-width: 560px; margin: 0 auto; }
.auth-hero { text-align: center; margin: 26px 0 18px; }
.auth-logo { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #a3262b); color: #fff; font-size: 2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.auth-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
/* v4.1.75 公开产品介绍（备案审核友好·也更好看）：定位一句话 + 功能清单 */
.auth-brand { font-size: .78rem; letter-spacing: 2px; color: var(--sub); text-transform: lowercase; margin-bottom: 10px; }
.auth-slogan { font-size: .95rem; color: var(--text); font-weight: 600; margin-bottom: 12px; }
.auth-feats { list-style: none; padding: 0; margin: 0 auto 12px; max-width: 420px; text-align: left; display: grid; gap: 6px; }
.auth-feats li { position: relative; padding: 7px 12px 7px 30px; border: 1px solid var(--border); border-radius: 9px; background: var(--card2); font-size: .86rem; color: var(--text); }
.auth-feats li::before { content: '✦'; position: absolute; left: 11px; top: 7px; color: var(--primary); font-size: .8rem; }
/* v4.1.75 页脚：主办单位 + 联系邮箱 + 备案号（备案公示在登录页也能看到） */
.auth-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: .76rem; color: var(--sub); }
.auth-foot a { color: var(--sub); text-decoration: none; }
.auth-foot a:hover { color: var(--primary); text-decoration: underline; }
.auth-warn { padding: 12px 14px; margin-bottom: 12px; border-color: var(--warn, #d9a03f); font-size: .88rem; }
.auth-agree { display: block; margin-top: 10px; font-size: .82rem; color: var(--sub); line-height: 1.6; }
.auth-agree a { color: var(--primary); }
.btn-block { width: 100%; }

/* ========== v1.34.0 📨 申请码/激活码大卡 ========== */
.auth-reqcode { background: var(--card2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; font-size: .8rem; word-break: break-all; user-select: all; font-family: monospace; margin-top: 8px; }

/* ========== v1.37.1 🧭 头部快捷导航（标题即锚点） ========== */
#topbar h1.qn-title { cursor: pointer; user-select: none; }
#topbar h1.qn-title::after { content: ' ▾'; font-size: .7rem; opacity: .45; }
.quicknav-pop {
  position: fixed; z-index: 90; min-width: 150px;
  background: var(--card, #fff); border: 1px solid var(--line, #e5e5ea); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.quicknav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
  font-size: .92rem; text-align: left; cursor: pointer; color: inherit;
}
.quicknav-item:active, .quicknav-item:hover { background: var(--card2, #f2f2f6); }

/* ========== v1.37.2 💬 长按引用条（定点锚定溯源） ========== */
.chat-quote-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 10px 6px;
  padding: 6px 10px; border-left: 3px solid var(--primary, #e8b33a);
  background: var(--card2, #f2f2f6); border-radius: 8px; font-size: .82rem;
}
.chat-quote-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.chat-quote-x { border: 0; background: transparent; cursor: pointer; opacity: .55; font-size: .85rem; padding: 2px 6px; }

/* v2.0.6 写作中动画（✏️ 笔在动 + 呼吸透明度）——会员知道系统在工作 */
.pen-anim { display: inline-block; animation: pen-write 1.2s ease-in-out infinite; }
@keyframes pen-write {
  0%, 100% { transform: translateX(0) rotate(0deg); opacity: 1; }
  25% { transform: translateX(3px) rotate(-8deg); opacity: .7; }
  50% { transform: translateX(6px) rotate(4deg); opacity: 1; }
  75% { transform: translateX(2px) rotate(-4deg); opacity: .8; }
}

/* v2.0.10 动态省略号（跳动点）：进度文字尾部「....」依次点亮，远比静态「…」有「在跑」感 */
.dots-anim { display: inline-block; letter-spacing: 2px; }
.dots-anim i { font-style: normal; animation: dot-blink 1.2s infinite; opacity: .25; }
.dots-anim i:nth-child(2) { animation-delay: .2s; }
.dots-anim i:nth-child(3) { animation-delay: .4s; }
.dots-anim i:nth-child(4) { animation-delay: .6s; }
@keyframes dot-blink {
  0%, 100% { opacity: .2; }
  30% { opacity: 1; }
}

/* v2.0.10 极简风车加载动画：4 片弧叶线条（黑白·跟随主题色）+ 中心点，匀速旋转——比 ✏️ 更「在运行」 */
.pinwheel { display: inline-block; vertical-align: -2px; width: 15px; height: 15px; animation: pinwheel-spin 1.4s linear infinite; transform-origin: 50% 50%; }
@keyframes pinwheel-spin { to { transform: rotate(360deg); } }

/* v2.0.10 极简线条图标（icon.js）：黑白跟随主题，与风车同一视觉语言 */
.icon { display: inline-block; vertical-align: -2px; }

/* v2.0.10 思考中动态：三个点上下呼吸（黑白·跟随主题）——陪聊「老墨正在思考」等待提示 */
.think-anim { display: inline-flex; gap: 3px; align-items: center; margin-right: 6px; }
.think-anim i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; display: inline-block; animation: think-bounce 1.2s ease-in-out infinite; opacity: .4; }
.think-anim i:nth-child(2) { animation-delay: .15s; }
.think-anim i:nth-child(3) { animation-delay: .3s; }
@keyframes think-bounce {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- v4.0 新建选择器：同一个道，两个面（对话=收 / 画布=放） ---------- */
.newpick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 768px) { .newpick { grid-template-columns: 1fr; } }
.newpick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px 14px; border-radius: 16px; cursor: pointer; text-align: left;
  background: var(--card, #1b1d24); border: 1px solid var(--border, #2a2d37);
  color: var(--text, #e9ebf1); transition: border-color .16s, transform .12s, background .16s;
  min-height: 108px;
}
.newpick-card:hover { border-color: var(--primary, #e5484d); background: var(--card2, #20222b); }
.newpick-card:active { transform: scale(.985); }
.newpick-ico { font-size: 22px; line-height: 1; }
.newpick-card b { font-size: .98rem; font-weight: 600; }
.newpick-desc { font-size: .78rem; color: var(--sub, #9aa0ae); line-height: 1.55; }

/* ---------- v4.0 资产库（六库 UI）：一个集合 + type 维度 = 六库 ---------- */
.tab-btn .as-n {
  margin-left: 6px; padding: 0 6px; border-radius: 7px; font-size: .68rem;
  background: var(--card2, #20222b); color: var(--sub, #9aa0ae);
  display: inline-block; min-width: 18px; text-align: center;
}
.tab-btn.on .as-n { background: var(--primary, #e5484d); color: #fff; }

/* 六库图标：内联 SVG（不用 emoji —— emoji 靠系统字体，Windows 上部分会退成单色深灰，
 * 暗色主题里几乎看不见，个别环境还是方块；SVG 走 currentColor，永远跟主题走） */
.ico-svg { display: inline-block; vertical-align: middle; flex: none; }
.tab-btn .ico-svg { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; opacity: .8; }
.tab-btn.on .ico-svg { opacity: 1; }
.as-ico .ico-svg { width: 19px; height: 19px; color: var(--sub, #9aa0ae); }
.as-emp-ico { display: block; margin-bottom: 8px; color: var(--sub, #9aa0ae); }
.as-emp-ico .ico-svg { width: 30px; height: 30px; }
.as-mh-ico { display: inline-block; vertical-align: -3px; margin-right: 4px; }

.as-item { align-items: flex-start; }
.as-ico {
  flex: none; width: 38px; height: 38px; border-radius: 11px; margin-right: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--card2, #20222b); border: 1px solid var(--border, #2a2d37);
}
.as-thumb {
  flex: none; width: 38px; height: 38px; border-radius: 11px; margin-right: 10px;
  object-fit: cover; background: var(--card2, #20222b); border: 1px solid var(--border, #2a2d37);
}
.as-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.as-title b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.as-vt {
  flex: none; padding: 1px 7px; border-radius: 7px; font-size: .66rem;
  font-weight: 400; color: var(--sub, #9aa0ae); background: var(--card2, #20222b);
  border: 1px solid var(--border, #2a2d37);
}
.as-group {
  margin-bottom: 12px; padding: 8px 10px 2px;
  border: 1px dashed var(--border, #2a2d37); border-radius: 14px;
}
.as-group-h {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; color: var(--text, #e9ebf1); margin: 0 0 6px 2px;
}
.as-group-h span { font-weight: 400; font-size: .72rem; color: var(--sub, #9aa0ae); }
/* 边界声明条：一句话钉死「这里只装画布产出，墨匣参考不在这里」 */
.as-scope {
  font-size: .76rem; line-height: 1.6; color: var(--sub, #9aa0ae);
  padding: 8px 12px; margin: 0 0 10px; border-radius: 10px;
  background: var(--card2, #20222b); border: 1px solid var(--border, #2a2d37);
  border-left: 3px solid var(--primary, #e5484d);
}
/* 多文件行：一条资产可以挂多张图（正面/侧面/背面/三视图） */
.as-files { display: flex; flex-direction: column; gap: 7px; }
.as-file-row { display: flex; align-items: center; gap: 7px; }
.as-file-row .input { flex: 1; min-width: 0; }
.as-file-role { flex: none; width: 88px; }
/* 标签 / 文件夹并排（短字段不各占一行，长表单才看得见下面的「图」） */
.as-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 768px) { .as-row2 { grid-template-columns: 1fr; } }
.as-sub { font-size: .78rem; color: var(--sub, #9aa0ae); margin: -6px 0 10px 2px; }
.as-tip {
  font-size: .78rem; color: var(--sub, #9aa0ae); line-height: 1.7;
  padding: 8px 12px; margin-bottom: 12px; border-radius: 10px;
  background: var(--card2, #20222b); border: 1px solid var(--border, #2a2d37);
}
.as-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }

/* 窄屏：变体徽标只留「变体」，父级名让位给标题 */
@media (max-width: 768px) { .as-vt i { display: none; } }

/* ---------- v4.0.74 十宫导航网格（P1-25 第 2 步 · 仅 navMode=grid 时生效）---------- */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
.nav-cell { border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 64px; }
.nav-cell-off { opacity: .45; }
.nav-cell-head { font-size: 12px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.nav-cell-ico { font-size: 14px; }
.nav-cell-body { display: flex; flex-direction: column; gap: 2px; }
.nav-cell-item { background: none; border: 0; padding: 3px 4px; text-align: left; font-size: 12px; color: inherit; border-radius: 6px; cursor: pointer; }
.nav-cell-item:hover { background: var(--line); }
.nav-cell-empty { font-size: 11px; opacity: .6; }

/* ---------- v4.0.75 聊天页十宫导航（navMode=grid 时显示）---------- */
.drawer-nav { padding: 8px 6px; border-top: 1px solid var(--line); }
.dnav-title { font-size: 11px; opacity: .62; margin: 2px 0 6px; }
.dnav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dnav-cell { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border: 1px solid var(--line);
  border-radius: 8px; background: none; font-size: 11px; color: inherit; cursor: pointer; text-align: left; }
.dnav-cell:hover { background: var(--line); }
.dnav-off { opacity: .4; cursor: default; }
.dnav-ico { font-size: 13px; }
.dnav-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- v4.0.79 功能面板（能力域：输入框左侧 ⊞ / logo 双入口）---------- */
.func-panel { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; width: min(560px, 92vw);
  max-height: 64vh; overflow-y: auto; background: var(--card, #fff); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 12px; z-index: 260; }
.func-panel.hidden { display: none; }
.fp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fp-head b { font-size: 14px; }
.fp-hint { font-size: 11px; opacity: .55; flex: 1; }
.fp-close { background: none; border: 0; font-size: 15px; cursor: pointer; opacity: .6; }
.fp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fp-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px;
  border: 1px solid var(--line); border-radius: 10px; background: none; font-size: 12px; color: inherit; cursor: pointer; }
.fp-cell:hover { background: var(--line); }
.fp-off { opacity: .42; cursor: default; }
.fp-pin { border-color: var(--primary, #e5534b); }
.fp-ico { font-size: 18px; line-height: 1; }
.fp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fp-tag { font-size: 10px; opacity: .6; }
.fp-tag-on { color: var(--primary, #e5534b); opacity: 1; }
#chat-func { font-size: 16px; line-height: 1; }
.drawer-brand-logo { cursor: pointer; }
@media (max-width: 768px) { .func-panel { bottom: 8px; width: 96vw; max-height: 72vh; } }
/* ---------- v4.0.89 会话壳三栏（默认 single；localStorage 'inkbox_shell_mode'=three 才生效）---------- */
.chat-panel.shell-three { display: grid; grid-template-columns: 220px minmax(0, 1fr) 320px; }
.chat-panel.shell-three .chat-drawer { position: static; transform: none; display: flex; }
.chat-panel.shell-three .chat-msgs { min-width: 0; }
.chat-side { display: none; flex-direction: column; border-left: 1px solid var(--line); min-width: 0; background: var(--bg, #fff); }
.chat-panel.shell-three .chat-side { display: flex; }
.chat-side-title { padding: 10px 12px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); opacity: .8; }
.chat-side-body { flex: 1; overflow-y: auto; padding: 8px; }
.chat-side-body .chat-msg { margin-bottom: 8px; }
/* 窄屏强制单栏：手机上三栏一定挤成一团，不如不给 */
@media (max-width: 1100px) {
  .chat-panel.shell-three { display: block; }
  .chat-panel.shell-three .chat-side { display: none; }
}

/* ---------- v4.1.3 五态（空/加载/错误/无权限/部分数据）---------- */
.ui-state { padding: 34px 16px; text-align: center; color: var(--sub); }
.ui-state-ico { font-size: 28px; line-height: 1; margin-bottom: 8px; }
.ui-state-title { font-size: .96rem; color: var(--text, inherit); font-weight: 600; margin-bottom: 6px; }
.ui-state-hint { font-size: .86rem; line-height: 1.6; max-width: 520px; margin: 0 auto; }
.ui-state-act { margin-top: 12px; }
.ui-state.ui-error .ui-state-title { color: var(--danger, #e5534b); }
.ui-state.ui-loading .ui-state-ico { animation: ui-state-pulse 1.2s ease-in-out infinite; }
.ui-state.ui-denied { opacity: .85; }
@keyframes ui-state-pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

/* ---------- v4.1.4 信息域就地看：浮层 / 钉住（右栏）---------- */
/* 默认不占位：对话流优先。只有点了信息域才出现，Esc/✕ 立刻散。 */
.chat-panel.side-float .chat-side,
.chat-panel.side-docked .chat-side { display: flex; position: static; }
.chat-panel.side-float .chat-side {
  position: fixed; right: 16px; top: 76px; bottom: 96px; width: 380px; z-index: 240;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 44px rgba(0,0,0,.18);
  background: var(--bg, #fff); overflow: hidden;
}
.chat-panel.side-docked { display: grid; grid-template-columns: 220px minmax(0, 1fr) 360px; }
.chat-panel.side-docked .chat-drawer { position: static; transform: none; display: flex; }
.side-float-head { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.side-float-head b { flex: 1; font-size: 13px; }
.side-btn { background: none; border: 0; cursor: pointer; font-size: 13px; opacity: .65; padding: 2px 4px; border-radius: 6px; }
.side-btn:hover { background: var(--line); opacity: 1; }
.side-btn.on { opacity: 1; color: var(--primary, #e5534b); }
.side-float-body { padding: 10px; overflow-y: auto; height: calc(100% - 42px); }
.side-float-wrap { display: flex; flex-direction: column; height: 100%; }
/* 手机没有"旁边"：浮层退化为底部抽屉；钉住也退化为抽屉（屏幕物理放不下双源） */
@media (max-width: 1100px) {
  .chat-panel.side-float .chat-side, .chat-panel.side-docked .chat-side {
    position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: 62vh;
  }
  .chat-panel.side-docked { display: block; }
  .chat-panel.side-docked .chat-drawer { display: none; }
}
/* ---------- v4.1.14 卡片瘦身：风格 chips 折叠 ---------- */
.chips-rest.hidden { display: none; }
.chip-more { opacity: .75; }
/* ---------- v4.1.20 歌词卡折叠（卡与生成不并列）---------- */
.chat-card.song-collapsed .chat-card-row { display: none; }
.chat-card.song-collapsed .chat-card-row.song-keep { display: block; }
.chat-card.song-collapsed.song-open .chat-card-row { display: block; }
/* ---------- v4.1.22 行级歌词编辑器 ---------- */
.ly-editor { font-family: inherit; line-height: 1.9; white-space: pre-wrap; }
.ly-line { padding: 1px 4px; border-radius: 4px; cursor: text; transition: background .12s; }
.ly-line:hover { background: rgba(0,0,0,.04); }
.ly-line.ly-blank { min-height: 1em; }
.ly-line.ly-editing { background: rgba(229,83,75,.08); outline: 1px solid var(--primary, #e5534b); }
/* ---------- v4.1.22 参数可点改 ---------- */
.pe { padding: 0 2px; border-radius: 3px; outline: 1px dashed transparent; cursor: text; }
.pe:hover { outline-color: var(--primary, #e5534b); }
.pe:focus { outline: 1px solid var(--primary, #e5534b); background: rgba(229,83,75,.06); }
/* ---------- v4.1.27 工作回执（对话里的一行轻提示） ---------- */
.wr-line { font-size: .84rem; color: var(--sub); padding: 2px 0 2px 2px; border-left: 2px solid var(--line); margin: 2px 0; }
.wr-line .wr-dot { color: var(--primary, #e5534b); }
/* ---------- v4.1.39 主编审阅两栏：桌面显式 flex（原内联样式已抽成类，避免手机端无 display:flex）----------
 * 手机端沿用既有 body.is-mobile #rv-split { flex-direction: column } 的竖排规则。 */
.rv-split { display: flex; gap: 12px; align-items: stretch; }
.rv-split > * { min-width: 0; }
/* ---------- v4.1.40 移动端输入框字号 ≥16px ----------
 * 病：iOS Safari 对 <16px 的输入框会在聚焦时**自动放大页面**，用户要手动缩回——
 * 这是移动端最典型的"不成熟"体感（实测我们 9 条输入框规则里 8 条 <16px）。
 * 只作用于窄屏/触屏，桌面紧凑排版不受影响。 */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  textarea, select, .input { font-size: 16px !important; }
}
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]),
  textarea, select, .input { font-size: 16px !important; }
}

/* ---------- v4.1.77 左下角头像菜单（大厂范式：顶栏=功能与历史，底栏=身份与全局操作） ---------- */
.um-entry{display:flex;align-items:center;gap:8px;width:100%;padding:7px 8px;margin-top:6px;border-radius:10px;background:transparent;border:1px solid transparent;color:var(--text);cursor:pointer;text-align:left}
.um-entry:hover{background:var(--card2);border-color:var(--border)}
.um-avatar{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:.8rem;font-weight:700;flex:0 0 auto}
.um-entry-name{flex:1;font-size:.86rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.um-entry-caret{color:var(--sub);font-size:.7rem}
.um-menu-wrap{padding:10px 10px 12px}
.um-menu-head{padding:6px 8px 10px;border-bottom:1px solid var(--border);margin-bottom:6px}
.um-menu-name{display:block;font-size:.9rem;font-weight:700}
.um-menu-sub{display:block;font-size:.72rem;color:var(--sub);margin-top:2px}
.um-menu{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.um-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:8px;background:transparent;border:0;color:var(--text);cursor:pointer;text-align:left;font-size:.86rem}
.um-item:hover{background:var(--card2)}
.um-item[data-danger="1"]{color:var(--danger,#e5484d)}
.um-item-ico{width:18px;text-align:center}
.um-item-label{flex:1}
.um-card{width:236px}

/* ---------- v4.1.77 左下角头像菜单（大厂范式：顶栏=功能与历史，底栏=身份与全局操作） ---------- */
.um-entry{display:flex;align-items:center;gap:8px;width:100%;padding:7px 8px;margin-top:6px;border-radius:10px;background:transparent;border:1px solid transparent;color:var(--text);cursor:pointer;text-align:left}
.um-entry:hover{background:var(--card2);border-color:var(--border)}
.um-avatar{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:.8rem;font-weight:700;flex:0 0 auto}
.um-entry-name{flex:1;font-size:.86rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.um-entry-caret{color:var(--sub);font-size:.7rem}
.um-menu-wrap{padding:10px 10px 12px}
.um-menu-head{padding:6px 8px 10px;border-bottom:1px solid var(--border);margin-bottom:6px}
.um-menu-name{display:block;font-size:.9rem;font-weight:700}
.um-menu-sub{display:block;font-size:.72rem;color:var(--sub);margin-top:2px}
.um-menu{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.um-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:8px;background:transparent;border:0;color:var(--text);cursor:pointer;text-align:left;font-size:.86rem}
.um-item:hover{background:var(--card2)}
.um-item[data-danger="1"]{color:var(--danger,#e5484d)}
.um-item-ico{width:18px;text-align:center}
.um-item-label{flex:1}
.um-card{width:236px}

/* ---------- v4.1.80 弹窗登录（精简：只留品牌 + 表单，不塞长介绍） ---------- */
#auth-modal-host .auth-page{max-width:420px;margin:0 auto}
#auth-modal-host .auth-logo{width:46px;height:46px;font-size:1.5rem;margin-bottom:6px;border-radius:13px}
#auth-modal-host .auth-hero{margin:6px 0 14px}
#auth-modal-host .auth-slogan,#auth-modal-host .auth-feats,#auth-modal-host .auth-brand{display:none}
#auth-modal-host .auth-foot{margin-top:12px;padding-top:10px}

/* ---------- v4.1.80 弹窗登录（精简：只留品牌 + 表单，不塞长介绍） ---------- */
#auth-modal-host .auth-page{max-width:420px;margin:0 auto}
#auth-modal-host .auth-logo{width:46px;height:46px;font-size:1.5rem;margin-bottom:6px;border-radius:13px}
#auth-modal-host .auth-hero{margin:6px 0 14px}
#auth-modal-host .auth-slogan,#auth-modal-host .auth-feats,#auth-modal-host .auth-brand{display:none}
#auth-modal-host .auth-foot{margin-top:12px;padding-top:10px}

/* ---------- v4.1.85 弹窗内的整行按钮允许换行（原来 .btn 的 nowrap 让描述被挤成一行并溢出） ---------- */
.modal .btn-block{white-space:normal;line-height:1.5;text-align:left}
.modal .btn-block .li-sub{display:block;margin-top:2px;white-space:normal}

/* ---------- v4.1.87 弹窗内文字不再重叠 / 强制换行（窄弹窗里标题与说明挤成一坨） ---------- */
.modal .modal-head .li-sub{display:block;margin-top:2px;white-space:normal}
.modal .li-sub{white-space:normal}
.modal .newpick-card b,.modal .newpick-card .newpick-desc{white-space:normal;line-height:1.5}
.modal .newpick-card{align-items:flex-start}

/* ---------- v4.1.87 弹窗内文字不再重叠 / 强制换行（窄弹窗里标题与说明挤成一坨） ---------- */
.modal .modal-head .li-sub{display:block;margin-top:2px;white-space:normal}
.modal .li-sub{white-space:normal}
.modal .newpick-card b,.modal .newpick-card .newpick-desc{white-space:normal;line-height:1.5}
.modal .newpick-card{align-items:flex-start}

/* ---------- v4.1.89 登录页：介绍六行整块去掉（保留占位节点便于后续恢复） ---------- */
.auth-slogan--hide,.auth-feats--hide,.auth-sub--hide{display:none !important}
