/* ============ 主题变量 ============ */
:root {
  --bg: #f2f4f9;
  --bg-soft: #eceef6;
  --card: #ffffff;
  --card-2: #f7f8fc;
  --card-3: #eef0f7;
  --text: #1c2230;
  --muted: #68738a;
  --border: #e2e6f0;
  --border-strong: #d0d7e6;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --accent-soft: rgba(99, 102, 241, .1);
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, .1);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --err: #dc2626;
  --err-soft: rgba(220, 38, 38, .1);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 34px rgba(16, 24, 40, .12);
  --radius: 10px;
  --radius-sm: 8px;
  --topbar-bg: rgba(250, 251, 253, .86);
  --topbar-height: 62px;
  --panel-width: 316px;
}

[data-theme="dark"] {
  --bg: #0f1116;
  --bg-soft: #151922;
  --card: #181c26;
  --card-2: #1d2230;
  --card-3: #242a3a;
  --text: #e9ecf4;
  --muted: #9aa3b6;
  --border: #262d3d;
  --border-strong: #30384c;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --accent-soft: rgba(129, 140, 248, .14);
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --err: #f87171;
  --err-soft: rgba(248, 113, 113, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, .45);
  --topbar-bg: rgba(15, 17, 22, .86);
}

/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background .25s, color .25s;
}
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }
textarea { resize: vertical; line-height: 1.6; }
img, video { max-width: 100%; }

/* ============ 顶栏 ============ */
.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: relative;
  z-index: 60;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text b { font-size: 16px; white-space: nowrap; }
.tag {
  width: fit-content;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  background: var(--card-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}
.main-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mod-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 15px;
  font-size: 13.5px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.mod-tab:hover { color: var(--text); background: var(--card); }
.mod-tab { text-decoration: none; }
.mod-tab.active {
  color: #fff;
  background: var(--accent-grad);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .28);
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.service-pill {
  font-size: 11.5px;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.service-pill.unconfigured { color: var(--warn); background: var(--warn-soft); }
.service-pill.configured { color: var(--ok); background: var(--ok-soft); }
.api-setting-status { min-height: 22px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  transition: .18s;
}
.icon-btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.icon-btn.small { width: 30px; height: 30px; font-size: 15px; }

/* ============ 主布局 ============ */
.app-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

/* ============ 左侧素材库 ============ */
.library-panel {
  width: var(--panel-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.library-header {
  flex-shrink: 0;
  padding: 14px 14px 10px;
}
.library-header h3 { font-size: 15px; }
.lib-filters {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.lib-filter {
  flex: 1;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  transition: .18s;
}
.lib-filter:hover { color: var(--text); border-color: var(--border-strong); }
.lib-filter.active {
  color: #fff;
  background: var(--accent-grad);
  border-color: transparent;
  font-weight: 600;
}
.library-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px 14px 12px;
  overflow-y: auto;
  min-height: 96px;
}
.lib-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  padding: 0;
  overflow: hidden;
  transition: .18s;
}
.lib-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.lib-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--card-3);
}
.lib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lib-thumb.video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  background: linear-gradient(180deg, rgba(15, 18, 30, .08), rgba(15, 18, 30, .35));
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.lib-item-label {
  display: block;
  padding: 7px 8px 8px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-empty { grid-column: 1 / -1; }

/* ============ 最近任务 ============ */
.library-tasks {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--card-2);
}
.library-tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px 6px;
  font-size: 13px;
  font-weight: 600;
}
.task-count {
  min-width: 52px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
}
.task-filter { padding: 0 14px 8px; }
.task-filter summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 6px;
  list-style: none;
}
.task-filter summary::before { content: "筛选  "; color: var(--muted); }
.gallery-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  font-size: 12px;
  transition: .18s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent-grad); color: #fff; border-color: transparent; }
.filter-custom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  margin-top: 4px;
}
.filter-custom input[type="date"] {
  flex: 1;
  min-width: 0;
  padding: 5px 7px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
}
.filter-custom .filter-btn { font-size: 11.5px; padding: 5px 10px; }
#taskList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
}
#taskList .empty { padding: 24px 10px; }

/* ============ 中间舞台 ============ */
.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  position: relative;
}
.canvas-zone {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.canvas-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
}
#canvasTitle {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.canvas-controls { display: flex; gap: 6px; }
.canvas-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 14px;
  background:
    linear-gradient(45deg, rgba(20, 24, 40, .025) 25%, transparent 25%, transparent 75%, rgba(20, 24, 40, .025) 75%),
    linear-gradient(45deg, rgba(20, 24, 40, .025) 25%, transparent 25%, transparent 75%, rgba(20, 24, 40, .025) 75%),
    var(--card-2);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}
#stageImg, #stageVideo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform .2s ease;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  background: #fff;
}
.canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.ph-mark {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 10px 28px rgba(99, 102, 241, .32);
}

/* ============ 舞台模块（素材管理 / AI 对话） ============ */
.stage-module {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#mod-library:not([hidden]) { display: block; }
.stage-panel {
  height: 100%;
  overflow-y: auto;
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 18px; line-height: 1.3; }
.panel-head p { margin-top: 4px; font-size: 12px; color: var(--muted); }
.model-pill {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.manager-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}
.manager-col {
  min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

/* ============ 表单与通用组件 ============ */
.param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin: 14px 0;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
label { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  background: var(--card-2);
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--card);
}
textarea { min-height: 66px; }
select { cursor: pointer; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 108px;
  padding: 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: .18s;
}
.drop:hover, .drop.hover { border-color: var(--accent); background: var(--accent-soft); }
.drop b { font-size: 13.5px; color: var(--text); }
.drop span { font-size: 12px; }
.drop-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 16px;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 3px 10px rgba(99, 102, 241, .3);
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.thumbs img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.row-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--card-3);
  transition: .18s;
  white-space: nowrap;
}
.btn.primary {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 5px 16px rgba(99, 102, 241, .3);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, .38); }
.btn.danger { color: var(--err); background: var(--err-soft); }
.btn.danger:hover { background: color-mix(in srgb, var(--err-soft) 75%, var(--err)); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.msg { display: block; margin-top: 10px; font-size: 12.5px; color: var(--err); min-height: 16px; }

.seg {
  display: flex;
  gap: 4px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px;
}
.seg button {
  flex: 1;
  border: 0;
  border-radius: 6px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  transition: .18s;
}
.seg button.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--card);
  box-shadow: var(--shadow);
}

