/* ============================================================
   醉银绘 — OpenArt 风格暗色主题
   ============================================================ */

:root {
  --bg: #0b0b0f;
  --bg-deep: #060608;
  --panel: #141419;
  --panel-2: #1a1a21;
  --card: #1c1c24;
  --card-hover: #232330;
  --border: #26262f;
  --border-2: #32323d;
  --text: #f2f2f7;
  --text-2: #a2a2b0;
  --text-3: #6d6d7c;
  --pink: #ff2fae;
  --pink-2: #ff5cc8;
  --purple: #a02bff;
  --grad: linear-gradient(135deg, #ff2fae 0%, #c22bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,47,174,.16), rgba(160,43,255,.14));
  --glow: 0 4px 28px rgba(255, 47, 174, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 56px;
  --rail-w: 76px;
  --panel-w: 400px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100vh; display: flex; flex-direction: column; }
::selection { background: rgba(255, 47, 174, .4); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2c2c38; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a48; }
::-webkit-scrollbar-track { background: transparent; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,47,174,.12); }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; }

/* 内联 SVG 图标默认 16px；带显式尺寸规则的组件（.logo/.rail-item/.quick-tools/.aspect-item 等）自行覆盖 */
svg { width: 16px; height: 16px; flex: none; }
svg.art { width: 130px; height: 110px; }

/* ================= 通用组件 ================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; transition: all .18s ease;
  white-space: nowrap;
}
.btn-grad {
  background: var(--grad); color: #fff;
  box-shadow: 0 2px 18px rgba(255, 47, 174, .3);
}
.btn-grad:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: var(--glow); }
.btn-grad:active { transform: translateY(0); }
.btn-grad:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--card-hover); border-color: #40404e; }
.btn-danger { background: rgba(255, 70, 70, .12); color: #ff6b6b; border: 1px solid rgba(255,70,70,.25); }
.btn-danger:hover { background: rgba(255, 70, 70, .2); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; cursor: pointer; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active { background: var(--grad-soft); border-color: rgba(255,47,174,.5); color: #ffb3e2; }

.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; color: var(--text-2); transition: all .15s; flex: none;
}
.icon-btn:hover { background: var(--card-hover); color: var(--text); }
.icon-btn.danger:hover { color: #ff6b6b; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-new {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px;
  background: #3fff9e; color: #06331d; letter-spacing: .5px;
}
.badge-cost {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: rgba(255, 214, 10, .1); color: #ffd60a; border: 1px solid rgba(255,214,10,.25);
}

/* 开关 */
.switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #34343f; transition: all .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: all .2s;
}
.switch input:checked + .track { background: var(--pink); box-shadow: 0 0 12px rgba(255,47,174,.5); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ================= 顶栏 ================= */

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--bg-deep); border-bottom: 1px solid var(--border);
  position: relative; z-index: 40;
}
.logo { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.logo svg { width: 26px; height: 26px; }
.logo .name { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.logo .plan {
  font-size: 10px; font-weight: 700; color: #3fff9e; background: rgba(63,255,158,.1);
  border: 1px solid rgba(63,255,158,.3); padding: 1px 7px; border-radius: 6px;
}
.crumb { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; padding-left: 14px; border-left: 1px solid var(--border); }
.crumb b { color: var(--text); font-weight: 600; }
.crumb .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.topbar .spacer { flex: 1; }
.credits-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(63, 255, 158, .08); border: 1px solid rgba(63,255,158,.25);
  color: #3fff9e; font-weight: 700; font-size: 13.5px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff; cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255,255,255,.08);
}
.user-menu-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: 44px; width: 220px;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; z-index: 100;
  animation: pop .15s ease;
}
.user-menu .head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .head b { display: block; font-size: 14px; }
.user-menu .head span { font-size: 12px; color: var(--text-3); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: var(--text-2);
  text-align: left;
}
.menu-item:hover { background: var(--card-hover); color: var(--text); }
.menu-item.danger { color: #ff7a7a; }
.menu-item.danger:hover { background: rgba(255,80,80,.1); }

/* ================= 左侧图标栏 ================= */

.rail {
  width: var(--rail-w); flex: none;
  background: var(--bg-deep); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; gap: 6px; z-index: 30;
}
.rail-item {
  width: 60px; padding: 9px 0 7px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text-3); font-size: 11px; transition: all .18s; position: relative;
}
.rail-item svg { width: 21px; height: 21px; }
.rail-item:hover { color: var(--text); background: var(--panel-2); }
.rail-item.active {
  color: #fff;
  background: linear-gradient(160deg, rgba(255,47,174,.28), rgba(160,43,255,.22));
  border: 1px solid rgba(255, 47, 174, .55);
  box-shadow: 0 0 22px rgba(255, 47, 174, .25), inset 0 0 14px rgba(255,47,174,.1);
}
.rail-item .new-tag { position: absolute; top: -2px; right: 2px; }
.rail .flex1 { flex: 1; }

/* ================= 主布局 ================= */

.page-wrap { flex: 1; display: flex; min-height: 0; }
.page { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }

/* ================= 创作页 ================= */

.create-layout { flex: 1; display: flex; min-height: 0; }

.side-panel {
  width: var(--panel-w); flex: none;
  border-right: 1px solid var(--border); background: var(--bg);
  display: flex; flex-direction: column; min-height: 0;
}
.side-panel .panel-scroll {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 10px;
  display: flex; flex-direction: column;
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel-head h2 { font-size: 19px; font-weight: 700; flex: 1; }
.panel-foot {
  flex: none; padding: 14px 18px 16px;
  border-top: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; gap: 12px;
  position: sticky; bottom: 0; z-index: 8;
  box-shadow: 0 -12px 28px rgba(0,0,0,.32);
}

/* 模式卡片 */
.mode-row { display: flex; gap: 10px; margin-bottom: 14px; }
.mode-card {
  flex: 1; padding: 14px 10px 12px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 13px; font-weight: 600; transition: all .18s;
}
.mode-card .emoji { font-size: 22px; line-height: 1; filter: saturate(1.3); }
.mode-card:hover { border-color: var(--border-2); color: var(--text); transform: translateY(-1px); }
.mode-card.active {
  background: linear-gradient(160deg, rgba(255,47,174,.30), rgba(160,43,255,.25));
  border-color: rgba(255, 47, 174, .6); color: #fff;
  box-shadow: 0 0 26px rgba(255, 47, 174, .3), inset 0 0 18px rgba(255,47,174,.12);
}

/* 模型选择卡 */
.model-card {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; cursor: pointer; transition: all .15s;
  text-align: left;
}
.model-card:hover { border-color: var(--border-2); background: var(--panel-2); }
.model-card .micon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--card); border: 1px solid var(--border-2);
}
.model-card .meta { flex: 1; min-width: 0; }
.model-card .meta .label { font-size: 11px; color: var(--text-3); }
.model-card .meta .name { font-size: 14.5px; font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-card .chev { color: var(--text-3); }

/* 提示词卡 */
.prompt-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column;
  flex: 1; min-height: 220px;
}
.prompt-card .pc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.prompt-card .pc-head b { font-size: 14.5px; }
.prompt-card .pc-actions { display: inline-flex; align-items: center; gap: 2px; }
/* AI 提示词工具（增强/反推）请求进行中：图标旋转 + 半透明禁用态 */
.icon-btn.busy svg { animation: pc-tool-spin .9s linear infinite; }
.icon-btn:disabled { opacity: .5; cursor: progress; }
@keyframes pc-tool-spin { to { transform: rotate(360deg); } }
.prompt-card textarea {
  width: 100%; min-height: 120px; flex: 1; resize: none; padding: 11px 12px;
  font-size: 13.5px; line-height: 1.65; background: var(--bg-deep);
}
.prompt-card textarea::placeholder { color: var(--text-3); }
.prompt-tools {
  display: flex; align-items: center; gap: 4px; margin-top: 10px;
}
.prompt-tools .grow { flex: 1; }

