/* ============================================================================

 * styles-dai.css —— AI 图片创作页 1:1 复刻样式

 * 参考：https://da-ai.cc/toolbox/image-generation

 * 所有类名以 dai- 前缀，仅影响图片创作页；删除即可回滚。

 * ========================================================================== */



/* studio 页铺满宽屏 */

.main-col.dai-wide { max-width: 1780px; }

@media (max-width: 1500px) { .main-col.dai-wide { max-width: 100%; } }



.dai-workspace {

  --dai-col-skill: 196px;

  --dai-col-compose: 300px;   /* 创作卡：默认更窄，把宽度让给结果区（横向放大成片预览） */

  --dai-col-recent: 168px;

  display: grid;

  grid-template-columns: var(--dai-col-skill) var(--dai-col-compose) 8px minmax(0, 1fr) var(--dai-col-recent);

  gap: 0;

  height: calc(100vh - 132px);

  min-height: 620px;

  padding: 4px 0 0;

}

.dai-workspace > *:not(.dai-resizer) { margin-right: 6px; }

.dai-workspace > *:last-child { margin-right: 0; }



/* 可拖拽分隔条 */

.dai-resizer {

  position: relative; cursor: col-resize; margin: 0 !important; align-self: stretch;

  display: flex; align-items: center; justify-content: center;

}