/* ============ 素材引用与列表 ============ */
.mini-actions { display: flex; align-items: center; gap: 6px; }
.mini-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--err);
  background: transparent;
  transition: .18s;
}
.mini-btn:hover { background: var(--err-soft); }
.mini-btn.neutral { color: var(--muted); }
.mini-btn.neutral:hover { color: var(--text); background: var(--card-3); }
.chip-count { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: .18s;
}
.chip:hover { border-color: var(--accent); }
.chip input { accent-color: var(--accent); }
.chip-empty { font-size: 12.5px; color: var(--muted); }
.chip-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 6px;
  width: 100%;
}
.chip-group-head b { font-size: 12.5px; }
.asset-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.asset {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.asset-card-main { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.asset-info { min-width: 0; }
.asset-preview-btn {
  width: 88px;
  height: 88px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-3);
  color: var(--muted);
}
.asset-preview-btn:not(:disabled):hover { border-color: var(--accent); box-shadow: var(--shadow); }
.asset-preview-btn img { width: 100%; height: 100%; display: block; object-fit: cover; }
.asset-preview-mark { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 12px; }
.lib-item:disabled { cursor: default; opacity: .7; }
.asset-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.asset-top b { font-size: 13.5px; }
.asset-tag {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.asset-url {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 7px;
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
}
.asset-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.asset-date { font-size: 11px; color: var(--muted); }

@media (max-width: 560px) {
  .asset-card-main { grid-template-columns: 68px minmax(0, 1fr); gap: 9px; }
  .asset-preview-btn { width: 68px; height: 68px; }
}

/* ============ 任务卡片 ============ */
.task {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 11px 12px;
  margin-bottom: 10px;
  transition: box-shadow .2s;
}
.task:hover { box-shadow: var(--shadow-lg); }
.task .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.task .id { font-weight: 600; font-size: 12.5px; }
.task .meta { font-weight: 400; color: var(--muted); font-size: 11px; }
.task .api-id { font-size: 10.5px; color: var(--muted); margin: 4px 0 0 10px; font-family: ui-monospace, Consolas, monospace; }
.task .time { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 0 10px; font-size: 11px; color: var(--muted); }
.task .time span { background: var(--card-3); padding: 2px 7px; border-radius: 6px; }
.task .log { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.55; }
.task-prompt-preview { display: block; width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-3); color: var(--text); text-align: left; font-size: 11px; line-height: 1.45; cursor: pointer; }
.task-prompt-preview span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); }
.task-prompt-preview em { display: block; margin-top: 3px; color: var(--accent); font-size: 10px; font-style: normal; }
.task-prompt-preview:hover { border-color: var(--accent); }
.prompt-view-card { width: min(720px, 94vw); }
.prompt-view-card textarea { width: 100%; min-height: 240px; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--card-3); color: var(--text); font: inherit; line-height: 1.6; }
.badge { border-radius: 999px; padding: 3px 10px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.badge.queued, .badge.running { background: var(--warn-soft); color: var(--warn); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.failed { background: var(--err-soft); color: var(--err); }
.badge.ended { background: var(--card-3); color: var(--muted); }
.badge.interrupted { background: var(--warn-soft); color: var(--warn); }
.plan {
  margin-top: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}
.plan b { color: var(--text); }
.imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.imgs figure { margin: 0; text-align: center; }
.imgs img {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-2);
  cursor: zoom-in;
  transition: .2s;
}
.imgs img:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.imgs video {
  width: 176px;
  height: 108px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
}
.imgs figcaption { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.out { font-size: 11.5px; color: var(--accent); margin-top: 7px; word-break: break-all; }
.out a { color: var(--accent); text-decoration: none; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 34px 16px; }

/* ============ 底部提示词条 ============ */
.prompt-dock {
  flex-shrink: 0;
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 12px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.dock-module {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.dock-main {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.ref-button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 52px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  white-space: nowrap;
  transition: .18s;
}
.ref-button:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.ref-plus {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  background: var(--accent-grad);
}
.ref-count {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}
#notes, #vPrompt {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  height: auto;
}
#imageModel, #resolution, #vModel, #vSize, #vResolution {
  width: 138px;
  flex-shrink: 0;
}
#vModel { width: 176px; }
.dock-main .btn { height: 52px; }
.dock-extras { min-height: 0; }
.dock-extras summary {
  width: fit-content;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  padding: 3px 0;
}
.dock-extras summary::before { content: "展开 "; }
.dock-extras details[open] summary::before { content: "收起 "; }
.dock-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 14px;
  max-height: 210px;
  overflow-y: auto;
  padding: 12px;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dock-params .field { min-width: 0; }

/* ============ 本地 AI 助手 ============ */
#mod-extra:not([hidden]) { display: flex; }
.qwen-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--card);
  padding: 16px;
  gap: 12px;
}
.qwen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qwen-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qwen-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 3px 10px rgba(99, 102, 241, .35);
}
.qwen-meta { display: flex; flex-direction: column; min-width: 0; }
.qwen-meta b { font-size: 15px; line-height: 1.3; }
.qwen-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status {
  flex-shrink: 0;
  font-size: 11.5px;
  border-radius: 999px;
  padding: 5px 10px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-status.ok { background: var(--ok-soft); color: var(--ok); }
.chat-status.warn { background: var(--warn-soft); color: var(--warn); }
.chat-status.err { background: var(--err-soft); color: var(--err); }
.qwen-session-bar { display: flex; gap: 8px; align-items: center; }
.qwen-session-bar select { flex: 1; }
.icon-mini {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  transition: .18s;
}
.icon-mini:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-mini.danger:hover { border-color: var(--err); color: var(--err); background: var(--err-soft); }
.chat-messages {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.ce-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.chat-msg { display: flex; margin-bottom: 10px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-msg .bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.user .bubble { background: var(--accent-grad); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .bubble { background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; min-height: 54px; max-height: 140px; }
.chat-send { width: auto; min-width: 72px; }
.chat-summary {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card-3);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 5px 10px;
  margin: 8px 0;
  cursor: help;
}

/* ============ Lightbox ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
  animation: fadeIn .2s;
}
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: var(--shadow-lg); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ 响应式 ============ */
@media (max-width: 1120px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .mod-tab { padding: 8px 10px; font-size: 13px; }
  .service-pill { display: none; }
  .app-shell { padding: 10px; gap: 10px; }
  .library-panel { width: 292px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .topbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .main-tabs { order: 3; width: 100%; justify-content: stretch; overflow-x: auto; margin: 0; }
  .mod-tab { flex: 1 0 auto; justify-content: center; padding: 8px 10px; font-size: 12.5px; }
  .app-shell {
    flex-direction: column;
    overflow: visible;
    padding: 10px;
  }
  .library-panel {
    width: 100%;
    max-height: 280px;
  }
  .library-grid {
    grid-template-columns: repeat(4, 1fr);
    min-height: 74px;
    overflow-y: hidden;
  }
  .library-tasks { min-height: 0; flex: 0 0 auto; }
  #taskList { max-height: 170px; }
  .stage { min-height: 430px; }
  .canvas-zone { min-height: 430px; }
  .canvas-body { min-height: 360px; }
  .manager-grid { grid-template-columns: 1fr; }
  .prompt-dock {
    position: sticky;
    bottom: 0;
    max-height: none;
    margin: 0 -10px -10px;
    padding: 10px 12px 12px;
  }
  .dock-main { flex-wrap: wrap; }
  #notes, #vPrompt { flex: 1 1 100%; order: -1; height: 58px; min-height: 58px; }
  .ref-button { flex: 1 1 130px; justify-content: center; }
  #imageModel, #resolution, #vModel, #vSize, #vResolution { flex: 1 1 120px; width: auto; }
  .dock-main .btn { flex: 0 0 auto; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
}

.tasks-area {
  flex: 1;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.outputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: var(--card-2);
  border-radius: 4px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}
input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}
.slider-val {
  min-width: 50px;
  text-align: right;
  color: var(--muted);
}
/* ============ v2 新增：子项网格 / 任务操作 / 作品缩略条 ============ */
.imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.imgs .item {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.imgs .item img, .imgs .item video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--card-3);
  border: 1px solid var(--border);
}
.imgs .item figcaption {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.item-status { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--card-3); }
.item-status.running { background: var(--accent-soft); color: var(--accent); }
.item-status.done { background: var(--ok-soft); color: var(--ok); }
.item-status.failed { background: var(--err-soft); color: var(--err); }
.item-status.canceled { background: var(--warn-soft); color: var(--warn); }
.item-pending, .item-spinner, .item-fail, .item-cancel {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--card-3);
  border: 1px dashed var(--border-strong);
  font-size: 12px; color: var(--muted);
}
.item-fail { color: var(--err); border-color: var(--err); background: var(--err-soft); }
.item-cancel { color: var(--warn); }
.item-spinner { color: var(--accent); }
.item-spinner::after {
  content: ""; width: 18px; height: 18px; border: 2px solid var(--border-strong);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.item-actions { display: flex; gap: 6px; }

.task-actions { display: flex; gap: 8px; margin-top: 8px; }
.plan { font-size: 12px; color: var(--muted); margin: 6px 0; background: var(--card-2); padding: 6px 8px; border-radius: 6px; }

.outputs-grid {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px;
}
.out-thumb {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--card-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer;
}
.out-thumb img { width: 100%; height: 100%; object-fit: cover; }
.out-thumb.video { color: var(--accent); }

.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-wrap { position: relative; }
.thumb-wrap img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.thumb-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: var(--err); color: #fff; font-size: 12px; line-height: 1; cursor: pointer;
}

.test-mode { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

/* ============ 发布中心 ============ */
.publish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.publish-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.col-title { font-size: 14px; }
.pub-product-row { display: flex; gap: 8px; }
.pub-product-row input { flex: 1; }
#pubProduct { width: 100%; min-height: 90px; font-size: 12.5px; }
.publish-queue { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.pub-item { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.pub-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pub-top b { font-size: 13px; }
.pub-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.pub-cap { font-size: 12px; color: var(--text); margin-top: 6px; line-height: 1.5; }
.pub-actions { display: flex; gap: 8px; margin-top: 8px; }
.confirm-check { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }

.lib-thumb.video-placeholder { font-size: 22px; color: var(--accent); }

/* ============ v3 工作区布局 ============ */
:root { --task-bar-height: 50px; --inspector-width: 334px; --composer-reserve-height: 0px; }

body { padding-bottom: calc(var(--task-bar-height) + 12px); }

.app-shell {
  padding-bottom: 4px;
  transition: padding-right .2s ease;
}
.create-mode .app-shell { padding-right: calc(var(--inspector-width) + 28px); }
.create-mode .library-panel { width: 250px; }
.stage { gap: 0; }
.stage-module { width: 100%; }
.stage-panel { padding: 24px; }

/* 创作模块右侧参数检查器 */
.prompt-dock {
  position: fixed;
  top: calc(var(--topbar-height) + 14px);
  right: 14px;
  bottom: calc(var(--task-bar-height) + 12px);
  width: var(--inspector-width);
  max-height: none;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  z-index: 40;
}
.dock-module { gap: 14px; }
.dock-main {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.dock-main::before {
  content: "创作参数";
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
#mod-video .dock-main::before { content: "视频参数"; }
.ref-button { width: 100%; justify-content: center; }
#notes, #vPrompt { flex: none; width: 100%; min-height: 92px; }
#imageModel, #resolution, #vModel, #vSize, #vResolution {
  width: 100%;
  flex-shrink: 1;
}
.dock-main .btn { width: 100%; min-height: 48px; height: auto; }
.dock-extras { border-top: 1px solid var(--border); padding-top: 4px; }
.dock-extras summary {
  width: 100%;
  padding: 8px 0;
  font-weight: 600;
  color: var(--text);
}
.dock-extras summary::before,
.dock-extras details[open] summary::before { content: ""; }
.dock-params {
  grid-template-columns: 1fr;
  gap: 13px;
  max-height: none;
  overflow: visible;
  padding: 0;
  margin-top: 4px;
  border: 0;
  background: transparent;
}
.dock-params .field-full { grid-column: auto; }
.dock-params .drop { min-height: 104px; }
.dock-extras .msg { display: block; margin-top: 10px; }
.seg { width: 100%; }
.seg button { flex: 1; }

/* 任务与作品改为底部抽屉 */
.tasks-area {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: var(--task-bar-height);
  min-height: 0;
  z-index: 70;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 -4px 24px rgba(16, 24, 40, .10);
  transition: height .22s ease, box-shadow .22s ease;
}
.tasks-area.open {
  height: min(52vh, 480px);
  box-shadow: 0 -14px 40px rgba(16, 24, 40, .18);
}
.tasks-area:not(.open) > :not(.tasks-header) { display: none; }
.tasks-header { min-height: 48px; padding: 0; flex-shrink: 0; }
.task-drawer-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.task-drawer-title { font-size: 13.5px; font-weight: 700; }
.task-drawer-icon { color: var(--accent); }
.task-drawer-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.task-drawer-chevron { color: var(--muted); transition: transform .2s ease; }
.tasks-area.open .task-drawer-chevron { transform: rotate(180deg); }
.tasks-area .outputs-grid { flex-shrink: 0; }

/* 独立管理模块占满可用工作区 */
body:not(.create-mode) .app-shell { padding-right: 14px; }
body:not(.create-mode) .stage { width: 100%; }
#mod-library:not([hidden]),
#mod-publish:not([hidden]),
#mod-extra:not([hidden]) { display: flex; }
#mod-library .stage-panel,
#mod-publish .stage-panel { width: 100%; }
#mod-extra .qwen-card { width: 100%; }
.qwen-logo { width: 42px; font-size: 12px; }

@media (max-width: 1120px) and (min-width: 861px) {
  :root { --inspector-width: 300px; }
  .create-mode .library-panel { width: 220px; }
  .create-mode .app-shell { padding-right: calc(var(--inspector-width) + 20px); }
  .prompt-dock { right: 10px; }
}

@media (max-width: 860px) {
  body { padding-bottom: calc(var(--task-bar-height) + 10px); }
  .app-shell { flex: none; }
  .create-mode .app-shell,
  body:not(.create-mode) .app-shell { padding: 10px; }
  .create-mode .library-panel { width: 100%; max-height: 190px; }
  .create-mode .library-grid { min-height: 72px; }
  .prompt-dock {
    position: static;
    width: auto;
    max-height: none;
    margin: 0 10px 10px;
    padding: 14px;
    border-radius: var(--radius);
  }
  .prompt-dock .dock-main { flex-direction: column; align-items: stretch; }
  #notes, #vPrompt { order: initial; min-height: 84px; }
  .ref-button,
  #imageModel, #resolution, #vModel, #vSize, #vResolution {
    flex: none;
    width: 100%;
    height: auto;
  }
  .stage { min-height: 460px; }
  .canvas-zone { min-height: 460px; }
  .canvas-body { min-height: 390px; }
  .stage-panel { padding: 16px; }
  .publish-grid { grid-template-columns: 1fr; }
  .tasks-area { left: 8px; right: 8px; bottom: 6px; }
  .tasks-area.open { height: min(70vh, 560px); }
  .task-drawer-hint { display: none; }
}

/* ============ CreatOK 风格视频工作区 ============ */
body.video-mode { padding-bottom: 0; }
body.video-mode .app-shell { padding: 14px 14px var(--composer-reserve-height); }
body.image-mode { padding-bottom: 0; }
body.image-mode .app-shell { padding: 14px 14px var(--composer-reserve-height); }
#mod-image:not([hidden]) { display: flex; }
#mod-video:not([hidden]) { display: flex; }
.video-studio, .image-studio {
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 8px 28px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.video-studio-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 8px 18px;
}
.video-studio-head h2 { font-size: 24px; line-height: 1.15; margin-top: 3px; }
.video-studio-head p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.video-view-tabs {
  display: flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.video-view-tabs button {
  min-width: 72px; padding: 8px 15px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 13px;
}
.video-view-tabs button.active { background: var(--card-3); color: var(--text); font-weight: 700; }
.video-view { min-height: 0; padding: 0 8px; }
.video-section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.video-section-title h3 { font-size: 18px; }
.video-section-title span { font-size: 12px; color: var(--muted); }
.video-featured-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
}
.image-featured-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
}
.image-feature-card {
  position: relative; min-width: 0; aspect-ratio: 1 / 1; overflow: hidden;
  padding: 0; border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(145deg, #f1f3f8, #cdd5e4); color: #fff;
  text-align: left; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.image-feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.image-feature-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-feature-preview {
  position: absolute; top: 9px; right: 9px; z-index: 2; padding: 4px 8px;
  border-radius: 999px; background: rgba(20,24,38,.58); color: #fff; font-size: 10.5px; opacity: 0;
}
.image-feature-card:hover .image-feature-preview { opacity: 1; }
.image-tone-premium { background: linear-gradient(145deg, #5c4c45, #c7aa8f); }
.image-tone-warm { background: linear-gradient(145deg, #eac8a4, #9f8267); }
.image-tone-info { background: linear-gradient(145deg, #bcd2ff, #6479b4); }
.image-tone-macro { background: linear-gradient(145deg, #d9d2ca, #756b63); }
.image-tone-social { background: linear-gradient(145deg, #ffd1df, #9b6478); }
.video-feature-card {
  position: relative; min-width: 0; aspect-ratio: 9 / 15; overflow: hidden;
  padding: 0; border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(145deg, #e8e5ff, #b9c7ff); box-shadow: var(--shadow);
  color: #fff; text-align: left; transition: transform .2s, box-shadow .2s;
}
.video-feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.video-feature-card img, .video-feature-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-mark { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 46px; color: rgba(255,255,255,.85); }
.feature-shade {
  position: absolute; inset: auto 0 0; padding: 42px 12px 12px;
  background: linear-gradient(transparent, rgba(10,14,28,.78));
}
.feature-shade b { font-size: 12.5px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.tone-warm { background: linear-gradient(145deg, #ffc8a5, #af7b66); }
.tone-fashion { background: linear-gradient(145deg, #bdd8ff, #7466af); }
.tone-ugc { background: linear-gradient(145deg, #ffd7df, #a86878); }
.tone-haul { background: linear-gradient(145deg, #ffe9b5, #c27f52); }
.tone-tech { background: linear-gradient(145deg, #34435d, #0d1321); }
.video-history-list { display: flex; flex-direction: column; width: 100%; gap: 16px; max-height: none; overflow: visible; padding: 2px 4px 18px 2px; align-items: stretch; }
.video-history-card { display: flex; flex-direction: column; gap: 0; width: 100%; min-width: 0; max-width: 340px; overflow: hidden; padding: 12px; border: 1px solid transparent; border-radius: 14px; background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--text); }
.video-history-card:hover { border-color: transparent; }
.video-history-media { width: 100%; max-height: none; aspect-ratio: 9 / 16; align-self: start; overflow: hidden; border-radius: 10px; background: #111318; }
.video-history-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-history-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; font-size: 11px; color: var(--muted); }
.video-history-heading { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.video-history-title { display: -webkit-box; overflow: hidden; color: var(--text); font-size: 15px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: normal; overflow-wrap: break-word; }
.video-history-model { width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 2px 6px; border-radius: 5px; background: var(--card-3); color: var(--text); white-space: nowrap; }
.video-history-top .badge { margin-left: auto; padding: 3px 8px; background: #123c31; color: #46d39b; }
.video-history-meta { margin: 9px 0 8px; color: var(--muted); font-size: 10.5px; }
.video-history-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.video-history-placeholder.failed { color: #ff7777; }
.video-history-actions { display: flex; align-items: center; gap: 8px; padding-top: 5px; border-top: 1px solid var(--border); }
.history-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.history-icon-btn:hover { color: var(--text); }
.history-icon-btn:disabled { opacity: .35; cursor: default; }
.history-more { margin-left: auto; color: var(--muted); letter-spacing: 2px; }
.video-empty { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.video-empty b { color: var(--text); }
.image-history-group { margin-bottom: 22px; }
#imageHistoryList { display: flex; flex-direction: column; gap: 0; max-height: none; overflow: visible; }
.image-history-group > h3 { margin: 0 0 9px; color: var(--text); font-size: 17px; }
.image-history-tasks { display: flex; flex-direction: column; gap: 16px; align-items: stretch; width: 100%; }
.image-history-tasks > .task { display: block; width: 100%; max-width: none; min-width: 0; margin: 0; padding: 16px; border-radius: 14px; }

.video-composer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--task-bar-height) + 20px);
  transform: translateX(-50%);
  width: min(1000px, calc(100vw - 48px));
  padding: 8px 12px 12px;
  min-height: 260px;
  max-height: min(78vh, 620px);
  overflow-y: auto;
  z-index: 65;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 22px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: 0 18px 54px rgba(25, 30, 50, .22);
  backdrop-filter: blur(22px);
  transition: opacity .18s, transform .18s;
}
.prompt-grip {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  width: 64px; height: 12px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; cursor: ns-resize; z-index: 2;
}
.prompt-grip span { display: block; width: 42px; height: 4px; margin: 4px auto; border-radius: 999px; background: var(--border-strong); transition: width .18s, background .18s; }
.prompt-grip:hover span { width: 62px; background: var(--accent); }
.video-prompt-row { position: relative; }
.composer-sub-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.composer-sub-row input { flex: 1 1 180px; min-width: 0; min-height: 30px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 11px; }
.composer-sub-row button { white-space: nowrap; }
.video-prompt-row textarea.is-resizing { user-select: none; }
.task-drawer-open .video-composer { opacity: 0; pointer-events: none; transform: translate(-50%, 18px); }
.video-composer-modes { display: flex; gap: 4px; margin-bottom: 8px; }
.video-composer-modes button {
  border: 0; border-radius: 999px; padding: 7px 12px; background: transparent;
  color: var(--muted); font-size: 12px;
}
.video-composer-modes button.active { color: var(--text); background: var(--card-3); font-weight: 700; }
.image-composer .video-composer-modes, .video-composer:not(.image-composer) .video-composer-modes { justify-content: flex-start; }
.composer-collapse { margin-left: auto; width: 28px; min-width: 28px !important; padding: 4px !important; font-size: 16px !important; }
.image-composer.collapsed, .video-composer.collapsed { height: 42px; min-height: 42px; overflow: hidden; padding-top: 7px; padding-bottom: 7px; }
.image-composer.collapsed .video-composer-modes, .video-composer.collapsed .video-composer-modes { margin-bottom: 0; }
.video-composer-modes button:disabled { opacity: .35; cursor: not-allowed; }
.video-prompt-row { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 10px; align-items: stretch; }
.video-composer.no-local-add .video-prompt-row { grid-template-columns: minmax(0,1fr); }
.video-prompt-row > .video-add-media {
  width: 48px !important; height: 66px !important; min-height: 66px !important; max-height: 66px !important; align-self: start !important; place-self: start !important; flex: none !important; border: 1px dashed var(--border-strong); border-radius: 12px;
  background: var(--card-2); color: var(--accent); font-size: 24px;
}
.video-prompt-row textarea { min-height: var(--composer-prompt-height, 66px); max-height: 240px; resize: vertical; border: 0; background: transparent; padding: 8px 4px; }
.video-composer #vPrompt { width: 100%; min-height: 66px; height: 66px; flex: none; }
.image-composer #notes { width: 100%; min-height: 66px; height: 66px; flex: none; order: initial; }
.numbered-prompt-hint { position: absolute; left: 66px; bottom: 6px; color: var(--muted); font-size: 10px; pointer-events: none; }
.numbered-prompt-hint.active { color: var(--accent); font-weight: 600; }
.prompt-manual-btn { position: absolute; right: 8px; bottom: 5px; border: 0; background: transparent; color: var(--accent); font-size: 10px; cursor: pointer; }
.manual-prompt-fields { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; }
.manual-prompt-fields label { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 8px; align-items: start; font-size: 12px; font-weight: 700; }
.manual-prompt-fields textarea { min-height: 58px; width: 100%; resize: vertical; padding: 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--card-3); color: var(--text); font: inherit; font-weight: 400; }
.video-prompt-row textarea:focus { box-shadow: none; }
.video-media-panel {
  max-height: 104px; overflow-y: auto; margin-top: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card-2);
}
#imageReferencePanel { position: relative; max-height: none; min-height: 0; height: auto; resize: none; overflow: visible; padding: 0; }
.asset-panel-grip { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); width: 62px; height: 10px; border: 0; background: transparent; cursor: ns-resize; }
.asset-panel-grip span { display: block; width: 38px; height: 3px; margin: 3px auto; border-radius: 999px; background: var(--border-strong); }
.asset-panel-grip:hover span { width: 56px; background: var(--accent); }
.video-asset-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11.5px; margin-bottom: 7px; }
.video-asset-chips { display: flex; flex-direction: column; gap: 8px; }
.video-asset-chips .chip-group-head {
  display: flex; margin: 2px 0 0; padding-top: 5px; border-top: 1px solid var(--border);
}
.video-asset-chips .chip-group-head:first-child { border-top: 0; padding-top: 0; }
.video-asset-chips .chip-group-head b { font-size: 11.5px; color: var(--text); }
.video-asset-chips .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.video-asset-chips .chip { padding: 5px 9px; font-size: 11.5px; background: var(--card); }
.video-asset-item { display: inline-flex; align-items: center; gap: 3px; }
.asset-alias-btn {
  padding: 4px 6px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); font-size: 10px; opacity: .55;
}
.video-asset-item:hover .asset-alias-btn { opacity: 1; color: var(--accent); background: var(--accent-soft); }
.asset-ui-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.video-local-thumbs:empty { display: none; }
.video-frame-panel { display: grid; grid-template-columns: 1fr 26px 1fr; max-height: none; overflow: visible; align-items: center; }
.video-frame-slot { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 7px; align-items: center; }
.video-frame-slot > button {
  grid-row: 1 / span 2; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--card); color: var(--text);
}
.video-frame-slot > button span { color: var(--accent); font-size: 18px; }
.video-frame-slot > button small, .frame-file-name { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-frame-slot select { padding: 7px 9px; font-size: 11.5px; }
.frame-flow { text-align: center; color: var(--muted); }
#vEditPanel { grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: 8px; max-height: none; }
#vEditPanel label { font-weight: 700; color: var(--text); }
#vEditPanel .hint { grid-column: 2; font-size: 10.5px; color: var(--muted); }
.video-control-row { display: flex; align-items: center; gap: 6px; margin-top: 9px; overflow: visible; padding-bottom: 2px; }
.video-control-row select { width: auto; min-width: 74px; padding: 7px 8px; border-radius: 999px; font-size: 11px; background: var(--card-2); }
.video-control-row #vModel, .video-control-row #vResolution, .video-control-row #vSize { width: auto; flex: none; }
.video-control-row #vModel { min-width: 158px; }
.video-control-row #vPreset { min-width: 76px; }
.video-control-row #vSize { min-width: 90px; }
.video-control-row #vCount { min-width: 88px; }
.image-composer .video-control-row #imageModel,
.image-composer .video-control-row #style,
.image-composer .video-control-row #platform,
.image-composer .video-control-row #bundle,
.image-composer .video-control-row #resolution { width: auto; flex: none; }
.image-composer .video-control-row #imageModel { min-width: 140px; }
.image-composer .video-control-row #style { min-width: 112px; }
.image-composer .video-control-row #bundle { min-width: 104px; }
.custom-count-input { width: 58px; min-height: 30px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 11px; }
.composer-tool { white-space: nowrap; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 11.5px; }
.composer-tool:hover { border-color: var(--accent); color: var(--accent); }
.video-composer-footer { display: flex; align-items: center; gap: 10px; min-height: 34px; margin-top: 6px; }
#vCostNotice { font-size: 11px; color: var(--muted); }
.video-char-count { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.video-composer-footer .msg { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-composer-footer .btn { min-width: 112px; padding: 9px 16px; }
.request-preview { color: var(--muted); font-size: 11px; line-height: 1.35; max-width: 430px; }
.draft-notice { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 11px; }
.asset-favorite-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; font-size: 15px; line-height: 1; }
.asset-favorite-btn:hover, .asset-favorite-btn.active { color: var(--accent); }
.model-capability { margin: 4px 0 0; color: var(--muted); font-size: 11px; min-height: 16px; }
.task-query-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.task-query-row input, .task-query-row select { min-height: 30px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--card-2); color: var(--text); font-size: 11px; }
.task-query-row input { flex: 1 1 190px; min-width: 150px; }
.task-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 0 4px; color: var(--muted); font-size: 11px; }
.batch-actions { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 8px; }
.item-removed { display: flex; align-items: center; justify-content: center; min-height: 72px; color: var(--muted); font-size: 11px; }
.final-active { color: var(--accent) !important; }
.preset-modal-card { width: min(760px, 96vw); }
.preset-list { display: flex; flex-direction: column; gap: 7px; }
.preset-row { display: flex; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-2); }
.preset-row > div { flex: 1; min-width: 0; }
.preset-row small { display: block; margin-top: 3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 180; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast-item { display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); font-size: 12px; pointer-events: auto; }
.toast-item button { border: 0; border-radius: 6px; padding: 4px 7px; background: var(--accent-soft); color: var(--accent); cursor: pointer; font-size: 11px; white-space: nowrap; }
.toast-item .toast-close { padding: 0 3px; background: transparent; color: var(--muted); font-size: 16px; }
@media (min-width: 861px) and (max-width: 1250px) {
  .video-composer { width: min(96vw, 1000px); padding: 10px 12px; }
  .video-composer-modes button { padding: 6px 10px; font-size: 11px; }
  .video-control-row { gap: 5px; flex-wrap: wrap; }
  .video-control-row select, .composer-tool { min-height: 30px; padding: 5px 8px; font-size: 10.5px; }
  .video-composer-footer { gap: 6px; font-size: 10.5px; }
  .video-composer-footer .btn { min-width: 96px; padding: 7px 11px; }
}

.modal-shell { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10,14,24,.52); backdrop-filter: blur(6px); }
.modal-card { width: min(680px, 96vw); max-height: 90vh; overflow-y: auto; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; }
.modal-head p { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.modal-head > button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--card-3); color: var(--text); font-size: 20px; }
.wizard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.video-asset-picker-card { width: min(860px, 96vw); }
.video-asset-picker-trigger { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--card-3); color: var(--accent); cursor: pointer; transition: .18s ease; }
.video-asset-picker-trigger svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.video-asset-picker-trigger:hover { border-color: var(--accent); background: var(--accent-soft); }
.asset-picker-popover { position: fixed; z-index: 140; width: min(960px, calc(100vw - 24px)); padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-lg); }
.asset-picker-popover[hidden] { display: none; }
.asset-picker-popover .modal-card { width: auto; max-height: none; padding: 8px; border: 0; box-shadow: none; background: transparent; }
.asset-picker-popover .modal-head { margin-bottom: 10px; }
.asset-picker-popover .modal-head p { font-size: 11px; }
#vReferencePanel { display: flex; align-items: center; gap: 8px; min-height: 0; margin: 4px 0 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
#vReferencePanel .video-asset-head { display: flex; align-items: center; gap: 8px; margin: 0; }
#vReferencePanel .video-asset-head > span { display: none; }
#vReferencePanel .mini-actions { gap: 6px; }
#vReferencePanel .selected-asset-summary { flex: 1; min-height: 34px; padding: 0; border: 0; background: transparent; }
#vReferencePanel .chip-empty { display: none; }
.asset-picker-grid { display: flex; flex-direction: column; gap: 16px; max-height: 58vh; overflow: auto; padding: 4px; }
.asset-picker-group-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.asset-picker-group-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.asset-picker-item { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-2); cursor: pointer; }
.asset-picker-item:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.asset-picker-item input { position: absolute; top: 9px; right: 9px; z-index: 1; }
.asset-picker-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--card-3); }
.asset-picker-item span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-picker-item small { color: var(--muted); font-size: 10px; }
.asset-summary-chip { display: inline-flex; margin: 3px; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.asset-summary-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; margin-right: 5px; }
@media (max-width: 860px) {
  .asset-picker-popover { width: min(720px, calc(100vw - 20px)); }
}
.video-preview-card { width: min(900px, 96vw); }
.video-preview-card video { width: 100%; max-height: 72vh; border-radius: 10px; background: #000; }
.asset-rename-card { width: min(440px, 94vw); }

@media (max-width: 1050px) {
  .video-featured-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .image-featured-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .video-feature-card { aspect-ratio: 4 / 5; }
}

@media (max-width: 860px) {
  body.video-mode .app-shell { flex: none; padding: 10px; }
  body.image-mode .app-shell { flex: none; padding: 10px; }
  .video-studio { min-height: 640px; padding: 14px 0 24px; }
  .video-studio-head { align-items: flex-start; padding: 0 4px 14px; }
  .video-studio-head h2 { font-size: 21px; }
  .video-featured-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 9px; }
  .image-featured-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 9px; }
  .video-composer {
    position: fixed; transform: none; width: auto; height: auto; min-height: 0; max-height: none;
    margin: 0 10px 12px; border-radius: 16px; backdrop-filter: none;
  }
  .composer-grip { display: none; }
  .prompt-grip { display: none; }
  .video-composer #vPrompt, .image-composer #notes { height: 84px !important; }
  .task-drawer-open .video-composer { opacity: 1; pointer-events: auto; transform: none; }
  .video-frame-panel { grid-template-columns: 1fr; gap: 8px; }
  .frame-flow { transform: rotate(90deg); }
  #vEditPanel { grid-template-columns: 1fr; }
  #vEditPanel .hint { grid-column: 1; }
  .video-composer-footer { flex-wrap: wrap; }
  .video-composer-footer .msg { order: 3; width: 100%; max-width: none; }
  .request-preview, .draft-notice { width: 100%; }
  .composer-sub-row { flex-wrap: wrap; }
  .composer-sub-row input { flex-basis: 100%; }
  .video-control-row { overflow-x: auto; scrollbar-width: none; }
  .video-control-row::-webkit-scrollbar { display: none; }
}

@media (max-width: 560px) {
  .video-studio-head { flex-direction: column; }
  .video-view-tabs { width: 100%; }
  .video-view-tabs button { flex: 1; }
  .video-feature-card { aspect-ratio: 4 / 5.5; }
  .video-prompt-row { grid-template-columns: 40px minmax(0,1fr); }
  .video-composer { padding: 10px; }
  .video-composer-modes { overflow-x: auto; }
  .video-composer-modes button { white-space: nowrap; }
  .video-control-row { align-items: stretch; }
  .wizard-grid { grid-template-columns: 1fr; }
  .wizard-grid .field-full { grid-column: 1; }
}

/* ============ 历史任务与提交区收口 ============ */
.task,
.task-head,
.task-head-main,
.task-results,
.task-actions { min-width: 0; max-width: 100%; }
.task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}
.task-head-main { flex: 1 1 auto; }
.task-title-row { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.task-kind-icon { flex: 0 0 auto; line-height: 1.35; }
.task-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: normal;
  overflow-wrap: break-word;
}
.task-meta {
  min-width: 0;
  margin: 3px 0 0 24px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-time {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0 24px;
  color: var(--muted);
  font-size: 10.5px;
}
.task-time .task-id { opacity: .7; font-family: ui-monospace, Consolas, monospace; }
.task-head > .badge { flex: 0 0 auto; margin-top: 1px; }
.task-results { margin-top: 11px; }
.task-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
}
.task-results-head span { color: var(--muted); font-size: 10.5px; }
.task-results .imgs,
.image-history-tasks > .task > .task-results .imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: 0;
  overflow: visible;
}
.task-results .imgs .item { min-width: 0; width: auto; }
.task-results .imgs .item img,
.task-results .imgs .item video { width: 100%; height: auto; aspect-ratio: 1; }
.task-results .imgs .item figcaption {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.item-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-label .batch-item { flex: 0 0 auto; }
.task-results .item-status { flex: 0 0 auto; white-space: nowrap; }
.task-results .item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.task-results .item-actions .mini-btn,
.task-actions .mini-btn,
.batch-actions .mini-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.task-results > .batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
}
.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.image-history-tasks {
  gap: 16px;
}
.image-history-tasks > .task {
  padding: 16px;
}
.image-history-tasks > .task .task-results .imgs {
  grid-template-columns: repeat(auto-fill, minmax(150px, 220px));
  justify-content: start;
}
.composer-submit-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
  margin-top: 10px;
}
.composer-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.composer-summary-title {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.composer-summary .request-preview {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-draft-notice {
  align-self: flex-start;
  max-width: 100%;
  flex-wrap: wrap;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 8px;
  background: var(--accent-soft);
}
.composer-draft-notice button { flex: 0 0 auto; white-space: nowrap; }
.composer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.composer-aux-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 360px;
  flex-wrap: wrap;
}
.composer-aux-info .video-char-count { margin-left: 0; white-space: nowrap; }
.composer-aux-info .msg {
  min-width: 0;
  max-width: 260px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-primary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.composer-primary-actions .mini-btn,
.composer-primary-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.composer-primary-actions .btn.primary { min-width: 118px; }
.video-composer { overflow-x: hidden; }
.video-control-row {
  flex-wrap: wrap;
  overflow: visible;
}
.video-control-row button { flex: 0 1 auto; white-space: nowrap; }

@media (max-width: 600px) {
  .task-results .imgs,
  .image-history-tasks > .task > .task-results .imgs {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  .image-history-tasks > .task .task-results .imgs {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .task-actions { gap: 6px; }
  .composer-bottom-row { align-items: stretch; }
  .composer-aux-info { flex-basis: 100%; width: 100%; }
  .composer-primary-actions { width: 100%; }
  .composer-primary-actions .btn.primary { min-width: 112px; }
  .composer-summary .request-preview { white-space: normal; }
  .video-control-row { overflow: visible; }
  .video-control-row select {
    min-width: 0 !important;
    flex: 1 1 120px;
  }
  .video-control-row .composer-tool,
  .video-control-row .mini-btn { flex: 0 1 auto; }
  .image-composer .video-control-row #imageModel,
  .image-composer .video-control-row #style,
  .image-composer .video-control-row #platform,
  .image-composer .video-control-row #bundle,
  .image-composer .video-control-row #resolution { min-width: 0 !important; }
  .video-history-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }
  .video-history-media {
    width: min(100%, 320px);
    max-height: min(65vh, 520px);
    align-self: center;
  }
}

@media (max-width: 450px) {
  .task { padding: 10px; }
  .task-head { gap: 8px; }
  .task-meta, .task-time { margin-left: 23px; }
  .task-actions .mini-btn { padding-left: 8px; padding-right: 8px; }
  .composer-draft-notice { align-self: stretch; }
  .composer-primary-actions { justify-content: stretch; }
  .composer-primary-actions .mini-btn,
  .composer-primary-actions .btn { flex: 1 1 auto; }
}

/* ============ 图片/视频案例与历史：自然流布局 ============ */
/*
 * 图片和视频工作区共用这一组规则：主内容由自身内容撑开，页面负责滚动，
 * 生成器参与正常文档流，不再用固定高度和大块底部预留覆盖案例/历史。
 */
body.image-mode,
body.video-mode {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 0;
}

body.image-mode .app-shell,
body.video-mode .app-shell {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  padding-bottom: var(--composer-reserve-height);
}

body.image-mode .stage,
body.video-mode .stage {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

body.image-mode .stage-module,
body.video-mode .stage-module,
body.image-mode .image-studio,
body.video-mode .video-studio {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

body.image-mode .video-view,
body.video-mode .video-view,
body.image-mode #imageHistoryList,
body.video-mode #videoHistoryList {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

body.image-mode .video-composer,
body.video-mode .video-composer {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(var(--task-bar-height) + 20px);
  transform: translateX(-50%);
  width: min(1000px, calc(100vw - 48px));
  max-width: none;
  min-height: 260px;
  max-height: min(78vh, 620px);
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 65;
}

body.image-mode .video-composer.collapsed,
body.video-mode .video-composer.collapsed {
  height: 42px;
  min-height: 42px;
  overflow: hidden;
}

body.image-mode .image-featured-grid,
body.video-mode .video-featured-grid,
body.image-mode .image-history-tasks > .task .task-results .imgs {
  grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 10vw, 190px), clamp(190px, 12vw, 220px)));
  justify-content: start;
  align-items: start;
}

body.image-mode .image-feature-card img {
  object-fit: contain;
}

body.video-mode .video-feature-card img,
body.video-mode .video-feature-card video {
  object-fit: contain;
  background: #111318;
}

body.image-mode .image-history-group,
body.image-mode .image-history-tasks,
body.video-mode .video-history-list {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

body.image-mode .image-history-tasks > .task,
body.image-mode .task-results,
body.video-mode .task-results {
  height: auto;
  max-height: none;
  overflow: visible;
}

body.image-mode .task-results .imgs .item img,
body.image-mode .task-results .imgs .item video {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

body.video-mode .video-history-card {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

body.video-mode .video-history-media {
  height: auto;
  max-height: none;
  aspect-ratio: 9 / 16;
}

body.video-mode .video-history-media video {
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

/* ============ 历史任务看板：桌面双列 ============ */
@media (min-width: 1080px) {
  body.image-mode .image-history-tasks,
  body.video-mode .video-history-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
}

body.image-mode .image-history-tasks > .task {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 14px;
}

body.image-mode .image-history-tasks > .task > .task-head { order: 1; }
body.image-mode .image-history-tasks > .task > .plan { order: 2; }
body.image-mode .image-history-tasks > .task > .task-results { order: 3; }
body.image-mode .image-history-tasks > .task > .task-prompt-preview { order: 4; }
body.image-mode .image-history-tasks > .task > .log,
body.image-mode .image-history-tasks > .task > .out { order: 5; }
body.image-mode .image-history-tasks > .task > .task-actions { order: 6; }

body.image-mode .image-history-tasks > .task .task-results .imgs {
  grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 10vw, 170px), 1fr));
  justify-content: initial;
}

body.image-mode .image-history-tasks > .task .task-results .imgs .item:only-child {
  width: min(100%, 220px);
}

body.video-mode .video-history-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 340px;
  justify-self: start;
  padding: 14px;
}

body.video-mode .video-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(320px, 20vw, 340px), 1fr));
  gap: 16px;
  align-items: start;
}

body.video-mode .video-history-actions {
  margin-top: 6px;
}

body.video-mode .video-history-media {
  width: 100%;
  max-height: none;
}

body.video-mode .video-history-media.is-placeholder {
  aspect-ratio: 2.4 / 1;
  min-height: 92px;
}

body.video-mode .video-history-media.is-placeholder .video-history-placeholder {
  height: auto;
  min-height: 92px;
}

body.video-mode .video-history-actions .history-more {
  margin-left: 0;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  letter-spacing: 1px;
}

@property --video-history-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

body.video-mode .video-history-card {
  position: relative;
  isolation: isolate;
  box-shadow: 0 8px 24px rgba(30, 35, 60, .08);
  transition: transform .2s ease, box-shadow .2s ease;
}

body.video-mode .video-history-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--video-history-border-angle),
    transparent 0deg 72deg,
    rgba(116, 86, 255, .35) 116deg,
    rgba(128, 180, 255, .22) 172deg,
    transparent 224deg 278deg,
    rgba(195, 160, 255, .25) 316deg,
    transparent 350deg 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: .3;
  animation: video-history-border-flow 11s linear infinite;
  pointer-events: none;
  z-index: 0;
}

body.video-mode .video-history-card > * {
  position: relative;
  z-index: 1;
}

body.video-mode .video-history-card:hover {
  transform: translateY(-1px);
  border-color: transparent;
  box-shadow: 0 10px 28px rgba(30, 35, 60, .11);
}

@keyframes video-history-border-flow {
  to { --video-history-border-angle: 360deg; }
}

[data-theme="dark"] body.video-mode .video-history-card {
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

[data-theme="dark"] body.video-mode .video-history-card::before {
  opacity: .28;
}

@media (prefers-reduced-motion: reduce) {
  body.video-mode .video-history-card,
  body.video-mode .video-history-card::before {
    animation: none;
    transition: none;
  }
}

@media (max-width: 860px) {
  body.image-mode .app-shell,
  body.video-mode .app-shell {
    padding: 10px 10px var(--composer-reserve-height);
  }

  body.image-mode .video-composer,
  body.video-mode .video-composer {
    left: 10px;
    right: 10px;
    bottom: calc(var(--task-bar-height) + 12px);
    transform: none;
    width: auto;
    min-height: 0;
    max-height: calc(100vh - var(--task-bar-height) - 24px);
  }

  body.video-mode .video-history-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  body.video-mode .video-history-list {
    grid-template-columns: 1fr;
  }

  body.video-mode .video-history-media {
    width: min(100%, 320px);
    align-self: center;
  }

}

@media (min-width: 861px) and (max-width: 1079px) {
  body.video-mode .video-history-list {
    grid-template-columns: 1fr;
  }
}

/* ============ 视频 Composer 辅助信息自动收口 ============ */
body.video-mode #videoComposer {
  min-height: 0;
}

body.video-mode #videoComposer .video-composer-secondary {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 8px;
  padding: 0 2px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

body.video-mode #videoComposer .video-secondary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
}

body.video-mode #videoComposer .video-secondary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

body.video-mode #videoComposer .video-secondary-summary {
  display: none;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.video-mode #videoComposer .video-secondary-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

body.video-mode #videoComposer .video-secondary-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

body.video-mode #videoComposer .video-secondary-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-height: 360px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: max-height .22s ease, opacity .2s ease, transform .22s ease;
}

body.video-mode #videoComposer .video-composer-secondary.is-collapsed .video-secondary-label {
  display: none;
}

body.video-mode #videoComposer .video-composer-secondary.is-collapsed .video-secondary-summary {
  display: block;
}

body.video-mode #videoComposer .video-composer-secondary.is-collapsed .video-secondary-content {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

body.video-mode #videoComposer .video-composer-secondary .model-capability {
  min-height: 0;
  margin: 0;
}

body.video-mode #videoComposer .video-composer-secondary .composer-summary {
  margin-top: 0;
}

body.video-mode #videoComposer .video-composer-secondary .composer-aux-info {
  margin: 0;
}