/* 参考图上传 */
.ref-box {
  border: 1.5px dashed rgba(255, 47, 174, .55); border-radius: var(--radius);
  background: rgba(255, 47, 174, .05); padding: 13px 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: all .15s; margin-bottom: 12px;
}
.ref-box:hover { background: rgba(255, 47, 174, .1); border-color: var(--pink); }
.ref-box .thumb-stack { display: flex; }
.ref-box .thumb-stack i {
  width: 30px; height: 30px; border-radius: 8px; background: var(--grad-soft);
  border: 1px solid rgba(255,47,174,.4); display: block; margin-left: -8px;
}
.ref-box .thumb-stack i:first-child { margin-left: 0; }
.ref-box .txt { flex: 1; min-width: 0; }
.ref-box .txt b { font-size: 13.5px; display: flex; gap: 7px; align-items: center; }
.ref-box .txt b .opt { font-size: 11px; color: var(--text-3); font-weight: 400; }
.ref-box .txt span { font-size: 11.5px; color: var(--text-3); }
.ref-box .count { font-size: 12px; color: var(--pink-2); font-weight: 600; }

.ref-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ref-thumb {
  width: 62px; height: 62px; border-radius: 10px; overflow: hidden; position: relative;
  border: 1px solid var(--border-2);
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumb .rm {
  position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; font-size: 11px; line-height: 17px; text-align: center;
}
.ref-thumb .rm:hover { background: var(--pink); }
.ref-thumb .mk {
  position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 6px;
  background: rgba(0,0,0,.7); color: #fff; display: flex; align-items: center; justify-content: center;
}
.ref-thumb .mk svg { width: 11px; height: 11px; }
.ref-thumb .mk:hover { background: var(--pink); }

/* 遮罩状态条 */
.mask-chip {
  display: flex; align-items: center; gap: 8px; margin: -6px 0 14px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--grad-soft); border: 1px solid rgba(255,47,174,.4);
  color: #ffb3e2; font-size: 12.5px;
}
.mask-chip svg { width: 14px; height: 14px; color: var(--pink-2); }
.mask-chip span { flex: 1; }
.mask-chip .rm {
  width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.35);
  color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.mask-chip .rm:hover { background: var(--pink); }

.opt-hint { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 6px; }

/* 参考图选择表单：拖入区 + 历史上传点选网格 */
.refpick-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 16px; margin-bottom: 14px;
  border: 1.5px dashed var(--border-2); border-radius: 12px;
  background: var(--bg-deep); transition: border-color .15s, background .15s;
}
.refpick-drop .rd-icon { width: 26px; height: 26px; color: var(--text-3); }
.refpick-drop .rd-icon svg { width: 100%; height: 100%; }
.refpick-drop b { font-size: 13.5px; }
.refpick-drop .rd-hint { font-size: 11.5px; color: var(--text-3); }
.refpick-drop .rd-note { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.refpick-drop.drag {
  border-color: var(--pink); background: rgba(255, 47, 174, .06);
}
.refpick-drop.busy { opacity: .6; pointer-events: none; }
.refpick-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.refpick-head b { font-size: 13px; }
.refpick-head .pm-dim { margin-left: auto; }
/* 弹层内的来源筛选 seg：紧凑版（上传素材 / 生成素材） */
.refpick-src { flex: none; width: 220px; padding: 3px; }
.refpick-src button { flex: 1; padding: 5px 0; font-size: 12px; }
.refpick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px;
  max-height: 40vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-deep); padding: 8px;
}
.refpick-tile {
  position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  border: 1.5px solid transparent; padding: 0; cursor: pointer; background: none;
}
.refpick-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.refpick-tile:hover { border-color: var(--border-2); }
.refpick-tile.on { border-color: var(--pink); }
.refpick-tile.on::after {
  content: ''; position: absolute; inset: 0; background: rgba(255, 47, 174, .14); pointer-events: none;
}
.refpick-tile .rp-mark {
  position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; display: none; align-items: center; justify-content: center;
}
.refpick-tile .rp-mark svg { width: 10px; height: 10px; }
.refpick-tile.on .rp-mark { display: flex; background: var(--pink); }
.refpick-tile.used { cursor: default; opacity: .45; }
.refpick-tile.used::after { content: none; }
.refpick-tile .rp-used {
  position: absolute; left: 5px; bottom: 5px; font-size: 10px; padding: 1px 6px;
  border-radius: 999px; background: rgba(0,0,0,.7); color: #ddd;
}
.refpick-empty {
  grid-column: 1 / -1; text-align: center; padding: 26px 14px;
  font-size: 12.5px; color: var(--text-3); line-height: 1.7;
}

/* 任务卡中间图预览 */
.task-card .skeleton { position: relative; overflow: hidden; }
.task-card .pp {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .85; filter: blur(0px);
}

