/* ============================================================
   AI 帮写提示词工作台（1:1 对齐参考站 gongZuoTai 三栏结构）
   ============================================================ */
/* 发送区竖排：橙色 AI 钮在上、青色发送钮在下 */
.cp-v2 .send-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.cp-v2 .ai-writer-open {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #fb923c, #f97316); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: .2px; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(249,115,22,.38); transition: .16s;
}
.cp-v2 .ai-writer-open:hover { transform: scale(1.07); filter: brightness(1.06); }
.cp-v2 .ai-writer-open.has-draft::after {
  content: ""; position: absolute;
}
.cp-v2 .ai-writer-open.has-draft { box-shadow: 0 0 0 2px rgba(251,146,60,.35), 0 4px 14px rgba(249,115,22,.45); }

/* 遮罩与主弹窗 */
#aiwMask { position: fixed; inset: 0; z-index: 4000; background: rgba(4,6,10,.62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 26px; }
#aiwMask.hidden { display: none; }
.aiw-modal { width: 1180px; max-width: 96vw; height: min(760px, 92vh); background: #141418;
  border: 1px solid #2a2a30; border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.6);
  display: flex; flex-direction: column; overflow: hidden; }
.aiw-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #24242b; }
.aiw-head .aiw-logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg,#fb923c,#f97316);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.aiw-head h3 { margin: 0; font-size: 16px; color: #f1f5f9; font-weight: 700; }
.aiw-head p { margin: 0; font-size: 12px; color: #94a3b8; }
.aiw-head .aiw-spacer { flex: 1; }
.aiw-head .aiw-history-btn, .aiw-head .aiw-close {
  border: 1px solid #2c2c33; background: #1c1c22; color: #cbd5e1; border-radius: 9px;
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: .15s; }
.aiw-head .aiw-history-btn:hover { border-color: rgba(34,211,238,.5); color: #22d3ee; }
.aiw-head .aiw-close { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 17px; }
.aiw-head .aiw-close:hover { background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.5); color: #f87171; }

.aiw-cols { flex: 1; display: grid; grid-template-columns: 300px 340px 1fr; min-height: 0; }
.aiw-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #24242b; }
.aiw-col:last-child { border-right: none; }
.aiw-col-head { padding: 11px 16px; font-size: 12.5px; font-weight: 700; color: #e2e8f0;
  border-bottom: 1px solid #202027; background: #17171d; position: sticky; top: 0; z-index: 2; }
.aiw-col-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.aiw-field-label { font-size: 11.5px; color: #94a3b8; margin: 12px 0 7px; font-weight: 600; }
.aiw-field-label:first-child { margin-top: 0; }

/* 素材模式 chip */
.aiw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aiw-chip { border: 1px solid #2c2c33; background: #1c1c22; color: #b6b6c2; border-radius: 999px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; transition: .13s; }
.aiw-chip:hover { border-color: rgba(34,211,238,.45); color: #22d3ee; }
.aiw-chip.active { background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.55); color: #22d3ee; font-weight: 600; }
.aiw-noimg { font-size: 11.5px; color: #64748b; margin-top: 8px; line-height: 1.5; }

.aiw-textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px;
  background: #1b1b21; border: 1px solid #2c2c33; border-radius: 11px; padding: 10px 12px;
  color: #e2e8f0; font-size: 13px; line-height: 1.55; font-family: inherit; outline: none; }
.aiw-textarea:focus { border-color: rgba(34,211,238,.5); }
.aiw-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aiw-select { background: #1c1c22; border: 1px solid #2c2c33; color: #cbd5e1; border-radius: 9px;
  padding: 6px 9px; font-size: 12.5px; outline: none; cursor: pointer; }
.aiw-yunjing-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.aiw-yj-tag { display: inline-flex; align-items: center; gap: 5px; background: rgba(34,211,238,.12);
  color: #22d3ee; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 11.5px; }
.aiw-yj-tag b { cursor: pointer; font-weight: 700; opacity: .75; }
.aiw-yj-tag b:hover { opacity: 1; }

/* 专家列 */
.aiw-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.aiw-tab { flex: 1; border: 1px solid #2c2c33; background: #1c1c22; color: #b6b6c2; border-radius: 9px;
  padding: 6px 0; font-size: 12.5px; cursor: pointer; }
.aiw-tab.active { background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.5); color: #22d3ee; font-weight: 700; }
.aiw-search { width: 100%; box-sizing: border-box; background: #1b1b21; border: 1px solid #2c2c33;
  border-radius: 9px; padding: 8px 11px; color: #e2e8f0; font-size: 12.5px; outline: none; margin-bottom: 12px; }
.aiw-group-title { font-size: 11px; color: #64748b; font-weight: 700; margin: 12px 0 7px; letter-spacing: .4px; }
.aiw-expert { border: 1px solid #2a2a30; background: #1a1a20; border-radius: 13px; padding: 10px 11px;
  margin-bottom: 9px; cursor: pointer; transition: .14s; position: relative; }
.aiw-expert:hover { border-color: rgba(34,211,238,.4); }
.aiw-expert.active { border-color: rgba(34,211,238,.65); background: rgba(34,211,238,.08); box-shadow: 0 0 0 1px rgba(34,211,238,.25) inset; }
.aiw-expert-top { display: flex; align-items: center; gap: 9px; }
.aiw-expert-ava { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px; }
.aiw-expert-meta { min-width: 0; flex: 1; }
.aiw-expert-name { font-size: 13px; color: #e8e8f0; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.aiw-expert-name .fav { color: #fbbf24; font-size: 11px; }
.aiw-expert-intro { font-size: 11.5px; color: #8b93a5; margin-top: 2px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aiw-expert-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.aiw-expert-tags span { background: #23232b; color: #a5acbd; border-radius: 6px; padding: 2px 7px; font-size: 10.5px; }
.aiw-expert-foot { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.aiw-expert-foot button, .aiw-expert-foot span { font-size: 11px; color: #7d8698; background: none; border: none; cursor: pointer; padding: 0; }
.aiw-expert-foot button:hover { color: #22d3ee; }
.aiw-new-expert { width: 100%; border: 1px dashed #3a3a44; background: transparent; color: #22d3ee;
  border-radius: 11px; padding: 10px; font-size: 12.5px; cursor: pointer; margin-top: 4px; }
.aiw-new-expert:hover { background: rgba(34,211,238,.07); }
.aiw-empty { text-align: center; color: #64748b; font-size: 12px; padding: 26px 10px; line-height: 1.7; }

/* 结果列 */
.aiw-result-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #64748b; gap: 8px; padding: 20px; }
.aiw-result-empty .big { font-size: 34px; }
.aiw-result-empty .t { font-size: 13.5px; color: #94a3b8; }
.aiw-version { border: 1px solid #2a2a30; border-radius: 13px; background: #1a1a20; padding: 13px 14px; margin-bottom: 12px; }
.aiw-version.latest { border-color: rgba(34,211,238,.45); }
.aiw-version-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 12px; color: #94a3b8; }
.aiw-version-head .st { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.st-doing { background: rgba(251,146,60,.16); color: #fb923c; }
.st-done { background: rgba(34,197,94,.15); color: #4ade80; }
.st-fail { background: rgba(244,63,94,.15); color: #f87171; }
.st-stop { background: #2a2a30; color: #94a3b8; }
.aiw-version-text { white-space: pre-wrap; font-size: 13px; line-height: 1.7; color: #dbe2ee; background: #15151b;
  border: 1px solid #24242b; border-radius: 10px; padding: 11px 12px; max-height: 280px; overflow-y: auto; }
.aiw-version-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.aiw-btn { border-radius: 9px; padding: 7px 13px; font-size: 12.5px; cursor: pointer; border: 1px solid #2c2c33;
  background: #1e1e25; color: #cbd5e1; transition: .14s; }
.aiw-btn:hover { border-color: rgba(34,211,238,.5); color: #22d3ee; }
.aiw-btn.primary { background: linear-gradient(135deg,#22d3ee,#0ea5e9); color: #04141a; border: none; font-weight: 700; }
.aiw-btn.orange { background: linear-gradient(135deg,#fb923c,#f97316); color: #fff; border: none; font-weight: 700; }
.aiw-btn:disabled { opacity: .5; cursor: not-allowed; }
.aiw-followup { margin-top: 12px; }
.aiw-followup-row { display: flex; gap: 8px; margin-top: 7px; }
.aiw-followup-row .aiw-textarea { min-height: 48px; flex: 1; }

/* 底部开始写条 */
.aiw-foot { border-top: 1px solid #24242b; padding: 12px 18px; display: flex; align-items: center; gap: 12px; background: #17171d; }
.aiw-foot .hint { font-size: 11.5px; color: #64748b; }
.aiw-foot .aiw-spacer { flex: 1; }
.aiw-foot kbd { background: #23232b; border: 1px solid #33333d; border-radius: 5px; padding: 1px 6px; font-size: 11px; color: #a5acbd; }

/* 自建专家编辑 / 运镜广场 子弹窗 */
.aiw-submask { position: absolute; inset: 0; z-index: 5; background: rgba(4,6,10,.55);
  display: flex; align-items: center; justify-content: center; }
.aiw-submask.hidden { display: none; }
.aiw-sub { width: 520px; max-width: 92%; max-height: 88%; overflow-y: auto; background: #16161c;
  border: 1px solid #2e2e36; border-radius: 16px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.aiw-sub h4 { margin: 0 0 14px; font-size: 15px; color: #f1f5f9; }
.aiw-sub label { display: block; font-size: 11.5px; color: #94a3b8; margin: 11px 0 6px; font-weight: 600; }
.aiw-sub input[type=text], .aiw-sub textarea { width: 100%; box-sizing: border-box; background: #1b1b21;
  border: 1px solid #2c2c33; border-radius: 9px; padding: 8px 11px; color: #e2e8f0; font-size: 13px; outline: none; font-family: inherit; }
.aiw-sub textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.aiw-tag-edit { display: flex; flex-wrap: wrap; gap: 6px; background: #1b1b21; border: 1px solid #2c2c33;
  border-radius: 9px; padding: 8px; }
.aiw-tag-edit span { display: inline-flex; gap: 5px; align-items: center; background: #26262e; color: #cbd5e1;
  border-radius: 7px; padding: 3px 6px 3px 9px; font-size: 11.5px; }
.aiw-tag-edit span b { cursor: pointer; color: #94a3b8; }
.aiw-tag-edit input { border: none; background: none; outline: none; color: #e2e8f0; font-size: 12px; min-width: 110px; flex: 1; }
.aiw-checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cbd5e1; margin-top: 10px; cursor: pointer; }
.aiw-sub-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

/* 运镜广场 */
.aiw-yj-modal { width: 620px; }
.aiw-yj-groups { margin-top: 6px; }
.aiw-yj-group { margin-bottom: 14px; }
.aiw-yj-group h5 { margin: 0 0 8px; font-size: 12px; color: #22d3ee; font-weight: 700; }
.aiw-yj-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.aiw-yj-card { border: 1px solid #2c2c33; background: #1c1c22; color: #cbd5e1; border-radius: 10px;
  padding: 8px 13px; font-size: 12.5px; cursor: pointer; }
.aiw-yj-card.active { background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.6); color: #22d3ee; font-weight: 600; }

/* 历史抽屉 */
.aiw-history-item { border: 1px solid #2a2a30; border-radius: 10px; padding: 9px 11px; margin-bottom: 8px;
  background: #1a1a20; font-size: 12px; color: #cbd5e1; }
.aiw-history-item .meta { font-size: 10.5px; color: #64748b; margin: 3px 0 6px; }
.aiw-history-item .preview { line-height: 1.5; max-height: 48px; overflow: hidden; color: #aeb6c6; }
.aiw-history-item .acts { display: flex; gap: 12px; margin-top: 7px; }
.aiw-history-item .acts button { background: none; border: none; color: #7d8698; font-size: 11px; cursor: pointer; padding: 0; }
.aiw-history-item .acts button:hover { color: #22d3ee; }

/* 浅色主题 */
html[data-theme="light"] .aiw-modal,
html[data-theme="light"] .aiw-col-head, html[data-theme="light"] .aiw-foot { background: #fff; }
html[data-theme="light"] .aiw-col-body, html[data-theme="light"] .aiw-col-head, html[data-theme="light"] .aiw-foot { border-color: #eef1f5; }
html[data-theme="light"] .aiw-head { border-color: #eef1f5; }
html[data-theme="light"] .aiw-head h3 { color: #0f172a; }
html[data-theme="light"] .aiw-expert, html[data-theme="light"] .aiw-version, html[data-theme="light"] .aiw-history-item { background: #f8fafc; border-color: #e2e8f0; }
html[data-theme="light"] .aiw-chip, html[data-theme="light"] .aiw-tab, html[data-theme="light"] .aiw-select,
html[data-theme="light"] .aiw-search, html[data-theme="light"] .aiw-textarea, html[data-theme="light"] .aiw-btn,
html[data-theme="light"] .aiw-sub input, html[data-theme="light"] .aiw-sub textarea, html[data-theme="light"] .aiw-yj-card { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
html[data-theme="light"] .aiw-version-text { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
html[data-theme="light"] .aiw-expert-name { color: #0f172a; }

@media (max-width: 960px) {
  .aiw-cols { grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; }
  .aiw-col { border-right: none; border-bottom: 1px solid #24242b; max-height: 320px; }
}

/* ---- 1:1 参考站：专家封面 / 圆头像 / 场景徽章 / 底部写作模型 ---- */
.aiw-expert { overflow: hidden; padding-top: 0; }
.aiw-expert-cover { height: 64px; margin: 0 -11px 9px; background-size: cover; background-position: center; position: relative; }
.aiw-expert-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,26,.05), rgba(20,20,26,.55)); }
.aiw-expert-top { position: relative; z-index: 1; }
.aiw-expert-ava { border-radius: 50%; overflow: hidden; background: #2a2a32; }
.aiw-expert-ava.aiw-ava-ph { border-radius: 10px; }
.aiw-expert-ava img { width: 100%; height: 100%; object-fit: cover; }
.aiw-expert-sc { font-style: normal; font-size: 9.5px; line-height: 1; padding: 2px 5px; border-radius: 5px; background: rgba(34,211,238,.16); color: #22d3ee; font-weight: 600; }
.aiw-foot-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #9aa3b5; white-space: nowrap; }
.aiw-foot-sel select { background: #202028; border: 1px solid #33333d; color: #d6d9e2; border-radius: 7px; padding: 4px 8px; font-size: 11.5px; width: auto; min-width: 96px; max-width: 150px; }
.aiw-foot .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
html[data-theme="light"] .aiw-expert-cover::after { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.35)); }
html[data-theme="light"] .aiw-foot-sel { color: #475569; }
html[data-theme="light"] .aiw-foot-sel select { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
