/* AI 能力三页共用样式：创作工作台（aigc）/ 数智员工（agent）/ 智能客服（customer-service）
 *
 * 这三页原来各写各的 CSS，三套 token、三种卡片、三种按钮，摆在同一个侧栏下面很割裂。
 * 本文件把三套类名映射到**同一组** redesign token 上 —— 用同一个文件而不是各页抄一份，
 * 是为了以后改一处就三页齐变，不会再漂回去。
 *
 * 只写视觉。三页的调用逻辑（/api/aigc/*）一行没动。
 */

/* ══════════ 版心 ══════════ */
body[data-portal="console"] .ai-wrap { max-width: 1080px; }

/* ══════════ 页头说明条（原 aigc-flow / slogan / cs 场景条） ══════════ */
.ai-lead {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .52);
}
.ai-lead-main { color: var(--ink); font-size: 13.5px; font-weight: 750; }
.ai-lead-sub { margin-top: 4px; color: var(--ink-3); font-size: 11.5px; line-height: 1.6; }
.ai-pill {
  flex: none; padding: 6px 12px; color: var(--accent); font-size: 11.5px; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); border-radius: 999px;
  background: var(--accent-bg); white-space: nowrap;
}

/* ══════════ 标签页 ══════════ */
.ai-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 4px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2);
}
.ai-tab {
  padding: 8px 15px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--ink-3);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 650;
  transition: background .15s ease, color .15s ease;
}
.ai-tab:hover { color: var(--ink); }
.ai-tab.active {
  color: var(--accent); background: #fff; font-weight: 750;
  box-shadow: 0 1px 5px rgba(36, 66, 92, .1);
}
.ai-tab .badge-coming {
  margin-left: 6px; padding: 1px 6px; border-radius: 5px;
  background: rgba(133, 149, 172, .14); color: var(--ink-3); font-size: 10px; font-weight: 600;
}
.ai-panel { display: none; }
.ai-panel.active { display: block; }

/* ══════════ 表单 ══════════ */
.ai-label { display: block; margin-bottom: 6px; color: var(--ink-3); font-size: 11px; font-weight: 720; }
.ai-input {
  width: 100%; max-width: 100%; min-height: 42px; padding: 10px 13px;
  border: 1px solid rgba(173, 194, 226, .5); border-radius: 11px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink); font-family: var(--font-body); font-size: 13.5px; resize: vertical;
}
.ai-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
  background: #fff;
}
.ai-textarea { min-height: 104px; line-height: 1.65; }
.ai-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.ai-row > div { flex: 1; min-width: 170px; }
.ai-row > .ai-row-action { flex: 0 0 auto; min-width: 0; }

/* ══════════ 结果区 ══════════ */
.ai-result { margin-top: 18px; min-height: 60px; }
.ai-result-empty {
  padding: 26px 0; color: var(--ink-3); font-size: 12px; text-align: center;
}
.ai-loading {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 30px; color: var(--ink-2); font-size: 13px;
}
.ai-spinner {
  flex: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-top-color: var(--accent);
  animation: ai-spin .75s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spinner { animation-duration: 2.4s; } }

.ai-ok img, .ai-ok video {
  display: block; max-width: 100%; border-radius: 14px; background: #0d1a2e;
}
.ai-imgwrap { position: relative; display: inline-block; max-width: 100%; }
.ai-wm, .aigc-wm {
  position: absolute; right: 9px; bottom: 9px; padding: 4px 8px; border-radius: 7px;
  background: rgba(11, 26, 46, .6); color: #fff; font-size: 10.5px; line-height: 1;
  letter-spacing: .02em; pointer-events: none;
}
.ai-usage { margin-top: 10px; color: var(--ink-3); font-size: 11.5px; }
.ai-proof {
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2);
}
.ai-proof b { display: block; margin-bottom: 5px; color: var(--ink-2); font-size: 11px; font-weight: 720; }
.ai-proof div { color: var(--ink); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; }
.ai-proof .muted { color: var(--ink-3); }
.ai-err {
  padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
  border-radius: 13px; background: var(--bad-bg); color: var(--bad); font-size: 12.5px; line-height: 1.65;
}
.ai-coming { padding: 56px 20px; color: var(--ink-3); text-align: center; }
.ai-coming-title { margin-bottom: 8px; color: var(--ink); font-size: 16px; font-weight: 750; }
.ai-coming-desc { font-size: 12.5px; line-height: 1.8; }
.ai-foot {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 11px; text-align: center;
}