/* 收藏星标 */
.icon-btn.fav-on { color: #ffd60a; }
.icon-btn.fav-on:hover { color: #ffe066; }

/* 遮罩编辑器 */
.mask-hint { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.mask-toolbar { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.mask-toolbar .mask-size-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.mask-toolbar .mask-size-wrap input { width: 110px; }
.mask-toolbar .chip.active { background: var(--grad-soft); border-color: rgba(255,47,174,.5); color: #ffb3e2; }
.mask-toolbar .mask-dim { font-size: 12px; color: var(--text-3); }
.mask-stage {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background:
    repeating-conic-gradient(#22222b 0% 25%, #1a1a21 0% 50%) 0 0 / 18px 18px;
  border: 1px solid var(--border-2);
  max-height: 58vh; display: flex; justify-content: center;
  touch-action: none;
}
.mask-wrap { position: relative; display: inline-block; max-width: 100%; max-height: 58vh; }
.mask-wrap #mask-img-cv { display: block; max-width: 100%; max-height: 58vh; width: auto; height: auto; }
.mask-wrap #mask-paint-cv { position: absolute; inset: 0; width: 100%; height: 100%; cursor: none; }
.mask-cursor {
  position: fixed; display: none; pointer-events: none; z-index: 10;
  border: 1.5px solid rgba(255,255,255,.85); border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.4);
}

/* 灯箱：实际参数回显 */
.lb-actual-tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: var(--grad-soft); color: #ffb3e2; vertical-align: 2px; margin-left: 6px;
}
.revised-box {
  margin-top: 9px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bg-deep); border: 1px solid var(--border);
}
.revised-box .k { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.revised-box .v { font-size: 12.5px; color: var(--text-2); line-height: 1.7; max-height: 120px; overflow: auto; word-break: break-all; }


/* 首尾帧 */
.frames-row { display: flex; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.frame-slot {
  flex: 1; aspect-ratio: 4/3; border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--text-3); font-size: 12.5px; cursor: pointer; transition: all .15s;
  position: relative; overflow: hidden; text-align: center; padding: 6px;
}
.frame-slot:hover { border-color: var(--pink); color: var(--text-2); }
.frame-slot.has-img { border-style: solid; padding: 0; }
.frame-slot img { width: 100%; height: 100%; object-fit: cover; }
.frame-slot .fx {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: rgba(10,10,14,.55); opacity: 0; transition: opacity .15s; font-size: 12px; color: #fff;
}
.frame-slot.has-img:hover .fx { opacity: 1; }
.frames-swap { align-self: center; color: var(--text-3); flex: none; }

/* 输出设置卡 */
.output-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px; cursor: pointer;
}
.output-card .oc-row { display: flex; align-items: center; gap: 12px; }
.output-card .oc-icon {
  width: 34px; height: 34px; border-radius: 10px; background: var(--card);
  border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.output-card .meta { flex: 1; }
.output-card .meta .label { font-size: 11px; color: var(--text-3); }
.output-card .meta .val { font-size: 14px; font-weight: 600; margin-top: 1px; }

/* 输出弹层 */
.output-pop {
  position: fixed; z-index: 90; width: 560px; max-width: calc(100vw - 40px);
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px;
  box-shadow: var(--shadow); padding: 18px; animation: pop .16s ease;
}
.output-pop h3 { font-size: 16px; margin-bottom: 14px; }
.output-pop .sec-label { font-size: 13px; color: var(--text-2); margin: 12px 0 8px; }
.output-pop .modal-foot { display: flex; justify-content: flex-end; } /* 弹层不在 .modal 内，完成按钮需显式右对齐 */

.aspect-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.aspect-grid.n7 { grid-template-columns: repeat(7, 1fr); }
.aspect-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 2px 7px; border-radius: 10px; border: 1px solid transparent;
  color: var(--text-3); font-size: 11px; transition: all .13s;
}
.aspect-item svg { width: 20px; height: 26px; }
.aspect-item:hover { color: var(--text); background: var(--card); }
.aspect-item.active { color: #fff; background: var(--card-hover); border-color: rgba(255,47,174,.6); }
.aspect-item.active svg rect, .aspect-item.active svg .rr { stroke: var(--pink); }

.seg { display: flex; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 11px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; padding: 8px 0; border-radius: 8px; font-size: 13px; color: var(--text-2); font-weight: 600;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--card-hover); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,47,174,.4); }

.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--pink); background: transparent; border: none; }
.slider-row .v { min-width: 40px; text-align: center; font-weight: 700; color: var(--pink-2); }

/* 数量步进器 */
.stepper {
  display: flex; align-items: center; gap: 2px; background: var(--panel-2);
  border: 1px solid var(--border-2); border-radius: 12px; padding: 4px;
}
.stepper button { width: 34px; height: 34px; border-radius: 9px; font-size: 17px; color: var(--text-2); }
.stepper button:hover { background: var(--card-hover); color: #fff; }
.stepper .num { min-width: 52px; text-align: center; font-weight: 800; font-size: 15px; }
.stepper .num small { color: var(--text-3); font-weight: 500; font-size: 12px; }

.gen-btn {
  flex: 1; height: 46px; border-radius: 13px; font-size: 15.5px; font-weight: 800;
  background: var(--grad); color: #fff; letter-spacing: .5px;
  box-shadow: 0 4px 26px rgba(255, 47, 174, .4);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: all .18s;
}
.gen-btn svg { width: 17px; height: 17px; }
.gen-btn:hover { filter: brightness(1.12); box-shadow: 0 6px 34px rgba(255, 47, 174, .55); transform: translateY(-1px); }
.gen-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }

