:root {
  --bg: #0e0f13;
  --topbar: #08090b;
  --rail: #0a0b0e;
  --card: #17181d;
  --card-2: #1d1e25;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f2f3f7;
  --muted: #8b8e9d;
  --muted-2: #62656f;
  --blue: #4d6bfe;
  --violet: #7a5cff;
  --green: #34d399;
  --grad: linear-gradient(135deg, #4d6bfe, #7a5cff);
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
textarea { resize: none; }
svg.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); background-clip: content-box; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  height: 54px;
  display: flex; align-items: center; gap: 28px;
  padding: 0 20px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(93, 108, 254, 0.45);
}
.logo-mark svg { width: 16px; height: 16px; fill: #fff; }
.logo b { font-size: 16px; letter-spacing: 0.5px; }
.logo-tag {
  font-size: 10px; color: var(--muted);
  padding: 2px 7px; border-radius: 99px;
  border: 1px solid var(--line-2);
}
.topnav { display: flex; gap: 4px; }
.topnav-item {
  padding: 6px 14px; border-radius: 9px;
  font-size: 13.5px; color: var(--muted);
  transition: color .16s, background .16s;
}
.topnav-item:hover { color: var(--text); }
.topnav-item.is-active { color: #fff; background: rgba(255,255,255,0.07); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lic-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 99px;
  background: rgba(77, 107, 254, 0.1);
  border: 1px solid rgba(77, 107, 254, 0.28);
  max-width: 330px;
}
.lic-code {
  font-size: 11px; color: #cfd7ff; letter-spacing: .4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lic-credits {
  font-size: 11px; color: var(--muted);
  padding-left: 8px; border-left: 1px solid rgba(77, 107, 254, 0.28);
  white-space: nowrap;
}
.lic-btn {
  font-size: 11px; color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 99px;
  transition: color .16s, border-color .16s;
}
.lic-btn:hover { color: #ffb4b4; border-color: rgba(248, 113, 113, .35); }
.billing-pill {
  font-size: 11px; color: #b9c2ff;
  padding: 5px 11px; border-radius: 99px;
  background: rgba(77, 107, 254, 0.12);
  border: 1px solid rgba(77, 107, 254, 0.3);
}
.key-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line);
}
.key-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.key-status.is-ok { color: #9ff3c9; border-color: rgba(52,211,153,.3); }
.key-status.is-ok i { background: var(--green); }
.key-status.is-bad { color: #ffb4b4; border-color: rgba(248,113,113,.3); }
.key-status.is-bad i { background: #f87171; }

/* ---------------- 主体 ---------------- */
.body { display: grid; grid-template-columns: 76px minmax(0, 1fr); height: calc(100vh - 54px); }

.rail {
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 12px 6px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 2px; border-radius: 11px;
  color: var(--muted); font-size: 10.5px;
  transition: color .16s, background .16s;
}
.rail-item .icon { width: 20px; height: 20px; }
.rail-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.rail-item.is-active { color: #fff; background: rgba(77, 107, 254, 0.16); }
.rail-item.is-active .icon { color: #8ea4ff; }
.rail-sep { height: 1px; background: var(--line); margin: 8px 10px; }

.main { overflow-y: auto; padding: 22px 26px 40px; }
.view { display: none; max-width: 1180px; margin: 0 auto; animation: rise .3s ease both; }
.view.is-active { display: block; }

/* 画布视图：铺满整个窗口，不留外边距 */
.main.is-canvas { padding: 0; overflow: hidden; }
#view-canvas { max-width: none; margin: 0; }
#view-canvas.is-active { display: flex; flex-direction: column; height: 100%; animation: none; }

/* ---------------- 创作卡片 ---------------- */
.composer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 13px;
}

.composer-tabs { display: flex; gap: 4px; }
.ctab {
  padding: 7px 15px; border-radius: 10px;
  font-size: 13px; color: var(--muted);
  border: 1px solid transparent;
  transition: all .16s;
}
.ctab:hover { color: var(--text); }
.ctab.is-active {
  color: #fff;
  background: var(--card-2);
  border-color: var(--line-2);
}

.prompt-area {
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: #101116;
  transition: border-color .18s, box-shadow .18s;
}
.prompt-area:focus-within { border-color: rgba(77,107,254,.55); box-shadow: 0 0 0 3px rgba(77,107,254,.13); }
.prompt-area textarea {
  width: 100%; border: none; outline: none; background: transparent;
  padding: 14px 15px 4px; font-size: 14px; line-height: 1.7; min-height: 74px;
}
.prompt-area textarea::placeholder { color: var(--muted-2); }
.prompt-tools {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px 10px;
}
.mini-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #9db1ff;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(77,107,254,.1);
  transition: background .16s;
}
.mini-btn:hover { background: rgba(77,107,254,.2); }
.mini-btn .icon { width: 13px; height: 13px; }
.mini-btn.is-busy { opacity: .55; pointer-events: none; }
.counter { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.counter b { color: var(--muted); font-weight: 500; }

.neg-row input {
  width: 100%; padding: 9px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: #101116;
  font-size: 12.5px; outline: none;
}
.neg-row input:focus { border-color: rgba(77,107,254,.45); }
.neg-row input::placeholder { color: var(--muted-2); }

/* 参考图 */
.ref-area {
  padding: 12px; border-radius: 12px;
  border: 1px dashed var(--line-2);
  background: rgba(255,255,255,0.015);
  display: flex; flex-direction: column; gap: 10px;
  animation: rise .25s ease both;
}
.ref-drop {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px; border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.02);
  color: var(--muted); font-size: 12.5px;
  cursor: pointer; transition: all .16s;
}
.ref-drop:hover, .ref-drop.is-drag { border-color: rgba(77,107,254,.6); background: rgba(77,107,254,.07); color: var(--text); }
.ref-drop .icon { width: 17px; height: 17px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, 76px); gap: 8px; }
.ref-thumb {
  position: relative; width: 76px; height: 76px; border-radius: 9px;
  overflow: hidden; border: 1px solid var(--line); background: #0b0c10;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumb button {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(5,5,9,.7); color: #fff;
}
.ref-thumb button .icon { width: 10px; height: 10px; }
.ref-thumb.is-linked { border-color: rgba(77,107,254,.7); box-shadow: 0 0 0 2px rgba(77,107,254,.18); }
.ref-thumb .ref-media { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.ref-thumb .ref-media .icon { width: 22px; height: 22px; }
.ref-thumb .ref-tag {
  position: absolute; left: 4px; bottom: 4px;
  padding: 1px 5px; border-radius: 4px;
  font-size: 9px; color: #dfe3ff; background: rgba(77,107,254,.8);
}

/* 连线状态提示 */
.ref-linked {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  max-width: 100%;
  padding: 6px 11px; border-radius: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid rgba(77,107,254,.45); background: rgba(77,107,254,.12);
  color: #cfd6ff; font-size: 11.5px; cursor: pointer; transition: all .15s;
}
.ref-linked:hover { background: rgba(77,107,254,.22); }
.ref-linked span { flex: none; }
.ref-linked .icon { flex: none; width: 13px; height: 13px; }
.ref-linked span { color: var(--muted); font-size: 10.5px; }

/* 连线弹窗 / 素材菜单 */
.link-popover {
  position: fixed; z-index: 80; right: 212px; top: 76px;
  width: 300px; border-radius: 14px; border: 1px solid var(--line-2);
  background: #14161d; box-shadow: var(--shadow); overflow: hidden;
}
.link-pop-head, .link-pop-foot {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
}
.link-pop-head { justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.link-pop-head b span { color: var(--blue); }
.link-pop-head button { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); }
.link-pop-head button .icon { width: 13px; height: 13px; }
.link-pop-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.link-pop-preview {
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: #0b0c10; max-height: 190px; display: grid; place-items: center;
}
.link-pop-preview img, .link-pop-preview video { width: 100%; max-height: 190px; object-fit: contain; display: block; }
.link-pop-preview audio { width: 100%; height: 34px; margin: 8px; }
.link-pop-file b { display: block; font-size: 12px; word-break: break-all; }
.link-pop-file em { font-size: 10.5px; font-style: normal; color: var(--muted-2); }
.link-recent-head { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.link-recent-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.link-recent-item {
  aspect-ratio: 1; border-radius: 7px; overflow: hidden;
  border: 1px solid var(--line); background: #0b0c10;
  display: grid; place-items: center; color: var(--muted);
}
.link-recent-item:hover { border-color: rgba(77,107,254,.7); }
.link-recent-item img { width: 100%; height: 100%; object-fit: cover; }
.link-recent-item .icon { width: 15px; height: 15px; }
.link-pop-foot { border-top: 1px solid var(--line); flex-wrap: wrap; padding-top: 9px; }
.link-pop-foot .mini-btn { font-size: 11px; padding: 5px 9px; }
.link-pop-foot .mini-btn.danger { color: #ff8f9a; border-color: rgba(255,120,130,.35); }

.link-menu {
  position: fixed; z-index: 90; width: 212px; padding: 6px;
  border-radius: 12px; border: 1px solid var(--line-2);
  background: #16181f; box-shadow: var(--shadow);
}
.link-menu-head { padding: 5px 8px 7px; font-size: 10.5px; color: var(--muted); }
.link-menu-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px; color: var(--text); text-align: left;
}
.link-menu-item:hover { background: rgba(255,255,255,.06); }
.link-menu-item b { flex: 1; font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-menu-item em { font-size: 10px; font-style: normal; color: var(--muted-2); }
.link-menu-item .icon { width: 14px; height: 14px; color: var(--blue); }
.link-menu-thumb {
  width: 24px; height: 24px; border-radius: 6px; overflow: hidden; flex: none;
  display: grid; place-items: center; background: #0b0c10; color: var(--muted);
}
.link-menu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.link-menu-thumb .icon { width: 13px; height: 13px; color: var(--muted); }
.link-menu-item.is-new { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 9px; }

/* 首尾帧 */
.frame-slots { display: flex; gap: 10px; }
.frame-slot {
  position: relative;
  width: 132px; height: 88px;
  border-radius: 11px;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.02);
  display: grid; place-items: center;
  overflow: hidden; cursor: pointer;
  transition: all .16s;
}
.frame-slot:hover, .frame-slot.is-drag { border-color: rgba(77,107,254,.6); background: rgba(77,107,254,.07); }
.slot-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px; text-align: center; }
.slot-empty .icon { width: 18px; height: 18px; color: var(--muted-2); }
.slot-empty b { font-size: 11.5px; font-weight: 500; }
.slot-empty span { font-size: 10px; color: var(--muted-2); }
.slot-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot-remove {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  display: none; place-items: center;
  background: rgba(6,6,10,.72); color: #fff;
}
.slot-remove .icon { width: 11px; height: 11px; }
.frame-slot.has-image .slot-remove { display: grid; }
.frame-slot.has-image .slot-empty { display: none; }

/* 控制区 */
.controls {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 18px;
}
.ctrl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctrl > label { font-size: 11.5px; color: var(--muted); }
.ctrl-desc { font-size: 10.5px; color: var(--muted-2); }
.ctrl-seed input {
  width: 90px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #101116;
  font-size: 12px; outline: none;
}
.ctrl-seed input:focus { border-color: rgba(77,107,254,.45); }

.select {
  appearance: none;
  padding: 7px 30px 7px 11px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--card-2);
  font-size: 12.5px; outline: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.select:focus { border-color: rgba(77,107,254,.55); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 9px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: var(--card-2);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { color: #fff; border-color: rgba(77,107,254,.6); background: rgba(77,107,254,.18); }
.chip .glyph {
  display: block; border: 1.4px solid currentColor; border-radius: 2.5px;
  opacity: .85;
}

.generate-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 30px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 28px rgba(93, 108, 254, 0.35);
  transition: transform .15s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.generate-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(93,108,254,.5); }
.generate-btn:active { transform: translateY(0); }
.generate-btn.is-busy { opacity: .55; pointer-events: none; }
.generate-btn .icon { width: 16px; height: 16px; }

/* 智能编辑布局 */
.edit-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.edit-upload { width: 100%; height: 180px; }
.edit-right { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.idea-row { display: flex; flex-wrap: wrap; gap: 7px; }
.idea {
  padding: 6px 12px; border-radius: 99px;
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); background: var(--card-2);
  transition: all .15s;
}
.idea:hover { color: #fff; border-color: rgba(77,107,254,.5); background: rgba(77,107,254,.12); }

/* ---------------- 历史记录 / 作品网格 ---------------- */
.history { margin-top: 26px; }
.history-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 13px;
}
.history-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.history-head span { font-size: 11.5px; color: var(--muted-2); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 13px;
}
.work-card {
  position: relative;
  border-radius: 13px; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  animation: rise .3s ease both;
}
.work-card:hover { transform: translateY(-3px); border-color: rgba(77,107,254,.45); box-shadow: var(--shadow); }
.work-thumb { position: relative; aspect-ratio: 16/10; background: #0b0c10; overflow: hidden; }
.work-thumb img, .work-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-thumb video { pointer-events: none; }
.work-type {
  position: absolute; top: 9px; left: 9px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 99px;
  font-size: 10px; color: #e6e8f0;
  background: rgba(6,6,10,.66);
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(6px);
}
.work-type .icon { width: 11px; height: 11px; }
.work-fav {
  position: absolute; top: 9px; right: 9px;
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(6,6,10,.66); color: var(--muted);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  transition: color .15s;
}
.work-fav .icon { width: 13px; height: 13px; }
.work-fav.is-fav { color: #ffd166; }
.work-fav.is-fav .icon { fill: currentColor; }
.work-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgba(4,4,8,.55));
  opacity: 0; transition: opacity .18s;
}
.work-card:hover .work-play { opacity: 1; }
.work-play i {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(8px);
}
.work-play i svg { width: 15px; height: 15px; fill: #fff; stroke: none; margin-left: 2px; }
.work-body { padding: 9px 11px 11px; }
.work-prompt {
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 34px;
}
.work-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; font-size: 10px; color: var(--muted-2); }
.work-meta em { font-style: normal; padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.05); }

/* 任务进行中卡片 */
.task-card {
  position: relative;
  border-radius: 13px; overflow: hidden;
  border: 1px solid rgba(77,107,254,.35);
  background: var(--card);
  aspect-ratio: 16/10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; text-align: center; padding: 14px;
}
.task-card::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(77,107,254,.14), transparent 70%);
}
.task-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.045) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 1.8s linear infinite;
}
.task-ring {
  position: relative; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(from 0deg, #4d6bfe var(--p, 8%), rgba(255,255,255,.09) 0);
}
.task-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #14151b; }
.task-ring b { position: relative; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.task-status { position: relative; font-size: 12px; }
.task-sub { position: relative; font-size: 10.5px; color: var(--muted); }
.task-cancel {
  position: relative;
  font-size: 10.5px; color: var(--muted);
  padding: 4px 11px; border-radius: 99px;
  border: 1px solid var(--line-2);
  transition: all .15s;
}
.task-cancel:hover { color: #ffb4b4; border-color: rgba(248,113,113,.4); }

.task-card.is-failed { border-color: rgba(248,113,113,.4); }
.task-card.is-failed .task-ring { background: none; border: 1px solid rgba(248,113,113,.4); }
.task-card.is-failed .task-ring::before { background: transparent; }
.task-card.is-failed .task-ring b { color: #ff9d9d; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 70px 20px; text-align: center;
  border-radius: 15px; border: 1px dashed rgba(255,255,255,.1);
  color: var(--muted-2);
}
.empty-state .icon { width: 26px; height: 26px; }
.empty-state b { font-size: 13px; color: var(--muted); font-weight: 500; }
.empty-state span { font-size: 11.5px; }

/* ---------------- 资产库 ---------------- */
.assets-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.assets-actions { display: flex; align-items: center; gap: 12px; }
.assets-actions input {
  width: 220px; padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 12.5px; outline: none;
}
.assets-actions input:focus { border-color: rgba(77,107,254,.5); }
.assets-count { font-size: 11.5px; color: var(--muted-2); }

/* ---------------- 灵感广场 ---------------- */
.inspire-head { margin-bottom: 16px; }
.inspire-head h3 { margin: 0; font-size: 16px; }
.inspire-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.insp-use {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  padding: 8px 0; border-radius: 9px;
  font-size: 12px; color: #fff; text-align: center;
  background: rgba(77,107,254,.85);
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s, transform .18s;
}
.work-card:hover .insp-use { opacity: 1; transform: translateY(0); }

/* ---------------- 数字人 ---------------- */
.dh-layout { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; }
.dh-side { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.dh-label { font-size: 11.5px; color: var(--muted); }
.dh-portrait { width: 100%; height: 176px; }
.dh-portrait .slot-empty .icon { width: 22px; height: 22px; }
.dh-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.dh-preset {
  position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: #0b0c10; padding: 0;
  transition: border-color .16s, transform .16s;
}
.dh-preset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dh-preset:hover { transform: translateY(-1px); border-color: var(--line-2); }
.dh-preset.is-active { border-color: rgba(77,107,254,.85); box-shadow: 0 0 0 2px rgba(77,107,254,.25); }
.dh-preset span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 0; font-size: 9.5px; text-align: center; color: #e8ebf5;
  background: linear-gradient(transparent, rgba(5,6,10,.82));
}
.dh-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dh-upload { display: flex; flex-direction: column; gap: 9px; }
.dh-upload audio { width: 100%; height: 34px; }
.dh-mode-tip { font-size: 11px; color: var(--muted-2); line-height: 1.7; }
@media (max-width: 760px) {
  .dh-layout { grid-template-columns: 1fr; }
  .dh-presets { grid-template-columns: repeat(4, 1fr); }
}

.placeholder-hero {
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 90% at 85% 0%, rgba(122,92,255,.13), transparent 60%),
    radial-gradient(60% 80% at 8% 100%, rgba(77,107,254,.1), transparent 65%),
    var(--card);
  padding: 44px 42px;
  display: flex; flex-direction: column; gap: 18px;
}
.ph-badge {
  align-self: flex-start;
  font-size: 11px; color: #b9c2ff;
  padding: 4px 11px; border-radius: 99px;
  background: rgba(77,107,254,.12);
  border: 1px solid rgba(77,107,254,.32);
}
.placeholder-hero h2 { margin: 0; font-size: 24px; letter-spacing: .5px; }
.placeholder-hero > p { margin: 0; font-size: 13px; color: var(--muted); max-width: 640px; line-height: 1.8; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 11px; margin-top: 6px; }
.ph-item {
  padding: 14px 15px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
}
.ph-item b { display: flex; align-items: center; gap: 7px; font-size: 12.8px; font-weight: 500; margin-bottom: 5px; }
.ph-item b .icon { width: 15px; height: 15px; color: #8ea4ff; }
.ph-item span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.ph-note { font-size: 11px; color: var(--muted-2); }

/* ---------------- 弹层 ---------------- */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px; border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(20, 21, 27, 0.96);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  backdrop-filter: blur(14px);
  animation: toastIn .28s ease both;
  max-width: 380px;
  cursor: pointer;
}
.toast > span {
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.55;
}
.toast.is-sticky { animation: none; }
.toast.is-out { animation: toastOut .25s ease both; }
.toast .icon { width: 15px; height: 15px; }
.toast.ok .icon { color: var(--green); }
.toast.err .icon { color: #ff9d9d; }
.toast.info .icon { color: #9db1ff; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 32px;
  background: rgba(3,3,6,.87);
  backdrop-filter: blur(10px);
  animation: fade .2s ease both;
}
.lightbox-inner {
  position: relative;
  width: min(1000px, 100%);
  max-height: 100%; overflow: auto;
  border-radius: 17px;
  border: 1px solid var(--line-2);
  background: #0d0e12;
  padding: 17px;
  box-shadow: var(--shadow);
  animation: rise .25s ease both;
}
.lightbox-close {
  position: absolute; top: 13px; right: 13px; z-index: 2;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06); color: var(--muted);
  border: 1px solid var(--line);
}
.lightbox-close:hover { color: #fff; background: rgba(255,255,255,.1); }
.lightbox-media { display: grid; place-items: center; border-radius: 12px; overflow: hidden; background: #000; }
.lightbox-media video, .lightbox-media img { width: 100%; max-height: 66vh; object-fit: contain; display: block; }
/* 3D 预览：弹窗变宽、画布可交互 */
.lightbox.is-3d .lightbox-inner { width: min(1080px, 94vw); }
.lightbox.is-3d .lightbox-media { background: #0d0f14; max-height: none; }
.m3-viewer { position: relative; width: 100%; height: min(62vh, 620px); cursor: grab; }
.m3-viewer:active { cursor: grabbing; }
.m3-viewer canvas { display: block; width: 100% !important; height: 100% !important; }
.m3-viewer-tip {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12.5px; color: var(--muted); padding: 24px; text-align: center; line-height: 1.7;
  background: radial-gradient(circle at 50% 45%, rgba(77,107,254,.14), transparent 62%);
}
.m3-viewer-tip.is-err { color: #ffb4b4; }
.lightbox-meta { padding: 13px 4px 6px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.lightbox-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px; }
.lb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 9px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  transition: all .15s;
}
.lb-btn:hover { color: var(--text); background: rgba(255,255,255,.07); }
.lb-btn.accent { color: #cdd7ff; border-color: rgba(77,107,254,.45); background: rgba(77,107,254,.14); }
.lb-btn .icon { width: 13px; height: 13px; }

/* ---------------- 动画 ---------------- */
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------------- 故事创作 ---------------- */
.story-hint { font-size: 11px; color: var(--muted-2); }
.story-board { margin-top: 22px; }
.story-board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.story-board-head h3 { margin: 0; font-size: 15px; }
.story-board-head > span { font-size: 11.5px; color: var(--muted-2); }
.story-board-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.story-board-actions .generate-btn { padding: 9px 20px; font-size: 13px; }
.shot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.shot-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 108px; gap: 10px;
  padding: 12px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--card);
  animation: rise .3s ease both;
}
.shot-no { font-size: 18px; font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.shot-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.shot-prompt {
  width: 100%; border: 1px solid var(--line); background: #101116;
  border-radius: 9px; padding: 8px 10px; font-size: 12px; line-height: 1.6;
  min-height: 66px; outline: none;
}
.shot-prompt:focus { border-color: rgba(77,107,254,.5); }
.shot-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.shot-meta em { font-style: normal; font-size: 10px; color: var(--muted-2); padding: 2px 7px; border-radius: 5px; background: rgba(255,255,255,.05); }
.shot-side { display: flex; flex-direction: column; gap: 7px; }
.shot-thumb {
  position: relative; width: 108px; height: 76px; border-radius: 9px;
  border: 1px dashed var(--line-2); background: #0b0c10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  overflow: hidden; color: var(--muted-2); font-size: 10px;
}
.shot-thumb .icon { width: 16px; height: 16px; }
.shot-thumb img, .shot-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-thumb.is-done { border-style: solid; cursor: pointer; }
.shot-thumb.is-failed { border-color: rgba(248,113,113,.45); color: #ff9d9d; }
.shot-thumb .spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15); border-top-color: #7a5cff;
  animation: rot 1s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.shot-gen { width: 100%; justify-content: center; }
.shot-gen[disabled] { opacity: .55; pointer-events: none; }

/* ---------------- 智能画布（无限节点画布） ---------------- */
.canvas-wrap {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
  border: none; border-radius: 0; overflow: hidden; background: #0b0c11;
}
.canvas-toolbar {
  flex: none; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #12131a, #0d0e13);
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
}
.canvas-vsep { width: 1px; height: 18px; background: var(--line-2); margin: 0 3px; flex: none; }
.canvas-zoom-label { font-size: 11.5px; color: var(--muted); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; flex: none; }
.canvas-hint {
  font-size: 10.5px; color: var(--muted-2); margin-left: auto; flex: 1; min-width: 40px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.canvas-clear:hover { color: #ffb4b4; background: rgba(248,113,113,.12); }
.cv-project {
  background: rgba(255,255,255,.05); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; font-size: 11.5px; padding: 5px 8px; max-width: 150px; outline: none;
}
.mini-btn.accent { background: rgba(77,107,254,.16); border-color: rgba(77,107,254,.45); color: #c5d0ff; }
.mini-btn.accent:hover { background: rgba(77,107,254,.3); }
.mini-btn.is-off { opacity: .35; pointer-events: none; }
.cv-add { position: relative; }
.cv-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 240px;
  background: #131419; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 46px rgba(0,0,0,.55);
}
.cv-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; font-size: 12px; color: var(--text);
}
.cv-menu button:hover { background: rgba(77,107,254,.14); }
.cv-menu button .icon { width: 14px; height: 14px; color: #8ea0ff; flex: none; }
.cv-menu button span { margin-left: auto; font-size: 10px; color: var(--muted-2); }

.canvas-main { display: flex; flex: 1; min-height: 0; }
.canvas-stage {
  position: relative; flex: 1; height: 100%; min-height: 0; overflow: hidden;
  background-color: #090a0e;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: default; touch-action: none;
}
.canvas-stage::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 520px at 50% -6%, rgba(77,107,254,.1), transparent 72%),
    radial-gradient(700px 420px at 100% 100%, rgba(122,92,255,.06), transparent 70%);
}
.canvas-stage.is-panning, .canvas-stage.is-hand { cursor: grab; }
.canvas-stage.is-hand:active { cursor: grabbing; }
.canvas-stage.is-dropfile { outline: 2px dashed rgba(77,107,254,.7); outline-offset: -6px; }
.canvas-board { position: absolute; left: 0; top: 0; width: 10px; height: 10px; transform-origin: 0 0; }
.canvas-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; text-align: center; padding: 0 40px;
  color: var(--muted-2); font-size: 12.5px; line-height: 1.9; pointer-events: none;
}
.canvas-empty b { font-size: 19px; color: #d6dbea; letter-spacing: .5px; }
.canvas-empty span { max-width: 580px; }
.cv-marquee {
  position: absolute; z-index: 40; border: 1px solid rgba(96,125,255,.9);
  background: rgba(77,107,254,.12); pointer-events: none; border-radius: 2px;
}

/* 节点 */
.cv-node {
  position: absolute; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, #181a23, #11131a);
  box-shadow: 0 14px 34px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  cursor: move; user-select: none; touch-action: none;
  transition: border-color .16s, box-shadow .16s;
}
.cv-node:hover { border-color: rgba(255,255,255,.2); box-shadow: 0 18px 42px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); }
.cv-node.is-sel {
  border-color: rgba(110,135,255,.95);
  box-shadow: 0 18px 42px rgba(0,0,0,.55), 0 0 0 2px rgba(77,107,254,.4), 0 0 26px rgba(77,107,254,.22);
}
.cv-node.is-drop { border-color: rgba(52,211,153,.9); box-shadow: 0 0 0 3px rgba(52,211,153,.3); }
.cv-k-image, .cv-k-video { overflow: hidden; }
.cv-k-image img, .cv-k-video video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cv-k-audio { width: 300px; height: 118px; display: flex; align-items: center; padding: 10px 11px; box-sizing: border-box; }
.cv-k-audio.is-empty { display: block; padding: 0; height: 118px; }
.cv-k-note { display: flex; flex-direction: column; cursor: default; }
.cv-note-bar {
  flex: none; display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding: 8px 11px; background: rgba(255,255,255,.05);
  border-bottom: 1px solid var(--line); cursor: move;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cv-note-bar .icon { width: 12px; height: 12px; flex: none; }
.cv-k-note textarea {
  flex: 1; width: 100%; border: none; outline: none; background: transparent;
  padding: 10px 11px; font-size: 12.5px; line-height: 1.65; color: var(--text); resize: none;
}
.cv-k-group {
  background: rgba(77,107,254,.07); border: 1.5px dashed rgba(96,125,255,.5);
  box-shadow: none; cursor: move;
}
.cv-group-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 26px;
  display: flex; align-items: center; gap: 7px; padding: 0 10px;
  font-size: 11px; color: #aab8ff;
}
.cv-group-bar .icon { width: 12px; height: 12px; }
.cv-group-bar em { font-size: 10px; color: var(--muted-2); font-style: normal; }

/* 生成节点 */
.cv-k-t2i, .cv-k-vgen { display: flex; flex-direction: column; cursor: default; padding: 11px; gap: 8px; }
.cv-gen-head {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: move;
  padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.cv-gen-head .icon { width: 14px; height: 14px; color: #9dadff; }
.cv-status { margin-left: auto; font-size: 10.5px; color: var(--muted-2); display: inline-flex; align-items: center; gap: 4px; }
.cv-status.st-busy { color: #8ea0ff; }
.cv-status.st-err { color: #ff9d9d; }
.cv-status.st-done { color: #6ee7b7; }
.cv-spin { width: 10px; height: 10px; border: 1.5px solid rgba(142,160,255,.3); border-top-color: #8ea0ff; border-radius: 50%; display: inline-block; animation: rot 1s linear infinite; }
.cv-gen-preview { border-radius: 8px; overflow: hidden; background: #0b0c10; border: 1px solid var(--line); min-height: 90px; display: grid; place-items: center; }
.cv-gen-preview img, .cv-gen-preview video { width: 100%; max-height: 240px; object-fit: contain; display: block; }
.cv-gen-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted-2); font-size: 10.5px; padding: 16px 0; }
.cv-gen-empty .icon { width: 18px; height: 18px; opacity: .5; }
.cv-in {
  background: rgba(255,255,255,.055); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; font-size: 11.5px; padding: 5px 7px; outline: none; min-width: 0;
}
.cv-in:focus { border-color: rgba(96,125,255,.7); }
textarea.cv-prompt { resize: vertical; min-height: 52px; max-height: 140px; line-height: 1.6; font-family: inherit; width: 100%; font-size: 12px; }
.cv-gen-row { display: flex; gap: 5px; }
.cv-gen-row .cv-model { flex: 1; }
.cv-gen-foot { align-items: center; }
.cv-refs { flex: 1; font-size: 10.5px; color: var(--muted-2); }
.cv-refs em { font-style: normal; }
.cv-refs em.ok { color: #6ee7b7; }
.cv-run {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--grad); color: #fff; border-radius: 9px;
  font-size: 11.5px; padding: 7px 16px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(77,107,254,.3);
  transition: filter .15s, transform .12s;
}
.cv-run:hover { filter: brightness(1.1); }
.cv-run:active { transform: scale(.98); }
.cv-run .icon { width: 12px; height: 12px; }
.cv-run[disabled] { opacity: .55; pointer-events: none; }

/* 节点工具条 / 手柄 */
.cv-tools { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; z-index: 3; flex-wrap: wrap; justify-content: flex-end; max-width: 90%; }
.cv-node:hover .cv-tools, .cv-node.is-sel .cv-tools { display: flex; }
/* 音频节点工具条：单行横排，宽度不够时横向滚动，避免文字被挤成竖排 */
.cv-k-audio .cv-tools {
  top: 4px; right: 4px; left: 4px; max-width: none; flex-wrap: nowrap;
  justify-content: flex-end; overflow-x: auto; overflow-y: hidden;
  padding-bottom: 2px;
}
.cv-k-audio .cv-tools button { flex: none; white-space: nowrap; }
.cv-tools button {
  font-size: 10px; padding: 3px 7px; border-radius: 6px;
  background: rgba(6,6,10,.78); color: #dfe3f0;
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
}
.cv-tools button:hover { background: rgba(77,107,254,.55); }
.cv-resize {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: nwse-resize; z-index: 3;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.35) 50%);
  border-bottom-right-radius: 10px;
}
.cv-rot {
  position: absolute; left: 50%; top: -22px; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: #607dff; border: 2px solid #0b0c10;
  cursor: grab; z-index: 3;
}

/* 左侧节点栏 */
.cv-dock {
  flex: none; width: 72px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #101118, #0b0c11);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 7px; overflow-y: auto;
}
.cv-dock button {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 2px; border-radius: 11px; color: #8f93a3;
  font-size: 10px; letter-spacing: .2px; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.cv-dock button:hover {
  background: rgba(77,107,254,.14); border-color: rgba(96,125,255,.32);
  color: #d8e0ff; transform: translateY(-1px);
}
.cv-dock button:active { transform: scale(.97); }
.cv-dock button .icon { width: 20px; height: 20px; stroke-width: 1.65; }
.cv-dock-sep { width: 34px; height: 1px; background: var(--line-2); margin: 7px 0; flex: none; }

/* 空素材节点上传区 */
.cv-upload-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 100%; padding: 12px; text-align: center; color: var(--muted-2);
}
.cv-upload-box .icon { width: 22px; height: 22px; opacity: .55; }
.cv-upload-box b { font-size: 12px; color: var(--muted); }
.cv-upload-box span { font-size: 10px; line-height: 1.6; }
.cv-upload-btns { display: flex; gap: 6px; margin-top: 4px; }
.cv-upload-btns button {
  font-size: 10.5px; padding: 4px 10px; border-radius: 7px;
  border: 1px solid rgba(96,125,255,.45); color: #c5d0ff; background: rgba(77,107,254,.16);
}
.cv-upload-btns button:hover { background: rgba(77,107,254,.34); }

/* 通用小按钮 / 参数 */
.cv-mini {
  font-size: 10px; padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--line-2); color: #dfe3f0; background: rgba(255,255,255,.06);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.cv-mini:hover { background: rgba(77,107,254,.3); border-color: rgba(96,125,255,.5); }
.cv-param-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cv-param { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.cv-param > span { flex: none; width: 26px; }
.cv-param select { flex: 1; }
.cv-dir-note {
  font-size: 10px; line-height: 1.55; color: #aab8ff;
  background: rgba(77,107,254,.1); border: 1px solid rgba(77,107,254,.22);
  border-radius: 7px; padding: 6px 8px; word-break: break-all;
}

/* 时间线节点 */
.cv-k-timeline { display: flex; flex-direction: column; gap: 7px; padding: 9px; cursor: default; }
.cv-tl-strip {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; min-height: 62px; align-items: center;
}
.cv-tl-empty { font-size: 10px; color: var(--muted-2); line-height: 1.6; padding: 8px 2px; }
.cv-tl-card {
  position: relative; flex: none; width: 84px; height: 56px; border-radius: 7px;
  overflow: hidden; border: 1px solid var(--line-2); background: #0b0c10;
}
.cv-tl-card img, .cv-tl-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-tl-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 9px; color: var(--muted-2); }
.cv-tl-no { position: absolute; left: 3px; top: 3px; font-size: 8.5px; padding: 0 4px; border-radius: 4px; background: rgba(6,6,10,.78); }
.cv-tl-dur { position: absolute; right: 3px; top: 3px; font-size: 8.5px; padding: 0 4px; border-radius: 4px; background: rgba(6,6,10,.78); color: #9fe8c8; }
.cv-tl-ops { position: absolute; right: 2px; bottom: 2px; display: none; gap: 2px; }
.cv-tl-card:hover .cv-tl-ops { display: flex; }
.cv-tl-ops button {
  font-size: 8.5px; padding: 1px 3px; border-radius: 3px;
  background: rgba(6,6,10,.85); color: #fff; border: 1px solid rgba(255,255,255,.15);
}

/* 主体节点 */
.cv-k-subject { display: flex; flex-direction: column; gap: 7px; padding: 9px; cursor: default; }
.cv-subj-body { display: flex; gap: 8px; }
.cv-subj-img {
  flex: none; width: 96px; height: 116px; border-radius: 8px; overflow: hidden;
  background: #0b0c10; border: 1px solid var(--line); cursor: pointer;
  display: grid; place-items: center;
}
.cv-subj-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-subj-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted-2); font-size: 9.5px; text-align: center; padding: 4px; }
.cv-subj-empty .icon { width: 18px; height: 18px; opacity: .5; }
.cv-subj-form { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cv-subj-form textarea { flex: 1; resize: none; }

/* 导演工具箱 / 导演台 */
.cv-k-director, .cv-k-stage { display: flex; flex-direction: column; gap: 7px; padding: 9px; cursor: default; }
.cv-stage-svg { width: 100%; height: auto; border-radius: 8px; background: #0b0c10; border: 1px solid var(--line); display: block; }
.cv-stage-svg .st-frame { fill: transparent; stroke: rgba(255,255,255,.08); }
.cv-stage-svg .st-ground { stroke: rgba(255,255,255,.16); stroke-width: 1; }
.cv-stage-svg .st-subject { fill: rgba(96,125,255,.18); stroke: rgba(142,160,255,.8); stroke-width: 1.4; }
.cv-stage-svg .st-cam { fill: rgba(52,211,153,.18); stroke: rgba(52,211,153,.85); stroke-width: 1.4; }
.cv-stage-svg .st-ray { stroke: rgba(52,211,153,.45); stroke-width: 1; stroke-dasharray: 4 4; }
.cv-stage-svg .st-arc { fill: none; stroke: rgba(245,180,90,.7); stroke-width: 1.2; stroke-dasharray: 5 4; }
.cv-stage-svg .st-label { fill: #8b93a7; font-size: 7px; text-anchor: middle; }
.cv-a-out, .cv-a-in {
  position: absolute; top: 50%; width: 13px; height: 13px; margin-top: -6.5px;
  border-radius: 50%; background: #17181d; border: 2px solid #607dff;
  cursor: crosshair; z-index: 4; transition: transform .12s, background .12s;
}
/* 扩大连线锚点的可点击热区：视觉仍是小圆点，命中范围 34×48 */
.cv-a-out::before, .cv-a-in::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 48px; border-radius: 10px;
}
/* 连线锚点常态更醒目，悬停节点时放大，方便找到拖线起点 */
.cv-a-out { right: -7px; background: #607dff; box-shadow: 0 0 0 3px rgba(96,125,255,.18); }
.cv-a-in { left: -7px; border-color: #34d399; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.16); }
.cv-a-out:hover, .cv-a-in:hover { transform: scale(1.35); background: #607dff; }
.cv-a-first { border-color: #f5b45a; }
.cv-a-last { border-color: #c986f0; }

/* 连线 SVG */
.cv-links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 2; }
.cv-link { fill: none; stroke: rgba(96,125,255,.75); stroke-width: 2; }
.cv-link.is-sel { stroke: #8ea0ff; stroke-width: 2.6; filter: drop-shadow(0 0 4px rgba(96,125,255,.6)); }
.cv-link-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.cv-link-temp { fill: none; stroke: rgba(52,211,153,.85); stroke-width: 2; stroke-dasharray: 6 5; }
.cv-link-del { pointer-events: all; cursor: pointer; }
.cv-link-del circle { fill: #1d1e26; stroke: rgba(255,255,255,.25); }
.cv-link-del text { fill: #ffb4b4; font-size: 10px; text-anchor: middle; }
.cv-link-del:hover circle { fill: rgba(248,113,113,.3); }

/* 图层面板 */
.canvas-layers {
  width: 212px; flex: none; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; background: linear-gradient(180deg, #101118, #0b0c11);
}
.ly-head {
  display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 13px;
  border-bottom: 1px solid var(--line); font-size: 12.5px; flex: none;
}
.ly-head .icon { width: 14px; height: 14px; color: #9dadff; }
.ly-head span { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.ly-list { flex: 1; overflow-y: auto; padding: 8px; }
.ly-empty { font-size: 11.5px; color: var(--muted-2); text-align: center; padding: 26px 0; }
.ly-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: 8px; font-size: 11.5px; cursor: pointer; color: var(--text);
}
.ly-row:hover { background: rgba(255,255,255,.05); }
.ly-row.is-sel { background: rgba(77,107,254,.16); }
.ly-row.is-off .ly-name, .ly-row.is-off .ly-ico { opacity: .38; }
.ly-ico { width: 13px; height: 13px; color: #8ea0ff; flex: none; display: inline-flex; }
.ly-ico .icon { width: 13px; height: 13px; }
.ly-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-row em { font-size: 9.5px; color: var(--muted-2); font-style: normal; }
.ly-eye { color: var(--muted); padding: 3px; border-radius: 5px; display: grid; place-items: center; }
.ly-eye:hover { color: #fff; background: rgba(255,255,255,.08); }
.ly-eye .icon { width: 12px; height: 12px; }

.picker {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(3,3,6,.7); backdrop-filter: blur(8px);
  animation: fade .18s ease both;
}
.picker-inner {
  width: min(860px, 92vw); max-height: 80vh; overflow: auto;
  background: #0d0e12; border: 1px solid var(--line-2);
  border-radius: 16px; padding: 16px;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.picker-head b { font-size: 14px; }
.picker-head button { color: var(--muted); padding: 5px; border-radius: 7px; display: grid; place-items: center; }
.picker-head button:hover { color: #fff; background: rgba(255,255,255,.07); }

/* ---------------- Agent 助手 ---------------- */
.agent-wrap { display: flex; flex-direction: column; height: calc(100vh - 54px - 62px); max-width: 860px; margin: 0 auto; }
.agent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.agent-head h3 { margin: 0; font-size: 16px; }
.agent-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.agent-chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 12px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  animation: rise .25s ease both;
}
.msg.user .bubble { background: rgba(77,107,254,.2); border: 1px solid rgba(77,107,254,.4); border-bottom-right-radius: 4px; }
.msg.agent .bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.agent-empty {
  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 9px;
  text-align: center; padding: 30px 20px;
  border: 1px dashed var(--line-2); border-radius: 16px; max-width: 560px;
}
.agent-empty b { font-size: 15px; }
.agent-empty span { font-size: 12px; color: var(--muted); }
.agent-suggests { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 50% { opacity: .3; } }
.plan-card { margin-top: 9px; border: 1px solid var(--line-2); border-radius: 11px; background: #101116; padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.plan-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.plan-row .icon { width: 14px; height: 14px; color: #8ea4ff; flex: none; }
.plan-row .p {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: normal;
}
.plan-row .tags { display: flex; gap: 4px; flex: none; }
.plan-row .tags em { font-style: normal; font-size: 9.5px; color: var(--muted-2); background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; }
.plan-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-2); }
.plan-row.st-running .plan-dot { background: #7a5cff; animation: pulse 1s infinite; }
.plan-row.st-done .plan-dot { background: var(--green); }
.plan-row.st-failed .plan-dot { background: #f87171; }
.plan-foot { display: flex; align-items: center; gap: 10px; padding-top: 3px; flex-wrap: wrap; }
.plan-foot .note { font-size: 10px; color: var(--muted-2); }
.agent-input { display: flex; gap: 9px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.agent-input textarea {
  flex: 1; border: 1px solid var(--line-2); background: #101116;
  border-radius: 12px; padding: 11px 13px; font-size: 13px; outline: none;
}
.agent-input textarea:focus { border-color: rgba(77,107,254,.55); }
.agent-input .generate-btn { padding: 10px 22px; margin-left: 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  .body { display: block; height: auto; }
  .rail {
    flex-direction: row; position: sticky; top: 54px; z-index: 20;
    padding: 8px 10px; gap: 6px;
    border-right: none; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .rail-item { flex-direction: row; padding: 8px 11px; white-space: nowrap; }
  .rail-item .icon { width: 15px; height: 15px; }
  .rail-sep { display: none; }
  .main { padding: 16px 14px 36px; overflow: visible; }
  .edit-layout { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .logo-tag { display: none; }
  .controls { gap: 12px; }
  .generate-btn { width: 100%; justify-content: center; margin-left: 0; }
  .shot-list { grid-template-columns: 1fr; }
  .canvas-stage { height: 46vh; }
  .canvas-layers { display: none; }
  .canvas-hint { display: none; }
  .agent-wrap { height: auto; }
  .agent-chat { max-height: 56vh; flex: none; min-height: 300px; }
  .agent-input .generate-btn { width: auto; }
}

/* ============ 画布节点 2.0：即梦式预览框 + 生成面板 ============ */
.cv-k-t2i, .cv-k-vgen {
  display: flex; flex-direction: column; gap: 10px; padding: 0;
  background: transparent; border: none; box-shadow: none; cursor: default;
}
.cv-k-t2i:hover, .cv-k-vgen:hover { border: none; box-shadow: none; }
.cv-k-t2i.is-sel, .cv-k-vgen.is-sel {
  border: none; box-shadow: none;
  outline: 2px solid rgba(110,135,255,.75); outline-offset: 7px; border-radius: 14px;
}
.cv-gf { display: flex; flex-direction: column; gap: 7px; }
.cv-gf-bar { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11.5px; color: #9aa1b4; }
.cv-gf-bar .icon { width: 13px; height: 13px; opacity: .85; }
.cv-gf-bar b { font-weight: 500; color: #d3d9e8; }
.cv-gf-edit { padding: 1px 4px; border-radius: 5px; color: #7c8296; font-size: 11px; }
.cv-gf-edit:hover { color: #fff; background: rgba(255,255,255,.09); }
.cv-gf-frame {
  position: relative; width: calc(100% - 44px); margin: 0 auto; min-height: 120px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.3);
  background: #17181d; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cv-gf-body { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 11px; }
.cv-gf-body img, .cv-gf-body video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cv-gf-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #5f6474; font-size: 10.5px; padding: 10px; text-align: center; }
.cv-gf-empty .icon { width: 18px; height: 18px; opacity: .55; }
.cv-gf-plus {
  position: absolute; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; z-index: 3;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(18,19,25,.94);
  color: #b7bece; font-size: 13px; line-height: 1; display: grid; place-items: center; transition: all .14s;
}
.cv-gf-plus:hover { background: #4d6bfe; border-color: #4d6bfe; color: #fff; transform: translateY(-50%) scale(1.08); }
.cv-gf-plus-l { left: -21px; }
.cv-gf-plus-r { right: -21px; }
.cv-gp {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 7px; padding: 9px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, #1a1c25, #12141a);
  box-shadow: 0 16px 36px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.05);
}
.cv-gp-chips { position: relative; z-index: 2; display: flex; align-items: center; gap: 5px; }
.cv-gp-chip {
  font-size: 10.5px; padding: 4px 9px; border-radius: 8px; color: #cbd2e4;
  background: rgba(255,255,255,.055); border: 1px solid var(--line-2); transition: all .14s;
}
.cv-gp-chip:hover { background: rgba(77,107,254,.26); border-color: rgba(96,125,255,.55); color: #fff; }
.cv-gp-chips .cv-status { margin-left: auto; }
.cv-gp-prompt {
  width: 100%; border: none; outline: none; background: transparent; resize: none;
  min-height: 52px; max-height: 220px; padding: 1px 2px;
  overflow-y: auto; field-sizing: content;
  font-size: 12px; line-height: 1.62; color: var(--text); font-family: inherit;
}
.cv-gp-prompt::placeholder { color: #5b6172; }
.cv-gp-foot { display: flex; align-items: center; gap: 5px; }
.cv-gp-foot .cv-in { font-size: 10.5px; padding: 5px 6px; background: #1c1f28; color: #e8ebf3; }
.cv-gp-meta { display: flex; align-items: center; min-height: 14px; }
.cv-gp-meta .cv-refs { font-size: 10px; }
.cv-dd { position: relative; min-width: 0; }
.cv-dd-model { flex: 1 1 auto; }
.cv-dd-btn {
  width: 100%; display: flex; align-items: center; gap: 3px; padding: 5px 7px;
  border-radius: 8px; border: 1px solid var(--line-2); background: #1c1f28;
  color: #e8ebf3; font-size: 10.5px; white-space: nowrap; overflow: hidden;
}
.cv-dd-btn:hover { border-color: rgba(96,125,255,.55); }
.cv-dd-btn .icon { width: 11px; height: 11px; margin-left: auto; opacity: .65; flex: none; }
.cv-dd-list {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 60;
  min-width: 200px; max-width: 260px; padding: 4px; max-height: 260px; overflow-y: auto;
  background: #191c24; border: 1px solid var(--line-2); border-radius: 11px;
  box-shadow: 0 18px 42px rgba(0,0,0,.65);
}
.cv-dd-item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 7px; color: #e8ebf3; }
.cv-dd-item b { font-size: 11px; font-weight: 500; }
.cv-dd-item span { font-size: 9.5px; color: #7e8496; }
.cv-dd-item:hover { background: rgba(77,107,254,.26); }
.cv-dd-item.is-on { background: rgba(77,107,254,.34); }
.cv-send { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; padding: 0; display: grid; place-items: center; font-size: 15px; font-weight: 700; line-height: 1; }
.cv-send:disabled { opacity: .5; filter: grayscale(.4); }
.cv-k-image > img, .cv-k-video > video { width: 100%; height: 100%; object-fit: contain; background: #0b0c10; }
/* 音频节点：左侧图标 + 右侧文件名与播放器，横向排布不折行 */
.cv-audio {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0; writing-mode: horizontal-tb;
}
.cv-audio-ico {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(77,107,254,.16); color: #9dadff;
}
.cv-audio-ico .icon { width: 17px; height: 17px; }
.cv-audio-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cv-audio-name {
  font-size: 11.5px; font-weight: 500; color: #d3d9e8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cv-audio audio { width: 100%; height: 30px; display: block; }
select, select option { background-color: #1b1e26; color: #f2f3f7; }
select option:checked { background-color: #2b3350; }
select option:disabled { color: var(--muted-2); }

/* 3D 建模结果卡片 */
.m3-thumb { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(77,107,254,.22), #0b0c10 70%); }
.m3-thumb > .icon { width: 46px; height: 46px; color: rgba(150,170,255,.75); }
.m3-download { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4,4,8,.45); opacity: 0; transition: opacity .18s; }
.work-card:hover .m3-download { opacity: 1; }
.m3-download .lb-btn { pointer-events: auto; }
.cv-ctx {
  position: fixed; z-index: 120; min-width: 208px; max-height: 72vh; overflow-y: auto;
  padding: 6px; border-radius: 12px; border: 1px solid var(--line-2);
  background: #16181f; box-shadow: 0 22px 54px rgba(0,0,0,.66); animation: rise .12s ease both;
}
.cv-ctx-title { font-size: 10px; color: #6c7284; padding: 4px 9px 6px; }
.cv-ctx button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 9px; border-radius: 8px; font-size: 12px; color: #e8ebf3; }
.cv-ctx button:hover { background: rgba(77,107,254,.24); }
.cv-ctx button .icon { width: 14px; height: 14px; color: #9dadff; flex: none; }
.cv-k-t2i > .cv-tools, .cv-k-vgen > .cv-tools { display: none !important; }

/* ============ @ 提及浮层 ============ */
.cv-at {
  position: fixed; z-index: 130; width: 268px; max-height: 340px; overflow: hidden;
  display: flex; flex-direction: column; padding: 6px;
  background: #191c24; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0,0,0,.66); animation: rise .12s ease both;
}
.cv-at-head { font-size: 10px; color: #7d8496; padding: 3px 7px 6px; }
.cv-at-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.cv-at-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 5px 7px; border-radius: 8px; color: #e8ebf3;
}
.cv-at-item:hover { background: rgba(77,107,254,.26); }
.cv-at-thumb {
  width: 30px; height: 30px; border-radius: 6px; overflow: hidden; flex: none;
  background: #101219; display: grid; place-items: center; color: #7e8496;
}
.cv-at-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-at-thumb .icon { width: 15px; height: 15px; }
.cv-at-item b { font-size: 11.5px; font-weight: 500; }
.cv-at-item em { margin-left: auto; font-style: normal; font-size: 9.5px; color: #6f7488; }
.cv-at-empty { font-size: 11px; color: #7c8296; padding: 12px 8px; line-height: 1.6; }
.cv-at-foot { display: flex; gap: 4px; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line); }
.cv-at-foot button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 10px; padding: 5px 4px; border-radius: 7px; color: #cbd2e4;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-2);
}
.cv-at-foot button:hover { background: rgba(77,107,254,.26); color: #fff; }
.cv-at-foot .icon { width: 12px; height: 12px; }

/* ============ 放大提示词弹窗 ============ */
.cv-pm {
  position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center;
  background: rgba(4,5,8,.62); backdrop-filter: blur(3px); padding: 24px;
}
.cv-pm-box {
  width: min(1040px, 92vw); height: min(620px, 76vh);
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px;
  background: #14161d; border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.cv-pm-head { display: flex; align-items: center; gap: 10px; }
.cv-pm-head b { font-size: 14px; }
.cv-pm-refs { flex: 1; display: flex; gap: 6px; overflow-x: auto; min-width: 0; }
.cv-pm-ref {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 3px 8px 3px 3px; border-radius: 9px; background: rgba(255,255,255,.06);
  border: 1px solid var(--line-2); font-size: 10.5px; color: #cfd6e6;
}
.cv-pm-ref img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.cv-pm-ref .icon { width: 13px; height: 13px; }
.cv-pm-tip { font-size: 10.5px; color: #6f7488; }
.cv-pm-btn {
  font-size: 12px; font-weight: 600; color: #fff; padding: 6px 16px; border-radius: 9px;
  background: var(--grad); box-shadow: 0 6px 16px rgba(77,107,254,.32);
}
.cv-pm-btn:hover { filter: brightness(1.1); }
.cv-pm-collapse { color: #8b90a2; padding: 4px; border-radius: 7px; }
.cv-pm-collapse:hover { color: #fff; background: rgba(255,255,255,.08); }
.cv-pm-collapse .icon { width: 15px; height: 15px; }
#cvPmText {
  flex: 1; width: 100%; resize: none; outline: none;
  padding: 14px 16px; border-radius: 13px;
  background: #101219; border: 1px solid var(--line-2); color: var(--text);
  font-size: 14.5px; line-height: 1.8; font-family: inherit;
}
#cvPmText:focus { border-color: rgba(96,125,255,.6); }
#cvPmText::placeholder { color: #5b6172; }
.cv-pm-foot { font-size: 10.5px; color: #6f7488; }
.cv-pm-foot b { color: #9dadff; }