body.video-mode #videoComposer .video-composer-secondary .composer-aux-info .msg {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

body.video-mode #videoComposer .video-composer-footer .composer-bottom-row {
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  body.video-mode #videoComposer .video-secondary-content {
    transition: none;
  }
}

@media (max-width: 560px) {
  body.video-mode #videoComposer .video-secondary-summary {
    font-size: 10.5px;
  }
}

/* ============ 视频参考素材外层摘要 ============ */
body.video-mode #vReferencePanel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  max-height: none;
  overflow: visible;
}

body.video-mode #vReferencePanel .video-reference-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-2) 82%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

body.video-mode #vReferencePanel .video-reference-summary:hover,
body.video-mode #vReferencePanel .video-reference-summary:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--card-2));
  outline: none;
}

body.video-mode #vReferencePanel .video-reference-summary-title {
  min-width: 0;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

body.video-mode #vReferencePanel #assetCount {
  min-width: 0;
  margin-right: auto;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

body.video-mode #vReferencePanel #openAssetPicker {
  width: auto;
  height: 30px;
  min-width: 54px;
  padding: 0 9px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

body.video-mode #vReferencePanel #openAssetPicker:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body.video-mode #vReferencePanel #vAssetChips {
  display: none;
}

/* ============ 图片参考素材外层摘要 ============ */
body.image-mode #imageComposer {
  min-height: 0;
}