/* 底部快捷工具条 */
.quick-tools { display: none; }
.quick-tools .qt { 
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); position: relative; transition: all .15s;
}
.quick-tools .qt { width:34px; height:34px; padding:0; border-radius:9px; font-size:0; }
.quick-tools .qt:hover,.quick-tools .qt.active { background:var(--card-hover); box-shadow:0 0 0 1px var(--border-2),0 4px 14px rgba(255,47,174,.16); }
.quick-tools .qt:hover { color: var(--text); background: var(--panel-2); }
.quick-tools .qt.active { background: var(--card-hover); color: #fff; box-shadow: inset 0 0 0 1px var(--border-2); }
.quick-tools .qt svg { width: 20px; height: 20px; }
.quick-tools .new-tag { position: absolute; top: -1px; right: -3px; }

/* ================= 画布区 ================= */

.canvas { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.canvas-toolbar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.canvas-toolbar .chip { flex: none; white-space: nowrap; }
.canvas-toolbar .grow { flex: 1; }
.zoom-ctrl { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.zoom-ctrl input { accent-color: var(--pink); width: 90px; }

.canvas-body { flex: 1; overflow-y: auto; padding: 20px; }

.masonry { column-gap: 14px; }
.masonry .m-item { break-inside: avoid; margin-bottom: 14px; }
.plaza-sentinel { height: 1px; width: 100%; }

.work-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  cursor: pointer; transition: all .18s;
}
.work-card:hover { border-color: rgba(255,47,174,.5); box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 18px rgba(255,47,174,.12); transform: translateY(-2px); }
.work-card .media { width: 100%; position: relative; background: #101016; }
/* height:100% + cover：横条 flex 拉伸卡片时媒体图铺满媒体盒（无空底）；
 * 未拉伸（masonry，媒体盒即 aspect-ratio 高度）时与 height:auto 渲染一致；媒体盒无定高时回退自然高 */
.work-card .media img, .work-card .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-card .type-badge {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,.12);
}
.work-card .hover-mask {
  position: absolute; inset: 0; opacity: 0; transition: opacity .18s;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.05) 40%, rgba(0,0,0,.72) 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 12px;
}
.work-card:hover .hover-mask { opacity: 1; }
.hover-mask .prompt-line {
  font-size: 12px; color: #e8e8ee; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.hover-mask .actions { display: flex; align-items: center; gap: 6px; }
.hover-mask .actions .spacer { flex: 1; }
.hover-mask .actions .icon-btn { background: rgba(20,20,26,.75); backdrop-filter: blur(6px); color: #fff; }
.hover-mask .actions .icon-btn:hover { background: var(--pink); }
.hover-mask .actions .icon-btn.shared-on { color: #3fff9e; }
.share-chip {
  position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; display: flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12);
}
.share-chip.pub { color: #3fff9e; }
.share-chip.pri { color: #ffb14d; }
.like-chip {
  position: absolute; bottom: 10px; left: 10px; font-size: 11.5px; color: #fff;
  display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
}
.owner-chip {
  position: absolute; bottom: 10px; right: 10px; font-size: 11px; color: #ddd;
  padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
}

/* 任务占位骨架 */
.task-card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); overflow: hidden; position: relative;
}
.task-card .skeleton { width: 100%; position: relative; background: linear-gradient(120deg, #15151c, #1d1d26, #15151c); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.task-card .prog { font-size: 15px; font-weight: 800; color: var(--pink-2); }
.task-card .st { font-size: 12px; color: var(--text-3); }
.task-card .cancel { margin-top: 2px; font-size: 12px; color: var(--text-3); text-decoration: underline; }
.task-card .cancel:hover { color: #ff7a7a; }
.task-card .sp { position: absolute; top: 10px; left: 10px; }

/* 空状态 */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 90px 20px; text-align: center; column-span: all; }
.empty-state .art { margin-bottom: 22px; opacity: .9; filter: drop-shadow(0 12px 30px rgba(255,47,174,.15)); }
.empty-state h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.empty-state p { color: var(--text-3); font-size: 14px; }

/* ================= 通用页面（广场/资产/设置/首页） ================= */

.page-inner { max-width: 1280px; margin: 0 auto; padding: 26px 30px 60px; }
.page-inner.page-inner-wide { width: 100%; max-width: none; margin: 0; }
.page-title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title-row h1 { font-size: 24px; font-weight: 800; }
.page-title-row .grow { flex: 1; }

.hero {
  position: relative; border-radius: 22px; overflow: hidden; padding: 54px 50px;
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(160,43,255,.35), transparent 60%),
    radial-gradient(500px 280px at 10% 110%, rgba(255,47,174,.28), transparent 60%),
    linear-gradient(160deg, #15151d, #0e0e14);
  border: 1px solid var(--border-2); margin-bottom: 28px;
}
.hero h1 { font-size: 40px; font-weight: 900; line-height: 1.25; letter-spacing: .5px; margin-bottom: 14px; }
.hero p { color: var(--text-2); font-size: 15.5px; line-height: 1.7; max-width: 620px; margin-bottom: 26px; }
.hero .cta { display: flex; gap: 14px; }
.hero .cta .btn { padding: 12px 28px; font-size: 15px; border-radius: 13px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.stat-card .num { font-size: 30px; font-weight: 900; margin-bottom: 3px; }
.stat-card .lbl { color: var(--text-3); font-size: 13px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 34px; }
.feature-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: all .18s; }
.feature-card:hover { border-color: rgba(255,47,174,.4); transform: translateY(-2px); }
.feature-card .fic { width: 44px; height: 44px; border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(255,47,174,.35); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; }
.feature-card b { display: block; font-size: 15.5px; margin-bottom: 7px; }
.feature-card p { color: var(--text-3); font-size: 13px; line-height: 1.65; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 16px; }
.section-title h2 { font-size: 19px; font-weight: 800; }

/* 横向滚动条带 */
.h-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.h-strip .work-card { width: 220px; flex: none; }
/* flex 默认 align-items:stretch 会把矮卡片拉到与最高卡片同高：
 * 媒体盒撑满卡片（aspect-ratio 在卡片无定高时仍按比例兜底），媒体图再以 cover 铺满，消除横向图的空底 */
.h-strip .work-card .media { height: 100%; }

/* 认证页 */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px; position: relative; overflow: hidden; }
.auth-wrap::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(700px 400px at 80% 10%, rgba(160,43,255,.22), transparent 60%),
    radial-gradient(600px 380px at 15% 90%, rgba(255,47,174,.18), transparent 60%);
}
.auth-card {
  position: relative; width: 420px; max-width: 94vw;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 20px;
  padding: 34px 34px 28px; box-shadow: var(--shadow);
}
.auth-card .logo { justify-content: center; margin-bottom: 8px; }
.auth-card .sub { text-align: center; color: var(--text-3); font-size: 13.5px; margin-bottom: 24px; }
.auth-tabs { display: flex; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--text-3); }
.auth-tabs button.active { background: var(--card-hover); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,47,174,.4); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.field input { width: 100%; padding: 11px 13px; font-size: 14px; }
.auth-card .submit { width: 100%; height: 46px; border-radius: 12px; font-size: 15px; margin-top: 6px; }
.auth-hint { margin-top: 18px; padding: 11px 13px; border-radius: 10px; background: rgba(63,255,158,.06); border: 1px solid rgba(63,255,158,.2); color: #8be8b8; font-size: 12px; line-height: 1.7; }

/* ================= 弹窗 / 抽屉 / 提示 ================= */

.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4,4,8,.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .15s ease;
}
.modal {
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 18px;
  width: 520px; max-width: 96vw; max-height: 88vh; overflow-y: auto;
  padding: 24px; box-shadow: var(--shadow); animation: pop .18s ease;
}
.modal.modal-wide { width: min(880px, 94vw); }
.modal h3 { font-size: 17px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* 大图预览 */
.lightbox {
  position: fixed; inset: 0; z-index: 210; display: flex;
  background: rgba(4,4,8,.88); backdrop-filter: blur(8px); animation: fade .15s ease;
}
.lightbox .lb-media { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px; min-width: 0; position: relative; }
.lightbox .lb-media img, .lightbox .lb-media video { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 80px rgba(0,0,0,.6); }
.lightbox .lb-media img[src$=".svg"] { max-height: 100%; }
.lightbox .lb-side {
  width: 360px; flex: none; background: rgba(14,14,20,.92); border-left: 1px solid var(--border-2);
  padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}
.lightbox .lb-side h4 { font-size: 13px; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.lightbox .prompt-box {
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 13px; line-height: 1.7; color: var(--text-2); max-height: 180px; overflow-y: auto;
}
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-grid .mg { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.meta-grid .mg .k { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.meta-grid .mg .v { font-size: 13px; font-weight: 600; word-break: break-all; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.lb-close { position: absolute; top: 18px; right: 22px; z-index: 5; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; font-size: 20px; color: #fff;
  background: rgba(20,20,28,.7); border: 1px solid var(--border-2); z-index: 5;
}
.lb-nav:hover { background: var(--pink); }
.lb-nav.prev { left: 18px; } .lb-nav.next { right: 18px; }

/* Toast */
#toasts { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 10px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: rgba(24, 24, 32, .95); border: 1px solid var(--border-2); color: var(--text);
  box-shadow: var(--shadow); animation: slideDown .2s ease;
}
.toast.ok { border-color: rgba(63,255,158,.4); color: #8be8b8; }
.toast.err { border-color: rgba(255,90,90,.45); color: #ff9c9c; }

/* 模型选择器 */
.model-list { display: flex; flex-direction: column; gap: 9px; }
.model-opt {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px;
  border-radius: 13px; border: 1px solid var(--border); background: var(--panel-2);
  cursor: pointer; transition: all .14s; text-align: left; width: 100%;
}
.model-opt:hover { border-color: var(--border-2); background: var(--card-hover); }
.model-opt.sel { border-color: var(--pink); background: var(--grad-soft); }
.model-opt .micon { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; background: var(--card); border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; flex: none; }
.model-opt .meta { flex: 1; min-width: 0; }
.model-opt .meta b { display: block; font-size: 14px; margin-bottom: 2px; }
.model-opt .meta span { font-size: 12px; color: var(--text-3); line-height: 1.4; display: block; }

/* 密钥页 */
.key-doc { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; font-family: Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.8; color: #b8b8c8; overflow-x: auto; white-space: pre; }
.key-doc .c1 { color: #ff7ac2; } .key-doc .c2 { color: #7adcff; } .key-doc .c3 { color: #9d9daf; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
table.data-table tr:hover td { background: rgba(255,255,255,.02); }
.card-block { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.card-block h3 { font-size: 16px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.card-block .desc { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.secret-reveal {
  display: flex; align-items: center; gap: 10px; background: rgba(63,255,158,.07);
  border: 1px dashed rgba(63,255,158,.4); border-radius: 10px; padding: 13px 15px; margin-top: 14px;
}
.secret-reveal code { flex: 1; font-family: Consolas, monospace; font-size: 13px; color: #8be8b8; word-break: break-all; }

.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row .meta { flex: 1; }
.set-row .meta b { display: block; font-size: 14px; margin-bottom: 2px; }
.set-row .meta span { font-size: 12.5px; color: var(--text-3); }

/* 加载 */
.spin { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--pink); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--text-3); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } }

@media (max-width: 1100px) {
  :root { --panel-w: 340px; }
  .feature-grid, .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .side-panel { display: none; }
  .hero h1 { font-size: 28px; }
  .hero { padding: 34px 26px; }
}
@media (max-width: 680px) {
  .set-row { align-items: flex-start; flex-wrap: wrap; }
  .set-row .meta { flex: 0 0 100%; min-width: 0; }
  .set-row > input { flex: 1 1 180px; max-width: calc(100% - 74px); }
  #p-name, #p-url, #p-key, #p-price { grid-column: 1 / -1; }
  .task-error-row summary { align-items: flex-start; padding: 11px; }
  .task-error-id { display: none; }
  .task-error-detail { padding: 12px; }
}

/* ---------- 上游供应商：模型选择弹层 ---------- */
.prov-add-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.mp-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.mp-toolbar input { flex: 1; padding: 9px 12px; font-size: 13px; }
.mp-toolbar .chip { display: inline-flex; align-items: center; }
.mp-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-deep); padding: 6px; }
.mp-group { font-size: 11.5px; color: var(--text-3); font-weight: 600; padding: 8px 8px 4px; letter-spacing: .4px; }
.mp-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.mp-item:hover { background: rgba(255, 255, 255, .04); }
.mp-item.on { background: rgba(255, 47, 174, .08); }
.mp-item input { accent-color: #ff2fae; width: 15px; height: 15px; flex: none; }
.mp-item .mp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, "Courier New", monospace; }
.mp-kind { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-3); flex: none; }
.mp-kind.k-image { color: #7cc8ff; border-color: rgba(124, 200, 255, .35); }
.mp-kind.k-video { color: #ffb35c; border-color: rgba(255, 179, 92, .35); }

/* ================= 用量概览 & 管理后台 ================= */

.usage-head { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.usage-chip { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 88px; }
.usage-chip .n { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.usage-chip .l { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.usage-chip.warn { border-color: rgba(255, 120, 120, .35); }
.usage-chip.warn .n { color: #ff9c9c; }

.usage-chart { display: flex; align-items: flex-end; gap: 5px; height: 92px; margin: 4px 0 6px; }
.u-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 4px; border-radius: 5px 5px 2px 2px; background: rgba(255, 255, 255, .045); overflow: hidden; }
.u-bar.empty { background: rgba(255, 255, 255, .03); }
.u-bar .seg-i { background: linear-gradient(180deg, var(--pink-2), rgba(255, 47, 174, .3)); border-radius: 2px; }
.u-bar .seg-v { background: linear-gradient(180deg, #7adcff, rgba(90, 180, 255, .28)); border-radius: 2px; }
.usage-dates { display: flex; gap: 5px; }
.usage-dates span { flex: 1; text-align: center; font-size: 10px; color: var(--text-3); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .dot-i { background: var(--pink-2); }
.legend .dot-v { background: #7adcff; }

/* ================= 标签 / 合集 / 模板 / 多选（创作工作流扩展） ================= */

/* 作品卡上的标签行 */
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 7px; }
.tag-chip {
  font-size: 11px; line-height: 1; padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 47, 174, .16); color: #ffb3e2; border: 1px solid rgba(255, 47, 174, .28);
  backdrop-filter: blur(6px);
}

/* 多选圆点 */
.sel-mark {
  position: absolute; top: 10px; left: 10px; z-index: 6;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .8); background: rgba(10, 10, 16, .35);
  display: flex; align-items: center; justify-content: center;
  color: transparent; cursor: pointer; transition: all .15s; padding: 0;
}
.sel-mark svg { width: 14px; height: 14px; }
.work-card.sel-on .sel-mark { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 0 10px rgba(255, 47, 174, .55); }
.work-card.sel-on .media { outline: 2px solid var(--pink); outline-offset: -2px; }

/* 批量操作条（固定底部） */
.sel-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 1300;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 16px;
  background: rgba(18, 18, 26, .92); border: 1px solid var(--border-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); backdrop-filter: blur(14px);
  animation: selbar-in .18s ease;
}
@keyframes selbar-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.sel-bar .n { font-size: 12.5px; color: var(--text-2); margin-right: 2px; white-space: nowrap; }
.sel-bar button {
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font-size: 12.5px; padding: 6px 13px; border-radius: 9px; cursor: pointer; transition: all .15s;
}
.sel-bar button:hover { border-color: var(--pink); color: #ffb3e2; }
.sel-bar button.danger:hover { border-color: #ff5c5c; color: #ff8c8c; }
.sel-bar button.ghost { background: transparent; color: var(--text-3); }

/* 浮层（筛选等） */
.pop-menu {
  position: fixed; z-index: 1200; padding: 14px;
  background: #16161f; border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.pm-title { font-size: 11.5px; color: var(--text-3); letter-spacing: .5px; margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; }
.pm-body { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pm-body.pm-col { flex-direction: column; align-items: stretch; }
.pm-dim { font-size: 12px; color: var(--text-3); }
.pm-foot { display: flex; justify-content: flex-end; margin-top: 2px; }
.pm-clear { background: none; border: none; color: var(--text-3); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 2px 4px; }
.pm-clear:hover { color: var(--text); }
.pm-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: all .15s;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2);
}
.pm-chip i { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.pm-chip:hover { color: var(--text); border-color: var(--border-2); }
.pm-chip.on { background: var(--grad-soft); border-color: rgba(255, 47, 174, .5); color: #ffb3e2; }
.pm-chip b { font-weight: 400; margin-left: 2px; opacity: .7; cursor: pointer; }
.pm-chip b:hover { opacity: 1; }
.pm-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text-2); font-size: 13px; cursor: pointer; transition: all .15s; text-align: left;
}
.pm-row svg { width: 15px; height: 15px; flex: none; }
.pm-row .pm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-row i { font-style: normal; font-size: 11px; color: var(--text-3); }
.pm-row:hover { border-color: var(--border-2); color: var(--text); }
.pm-row.on { border-color: rgba(255, 47, 174, .5); color: #ffb3e2; }

/* 弹窗内的输入行 / 列表（合集 / 模板 / 历史） */
.tag-input-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.tag-input-row input { flex: 1; padding: 9px 12px; font-size: 13px; border-radius: 10px; }
.col-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.col-row { display: flex; align-items: center; gap: 8px; }
.col-row .icon-btn { opacity: .45; }
.col-row:hover .icon-btn { opacity: 1; }
.col-toggle {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; transition: all .15s; text-align: left;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2);
}
.col-toggle:hover { border-color: var(--border-2); color: var(--text); }
.col-toggle .cb {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  border: 1.5px solid var(--border-2); background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.col-toggle .cb svg { width: 13px; height: 13px; }
.col-row.on .col-toggle { border-color: rgba(255, 47, 174, .5); color: var(--text); }
.col-row.on .cb { background: var(--pink); border-color: var(--pink); color: #fff; }
.col-toggle .pm-name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.col-toggle i { font-style: normal; font-size: 11.5px; color: var(--text-3); flex: none; }
.ph-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; transition: all .15s; text-align: left;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.ph-row:hover { border-color: rgba(255, 47, 174, .5); }
.ph-row .pm-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ph-row i { font-style: normal; font-size: 11px; color: var(--text-3); flex: none; }

/* 任务错误记录 */
.task-errors-intro { color: var(--text-2); font-size: 13px; line-height: 1.7; margin: -8px 0 12px; }
.task-errors-toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.task-errors-list { max-height: 54vh; overflow-y: auto; padding-right: 2px; }
.task-error-row { border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); margin-bottom: 8px; overflow: hidden; }
.task-error-row summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.task-error-row summary::-webkit-details-marker { display: none; }
.task-error-row summary::before { content: '›'; color: var(--text-3); font-size: 20px; line-height: 1; transform: rotate(0deg); transition: transform .15s; }
.task-error-row[open] summary::before { transform: rotate(90deg); color: var(--pink); }
.task-error-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.task-error-main b { color: #ff9c9c; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.task-error-main span { color: var(--text-3); font-size: 11.5px; }
.task-error-id { color: var(--text-3); font: 11px Consolas, monospace; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-error-detail { border-top: 1px solid var(--border); padding: 13px 15px 15px 42px; color: var(--text-2); font-size: 12.5px; line-height: 1.7; }
.task-error-detail > div + div { margin-top: 12px; }
.task-error-detail b { color: var(--text); font-size: 12px; }
.task-error-detail p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-error-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-3); font-size: 11.5px; }
.task-error-detail pre { margin-top: 5px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-deep); color: var(--text-2); font: 11.5px/1.6 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.task-errors-empty { padding: 38px 18px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; }
.task-errors-failed { color: #ff9c9c; }

/* 工具栏搜索 */
.search-chip { display: inline-flex; align-items: center; gap: 4px; }

/* ================= 评论 / 回收站 / 打包下载（v8 新增） ================= */

/* 可操作 Toast（带撤销等按钮） */
.toast.has-action { display: flex; align-items: center; gap: 12px; max-width: min(560px, 90vw); }
.toast-act {
  flex: none; font-size: 12.5px; font-weight: 700; color: var(--pink-2);
  border: 1px solid rgba(255, 47, 174, .45); background: rgba(255, 47, 174, .1);
  padding: 4px 12px; border-radius: 999px; transition: all .15s;
}
.toast-act:hover { background: var(--pink); color: #fff; }

/* 卡片评论角标（可点击；z-index 需高于 hover-mask 蒙层，否则被其拦截点击） */
.like-chip.cmt { cursor: pointer; transition: all .15s; z-index: 3; }
.like-chip.cmt:hover { background: rgba(255, 47, 174, .8); }
.like-chip.cmt svg { width: 13px; height: 13px; }

/* 回收站 */
.chip .trash-badge {
  font-style: normal; font-size: 10.5px; font-weight: 800; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 177, 77, .18); color: #ffb14d; border: 1px solid rgba(255, 177, 77, .4);
}
.chip.trash-on { border-color: rgba(255, 177, 77, .6); color: #ffcf8d; background: rgba(255, 177, 77, .1); }
.trash-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2); background: rgba(255, 177, 77, .07);
  border: 1px dashed rgba(255, 177, 77, .35); border-radius: 12px;
  padding: 10px 14px; margin: 4px 0 14px;
}
.trash-hint svg { color: #ffb14d; flex: none; }
.trash-hint b { color: #ffcf8d; }
.work-card.is-trashed .media img,
.work-card.is-trashed .media video { filter: grayscale(.75) brightness(.65); }

/* 灯箱评论区 */
.lb-cmt-sec .lb-cmt-n { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.lb-cmt-list { display: flex; flex-direction: column; gap: 12px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.lb-cmt { display: flex; gap: 9px; align-items: flex-start; }
.cmt-avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff3db8, #7a5cff);
}
.cmt-main { flex: 1; min-width: 0; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; }
.cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cmt-head b { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-head i { font-style: normal; font-size: 11px; color: var(--text-3); flex: none; }
.cmt-head .cmt-del { margin-left: auto; color: var(--text-3); opacity: 0; transition: opacity .15s; display: flex; }
.cmt-head .cmt-del svg { width: 12px; height: 12px; }
.lb-cmt:hover .cmt-del { opacity: 1; }
.cmt-head .cmt-del:hover { color: #ff8c8c; }
.cmt-text { font-size: 13px; line-height: 1.65; color: var(--text-2); word-break: break-word; white-space: pre-wrap; }
.lb-cmt-empty { font-size: 12.5px; color: var(--text-3); text-align: center; padding: 14px 0; }
.lb-cmt-input { display: flex; gap: 8px; margin-top: 10px; }
.lb-cmt-input input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 13px; border-radius: 10px; }
.lb-cmt-input .btn { flex: none; }

/* 多选操作条按钮（含图标） */
.sel-bar button { display: inline-flex; align-items: center; gap: 5px; }
.sel-bar button svg { width: 13px; height: 13px; }

/* 卡片媒体加载淡入（配合 onload 加 .loaded） */
.work-card .media img, .work-card .media video { transition: opacity .35s ease; }
.work-card .media img:not(.loaded), .work-card .media video:not(.loaded) {
  opacity: 0;
  background: linear-gradient(120deg, #15151c, #1d1d26, #15151c);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* 回收站提示条内的清空按钮靠右 */
.trash-hint .btn-danger { margin-left: auto; flex: none; }

/* 灵感库书签 */
.icon-btn.bmk-on { color: var(--pink); }

/* 敏感内容打码（nsfw_level > 0 的作品在广场打码展示，点击揭开） */
.work-card .media.nsfw img,
.work-card .media.nsfw video { filter: blur(22px) saturate(.75); transform: scale(1.08); }
.nsfw-veil {
  position: absolute; inset: 0; z-index: 4; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(12, 10, 18, .35); backdrop-filter: blur(2px);
}
.nsfw-veil .nsfw-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #ffd9ec;
  background: rgba(255, 47, 174, .55); border: 1px solid rgba(255, 47, 174, .8);
  padding: 3px 10px; border-radius: 999px;
}
.nsfw-veil .nsfw-hint { font-size: 11px; color: rgba(255,255,255,.85); }
.advanced-settings{margin-top:12px;border:1px solid var(--border);border-radius:12px;padding:10px;background:rgba(255,255,255,.02)}.advanced-settings summary{cursor:pointer;font-weight:700;color:var(--text-2);padding:4px}.advanced-settings[open] summary{color:var(--pink-2)}

/* Pixel-tech visual layer */
:root {
  --bg: #080b12;
  --bg-deep: #05070d;
  --panel: #101622;
  --panel-2: #151d2b;
  --card: #182232;
  --card-hover: #202d40;
  --border: #233149;
  --border-2: #334766;
  --cyan: #41e7ff;
  --lime: #9dff72;
  --pixel-grid: rgba(65,231,255,.045);
}
body {
  background-color: var(--bg);
  background-image: none;
}
body::before { content:""; position:fixed; inset:0; pointer-events:none; z-index:99; opacity:.06; background:repeating-linear-gradient(0deg, transparent 0 3px, #fff 4px); mix-blend-mode:overlay; }
.topbar { background:rgba(5,7,13,.92); box-shadow:0 1px 0 var(--cyan), 0 8px 30px rgba(0,0,0,.28); }
.logo .name, .panel-head h2, .page-title-row h1 { font-family:"Courier New", monospace; letter-spacing:1px; }
.logo svg, .rail-item.active, .btn-grad { filter: drop-shadow(0 0 8px rgba(65,231,255,.25)); }
.rail { background:rgba(5,7,13,.88); border-color:#1e3048; }
.rail-item { border-radius:4px; }
.rail-item.active { background:linear-gradient(135deg,rgba(65,231,255,.2),rgba(160,43,255,.22)); border-color:var(--cyan); box-shadow:0 0 18px rgba(65,231,255,.22), inset 0 0 12px rgba(65,231,255,.08); }
.card-block, .prompt-card, .output-card, .model-card, .mode-card, .task-card, .work-card { border-radius:6px; border-color:var(--border); box-shadow:0 10px 28px rgba(0,0,0,.16); }
.mode-card.active, .chip.active { border-color:var(--cyan); box-shadow:0 0 16px rgba(65,231,255,.18); }
.btn-grad { background:linear-gradient(135deg,#ff2fae,#7c5cff 55%,#28dfff); }
.credits-pill { color:var(--lime); border-color:rgba(157,255,114,.35); background:rgba(157,255,114,.08); }
.section-label, .field label { letter-spacing:.08em; text-transform:uppercase; color:var(--cyan); }
.page { scrollbar-color:#2b4565 transparent; }
@media (max-width: 860px) {
  :root { --rail-w:58px; --panel-w: min(360px, 42vw); }
  .rail-item { width:46px; font-size:10px; }
  .topbar { padding:0 10px; gap:8px; }
  .crumb { display:none; }
}
@media (max-width: 680px) {
  body::before { opacity:.035; }
  :root { --rail-w:0px; }
  .rail { display:none; }
  .create-layout { display:block; overflow:auto; }
  .side-panel { width:100%; border-right:0; }
  .panel-foot { position:sticky; }
  .topbar .credits-pill { display:none; }
}
.rive-showcase{display:grid;grid-template-columns:1fr 1.35fr;gap:28px;align-items:center;margin:30px 0;padding:26px;border:1px solid rgba(255,61,184,.22);background:linear-gradient(120deg,rgba(255,61,184,.08),rgba(93,45,255,.08));border-radius:12px;overflow:hidden}.rive-copy h2{margin:8px 0;font-size:26px}.rive-copy p{color:var(--text-2);line-height:1.7}.eyebrow{font-size:11px;letter-spacing:2px;color:#ff70c8}.rive-stage{min-height:220px;display:grid;place-items:center;background:#0b0b12;border-radius:8px}.rive-stage canvas{width:100%;height:260px}.rive-fallback{display:none;text-align:center;color:#ff70c8}.rive-fallback span{display:block;font-size:48px;animation:rive-pulse 1.5s infinite}.rive-fallback small{display:block;color:var(--text-3);margin-top:8px}@keyframes rive-pulse{50%{transform:scale(1.18);opacity:.55}}.rive-offline canvas{display:none}.rive-offline .rive-fallback{display:block}@media(max-width:700px){.rive-showcase{grid-template-columns:1fr}.rive-stage{min-height:180px}.rive-stage canvas{height:210px}}

/* ================= 社区能力：受控标签 / 关注系统 / 公开个人主页 ================= */

/* 卡片右下角：作者 chip + 关注按钮组合 */
.owner-wrap { position: absolute; bottom: 10px; right: 10px; display: flex; align-items: center; gap: 6px; z-index: 3; }
.owner-chip.owner-link {
  position: static; border: 1px solid rgba(255,255,255,.12); transition: all .15s; cursor: pointer;
  font-family: inherit;
}
.owner-chip.owner-link:hover { background: rgba(255,47,174,.75); color: #fff; }
.follow-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #fff;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #ff2fae, #c22bff); box-shadow: 0 2px 12px rgba(255,47,174,.4);
  transition: all .15s; white-space: nowrap;
}
.follow-chip svg { width: 12px; height: 12px; }
.follow-chip:hover { filter: brightness(1.15); transform: translateY(-1px); }
.follow-chip.on { background: rgba(0,0,0,.5); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.2); box-shadow: none; color: #ddd; }

/* 标签 chip 可点击态（广场 / 主页卡片） */
.tag-chip.tag-link { cursor: pointer; transition: all .15s; font-family: inherit; }
.tag-chip.tag-link:hover { background: rgba(66,232,255,.25); color: #fff; transform: translateY(-1px); }

/* 标签弹层：排序行与近期热度角标 */
.pm-toolbar-row { display: flex; gap: 6px; margin: 2px 0 8px; }
.pm-toolbar-row .pm-sort { flex: none; font-size: 11.5px; padding: 5px 10px; }
.pm-hot { margin-left: 6px; color: #ffb14d; font-style: normal; font-weight: 800; font-size: 10.5px; }

/* 标签编辑弹窗：受控词表自动补全下拉 */
.tag-ac { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-deep); }
.tag-ac .pm-chip { font-size: 12px; }

/* 公开个人主页（/u/:nickname） */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 22px 4px 14px; }
.profile-avatar .profile-avatar-icon { width: 64px; height: 64px; border-radius: 18px; font-size: 0; box-shadow: 0 6px 24px rgba(255,47,174,.3); }
.profile-id h1 { font-size: 24px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.profile-sub { color: var(--text-3); font-size: 13px; }
.profile-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 20px; }
.profile-stat { flex: 1; min-width: 96px; text-align: center; padding: 12px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.profile-stat b { display: block; font-size: 20px; color: var(--pink-2); }
.profile-stat span { font-size: 11.5px; color: var(--text-3); }

/* 灯箱：关注创作者按钮 */
.lb-follow.on { color: var(--pink); border-color: rgba(255,47,174,.45); }
.lb-follow svg { width: 13px; height: 13px; }

/* 设置页表格中的下拉 */
.field select { padding: 9px 12px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--border-2); color: var(--text); width: 100%; }


/* ================= 模型缩略图 + 双栏品牌选择器 + 能力标签（仅展示层） ================= */

/* 缩略图：micon 形状内嵌图片；图片加载失败时露出底色渐变（由 thumbHTML 内联） */
.mthumb { overflow: hidden; position: relative; }
.mthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* 创作页选择器：场景能力提示行 */
.mp2-scene { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.mp2-scene-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--bg-deep); color: var(--text-2); font-weight: 600; }
.mp2-scene-tag svg { width: 13px; height: 13px; }
.mp2-alltoggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); user-select: none; }
.mp2-alltoggle input { accent-color: #ff2fae; width: 14px; height: 14px; }

/* 双栏主体：左品牌 / 右模型 */
.mp2 { display: flex; gap: 14px; height: min(56vh, 460px); }
.mp2-side { width: 210px; flex: none; overflow-y: auto; border: 1px solid var(--border); border-radius: 13px; background: var(--bg-deep); padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.mp2-brand { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; border: none; background: transparent; color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 600; text-align: left; width: 100%; }
.mp2-brand:hover { background: rgba(255, 255, 255, .05); }
.mp2-brand.on { background: var(--grad-soft); }
.mp2-brand.on .mp2-bname { color: var(--pink); }
.mp2-brand.is-flat { cursor: default; }
.mp2-bname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp2-brand-n { font-size: 11px; color: var(--text-3); background: rgba(255, 255, 255, .07); border-radius: 999px; padding: 1px 7px; flex: none; }
.mp2-chev { width: 13px; height: 13px; opacity: .45; flex: none; }
.mp2-chev svg { width: 100%; height: 100%; }
.mp2-bicon { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.mp2-bicon-ph { display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .09); color: var(--text-2); font-weight: 700; font-size: 13px; }
.mp2-bicon-wrap { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .09); color: var(--text-2); font-weight: 700; font-size: 13px; }
.mp2-bicon-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.mp2-main { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 13px; background: var(--bg-deep); overflow: hidden; }
.mp2-main-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap; }
.mp2-main-head b { font-size: 15px; }
.mp2-sub { font-size: 12px; color: var(--text-3); }
.mp2-count { margin-left: auto; font-size: 12px; color: var(--text-3); flex: none; }
.mp2-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mp2-check { color: var(--pink); font-weight: 800; font-size: 16px; flex: none; }

/* 设置页模型弹层：能力标签 chips（点击切换，未点亮=不支持该能力） */
.mp-capwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mp-caps { display: flex; flex-wrap: wrap; gap: 5px; }
.cap-chip { font-size: 11px; line-height: 1.5; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--text-3); cursor: pointer; transition: all .12s; }
.cap-chip:hover { border-color: var(--border-2); color: var(--text-2); }
.cap-chip.on { border-color: rgba(255, 47, 174, .55); color: #ff9ed3; background: rgba(255, 47, 174, .10); }

@media (max-width: 720px) {
  .mp2 { flex-direction: column; height: auto; }
  .mp2-side { width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .mp2-brand { width: auto; flex: none; }
  .mp2-main { min-height: 260px; }
}