.dai-resizer::before {

  content: ''; width: 2px; height: 34px; border-radius: 2px; background: var(--line-strong, #d9dde4);

  transition: background .15s, height .15s;

}

.dai-resizer:hover::before, .dai-resizer.dragging::before { background: var(--accent, #1c1f24); height: 64px; }

body.dai-resizing, body.dai-resizing * { cursor: col-resize !important; user-select: none !important; }



@media (max-width: 1320px) {

  .dai-workspace { grid-template-columns: 190px var(--dai-col-compose) 8px minmax(0, 1fr); }

  .dai-recent, .dai-workspace > .dai-resizer ~ .dai-recent { display: none; }

}

@media (max-width: 980px) {

  .dai-workspace {

    grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; gap: 12px;

  }

  .dai-workspace > * { margin-right: 0 !important; }

  .dai-skillbar { display: none; }

  .dai-resizer { display: none; }

  .dai-compose, .dai-preview { min-height: auto; }

  .dai-preview { min-height: 480px; }

}



/* 统一卡片 */

.dai-skillbar, .dai-compose, .dai-preview, .dai-recent {

  background: var(--panel, #fff);

  border: 1px solid var(--line, #e9ebef);

  border-radius: 14px;

  box-shadow: 0 1px 2px rgba(20, 24, 32, .03);

  overflow: hidden;

}



/* ---------- 技能目录 ---------- */

.dai-skillbar { display: flex; flex-direction: column; }

.dai-sb-head {

  display: flex; align-items: center; gap: 8px;

  padding: 14px 16px 12px; font-size: 14px; font-weight: 700; color: var(--ink, #16181c);

  border-bottom: 1px solid var(--line, #eef0f3);

}

.dai-sb-logo {

  display: inline-flex; align-items: center; justify-content: center;

  width: 24px; height: 24px; border-radius: 8px; font-size: 14px; color: #fff;

  background: linear-gradient(135deg, #7c5cff, #4f6bff);

}

.dai-sb-list { flex: 1; overflow-y: auto; padding: 12px 10px 22px; }

.dai-sb-group {

  padding: 16px 9px 9px; font-size: 12px; color: var(--faint, #9aa0ac); font-weight: 600;
  letter-spacing: .04em;

}

.dai-skill-item {

  display: flex; align-items: center; gap: 12px; width: 100%;

  padding: 11px 10px; border: 0; border-radius: 12px; cursor: pointer; text-align: left;

  background: transparent; color: var(--ink, #16181c); transition: background .15s;

}

.dai-skill-item + .dai-skill-item { margin-top: 5px; }
.dai-skill-item:hover { background: var(--panel-soft, #f5f6f9); }

.dai-skill-item.active { background: var(--accent-soft, #f0f1f4); }

.dai-skill-emoji {

  /* 技能图标：基准放大到 48px，随视口/容器在 36~48px 间缩放，防止遮挡与挤压文字 */
  flex: 0 0 clamp(36px, 12vw, 48px);

  width: clamp(36px, 12vw, 48px);

  height: auto; aspect-ratio: 1 / 1; max-width: 30%;

  border-radius: 11px;

  display: inline-flex; align-items: center; justify-content: center;

  font-size: 21px; background: var(--panel-soft, #f3f4f7); border: 1px solid var(--line, #eef0f3);

}

/* 参考站真实缩略图：铺满圆角方块，object-fit:cover 保持一致的观感 */

.dai-skill-emoji, .dai-sp-emoji, .dai-title-avatar { overflow: hidden; padding: 0; }

img.dai-skill-thumb-img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; object-position: center; display: block; border-radius: inherit; }

.dai-skill-tx { display: flex; flex-direction: column; min-width: 0; gap: 4px; }

.dai-skill-name { font-size: 14px; font-weight: 650; }

.dai-skill-desc {

  font-size: 11px; color: var(--faint, #9aa0ac); white-space: nowrap;

  overflow: hidden; text-overflow: ellipsis;

}



/* ---------- 创作卡 ---------- */

.dai-compose { position: relative; display: flex; flex-direction: column; }

.dai-compose-head {

  display: flex; align-items: center; justify-content: space-between;

  padding: 12px 14px 10px; border-bottom: 1px solid var(--line, #eef0f3);

}

.dai-compose-title {

  display: flex; align-items: center; gap: 7px; border: 0; background: transparent;

  cursor: pointer; color: var(--ink, #16181c); font-size: 13.5px; font-weight: 650; padding: 2px;

}

.dai-title-avatar {

  display: inline-flex; align-items: center; justify-content: center;

  width: 22px; height: 22px; border-radius: 7px; color: #fff; font-size: 12px;

  background: linear-gradient(135deg, #8a6bff, #5b7bff);

}

.dai-title-chevron { color: var(--faint, #9aa0ac); font-size: 16px; line-height: 1; }

.dai-new-btn {

  border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600;

  color: var(--ink-soft, #3a3f47); padding: 4px 6px; border-radius: 7px;

}

.dai-new-btn:hover { background: var(--panel-soft, #f5f6f9); }



.dai-form { flex: 1; display: flex; flex-direction: column; padding: 12px 14px 14px; gap: 12px; min-height: 0; }

.dai-up-head { display: flex; align-items: center; justify-content: space-between; }

.dai-up-count { font-size: 11px; color: var(--muted, #717783); }

.dai-up-tools { display: inline-flex; gap: 12px; color: var(--faint, #9aa0ac); }



.dai-ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.dai-ref-cell { position: relative; aspect-ratio: 1 / 1; border-radius: 9px; overflow: hidden; border: 1px solid var(--line, #eef0f3); }

.dai-ref-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dai-ref-del {

  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;

  border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; cursor: pointer;

}

.dai-ref-add {

  aspect-ratio: 1 / 1; border: 1.5px dashed var(--line-strong, #d9dde4); border-radius: 9px;

  background: var(--panel-soft, #fafbfc); cursor: pointer; color: var(--muted, #717783);

  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;

}

.dai-ref-add:hover { border-color: var(--accent, #1c1f24); }

.dai-ref-add-ic { font-size: 24px; font-weight: 300; line-height: 1; }

.dai-ref-add span:nth-child(2) { font-size: 11px; font-weight: 600; }

.dai-ref-add-sub { font-size: 9px; color: var(--faint, #9aa0ac); }



.dai-prompt {

  flex: 1; min-height: 140px; width: 100%; resize: none; border: 1px solid var(--line, #e9ebef);

  border-radius: 10px; padding: 12px; font-size: 12.5px; line-height: 1.7; color: var(--ink, #16181c);

  background: var(--panel, #fff); outline: none; font-family: inherit;

}

.dai-prompt:focus { border-color: var(--line-strong, #c9ced8); }

.dai-prompt::placeholder { color: var(--faint, #a4a9b3); }

.dai-prompt-foot { display: flex; justify-content: space-between; align-items: center; margin-top: -4px; }

.dai-char-count { font-size: 11px; color: var(--faint, #9aa0ac); }

.dai-mic { color: var(--faint, #9aa0ac); display: inline-flex; cursor: pointer; }



/* ===== 第12轮：统一「语音输入」胶囊按钮（截图提供的黑色圆角胶囊，白字+麦克风） =====

   所有带输入框的区域下方共用同一款按钮；尺寸按所在容器字号自适应缩放（em/clamp）。 */

.dai-voice-pill,

button.dai-voice-pill,

button.dai-voice-enhanced.skws-iconbtn {

  display: inline-flex !important; align-items: center !important; justify-content: center !important;

  gap: 5px !important;

  width: auto !important; min-width: clamp(74px, 7vw, 96px) !important;

  height: clamp(25px, 2.4vw, 30px) !important;

  padding: 0 clamp(9px, 1.1vw, 14px) !important;

  border: 1px solid var(--accent, #1c1f24) !important;

  border-radius: 999px !important;

  background: var(--accent, #1c1f24) !important; color: #fff !important;

  font-size: clamp(11px, 1vw, 12.5px) !important; font-weight: 600 !important; line-height: 1 !important;

  letter-spacing: .2px; white-space: nowrap; cursor: pointer;

  box-shadow: 0 2px 6px rgba(0,0,0,.14);

  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;

  font-family: inherit;

}

.dai-voice-pill svg,

button.dai-voice-pill svg,

button.dai-voice-enhanced.skws-iconbtn svg {

  width: clamp(13px, 1.2vw, 15px) !important; height: clamp(13px, 1.2vw, 15px) !important;

  flex: 0 0 auto;

}

.dai-voice-pill:hover,

button.dai-voice-pill:hover,

button.dai-voice-enhanced.skws-iconbtn:hover {

  transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.22); opacity: .96;

}

.dai-voice-pill.recording,

button.dai-voice-pill.recording,

button.dai-mic.recording,

button.dai-voice-enhanced.skws-iconbtn.recording {

  background: #d0405b !important; border-color: #d0405b !important; animation: dai-pulse 1s infinite;

}

/* 语音胶囊所在行 */

.dai-voice-row { display: flex; justify-content: flex-end; align-items: center; margin: 6px 0 2px; }



/* 内嵌提示词淡色占位：与用户手写内容区分（降低亮度/透明度） */

textarea.dai-embedded-placeholder { color: var(--faint, #a4a9b3) !important; opacity: .72; }

textarea.dai-embedded-placeholder::placeholder { color: var(--faint, #a4a9b3); }



/* 第13轮：创作方向（辅助）提示条 —— 独立于输入框，淡色呈现，不干扰用户输入 */

.dai-direction-helper {

  display: flex; align-items: flex-start; gap: 8px;

  margin: 2px 0 8px; padding: 8px 11px;

  border: 1px dashed var(--line-strong, #dfe3ea);

  border-radius: 9px; background: var(--panel-soft, #fafbfc);

  font-size: 12px; line-height: 1.55;

  color: var(--faint, #9aa0ac);

}

.dai-direction-helper[hidden] { display: none !important; }

.dai-direction-helper-label {

  flex: 0 0 auto; color: var(--muted, #7d8592); font-weight: 600; white-space: nowrap;

}

.dai-direction-helper-text {

  color: var(--faint, #9aa0ac); opacity: .9;

  max-height: 4.7em; overflow: hidden;

  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;

}

.dai-form-sep { height: 1px; background: var(--line, #eef0f3); margin: 0 -2px; }



.dai-triggers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; min-width: 0; }

.dai-trigger {

  display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; text-align: left; min-width: 0;

  border: 1px solid var(--line, #e9ebef); border-radius: 9px; background: var(--panel, #fff); color: var(--ink, #16181c);

}

.dai-trigger:hover { border-color: var(--line-strong, #c9ced8); }

.dai-trigger-ic { font-size: 14px; color: var(--muted, #717783); }

.dai-trigger-l { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }

.dai-trigger-label { font-size: 9.5px; color: var(--faint, #9aa0ac); }

.dai-trigger-value { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html[data-theme="dark"] .dai-trigger-value { color: #e4e4e7; }

.dai-summary { font-size: 10px; }

.dai-caret { color: var(--faint, #9aa0ac); font-size: 13px; }



.dai-submit {

  display: flex; align-items: center; justify-content: center; gap: 10px;

  padding: 11px; border: 0; border-radius: 9px; cursor: pointer;

  background: var(--accent, #1c1f24); color: #fff; font-size: 13px; font-weight: 650;

}

.dai-submit:hover { background: var(--accent-deep, #0c0e11); }

.dai-est { font-size: 10.5px; font-weight: 400; opacity: .8; }



/* ---------- 弹层（模型 / 图片设置 / 技能选择）

 * 全局修复：所有浮层挂到 body，position:fixed + JS 视口钳位定位，

 * 彻底摆脱 .dai-compose{overflow:hidden} 等祖先裁剪（图片设置左边缘被切的根因）。

 * 统一 max-height + 内部滚动，避免矮屏下内容溢出被截断。

 * ------------------------------------------------------------------------ */

.dai-popup, .dai-skill-panel {

  position: fixed; z-index: 3000; background: var(--panel, #fff);

  border: 1px solid var(--line, #e9ebef); border-radius: 12px;

  box-shadow: 0 12px 34px rgba(20,24,32,.14);

  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain;

  box-sizing: border-box;

}

.dai-model-popup { width: min(320px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); padding: 6px; }

.dai-model-opt {

  display: flex; align-items: center; justify-content: space-between; width: 100%;

  padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left;

}

.dai-model-opt:hover { background: var(--panel-soft, #f5f6f9); }

.dai-model-opt.active { background: var(--accent-soft, #f0f1f4); }

.dai-model-opt-l { display: flex; flex-direction: column; gap: 3px; }

.dai-model-opt-name { font-size: 12.5px; font-weight: 650; color: var(--ink, #16181c); }

.dai-model-badge { display: inline-block; margin-left: 6px; font-size: 9px; color: #fff; background: #6d54ff; padding: 1px 5px; border-radius: 5px; vertical-align: middle; }

/* 未接入上游接口的模型：灰色角标，避免和「推荐 / 超值」这类营销角标混淆 */

.dai-model-badge.wait { background: var(--panel-soft, #f0f1f4); color: var(--faint, #9aa0ac); border: 1px solid var(--line, #e9ebef); }

.dai-model-opt-desc { font-size: 10px; color: var(--faint, #9aa0ac); }

.dai-check { color: var(--accent, #1c1f24); font-size: 14px; font-weight: 700; }

/* 模型列表为空时的“可配置入口”空状态 */

.dai-model-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px 16px; text-align: center; }

.dai-model-empty-ic {

  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;

  font-size: 20px; color: #b6bcc7; background: var(--panel-soft, #f5f6f9); border: 1px dashed var(--line-strong, #d9dde4);

}

.dai-model-empty-t { font-size: 12.5px; font-weight: 650; color: var(--ink-soft, #3a3f47); }

.dai-model-empty-d { font-size: 10.5px; color: var(--faint, #9aa0ac); line-height: 1.6; }



.dai-settings-popup { width: min(360px, calc(100vw - 16px)); padding: 14px; }

/* 电商带货 / 剧情短片：模型 / 视频设置紧凑浮层标题 */

.dai-vs-head {

  font-size: 12.5px; font-weight: 700; color: var(--ink, #16181c);

  padding: 2px 2px 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line, #e9ebef);

}

.dai-vs-model.dai-model-popup { padding: 10px; }

.dai-vs-model .dai-vs-head { padding: 2px 4px 10px; }

.dai-set-group + .dai-set-group { margin-top: 14px; }

.dai-set-title { font-size: 10.5px; color: var(--faint, #9aa0ac); margin-bottom: 7px; }

.dai-set-ratios { display: flex; gap: 6px; }

.dai-set-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.dai-set-opt {

  display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px;

  border: 1px solid var(--line, #e9ebef); border-radius: 8px; background: var(--panel-soft, #f7f8fa);

  cursor: pointer; font-size: 11px; color: var(--ink-soft, #3a3f47); padding: 5px 6px;

}

.dai-set-opt:hover { border-color: var(--line-strong, #c9ced8); }

html[data-theme="dark"] .dai-set-opt.active { background: rgba(124, 58, 237, .22); border-color: #7c3aed; color: #f4f1ff; font-weight: 650; }
html[data-theme="light"] .dai-set-opt.active { background: #e8eaee; border-color: #d3d7de; color: var(--ink, #16181c); font-weight: 650; }

.dai-set-ratios .dai-set-opt { flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; flex: 1 1 0; min-width: 0; min-height: 46px; padding: 8px 3px; }
.dai-set-ratios .dai-ratio-box { margin-top: 1px; }

.dai-ratio-box { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; opacity: .7; }

.dai-ratio-box.auto { border-style: dashed; }



.dai-skill-panel { width: min(380px, calc(100vw - 16px)); max-height: min(560px, calc(100vh - 16px)); padding: 14px; }

.dai-sp-title { font-size: 14px; font-weight: 700; color: var(--ink, #16181c); }

.dai-sp-sub { font-size: 10.5px; color: var(--faint, #9aa0ac); margin-top: 2px; margin-bottom: 12px; }

.dai-sp-cats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }

.dai-sp-cat {

  border: 0; background: transparent; cursor: pointer; padding: 4px 9px; border-radius: 7px;

  font-size: 11px; color: var(--muted, #717783);

}

.dai-sp-cat.active { background: var(--accent-soft, #f0f1f4); color: var(--ink, #16181c); font-weight: 650; }

.dai-sp-search {

  margin-left: auto; border: 1px solid var(--line, #e9ebef); border-radius: 7px; padding: 4px 8px;

  font-size: 11px; width: 90px; outline: none; background: var(--panel, #fff); color: var(--ink, #16181c);

}

.dai-sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.dai-sp-card {

  display: flex; align-items: center; gap: 11px; padding: 11px; cursor: pointer; text-align: left;

  border: 1px solid var(--line, #e9ebef); border-radius: 12px; background: var(--panel, #fff);

}

.dai-sp-card:hover { border-color: var(--line-strong, #c9ced8); background: var(--panel-soft, #fafbfc); }

.dai-sp-emoji {

  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px; font-size: 21px;

  display: inline-flex; align-items: center; justify-content: center; background: var(--panel-soft, #f3f4f7);

}

.dai-sp-emoji img.dai-skill-thumb-img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }

.dai-sp-card-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.dai-sp-card-name { font-size: 12.5px; font-weight: 650; color: var(--ink, #16181c); }

.dai-sp-card-desc { font-size: 10.5px; color: var(--faint, #9aa0ac); line-height: 1.4; }

.dai-sp-empty, .dai-sp-more { grid-column: 1 / -1; text-align: center; font-size: 10.5px; color: var(--faint, #9aa0ac); padding: 8px; }



/* ---------- 结果预览 ---------- */

.dai-preview { display: flex; flex-direction: column; }

.dai-tabs { display: flex; gap: 16px; padding: 12px 16px 0; border-bottom: 1px solid var(--line, #eef0f3); }

.dai-tab {

  border: 0; background: transparent; cursor: pointer; padding: 0 0 10px; font-size: 12.5px;

  color: var(--muted, #717783); position: relative;

}

.dai-tab.active { color: var(--ink, #16181c); font-weight: 650; }

.dai-tab.active::after {

  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;

  background: var(--ink, #16181c); border-radius: 2px;

}

.dai-preview-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; align-items: center; }

.dai-empty {

  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--faint, #9aa0ac); text-align: center;

}

.dai-empty-ic {

  width: 62px; height: 62px; border-radius: 14px; display: flex; align-items: center; justify-content: center;

  font-size: 30px; color: #c4c9d2; background: var(--panel-soft, #f7f8fa);

}

.dai-empty-txt { font-size: 12px; }

.dai-result-img {

  max-width: 100%; max-height: 60%; border-radius: 10px; cursor: zoom-in; border: 1px solid var(--line, #e9ebef);

}

.dai-result-bar { display: flex; gap: 8px; margin-top: 12px; }

.dai-mini-btn {

  border: 1px solid var(--line, #e9ebef); border-radius: 7px; padding: 6px 12px; font-size: 11px;

  cursor: pointer; background: var(--panel, #fff); color: var(--ink-soft, #3a3f47); text-decoration: none;

}

.dai-mini-btn:hover { background: var(--panel-soft, #f5f6f9); }

.dai-result-info { width: 100%; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

.dai-res-badge { align-self: flex-start; }

.dai-res-prompt { font-size: 11.5px; color: var(--muted, #717783); line-height: 1.6; }



/* ---------- 状态徽标 ---------- */

.dai-tbadge, .dai-res-badge {

  display: inline-block; font-size: 9.5px; padding: 2px 7px; border-radius: 6px; font-weight: 600; white-space: nowrap;

}

.dai-st-queue { background: #fff4e0; color: #a86a00; }

.dai-st-run { background: #e7efff; color: #2f5fd0; }

.dai-st-done { background: #e6f6ee; color: #12855a; }

.dai-st-fail { background: #fdeaed; color: #c2415a; }

.dai-st-idle { background: #eef0f3; color: #717783; }



/* ---------- 最近任务 ---------- */

.dai-recent { display: flex; flex-direction: column; }

.dai-recent-head { padding: 13px 14px; font-size: 13px; font-weight: 650; border-bottom: 1px solid var(--line, #eef0f3); }

.dai-recent-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.dai-task-card {

  display: flex; gap: 8px; width: 100%; padding: 7px; cursor: pointer; text-align: left;

  border: 1px solid transparent; border-radius: 9px; background: transparent;

}

.dai-task-card:hover { background: var(--panel-soft, #f7f8fa); }

.dai-task-card.active { background: var(--accent-soft, #f0f1f4); border-color: var(--line, #e9ebef); }

.dai-task-thumb {

  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 7px; overflow: hidden;

  background: var(--panel-soft, #f3f4f7); display: flex; align-items: center; justify-content: center;

}

.dai-task-thumb img { width: 100%; height: 100%; object-fit: cover; }

.dai-task-ph { font-size: 18px; color: #c4c9d2; }

.dai-task-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }

.dai-task-prompt {

  font-size: 10.5px; color: var(--ink-soft, #3a3f47); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

}

.dai-task-meta { display: flex; align-items: center; gap: 6px; }

.dai-task-time { font-size: 9px; color: var(--faint, #9aa0ac); }

.dai-recent-empty { padding: 20px 8px; text-align: center; font-size: 11px; color: var(--faint, #9aa0ac); }



/* ============================================================================

 * 增补（2026-11-17 第二轮）：悬停悬浮层 / 参考图浮层 / 示例图 / 成片网格 / 响应式

 * ========================================================================== */



/* ---------- 上传区工具条：默认隐藏，悬停上传区上方以悬浮层显现 ---------- */

.dai-up-head { position: relative; }

/* 右上角悬浮工具栏和「识别模型」胶囊同处一行：给胶囊右侧留出工具栏宽度。
   否则鼠标移到胶囊上时 .dai-up-head:hover 让工具栏（pointer-events:auto）浮现并盖住
   胶囊，用户点到的其实是透明工具栏，表现为「识别模型点不开 / 像没接入」。 */
@media (hover: hover) {
  .dai-up-head > .yk-mpill { margin-right: 100px; }
}

.dai-up-tools {

  position: absolute; right: 0; top: 50%; transform: translateY(-50%);

  display: inline-flex; gap: 4px; padding: 4px 6px;

  background: var(--panel, #fff); border: 1px solid var(--line, #e9ebef);

  border-radius: 8px; box-shadow: 0 6px 18px rgba(20,24,32,.12);

  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;

  z-index: 12;

}

/* 悬停上传区头部或整个创作卡顶部区域时显现 */

.dai-up-head:hover .dai-up-tools,

.dai-compose:hover .dai-up-tools,

.dai-form:hover .dai-up-tools { opacity: 1; pointer-events: auto; }

.dai-up-tool {

  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;

  border: 0; border-radius: 6px; background: transparent; color: var(--muted, #717783); cursor: pointer;

}

.dai-up-tool:hover { background: var(--accent-soft, #f0f1f4); color: var(--ink, #16181c); }

@media (hover: none) { .dai-up-tools { opacity: 1; pointer-events: auto; position: static; transform: none; box-shadow: none; border: 0; background: transparent; } }



/* ---------- 视频创作（电商带货）工具条：与图片制作统一 ----------

   原来是三个裸文字符号（⌸ ▤ ⤢）常显无背景，现换成同款白色胶囊：

   默认隐藏，悬停创作卡才浮现；计数 0/40 保持在左侧。 */

.skws-cmp-tools { position: relative; }

.skws-cmp-tools .dai-up-tools { right: 0; }

.skws-main-inner:hover .skws-cmp-tools .dai-up-tools,

.skws-cmp-tools:hover .dai-up-tools,

.skws-cmp-head:hover .dai-up-tools { opacity: 1; pointer-events: auto; }

.skws-cmp-tools .dai-up-tool svg { pointer-events: none; }



/* ---------- 麦克风录音态 ---------- */

.dai-mic.recording { color: #d0405b; animation: dai-pulse 1s infinite; }

@keyframes dai-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }



/* ---------- 参考图放大浮层（悬浮于功能区上层） ---------- */

.dai-ref-float {

  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column;

  width: min(920px, 92vw); height: min(680px, 86vh); margin: auto;

  background: var(--panel, #fff); border: 1px solid var(--line, #e9ebef); border-radius: 16px;

  box-shadow: 0 24px 70px rgba(0,0,0,.32); padding: 18px;

}

.dai-ref-float[hidden] { display: none; }

.dai-rf-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 14px; }

.dai-rf-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--panel-soft, #f5f6f9); font-size: 20px; cursor: pointer; color: var(--muted); }

.dai-rf-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; align-content: start; }

.dai-rf-cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }

.dai-rf-cell img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

.dai-rf-del { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 15px; cursor: pointer; }

.dai-rf-empty { grid-column: 1 / -1; text-align: center; color: var(--faint); padding: 60px 0; font-size: 13px; }

.dai-rf-add { margin-top: 14px; padding: 11px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--panel-soft, #fafbfc); cursor: pointer; color: var(--ink-soft); font-size: 13px; }



/* ---------- 参考示例引导图（对齐参考页） ---------- */

.dai-example { margin: auto; width: 100%; max-width: 620px; text-align: center; padding: 24px; }

.dai-example-title { font-size: 20px; font-weight: 700; color: var(--ink, #16181c); }

.dai-example-sub { font-size: 12.5px; color: var(--muted, #717783); margin: 8px 0 22px; }

.dai-example-figure {

  width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;

  background: linear-gradient(135deg, #efe7dd, #e5d9cf);

  display: flex; align-items: center; justify-content: center;

}

.dai-example-figure img { width: 100%; height: 100%; object-fit: cover; }

.dai-example-figure.fallback::after { content: '上传参考图片，描述你的想法'; color: #9aa0ac; font-size: 13px; }



/* ---------- 成片预览网格 + 悬浮工具栏 ---------- */

.dai-result-grid { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; }

.dai-result-grid.multi { grid-template-columns: repeat(2, 1fr); }

.dai-result-cell { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-soft); }

.dai-result-cell .dai-result-img { width: 100%; height: auto; max-height: none; display: block; border: 0; border-radius: 0; margin: 0; }

.dai-result-hoverbar {

  position: absolute; left: 8px; top: 8px; display: flex; gap: 6px;

  opacity: 0; transform: translateY(-6px); transition: opacity .16s, transform .16s;

}

.dai-result-cell:hover .dai-result-hoverbar { opacity: 1; transform: none; }

@media (hover: none) { .dai-result-hoverbar { opacity: 1; transform: none; } }

.dai-hover-btn {

  padding: 4px 10px; border: 0; border-radius: 6px; font-size: 11px; cursor: pointer;

  background: rgba(20,24,32,.72); color: #fff; text-decoration: none;

}

.dai-result-meta { width: 100%; text-align: center; font-size: 11px; color: var(--faint); margin-top: 10px; }



/* ---------- 全站响应式增强（与原站 1024px 断点协同，不破坏既有布局） ---------- */

/* 数字屏/平板横屏：顶栏次要元素收敛，快捷条换行 */

@media (max-width: 1180px) {

  .topbar-right .chip:not(.user-chip) { display: none; }

  .quickbar { flex-wrap: wrap; gap: 6px; }

}

/* 手机/窄平板：字号、间距、图片、主要模块自适应（侧栏仍沿用原站抽屉机制） */

@media (max-width: 720px) {

  .main-col { padding-left: 12px; padding-right: 12px; }

  .topbar { gap: 8px; flex-wrap: wrap; }

  .page-title { font-size: 16px; }

  .btn.recharge { padding: 7px 10px; font-size: 12px; }

  .contact-row { font-size: 11px; flex-wrap: wrap; }

  .panel-body { padding: 10px 12px; }

  .panel-head h2 { font-size: 14px; }

}

@media (max-width: 600px) {

  .main-col { padding-left: 8px; padding-right: 8px; }

  .topbar-right { gap: 6px; }

  .topbar-right .btn.ghost { font-size: 11px; padding: 6px 8px; }

  .qbtn { flex: 0 0 auto; font-size: 11px; padding: 6px 9px; }

  /* 表单类控件在手机上单列、图片自适应 */

  .dai-ref-grid { grid-template-columns: repeat(3, 1fr); }

  .dai-triggers { grid-template-columns: 1fr; }

  .dai-result-grid.multi { grid-template-columns: 1fr; }

  .dai-example { padding: 12px; }

  .dai-example-title { font-size: 17px; }

  .dai-example-figure { aspect-ratio: 4 / 3; }

  .dai-settings-popup, .dai-model-popup { width: calc(100vw - 16px); }

  .dai-sp-grid { grid-template-columns: 1fr; }

  .dai-workspace { gap: 10px; }

}

/* 图片与全局模块防溢出（不强制 overflow-x:auto，避免破坏弹层定位） */

img, video, canvas { max-width: 100%; }

.panel { max-width: 100%; }



/* 修正：窄屏隐藏技能目录（置于文件末尾以确保覆盖基础 display:flex） */

@media (max-width: 980px) {

  .dai-workspace .dai-skillbar { display: none !important; }

}



/* ============================================================================

 * 全屏铺满（仅 studio 路由 body.dai-fullscreen，切到其它页自动移除）

 * 对齐参考页：shell 无最大宽度限制、侧栏收窄为极窄图标栏、结果区铺满剩余空间

 * ========================================================================== */

body.dai-fullscreen .shell {

  max-width: none !important;

  padding-left: 8px !important;

  padding-right: 8px !important;

  gap: 8px !important;

}

body.dai-fullscreen .main-col { max-width: none !important; }



/* 全局侧栏 → 常驻极窄图标栏（保留图标可点击导航，隐藏所有文字） */

body.dai-fullscreen .sidebar {

  flex: 0 0 54px !important;

  width: 54px !important;

  overflow: visible !important;

  z-index: 40;

  transition: width .2s ease, flex-basis .2s ease, margin-right .2s ease, box-shadow .2s ease;

}

body.dai-fullscreen .side-head { justify-content: center !important; padding: 14px 0 !important; white-space: nowrap; }

body.dai-fullscreen .side-logo { margin: 0 !important; flex: 0 0 auto; }

body.dai-fullscreen .side-title,

body.dai-fullscreen .side-close,

body.dai-fullscreen .side-foot,

body.dai-fullscreen .side-group { display: none !important; }

body.dai-fullscreen .side-nav { padding: 6px 0 !important; }

body.dai-fullscreen .side-link {

  justify-content: center !important;

  align-items: center !important;

  padding: 10px 0 !important;

  margin: 0 6px !important;

  min-height: 0 !important;

  white-space: nowrap;

}

body.dai-fullscreen .side-link svg { width: 20px !important; height: 20px !important; margin: 0 !important; }

body.dai-fullscreen .side-link > span,

body.dai-fullscreen .side-link > small { display: none !important; }

body.dai-fullscreen .side-link.is-active { border-radius: 10px !important; }



/* 鼠标悬停图标栏 → 就地浮层展开完整菜单；负 margin 抵消宽度增长，工作区不位移 */

body.dai-fullscreen .sidebar.dai-side-expanded {

  flex-basis: 248px !important;

  width: 248px !important;

  margin-right: -194px !important; /* -(248-54)，抵消对 flex 布局的挤压 */

  z-index: 60 !important;

  box-shadow: 0 10px 44px rgba(10, 20, 16, .24) !important;

}

body.dai-fullscreen .sidebar.dai-side-expanded .side-head { justify-content: flex-start !important; padding: 16px 16px 12px !important; }

body.dai-fullscreen .sidebar.dai-side-expanded .side-title { display: block !important; }

body.dai-fullscreen .sidebar.dai-side-expanded .side-group { display: flex !important; }

body.dai-fullscreen .sidebar.dai-side-expanded .side-foot { display: flex !important; }

body.dai-fullscreen .sidebar.dai-side-expanded .side-nav { padding: 4px 12px 12px !important; }

body.dai-fullscreen .sidebar.dai-side-expanded .side-link {

  justify-content: flex-start !important;

  padding: 10px 12px !important;

  margin: 0 !important;

}

body.dai-fullscreen .sidebar.dai-side-expanded .side-link > span { display: inline !important; }

body.dai-fullscreen .sidebar.dai-side-expanded .side-link > small { display: block !important; }



/* 结果区示例图在宽屏下铺满（参考页大图几乎占满结果区） */

body.dai-fullscreen .dai-example { max-width: 100%; }

body.dai-fullscreen .dai-workspace { height: calc(100vh - 122px); }



/* 说明：移动端(<980px)侧栏本就是抽屉式且工作区单列，fullscreen 下不额外收窄，

   避免破坏原站点响应式；上面的侧栏图标化仅在桌面 flex 布局下视觉生效。 */

@media (max-width: 1023px) {

  body.dai-fullscreen .sidebar,

  body.dai-fullscreen .sidebar.dai-side-expanded {

    flex-basis: auto !important;

    width: 260px !important;

    margin-right: 0 !important;

    z-index: 50 !important;

  }

  body.dai-fullscreen .side-title,

  body.dai-fullscreen .side-close,

  body.dai-fullscreen .side-foot,

  body.dai-fullscreen .side-group,

  body.dai-fullscreen .side-link > span,

  body.dai-fullscreen .side-link > small { display: initial !important; }

}



/* ============================================================================

 * 第五轮：具名参考图槽位（对齐参考站 da-ai.cc 的 reference-slot 结构）

 * 每技能一组槽位卡片：64px 线稿占位图 + 右下角圆形上传箭头 + 分隔线 + 标签

 * ========================================================================== */

.dai-slot-list {

  display: flex;

  align-items: flex-start;

  gap: 14px;

  flex-wrap: nowrap;

  /* 对齐参考站：三槽位固定宽度合计约 250px，可容纳于创作卡内，无需滚动条；

     若极窄屏确需滚动，由下方媒体查询单独开启。 */

  overflow: visible;

  padding: 2px 0 4px;

}

.dai-slot-divider {

  flex: 0 0 1px;

  align-self: flex-start;

  height: 48px;

  margin-top: 2px;

  background: var(--line, #e9ebef);

}

.dai-slot-card {

  position: relative;

  /* 关键修复：卡片固定 64px 宽（与参考站 reference-slot-card 一致），

     长标签用 max-w-max 溢出居中，不撑宽卡片，保证三个槽位等宽且不被截断 */

  flex: 0 0 64px;

  width: 64px;

  display: flex;

  flex-direction: column;

  align-items: center;

  cursor: pointer;

}

.dai-slot-stage { position: relative; width: 64px; height: 64px; }

.dai-slot-thumb {

  position: relative;

  width: 64px; height: 64px;

  border: 1px solid var(--line, #e9ebef);

  border-radius: 12px;

  overflow: hidden;

  background: var(--panel-soft, #f6f7f9);

  box-shadow: 0 1px 3px rgba(20,24,32,.05);

  transition: border-color .16s;

}

.dai-slot-card:hover .dai-slot-thumb { border-color: #999; }

.dai-slot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dai-slot-filled .dai-slot-thumb img,

.dai-slot-card.filled .dai-slot-thumb img { object-fit: cover; }

/* 右下角圆形上传箭头 */

.dai-slot-upicon {

  position: absolute; right: 4px; bottom: 4px;

  width: 16px; height: 16px;

  display: flex; align-items: center; justify-content: center;

  border-radius: 50%;

  background: #5c5c5c; color: #fff;

  box-shadow: 0 1px 3px rgba(0,0,0,.2);

}

.dai-slot-upicon svg { width: 10px; height: 10px; }

/* 多图数量角标 */

.dai-slot-count {

  position: absolute; left: 4px; top: 4px;

  min-width: 16px; height: 16px; padding: 0 4px;

  display: flex; align-items: center; justify-content: center;

  border-radius: 8px; background: var(--accent, #0e8a63); color: #fff;

  font-size: 10px; font-weight: 700;

}

/* 删除按钮 */

.dai-slot-del {

  position: absolute; right: -5px; top: -5px;

  width: 18px; height: 18px; padding: 0;

  border: 0; border-radius: 50%;

  background: rgba(20,24,32,.72); color: #fff;

  font-size: 14px; line-height: 18px; cursor: pointer;

  z-index: 2;

}

/* 标签 */

.dai-slot-label {

  display: flex; align-items: center; justify-content: center;

  margin-top: 4px; height: 16px;

  white-space: nowrap;

  /* 参考站 label 为 max-w-max：长标签按内容宽度向两侧溢出居中，不撑宽卡片 */

  max-width: max-content; flex-shrink: 0;

}

.dai-slot-title { font-size: 10px; font-weight: 500; color: #555; }

.dai-slot-optional { font-size: 10px; color: #888; margin-left: 1px; }

/* 触屏/窄屏：槽位可横向滚动 */

@media (max-width: 600px) {

  .dai-slot-list { gap: 10px; }

  .dai-slot-stage, .dai-slot-thumb { width: 56px; height: 56px; }

}



/* ===================================================================

 * 第十轮：放大编辑脚本 / 语音输入增强 / 同城到店类目标签

 * =================================================================== */

/* ⤢ 放大编辑脚本按钮：更醒目 */

.dai-script-expand {

  font-size: 15px !important;

  color: var(--accent, #1c1f24) !important;

  font-weight: 700 !important;

}

/* 放大编辑脚本面板 */

.dai-script-panel {

  width: min(720px, calc(100vw - 24px));

  max-height: min(820px, 92vh);

  overflow: auto;

  padding: 16px 18px 18px;

  z-index: 10005;

}

.dai-script-head {

  display: flex; align-items: center; justify-content: space-between;

  font-size: 15px; font-weight: 700; margin-bottom: 6px;

}

.dai-script-x {

  border: 0; background: transparent; cursor: pointer;

  font-size: 24px; line-height: 1; color: var(--faint, #9aa0ac); padding: 0 4px;

}

.dai-script-x:hover { color: var(--text, #1c1f24); }

.dai-script-hint { font-size: 12px; color: var(--faint, #9aa0ac); margin-bottom: 10px; }

.dai-script-edit {

  width: 100%; min-height: 320px; resize: vertical;

  box-sizing: border-box;

  padding: 12px; border: 1px solid var(--line, #e9ebef); border-radius: 10px;

  font: 13px/1.7 inherit; font-family: inherit;

  background: var(--bg-soft, #fafbfc); color: var(--text, #1c1f24);

}

.dai-script-edit:focus { outline: 2px solid var(--accent, #1c1f24); outline-offset: -1px; }

.dai-script-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.dai-script-actions .btn { cursor: pointer; }



@media (max-width: 600px) {

  .dai-script-panel { width: calc(100vw - 16px); max-height: 94vh; padding: 14px; }

  .dai-script-edit { min-height: 240px; }

  /* 语音胶囊统一显示文字（不再在移动端缩成纯图标） */

  button.dai-voice-enhanced.skws-iconbtn span,

  .dai-voice-pill span { display: inline !important; }

}


/* ===================================================================
 * 第15轮
 *  1) 顶栏去掉冗余前缀「AI 视频 |」：文字与分隔符都不再渲染、不占位，
 *     后面的「电商带货 / 同城到店 / 剧情短片」直接左移补齐（flex 自然回流）。
 *  2) 参考图放大查看改由计数标签触发（脚本入口已归位到「放大编辑脚本」）。
 * =================================================================== */
.skws-topbar-title,
.skws-topbar-sep { display: none !important; }
.dai-up-count { cursor: pointer; }
.dai-up-count:hover { color: var(--text, #1c1f24); }
/* 放大编辑脚本面板：字数行贴住语音行，避免多余留白 */
.dai-script-panel .dai-script-hint + .dai-voice-row { margin-top: 2px; }

/* ---------- 最近任务：单条删除键（2026-11-21 增补） ---------- */
.dai-task-wrap { position: relative; }
.dai-task-wrap .dai-task-card { padding-right: 26px; }
.dai-task-del {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--faint, #9aa0ac); font-size: 10px; line-height: 1; cursor: pointer;
  opacity: .55; transition: opacity .15s, color .15s, background .15s, border-color .15s;
}
.dai-task-wrap:hover .dai-task-del { opacity: 1; }
.dai-task-del:hover { color: #c2415a; border-color: #f3c9d2; background: #fdeaed; opacity: 1; }