body.image-mode #imageReferencePanel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  max-height: none;
  overflow: visible;
}

body.image-mode #imageReferencePanel .image-reference-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-2) 82%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

body.image-mode #imageReferencePanel .image-reference-summary:hover,
body.image-mode #imageReferencePanel .image-reference-summary:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--card-2));
  outline: none;
}

body.image-mode #imageReferencePanel .image-reference-summary-title {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

body.image-mode #imageReferencePanel #imageAssetCount {
  min-width: 0;
  margin-right: auto;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

body.image-mode #imageReferencePanel #imageAssetPickerOpen {
  width: auto;
  height: 30px;
  min-width: 54px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

body.image-mode #imageReferencePanel #imageAssetPickerOpen:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.image-asset-picker-card { width: min(860px, 96vw); }
.image-asset-picker-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.image-asset-picker-toolbar .chip-count { margin-left: auto; }
.image-asset-picker-list { max-height: 58vh; overflow-y: auto; padding: 4px; }

/* ============ 图片 Composer 辅助信息自动收口 ============ */
body.image-mode #imageComposer .image-composer-secondary {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 8px;
  padding: 0 2px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

body.image-mode #imageComposer .image-secondary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
}

body.image-mode #imageComposer .image-secondary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

body.image-mode #imageComposer .image-secondary-summary {
  display: none;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.image-mode #imageComposer .image-secondary-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