/* ══════════ 模板卡（数智员工） ══════════ */
.ai-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.ai-tpl {
  width: 100%; -webkit-appearance: none; appearance: none; font: inherit; color: inherit;
  padding: 14px 16px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .55);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.ai-tpl:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 24%, transparent); background: rgba(255, 255, 255, .85); }
.ai-tpl:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 36%, transparent); outline-offset: 3px; }
.ai-tpl.on, .ai-tpl.active { border-color: var(--accent); background: var(--accent-bg); }
.ai-tpl-name { display: block; color: var(--ink); font-size: 13px; font-weight: 750; }
.ai-tpl-desc { display: block; margin-top: 5px; color: var(--ink-3); font-size: 11.5px; line-height: 1.6; }

/* ══════════ 对话（智能客服） ══════════ */
.ai-chat {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 340px; max-height: 56vh; overflow-y: auto; padding: 4px 2px;
}
.ai-msg { max-width: 78%; padding: 11px 14px; border-radius: 16px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.ai-msg.me { align-self: flex-end; background: linear-gradient(135deg, #4b88ed, #245bbd); color: #fff; border-bottom-right-radius: 5px; }
.ai-msg.bot { align-self: flex-start; border: 1px solid var(--line); background: rgba(255, 255, 255, .8); color: var(--ink); border-bottom-left-radius: 5px; }
.ai-msg.pending { opacity: .62; font-style: italic; }
.ai-msg.sys { align-self: center; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); color: var(--ink-3); font-size: 11.5px; }
.ai-inputbar { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ai-inputbar .ai-input { flex: 1; min-height: 46px; }
.ai-scenes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ai-scene {
  padding: 7px 13px; cursor: pointer; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .6); color: var(--ink-2);
  font-family: var(--font-body); font-size: 12px; font-weight: 650;
}
.ai-scene:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.ai-scene.on, .ai-scene.active { color: var(--accent); background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 34%, transparent); }

/* ══════════ 提示条 ══════════ */
.ai-toast {
  position: fixed; right: 22px; bottom: 82px; z-index: 300; max-width: 340px;
  padding: 10px 13px; border-radius: 9px; background: #18345f; color: #fff;
  box-shadow: var(--shadow-lg); font-size: 12px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s;
}
.ai-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .ai-lead { align-items: flex-start; }
  .ai-pill { white-space: normal; }
  .ai-row { flex-direction: column; align-items: stretch; }
  .ai-row > div { min-width: 0; }
  .ai-row > .ai-row-action .btn { width: 100%; justify-content: center; }
  .ai-msg { max-width: 88%; }
  .ai-chat { max-height: none; }
}

/* ══════════ 分节标题与表单校验（数智员工） ══════════ */
.ai-section-title {
  margin: 22px 0 12px; color: var(--ink); font-family: var(--font-display);
  font-size: 15px; font-weight: 750; letter-spacing: .02em;
}
.ai-section-title:first-child { margin-top: 0; }
.ai-field-err { display: none; margin-top: 5px; color: var(--bad); font-size: 11px; }
.ai-field-err.show { display: block; }
.ai-out-name { margin-bottom: 8px; color: var(--accent); font-size: 12.5px; font-weight: 750; }
.ai-out-text { color: var(--ink); font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
/* 表单里的 label / input / select / textarea 统一到同一套控件外观 */
.ai-wrap .field { margin-bottom: 14px; }
.ai-wrap .field > label { display: block; margin-bottom: 6px; color: var(--ink-3); font-size: 11px; font-weight: 720; }
.ai-wrap .field input, .ai-wrap .field select, .ai-wrap .field textarea {
  width: 100%; min-height: 42px; padding: 10px 13px;
  border: 1px solid rgba(173, 194, 226, .5); border-radius: 11px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink); font-family: var(--font-body); font-size: 13.5px;
}
.ai-wrap .field textarea { min-height: 96px; line-height: 1.65; resize: vertical; }
.ai-wrap .field input:focus, .ai-wrap .field select:focus, .ai-wrap .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); background: #fff;
}