body.image-mode #imageComposer .image-secondary-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

body.image-mode #imageComposer .image-secondary-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-height: 360px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: max-height .22s ease, opacity .2s ease, transform .22s ease;
}

body.image-mode #imageComposer .image-composer-secondary.is-collapsed .image-secondary-label { display: none; }
body.image-mode #imageComposer .image-composer-secondary.is-collapsed .image-secondary-summary { display: block; }
body.image-mode #imageComposer .image-composer-secondary.is-collapsed .image-secondary-content {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

body.image-mode #imageComposer .image-composer-secondary .composer-aux-info { margin: 0; }
body.image-mode #imageComposer .image-composer-secondary .composer-aux-info .msg {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
body.image-mode #imageComposer .video-composer-footer .composer-bottom-row { justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  body.image-mode #imageComposer .image-secondary-content { transition: none; }
}

@media (max-width: 560px) {
  body.image-mode #imageComposer .image-secondary-summary { font-size: 10.5px; }
}

/* ============ 线上访问密钥登录 ============ */
.access-logout-btn { display: none; }
html.access-gated .access-logout-btn { display: inline-flex; }
.access-login-screen {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(242, 244, 249, .78);
  backdrop-filter: blur(18px);
}
[data-theme="dark"] .access-login-screen { background: rgba(15, 17, 22, .82); }
.access-login-screen.is-visible { display: flex; }
.access-login-card {
  width: min(390px, 100%);
  padding: 30px 28px 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.access-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}
.access-login-brand .logo { width: 42px; height: 42px; }
.access-login-brand h1 { font-size: 21px; line-height: 1.2; }
.access-login-brand div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.access-login-hint {
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.access-login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.access-login-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--card-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.access-login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.access-remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.access-login-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
}
.access-login-status {
  min-height: 18px;
  margin-top: 12px;
  color: var(--err);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.access-login-status.is-loading { color: var(--muted); }
@media (max-width: 450px) {
  .access-login-screen { padding: 14px; }
  .access-login-card { padding: 25px 20px 22px; }
}
