/* =============================================================
   AI 图文智能设计系统 V1.0 - 样式
   印刷图文行业：专业、克制、简洁。主色蓝，辅以青绿点缀。
   ============================================================= */
:root {
  --blue: #2f6bff;
  --blue-dark: #2250c4;
  --green: #00a86b;
  --orange: #e08c00;
  --purple: #8e44ad;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --sidebar: #1c2340;
  --text: #1f2733;
  --muted: #8a93a6;
  --border: #e6eaf2;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(28, 35, 64, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.5; font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3 { font-weight: 600; }
svg { display: block; }

/* ---------- 通用 ---------- */
.btn-primary {
  background: var(--blue); color: #fff; border-radius: 8px;
  padding: 11px 18px; font-size: 15px; font-weight: 600;
  transition: background .2s; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-block { width: 100%; }
.btn-ghost {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px;
  color: var(--muted); transition: all .2s;
}
.btn-ghost:hover { color: var(--blue); border-color: var(--blue); }
/* 通用线框图图标：行内对齐 + flex 容器内不收缩 */
.li-ic { display: inline-block; vertical-align: -0.18em; flex: 0 0 auto; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--muted); font-size: 17px;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: rgba(47,107,255,.08); color: var(--blue); }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; flex: none; letter-spacing: .3px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    linear-gradient(160deg, rgba(8, 20, 48, .55) 0%, rgba(16, 42, 104, .30) 55%, rgba(30, 70, 160, .18) 100%),
    url('../images/login-bg.jpg') center / cover no-repeat,
    #0d2149;
}
.brand-mark {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--blue), #7aa0ff);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(47,107,255,.45);
}
.brand-mark svg { width: 28px; height: 28px; }

.login-card {
  width: min(92vw, 400px); background: #fff; border-radius: 16px; padding: 36px 32px 30px;
  display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(28,35,64,.12);
}
.login-title { font-size: 20px; text-align: center; margin: 0 0 24px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.account-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.account-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px;
  border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: all .2s;
}
.account-item:hover { border-color: #c6d5ff; background: #f7f9ff; }
.account-item.active { border-color: var(--blue); background: #f2f6ff; box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.account-info { flex: 1; min-width: 0; }
.account-info strong { font-size: 15px; }
.account-info strong em { font-style: normal; font-weight: 500; font-size: 12px; background: #eef1fe; color: var(--blue); padding: 2px 8px; border-radius: 6px; margin-left: 6px; }
.account-info span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.radio-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d5dae6; flex: none;
  transition: all .2s; position: relative;
}
.account-item.active .radio-dot { border-color: var(--blue); }
.account-item.active .radio-dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue);
}
.login-foot { text-align: center; color: #b4bccb; font-size: 12px; margin-top: 16px; }

/* ---------- 主框架布局 ---------- */
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 236px; background: var(--sidebar); color: #aeb6cf;
  display: flex; flex-direction: column; flex: none;
  transition: width .22s ease; overflow: hidden; position: sticky; top: 0; height: 100vh;
}
.sidebar.collapsed { width: 68px; }
.logo { display: flex; align-items: center; gap: 12px; padding: 22px 18px 16px; }
.logo .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.logo .brand-mark svg { width: 22px; height: 22px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.logo-text b { color: #fff; font-size: 15px; }
.logo-text i { font-style: normal; font-size: 11px; color: #7d87ad; }
.sidebar.collapsed .logo-text { display: none; }



.menu { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.menu::-webkit-scrollbar { width: 5px; }
.menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.menu-group { margin-bottom: 6px; }
.group-title { font-size: 11px; color: #6d77a0; padding: 12px 10px 6px; letter-spacing: 1px; white-space: nowrap; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 9px; cursor: pointer; white-space: nowrap;
  transition: all .18s; margin-bottom: 2px;
}
.menu-item:hover { background: rgba(255,255,255,.06); color: #e6ebff; }
.menu-item.active { background: linear-gradient(135deg, var(--blue), #4a7dff); color: #fff; box-shadow: 0 4px 12px rgba(47,107,255,.35); }
.mi-icon { display: inline-flex; }
.mi-text { font-size: 14px; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .mi-text, .sidebar.collapsed .group-title { display: none; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }

/* 主区域 */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.top-left { display: flex; align-items: center; gap: 8px; }
.page-crumb { font-size: 16px; font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 30px; cursor: pointer; transition: border-color .15s, background .15s; }
.user-chip:hover { border-color: var(--blue-light); background: var(--bg-soft); }
.user-chip .user-name { font-size: 13px; font-weight: 500; }
.user-chip em { font-style: normal; font-weight: 600; font-size: 11px; }

.content { padding: 26px 28px 40px; flex: 1; }
.content-foot { text-align: center; color: #b6bfd0; font-size: 12px; margin-top: 34px; }

.panel-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.panel {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.panel-title { font-size: 15px; margin-bottom: 16px; }

/* 业务页 */
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 21px; margin-bottom: 6px; }
.section-head p { color: var(--muted); font-size: 13px; max-width: 680px; }
.count-pill { background: #eef1fe; color: var(--blue); font-size: 13px; padding: 8px 14px; border-radius: 20px; white-space: nowrap; }

.table-panel { padding: 6px 8px; }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: break-word; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #f7f9ff; }

/* 筛选下拉 */
.sel-filter { width: 220px; cursor: pointer; color: var(--ink); background: #fff; }
.sel-filter:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }

/* Bootstrap 风格分页条 */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 10px; border-top: 1px solid var(--border); }
.pager-info { font-size: 13px; color: var(--muted); }
.pager-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-btn {
  font-size: 13px; color: var(--blue); background: #fff; border: 1px solid #c9d6ff; border-radius: 6px;
  padding: 5px 11px; cursor: pointer; transition: all .15s; min-width: 32px; text-align: center;
}
.pg-btn:hover:not(:disabled) { background: var(--blue); color: #fff; border-color: var(--blue); }
.pg-btn.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.pg-btn:disabled { opacity: .5; cursor: not-allowed; }
.empty-cell { text-align: center; color: var(--muted); padding: 26px 10px !important; }

/* 隐藏数字输入框的上下标，避免遮挡输入内容 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* 系统配置页 */
.cfg-desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.cfg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.cfg-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.cfg-card b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.cfg-card span { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }

/* ============ 智能客服模块 ============ */
.cs-head { margin-bottom: 18px; }
.cs-head h2 { font-size: 21px; margin-bottom: 6px; }
.cs-head p { color: var(--muted); font-size: 13px; max-width: 680px; }

/* 企微对话横幅 */
.cs-reqctx {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg, #eaf2ff, #f6f9ff); border: 1px solid #cfe0fb;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.cs-reqctx-ico { flex: 0 0 auto; font-size: 18px; }
.cs-reqctx-body { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.cs-reqctx-body b { font-size: 14px; color: var(--text); }
.cs-reqctx-body span { font-size: 12px; color: var(--muted); }
.cs-reqctx-items { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-reqctx-items i {
  font-style: normal; font-size: 11.5px; color: var(--blue); background: #fff;
  border: 1px solid #d3e4fd; border-radius: 8px; padding: 3px 9px;
}
.cs-banner { position: relative; border-radius: var(--radius); overflow: hidden; height: 132px; box-shadow: var(--shadow); margin-bottom: 16px; }
.cs-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-banner-txt {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 26px; background: linear-gradient(90deg, rgba(28,35,64,.82), rgba(47,107,255,.35) 70%, transparent);
  color: #fff;
}
.cs-banner-txt b { font-size: 19px; letter-spacing: .5px; }
.cs-banner-txt span { font-size: 13px; color: #dfe6ff; margin-top: 6px; max-width: 560px; }

.cs-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.chat-panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--green), #4cd6a3); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; }
.chat-cust { flex: 1; min-width: 0; }
.chat-cust b { font-size: 15px; }
.chat-cust span { display: block; color: var(--muted); font-size: 12px; }
.chat-tag { font-size: 12px; color: var(--green); background: #e9f8f0; padding: 4px 10px; border-radius: 20px; }
.chat-body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 16px; max-height: 470px; overflow-y: auto; background: #f7f9fd; }
.msg { display: flex; gap: 10px; max-width: 82%; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; }
.msg.customer .msg-avatar { background: linear-gradient(135deg, var(--orange), #f0a93c); }
.msg.cs .msg-avatar { background: linear-gradient(135deg, var(--blue), #7aa0ff); }
.msg.customer { align-self: flex-end; flex-direction: row-reverse; }
.msg-main { display: flex; flex-direction: column; gap: 4px; }
.msg-name { font-size: 11px; color: var(--muted); }
/* 成对排除：悬停显示，第一次点击进入确认态 */
.msg-actions { display: flex; justify-content: flex-end; opacity: .35; transition: opacity .15s; }
.msg.customer:hover .msg-actions { opacity: 1; }
.msg-del { display: inline-flex; align-items: center; gap: 4px; border: none; background: transparent; color: #8a94a8; font-size: 11px; padding: 2px 6px; cursor: pointer; border-radius: 6px; }
.msg-del:hover { background: #eef2f8; color: #d94a4a; }
/* 删除确认弹窗 */
.confirm-mask { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .38); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .12s ease; }
.confirm-dialog { width: min(92vw, 420px); background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; animation: supplyPop .15s ease; }
.confirm-title { font-size: 15px; font-weight: 700; }
.confirm-body p { margin: 0 0 6px; font-size: 12.5px; color: #5a6478; line-height: 1.6; }
.confirm-body p:last-child { margin-bottom: 0; }
.confirm-quote { background: #f6f8fc; border-left: 3px solid #dce4f0; padding: 6px 8px; border-radius: 6px; color: #3a4458; word-break: break-all; }
.confirm-note { color: #8a94a8; font-size: 11.5px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-danger { height: 34px; padding: 0 16px; border: none; border-radius: 8px; background: #e5484d; color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.confirm-danger:hover { background: #d93a3f; }
.msg.cs .msg-name { align-self: flex-end; }
.bubble { padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.6; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(28,35,64,.05); }
.msg.customer .bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-bottom-right-radius: 4px; }
.msg.cs .bubble { border-bottom-left-radius: 4px; }
.bubble.img { padding: 8px; }
.bubble.img img { width: 168px; border-radius: 8px; display: block; }
/* 补充需求：一条富文本消息，文字与图片保持原文顺序 */
.bubble.rich { max-width: 560px; }
.bubble.rich p { margin: 0 0 6px; }
.bubble.rich p:last-child { margin-bottom: 0; }
.bubble.rich img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; margin: 6px 0; }
.bubble.rich table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.bubble.rich th, .bubble.rich td { border: 1px solid rgba(255,255,255,.45); padding: 4px 7px; }
.bubble.rich a.supply-img-link { color: inherit; text-decoration: underline; }
.bubble.ai-rich p { margin: 0 0 6px; }
.bubble.ai-rich p:last-child { margin-bottom: 0; }
.bubble.ai-rich h1, .bubble.ai-rich h2, .bubble.ai-rich h3, .bubble.ai-rich h4 { margin: 8px 0 4px; line-height: 1.35; }
.bubble.ai-rich h1 { font-size: 15px; } .bubble.ai-rich h2 { font-size: 14px; } .bubble.ai-rich h3 { font-size: 13.5px; } .bubble.ai-rich h4 { font-size: 13px; }
.bubble.ai-rich ul { margin: 4px 0 6px; padding-left: 18px; }
.bubble.ai-rich li { margin: 2px 0; }
.bubble.ai-rich b { font-weight: 700; }
.bubble.ai-rich .ai-table { margin: 6px 0; overflow-x: auto; }
.bubble.ai-rich table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bubble.ai-rich th, .bubble.ai-rich td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; vertical-align: top; }
.bubble.ai-rich th { background: #f3f5fa; font-weight: 600; min-width: 76px; }
.bubble.ai-rich tr:last-child td { border-bottom: 1px solid var(--border); }
.img-cap { font-size: 11px; color: var(--muted); display: block; padding: 6px 2px 2px; }
.ai-loading { display: flex; gap: 4px; align-items: baseline; }
.ai-loading i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: blink 1s infinite; }
.ai-loading i:nth-child(2) { animation-delay: .2s; }
.ai-loading i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100%{opacity:.25} 50%{opacity:1} }
.chat-toolbar { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }
/* 手动补充需求输入区 */
.head-supply-btn { margin-left: auto; }
/* 补充需求弹窗（居中大弹窗） */
.supply-drawer-mask { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .38); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .15s ease; }
.supply-drawer { width: min(92vw, 820px); max-width: 820px; max-height: 88vh; overflow-y: auto; margin: 0 auto; background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22); padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; animation: supplyPop .18s ease; }
@keyframes supplyPop { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.supply-drawer-head { display: flex; align-items: flex-start; gap: 10px; }
.supply-drawer-title b { font-size: 16px; }
.supply-drawer-title p { margin: 4px 0 0; font-size: 12px; color: #8a94a8; }
.supply-drawer-head span { font-size: 11.5px; color: #8a94a8; flex: 1; }
/* 补充信息：与需求分析联动块 */
.req-supply-linked { margin-bottom: 14px; background: #fffdf4; border: 1px solid #f0e3bd; border-left: 3px solid #e0a800; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.req-supply-tag { font-size: 10.5px; font-weight: 700; color: #a67c00; }
.req-supply-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #5b4a1a; }
.req-supply-text { font-weight: 600; }
.req-supply-img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid #eee0b0; }
.req-supply-cap { font-size: 11px; color: #8a6d1a; }
.supply-attach { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #3a4458; background: #eef4ff; border: 1px dashed #b6d0f5; border-radius: 8px; padding: 6px 10px; }
.supply-attach img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.supply-x { margin-left: auto; border: none; background: transparent; color: #8a94a8; cursor: pointer; font-size: 14px; }
.supply-row { display: block; }
.supply-row textarea { width: 100%; resize: vertical; border: 1px solid #dce4f0; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.6; min-height: 180px; max-height: 52vh; font-family: inherit; outline: none; }
/* 微信式补充输入框：富文本编辑区，粘贴的图片直接内嵌在文字流里 */
.supply-editor { width: 100%; min-height: 380px; max-height: 58vh; overflow-y: auto; border: 1px solid #dce4f0; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.65; outline: none; white-space: pre-wrap; word-break: break-word; background: #fff; }
.supply-editor:focus { border-color: #0d99ff; box-shadow: 0 0 0 2px #e9f3ff; }
.supply-editor:empty::before { content: attr(data-placeholder); color: #9aa4b8; pointer-events: none; }
.supply-editor .supply-inline-img { max-width: 200px; max-height: 140px; border-radius: 6px; border: 1px solid #e3e9f3; vertical-align: middle; margin: 2px 4px 2px 0; }
.supply-editor .supply-img-link { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: 12px; color: #0b63b6; background: #eef4ff; border: 1px dashed #b6d0f5; border-radius: 6px; text-decoration: none; }
.supply-row textarea:focus { border-color: #0d99ff; box-shadow: 0 0 0 2px #e9f3ff; }
/* 底部操作区：附件在左，取消/确认在右（聊天输入框常见布局） */
.supply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.supply-actions-left, .supply-actions-right { display: flex; align-items: center; gap: 10px; }
.supply-attach-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid #dce4f0; background: #fff; border-radius: 8px; color: #3a4458; font-size: 12.5px; cursor: pointer; }
.supply-attach-btn:hover { border-color: #0d99ff; color: #0d99ff; }
.supply-cancel { height: 36px; padding: 0 16px; border: 1px solid #dce4f0; background: #fff; border-radius: 8px; font-size: 12.5px; color: #5a6478; cursor: pointer; }
.supply-cancel:hover { background: #f6f8fc; }
.supply-send { height: 36px; padding: 0 18px; border: none; border-radius: 8px; background: #0d99ff; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.supply-send:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.chat-side { display: flex; flex-direction: column; gap: 16px; }
.side-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.side-list li { font-size: 13px; color: var(--text); padding-left: 20px; position: relative; }
.side-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.digest { display: flex; flex-direction: column; gap: 10px; }
.digest div { display: flex; justify-content: space-between; font-size: 13px; }
.digest span { color: var(--muted); }
.digest b { font-weight: 600; }

/* 需求界面右侧：AI 抽取的客户需求面板 */
.req-side-panel {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 14px 6px; position: relative; overflow: hidden;
}
.req-side-panel .fwb-brief { margin: 0; }
/* 客户目的：行业 / 场景 / 原因 */
.req-purpose { margin-bottom: 8px; padding: 8px 10px; background: #f4f7fc; border: 1px dashed #c9d8f2; border-radius: 10px; display: flex; flex-direction: column; gap: 5px; }
.req-purpose-tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; color: #7a5bd0; background: #efeaff; padding: 2px 8px; border-radius: 20px; }
.req-purpose-row { display: flex; gap: 8px; font-size: 11.5px; color: #3a4458; }
.req-purpose-row b { flex: 0 0 auto; color: #8a94a8; font-weight: 600; }
.req-purpose-row.reason span { line-height: 1.55; }
.req-topic-content { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: #3a4458; }
.req-topic-content b { color: #8a94a8; font-weight: 600; font-size: 11px; }
.req-topic-content ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 2px; }
.req-topic-content li { line-height: 1.5; }
/* 客户素材：从会话收录的图像素材（场景照、Logo、画册等），随产品参与设计 */
.req-material { margin-bottom: 8px; padding: 8px 10px; background: #fbf8f1; border: 1px dashed #e6d9bd; border-radius: 10px; display: flex; flex-direction: column; gap: 7px; }
.req-material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
.req-material-item { position: relative; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid #ece5d5; display: flex; flex-direction: column; }
.req-material-item a { display: block; }
.req-material-item img { width: 100%; height: 58px; object-fit: cover; display: block; cursor: zoom-in; }
.req-material-placeholder { width: 100%; height: 58px; display: flex; align-items: center; justify-content: center; color: #c9bf9f; background: #f4f0e4; }
.req-material-meta { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 2px; }
.req-mat-kind { font-size: 9px; color: #a0873e; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-mat-prod { font-size: 8.5px; color: #b3a783; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 客户需求：两大部分分段标题（一、项目通用信息 / 二、产品具体需求） */
.req-part-title { font-size: 12px; font-weight: 800; color: #2b3a55; letter-spacing: .3px; margin: 10px 0 6px; padding: 5px 10px; background: linear-gradient(90deg, #eef6ff, #f7fbff); border-left: 3px solid #0d99ff; border-radius: 6px; }
.req-part-title:first-of-type { margin-top: 4px; }
/* 客户需求：需求点（产品 / 设计） */
.req-points { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.req-points-title, .req-format-title { font-size: 11px; font-weight: 700; color: #5f6b80; margin-bottom: 5px; }
.req-format-title { color: #44506b; }
.req-point-group { display: flex; flex-direction: column; gap: 4px; }
.req-point-tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.req-point-tag.prod { color: #0d99ff; background: #e9f3ff; }
.req-point-tag.design { color: #e08c00; background: #fff4e2; }
.req-point { font-size: 11.5px; color: #3a4458; line-height: 1.5; padding: 4px 8px; background: #fff; border: 1px solid #edf1f8; border-left: 3px solid #0d99ff; border-radius: 6px; }
.req-point-detail { font-style: normal; color: #9aa5b8; font-size: 11px; }
.req-point-group .req-point:nth-child(n+2) { border-left-color: #8ec5ff; }
/* 客户需求：格式化需求整理列表 —— 名称在上、规格在下的两行布局，多规格拆成独立标签 */
.req-format { display: flex; flex-direction: column; margin-bottom: 8px; border: 1px solid #e3ecfb; border-radius: 10px; overflow: hidden; }
.req-format-head { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 11px; font-weight: 700; color: #8a94a8; background: #eef3fc; padding: 6px 10px; align-items: center; }
.req-format-head .rh-qty { text-align: right; }
.req-format-item { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; background: #fff; border-top: 1px solid #eef2f9; padding: 7px 10px; }
.req-format-item:nth-child(odd) { background: #fbfdff; }
.req-format-main { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; min-width: 0; }
.req-no { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 700; line-height: 1; color: #fff; background: #0d99ff; border-radius: 50%; }
.req-name { font-weight: 600; color: #2b3a55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-qty { text-align: right; font-weight: 700; color: #e08c00; }
.req-spec { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-left: 2px; min-width: 0; }
.req-spec-lbl { flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: #9aa5b8; }
.req-spec-chip { font-size: 10.5px; color: #55617a; background: #f2f6fd; border: 1px solid #e3ecfb; border-radius: 5px; padding: 1px 6px; line-height: 1.5; word-break: break-all; }
.req-act { text-align: right; }
.req-gen-btn { font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #0d99ff, #5b6cff); border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: opacity .15s; }
.req-gen-btn:hover { opacity: .85; }
/* 区域(group)分组：同一组合区域的产品归一组，可一起生成整体效果图 */
.req-format-group { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: #3a4a6b; background: #eef6ff; padding: 6px 10px; border-top: 1px solid #e3ecfb; }
.req-format-group .rg-icon { flex: 0 0 auto; color: #0d99ff; }
.req-format-group .rg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-format-group .rg-gen { margin-left: auto; flex: 0 0 auto; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: opacity .15s; white-space: nowrap; }
.req-format-group .rg-gen:hover:enabled { opacity: .85; }
.req-format-group .rg-gen:disabled { opacity: .6; cursor: not-allowed; }
.req-format-rgimg { padding: 8px 10px; background: #fbfdff; border-top: 1px solid #eef2f9; }
.req-format-rgimg img { width: 100%; border-radius: 8px; border: 1px solid #e3ecfb; display: block; }
/* 产品具体需求：逐条标准段落（序号 + 名称 + [区域] + 数量 + 完整描述） */
.req-paras { display: flex; flex-direction: column; margin-bottom: 8px; border: 1px solid #e3ecfb; border-radius: 10px; overflow: hidden; }
.req-para { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; background: #fff; border-top: 1px solid #eef2f9; padding: 8px 10px; }
.req-para:first-child { border-top: none; }
.req-para:nth-child(odd) { background: #fbfdff; }
.req-para-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.req-para-no { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 700; line-height: 1; color: #fff; background: #0d99ff; border-radius: 50%; }
.req-para-name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: #2b3a55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-para-tag { flex: 0 0 auto; font-size: 10px; font-weight: 700; color: #0d99ff; background: #e9f3ff; border-radius: 4px; padding: 1px 6px; }
.req-para-qty { flex: 0 0 auto; font-weight: 700; color: #e08c00; }
.req-para-text { font-size: 11.5px; color: #3a4458; line-height: 1.6; padding-left: 22px; word-break: break-word; }
/* 产品区域内的素材：需求在上，实景照片/效果参考图分组在下 */
.req-para-mats { margin-top: 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.req-mat-group { display: flex; flex-direction: column; gap: 6px; }
.req-para-mats .req-material-grid { margin-top: 2px; }
.req-extracting {
  position: absolute; inset: 0; z-index: 5; background: rgba(255,255,255,.72); backdrop-filter: blur(2px);
  display: grid; place-items: center; font-size: 13.5px; color: var(--blue); font-weight: 600; text-align: center; padding: 0 20px;
}

/* 报价单 */
.quote-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
/* 报价单产品列缩略图 */
.pi-cell { display: flex; align-items: center; gap: 10px; }
.pi-thumb { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #f2f5f9; }
.pi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pi-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pi-name { font-weight: 600; font-size: 13.5px; }
.pi-spec { color: var(--muted); font-size: 12px; }
/* 订单列表：负责人行内下拉 */
.ord-assign-select { max-width: 120px; height: 26px; padding: 2px 6px; font-size: 12px; color: var(--text); border: 1px solid #dce4f0; border-radius: 6px; background: #fff; cursor: pointer; outline: none; }
.ord-assign-select:hover, .ord-assign-select:focus { border-color: #0d99ff; box-shadow: 0 0 0 2px #e9f3ff; }
.quote-panel { padding: 20px; }
.quote-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.quote-toolbar { margin-bottom: 10px; }
.quote-cust b { font-size: 16px; display: block; }
.quote-cust span { color: var(--muted); font-size: 12px; }
.quote-ai { font-size: 12px; color: var(--blue); background: #eef1fe; padding: 6px 12px; border-radius: 20px; }
.quote-tbl { margin-top: 6px; }
.amount { font-weight: 700; color: var(--text); white-space: nowrap; }
.mini-input { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 7px 8px; font-size: 13px; color: var(--text); background: #fff; }
.mini-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.mini-input.wide { min-width: 120px; }
.mini-input.empty { border-color: #f66; box-shadow: 0 0 0 3px rgba(255,102,102,.12); }
.mini-input.err { border-color: #e2442c; box-shadow: 0 0 0 3px rgba(226,68,44,.14); }
.mini-input:disabled { background: #f3f5f8; color: var(--muted); cursor: not-allowed; }
.size-err { color: #e2442c; font-size: 11px; margin-top: 4px; line-height: 1.3; }
.src-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; line-height: 1.6; align-self: flex-start; }
.src-tag.lib { color: #2f57a8; background: #eaf0ff; }
.src-tag.manual { color: #b26b00; background: #fff3dd; }
.manual-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; color: #b26b00; background: #fff3dd; line-height: 1.6; }
.mini-input.manual { border-color: #e0a53a; background: #fffaf0; }
.ref-price { min-width: 96px; line-height: 1.35; }
.tier-hint { display: block; font-size: 11px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.tier-reset { margin-top: 2px; padding: 0; font-size: 11px; color: var(--blue); background: none; border: none; cursor: pointer; }
.tier-reset:hover { text-decoration: underline; }
.tier-edit-table { margin-bottom: 8px; }
.tier-edit-table td { padding: 4px 6px; }
.tier-edit-table .mini-input { min-width: 80px; }
.name-input.select { appearance: auto; }
.quote-toolbar { display: flex; gap: 10px; align-items: center; margin: 14px 0 4px; flex-wrap: wrap; }
.quote-hint { font-size: 12px; color: var(--muted); margin: 4px 0 2px; }
.ai-gen-tip { font-size: 12px; color: #d97a1e; background: #fff6e9; border: 1px solid #ffd9a8; border-radius: 8px; padding: 7px 12px; margin: 6px 0 4px; }
.ai-gen-tip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f5a623; margin-right: 7px; }
.quote-tbl tr.miss { background: #fffbe8 !important; }
.quote-tbl tr.miss td { border-top-color: #ffe9b0; }
.del-row { border: none; background: transparent; color: #ccc; font-size: 14px; cursor: pointer; padding: 2px 4px; border-radius: 5px; line-height: 1; }
.del-row:hover { color: #e2442c; background: #fee7e2; }
.dim-na { color: #c5c5c5; }
.quote-custom-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.name-input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font-size: 13.5px; font-weight: 600; color: var(--text); background: #fff; }
.name-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.spec-input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px; font-size: 12px; color: var(--muted); background: #fff; }
.spec-input:focus { outline: none; border-color: var(--blue); color: var(--text); }
.quote-sum { margin: 18px 0 0; margin-left: auto; width: 260px; display: flex; flex-direction: column; gap: 8px; }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sum-row b { color: var(--text); font-weight: 600; }
.sum-row.total { border-top: 1px dashed var(--border); padding-top: 10px; font-size: 15px; }
.sum-row.total b { font-size: 20px; color: var(--blue); }
.quote-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.quote-note { color: var(--muted); font-size: 12px; margin-top: 12px; text-align: right; }

/* 产品信息库 */
.prod-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.craft-bot-btn { border-color: #b9ccff; color: #2f6bff; }
.craft-bot-btn:hover { background: #eef4ff; border-color: #2f6bff; }
/* 工艺智能体 · 内部维护对话抽屉 */
.craft-mask { position: fixed; inset: 0; z-index: 75; background: rgba(15, 23, 42, .35); display: flex; justify-content: flex-end; }
.craft-drawer { width: min(560px, 100vw); height: 100%; background: #fff; box-shadow: -10px 0 40px rgba(15, 23, 42, .18); display: flex; flex-direction: column; animation: craftIn .18s ease; }
@keyframes craftIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.craft-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.craft-head-txt b { font-size: 15px; }
.craft-head-txt p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.craft-head-ops { display: flex; align-items: center; gap: 8px; flex: none; }
.craft-link { border: none; background: transparent; color: var(--blue); font-size: 12px; cursor: pointer; }
.craft-x { border: none; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; padding: 2px 4px; }
.craft-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: #f7f9fc; }
.craft-empty { color: var(--muted); font-size: 12.5px; line-height: 1.7; background: #fff; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; }
.craft-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.craft-msg.user { align-self: flex-end; align-items: flex-end; }
.craft-msg.agent { align-self: flex-start; }
.craft-role { font-size: 11px; color: var(--muted); }
.craft-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.65; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.craft-msg.user .craft-text { background: var(--blue); border-color: var(--blue); color: #fff; }
.craft-text p { margin: 0 0 6px; }
.craft-text p:last-child { margin-bottom: 0; }
.craft-text h1, .craft-text h2, .craft-text h3, .craft-text h4 { margin: 8px 0 4px; line-height: 1.35; }
.craft-text h1 { font-size: 15px; } .craft-text h2 { font-size: 14.5px; } .craft-text h3 { font-size: 13.5px; } .craft-text h4 { font-size: 13px; }
.craft-text ul { margin: 4px 0 6px; padding-left: 18px; }
.craft-text li { margin: 2px 0; }
.craft-text .ai-table { margin: 6px 0; overflow-x: auto; }
.craft-text table { width: 100%; border-collapse: collapse; font-size: 12px; }
.craft-text th, .craft-text td { border: 1px solid var(--border); padding: 5px 7px; text-align: left; vertical-align: top; }
.craft-text th { background: #f3f5fa; font-weight: 600; }
.craft-typing { color: var(--blue); }
.craft-input { flex: none; border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.craft-input textarea { width: 100%; box-sizing: border-box; resize: none; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 13px; line-height: 1.55; font-family: inherit; outline: none; }
.craft-input textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.craft-actions { display: flex; justify-content: space-between; gap: 10px; }
.craft-upload { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.craft-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.craft-upload.disabled { opacity: .5; pointer-events: none; }
.craft-attach { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--border); background: #f8fafc; font-size: 12px; }
.craft-attach-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.craft-attach-x { border: none; background: none; color: var(--blue); cursor: pointer; font-size: 12px; }
.search-input { border: 1px solid var(--border); border-radius: 9px; padding: 9px 13px; font-size: 13px; width: 260px; background: #fff; }
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.row-ops { display: flex; gap: 6px; }
.ord-ops { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ord-ops .ord-status-btn { margin-left: 4px; }
.op-btn { font-size: 12px; color: var(--blue); border: 1px solid #c6d5ff; padding: 4px 10px; border-radius: 7px; background: #f7f9ff; transition: all .18s; }
.op-btn:hover { background: var(--blue); color: #fff; }
.op-btn.danger { color: #d24b4b; border-color: #f3cccc; background: #fdf4f4; }
.op-btn.danger:hover { background: #d24b4b; color: #fff; }
.empty-cell { text-align: center; color: var(--muted); padding: 30px !important; }
.perm-tip { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,26,48,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 660px; max-width: 100%; max-height: 86vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h3 { font-size: 17px; }
.modal-x { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; }
.modal-x:hover { background: var(--bg); color: var(--text); }
.modal-sub { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.req-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.req-meta div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.req-meta span { display: block; font-size: 11px; color: var(--muted); }
.req-meta b { font-size: 13px; font-weight: 600; display: block; margin-top: 2px; }
.req-tbl { margin-bottom: 12px; }
.req-follow { background: #fff7e8; color: #a06a00; font-size: 12.5px; padding: 10px 14px; border-radius: 9px; }
.req-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.product-modal { width: 520px; }
.quote-detail-modal { width: 720px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.form-grid label.full { grid-column: span 2; }
.form-grid input, .form-grid select { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; background: #fff; color: var(--text); }
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }

/* Toast */
.cs-toast {
  position: fixed; top: 74px; right: 26px; z-index: 2000;
  background: #1c2340; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  animation: toastIn .25s ease;
}
.cs-toast.warn { background: #b9770b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 智能设计模块 ============ */
.btn-primary.sm, .btn-ghost.sm { padding: 6px 12px; font-size: 12.5px; }
.btn-primary.lg, .btn-ghost.lg { padding: 11px 22px; font-size: 14px; }

.dm { min-height: 420px; }
.dm-step-bar { display: flex; gap: 0; margin-bottom: 18px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.dm-step { flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--panel); border-right: 1px solid var(--border); }
.dm-step .step-no { width: 30px; height: 30px; border-radius: 50%; background: #eef1fe; color: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.dm-step.on .step-no { background: var(--blue); color: #fff; }
.dm-step.done .step-no { background: var(--green); color: #fff; }
.dm-step b { font-size: 14px; display: block; }
.dm-step i { font-style: normal; font-size: 12px; color: var(--muted); }

.dm-req { padding: 20px; margin-bottom: 16px; }
.dm-req-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dm-req-head h3 { font-size: 15px; }
.dm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dm-form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dm-form-grid label.full { grid-column: span 2; }
.dm-form-grid input, .dm-form-grid select { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; background: #fff; color: var(--text); }
.dm-form-grid input:focus, .dm-form-grid select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.dm-req-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.dm-prompt { margin-top: 16px; background: #eef4ff; border: 1px solid #cfdcff; border-radius: 10px; padding: 14px; }
.dm-prompt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dm-prompt-head b { font-size: 13.5px; color: #143a9e; }
.dm-prompt p { font-size: 13px; line-height: 1.7; color: #1c2340; }
.tag-ai { font-size: 11px; color: var(--blue); background: #fff; padding: 3px 9px; border-radius: 20px; }

.dm-gen-bar { margin: 6px 0 18px; display: flex; gap: 14px; align-items: center; }
.dm-gen-hint { color: var(--muted); font-size: 13px; }
.dm-sec { margin-bottom: 18px; }
.dm-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dm-sec-head h3 { font-size: 15px; }
.dm-warn { font-size: 12px; color: #c07a00; background: #fff4dc; padding: 4px 11px; border-radius: 20px; }
.cand-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cand { background: var(--panel); border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: all .18s; }
.cand:hover { transform: translateY(-3px); }
.cand.sel { border-color: var(--blue); box-shadow: 0 8px 24px rgba(47,107,255,.25); }
.cand-img { position: relative; }
.cand-img img { width: 100%; height: 218px; object-fit: cover; display: block; }
.cand-watermark { position: absolute; inset: 50% 0 auto 0; transform: translateY(-50%); text-align: center; color: rgba(255,255,255,.9); background: rgba(0,0,0,.35); font-size: 13px; letter-spacing: 1px; padding: 6px 0; font-weight: 600; }
.cand-meta { padding: 10px 12px; }
.cand-meta b { font-size: 13.5px; display: block; }
.cand-meta span { font-size: 12px; color: var(--muted); display: block; margin-top: 3px; }
.cand-meta em { font-style: normal; font-size: 12px; color: var(--blue); font-weight: 700; display: block; margin-top: 4px; }
.dm-actions { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
.dm-hint { color: var(--muted); font-size: 12.5px; }

.refine-panel { background: var(--panel); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.refine-steps { display: flex; gap: 12px; margin-bottom: 16px; }
.rstep { flex: 1; text-align: center; font-size: 13px; color: var(--muted); position: relative; padding: 10px 0; border-radius: 9px; background: #fff; border: 1px solid var(--border); }
.rstep.active { color: var(--blue); border-color: var(--blue); background: #eef4ff; font-weight: 600; }
.rstep.done { color: var(--green); border-color: #b8ecd4; background: #eef9f2; }
.rstep i { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--border); margin-right: 6px; vertical-align: middle; }
.rstep.active i { background: var(--blue); }
.rstep.done i { background: var(--green); }
.refine-progress { height: 12px; border-radius: 20px; background: #eef1f7; overflow: hidden; }
.rp-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--blue), #4d9bff); transition: width .12s linear; }
.refine-meta { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--muted); }
.refine-meta b { color: var(--blue); font-size: 15px; }

.dm-final-tags { display: flex; gap: 8px; }
.tag-final { font-size: 12px; color: var(--green); background: #e9f8f0; border: 1px solid #bbe8d0; padding: 4px 12px; border-radius: 20px; font-weight: 600; }
.final-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.final-canvas { background: var(--panel); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); text-align: center; }
.final-view { position: relative; border-radius: 10px; overflow: hidden; }
.final-view img { width: 100%; max-height: 500px; object-fit: cover; display: block; }
.final-print { position: absolute; left: 12px; top: 12px; background: rgba(0,168,107,.9); color: #fff; font-size: 12px; padding: 5px 11px; border-radius: 20px; font-weight: 600; }
.final-bar { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.final-file { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.res-panel { padding: 18px; }
.res-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.res-head h3 { font-size: 14px; }
.res-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.res-chip { border: 1px solid var(--border); border-radius: 8px; padding: 6px 13px; font-size: 12.5px; color: var(--text); background: #fff; }
.res-chip.on { border-color: var(--blue); color: var(--blue); background: #eef4ff; font-weight: 600; }
.res-custom { display: flex; gap: 8px; margin-bottom: 16px; }
.res-custom input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; font-size: 13px; }
.res-custom input:focus { outline: none; border-color: var(--blue); }
.res-preview { border: 1px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.res-dims b { font-size: 26px; color: var(--blue); display: block; }
.res-dims span { color: var(--muted); font-size: 13px; }
.res-chip-mark { margin-top: 10px; font-size: 12.5px; color: #a06a00; background: #fff4dc; padding: 7px 10px; border-radius: 8px; }
.res-chip-mark.high { color: var(--green); background: #e9f8f0; }
.res-note { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* 任务队列 */
.queue-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.queue-count { color: var(--muted); font-size: 13px; }
.task-id { color: var(--blue); font-weight: 700; }
.st { display: inline-block; font-size: 12px; padding: 4px 11px; border-radius: 20px; font-weight: 600; }
.st.done { color: var(--green); background: #e9f8f0; }
.st.running { color: var(--blue); background: #e8eeff; }
.st.queued { color: #a06a00; background: #fff2d8; }
.st.failed { color: #cc3f3f; background: #fcecec; }
.queue-modal { width: 560px; }
.qd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.qd-grid .full { grid-column: span 2; }
.qd-grid > div { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.qd-grid span { display: block; font-size: 11px; color: var(--muted); }
.qd-grid b { font-size: 13px; font-weight: 600; margin-top: 2px; display: block; }

/* ============ 内置 ERP 模块 ============ */
.erp { min-height: 420px; }
.erp-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.erp-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.src-filter { display: flex; gap: 6px; }
.src-filter button { border: 1px solid var(--border); border-radius: 8px; padding: 7px 13px; font-size: 12.5px; color: var(--muted); background: #fff; }
.src-filter button.on, .src-filter button:hover { color: var(--blue); border-color: var(--blue); background: #eef4ff; font-weight: 600; }
.erp-legends { display: flex; gap: 20px; padding: 10px 18px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.erp-legends i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.lvl { display: inline-block; font-size: 12px; padding: 3px 11px; border-radius: 20px; font-weight: 600; }
.lvl.vip { color: #2046b8; background: #e8edff; }
.lvl.gold { color: #a06a00; background: #fff2d8; }
.lvl.std { color: var(--muted); background: #eef1f7; }
.ptag { display: inline-block; font-size: 11.5px; color: var(--blue); background: #eef4ff; border: 1px solid #d6e1ff; padding: 3px 10px; border-radius: 6px; margin: 2px 4px 2px 0; }
.src { display: inline-block; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.src.quote { color: var(--green); background: #e9f8f0; }
.src.manual { color: var(--purple); background: #f4ecfa; }
.src.wechat { color: var(--green); background: #e9f8f0; }
.src.custom { color: #666b76; background: #eef0f3; }
.erp-back { color: var(--blue); cursor: pointer; font-size: 13px; margin-bottom: 12px; display: inline-block; }
.erp-back:hover { text-decoration: underline; }
.erp-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.erp-client { display: flex; align-items: center; gap: 14px; }
.erp-client h3 { font-size: 17px; }
.erp-client p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.erp-client .avatar.vip, .erp-client .avatar.order { background: var(--blue); }
.erp-client .avatar.gold { background: #e08c00; }
.erp-client .avatar.std { background: #8a93a6; }
.erp-stat { display: flex; gap: 26px; }
.erp-stat b { display: block; font-size: 18px; color: var(--text); }
.erp-stat span { color: var(--muted); font-size: 12px; }
/* 订单详情头部：负责人（含配发下拉） */
.erp-stat .erp-stat-assign { min-width: 120px; }
.erp-stat .erp-stat-assign select { display: block; width: 100%; margin-top: 6px; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: inherit; }
.erp-head-actions { display: flex; gap: 10px; }
.erp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ep-title { font-size: 14px; margin-bottom: 12px; }
.ep-title em.muted { color: var(--muted); font-weight: 400; font-style: normal; font-size: 12px; }
.ep-title.m { margin-top: 18px; }
.erp-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.erp-info > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.erp-info > div.full { grid-column: span 2; }
.erp-info span { display: block; font-size: 11px; color: var(--muted); }
.erp-info b { font-size: 13px; font-weight: 600; margin-top: 2px; display: block; }
/* 订单详情：负责人二次配发下拉 */
.erp-info .erp-assign { display: block; width: 100%; margin-top: 6px; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: inherit; }
/* 客户详情：微信号维护 */
.erp-wx-mgmt { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.erp-wx-mgmt .wx-title { font-size: 12px; margin-bottom: 8px; }
.erp-wx-mgmt .wx-title em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.erp-wx-mgmt .wx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.erp-wx-mgmt .wx-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); background: #e9f8f0; border: 1px solid #cdeeda; border-radius: 6px; padding: 3px 8px; }
.erp-wx-mgmt .wx-tag .wx-del { font-style: normal; color: var(--muted); cursor: pointer; font-size: 11px; }
.erp-wx-mgmt .wx-tag .wx-del:hover { color: #e5484d; }
.erp-wx-mgmt .wx-empty { font-size: 12px; color: var(--muted); }
.erp-wx-mgmt .wx-add { display: flex; gap: 6px; margin-top: 8px; }
.erp-wx-mgmt .wx-add input { flex: 1; min-width: 0; }
.erp-tags { display: flex; flex-wrap: wrap; }
.erp-consult { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; }
.erp-consult .tt { font-size: 11px; color: var(--blue); font-weight: 600; margin-right: 8px; }
.erp-consult p { font-size: 13px; margin: 4px 0; }
.erp-consult em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.empty-mini { color: var(--muted); font-size: 13px; padding: 14px; text-align: center; }
.erp-modal { width: 560px; }
.erp-modal.lg { width: 720px; }
.erp-modal textarea { min-height: 72px; resize: vertical; }
.erp-approve-line, .ap-records { padding-top: 4px; }
.erp-approve-line > div { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.erp-approve-line i { width: 18px; height: 18px; border-radius: 50%; background: var(--border); flex: none; }
.erp-approve-line > div > i.done { background: var(--green); }
.erp-approve-line > i.done { background: var(--green); }
.erp-approve-line > i.current { background: var(--blue); box-shadow: 0 0 0 4px rgba(47, 107, 255, .15); }
.erp-approve-line b { font-size: 13px; }
.erp-approve-line span { color: var(--muted); font-size: 12px; margin-left: auto; }
/* 订单流程：状态 / 操作人 / 操作时间 */
.erp-approve-line.flow-head,
.erp-approve-line.flow-row {
  display: grid;
  grid-template-columns: 18px minmax(150px, 1.3fr) minmax(90px, 1fr) minmax(140px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.erp-approve-line.flow-head { padding-top: 0; color: var(--muted); font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); }
.erp-approve-line.flow-head > div { display: block; padding: 0; border: none; }
.erp-approve-line.flow-row > div { display: flex; align-items: center; gap: 8px; padding: 0; border: none; }
.erp-approve-line.flow-row .flow-status span { margin-left: auto; color: var(--muted); font-size: 12px; }
.erp-approve-line.flow-row .flow-operator,
.erp-approve-line.flow-row .flow-time { color: #3a4250; font-size: 12px; }
.ep-foot { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* 审批 */
.ap-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ap-tabs button { border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: 13px; color: var(--muted); background: #fff; }
.ap-tabs button.on { color: var(--blue); border-color: var(--blue); background: #eef4ff; font-weight: 600; }
.ap-internal { padding: 18px; }
.ap-flow-hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.ap-flow-hint i.fq { font-style: normal; color: var(--green); }
.ap-flow-hint i.f2 { color: var(--blue); }
.ap-nodes { display: flex; gap: 6px; }
.ap-nodes span { font-size: 11.5px; border-radius: 16px; padding: 3px 11px; background: #eef1f7; color: var(--muted); }
.ap-nodes span.active { background: var(--blue); color: #fff; font-weight: 600; }
.ap-nodes span.done { background: var(--green); color: #fff; }
.ap-record { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; }
.ap-record b { font-size: 13px; }
.ap-record p { font-size: 12.5px; color: var(--muted); margin: 3px 0 0 4px; }
.ap-records { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }

/* 订单看板 */
.kanban-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; }
.kanban-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.kb-exec { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #eef4ff, #f6f0ff); border: 1px solid #c9d8ff; border-radius: 12px; padding: 5px 14px; font-size: 14px; }
.kb-exec-label { font-weight: 600; color: #2f6bff; }
.kb-exec-num { font-size: 18px; font-weight: 700; line-height: 1; color: #2a5bd7; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.kanban-count b { color: var(--blue); }
.kanban-hint { font-size: 12px; color: var(--blue); background: #eef4ff; border: 1px dashed var(--blue); border-radius: 10px; padding: 3px 10px; }
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: stretch; }
.kanban-col { background: var(--bg, #f5f6fa); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-height: max(420px, calc(100vh - 280px)); }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: #fff; border-bottom: 2px solid var(--kb); font-size: 14px; }
.kb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.kb-count { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg, #f5f6fa); border: 1px solid var(--border); border-radius: 12px; padding: 1px 9px; }
.kanban-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kb-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; cursor: grab; transition: box-shadow .15s, border-color .15s, opacity .15s; }
.kb-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.06); border-color: var(--kb, var(--blue)); }
.kb-card:active { cursor: grabbing; }
.kb-card.drag-ghost { opacity: .45; }
.kanban-col.drag-over { background: #eef4ff; border-style: dashed; border-color: var(--blue); }
.kb-grip { font-size: 11px; color: var(--muted); cursor: grab; user-select: none; }
.kb-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; color: #24292f; }
.kb-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 2px 0; }
.kb-meta b { color: #3a4250; font-weight: 500; text-align: right; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.kb-type { font-size: 11px; color: var(--blue); background: #eef4ff; border-radius: 10px; padding: 2px 8px; }
.kb-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; }
.status-confirm-hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* 订单状态标签（列表展示） */
.src.st-communicate { color: #2f6bff; background: #eaf0ff; }
.src.st-design { color: #7a52d8; background: #f2ecfb; }
.src.st-production { color: #e08c00; background: #fff3dd; }
.src.st-install { color: #0aa878; background: #e6f8f1; }
.src.st-payment { color: #c0392b; background: #fdeeec; }
.src.st-completed { color: #2fa84c; background: #e9f8ee; }

/* 飞书审批形态 */
.fs-panel { padding: 18px; }
.fs-banner { display: flex; align-items: center; gap: 14px; background: linear-gradient(90deg, #1677ff, #0e5fd8); color: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.fs-logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; color: #1677ff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex: none; }
.fs-banner b { font-size: 16px; }
.fs-banner p { font-size: 12.5px; opacity: .9; margin-top: 3px; }
.fs-list { display: flex; flex-direction: column; gap: 12px; }
.fs-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; }
.fs-item-head { display: flex; justify-content: space-between; align-items: center; }
.fs-item-head b { font-size: 14px; }
.fs-tag { font-size: 12px; color: var(--blue); background: #eef4ff; padding: 3px 12px; border-radius: 20px; }
.fs-item > p { color: var(--muted); font-size: 12.5px; margin: 6px 0 10px; }
.fs-node { display: flex; gap: 10px; }
.fs-node span { font-size: 12px; border-radius: 16px; padding: 4px 14px; background: #f2f4f9; color: var(--muted); }
.fs-node span.on { background: var(--blue); color: #fff; font-weight: 600; }
.fs-node span.done { background: var(--green); color: #fff; }
.fs-records { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.fs-records i { color: var(--green); font-style: normal; margin-right: 4px; }

/* 审批配置 */
.erp-config { padding: 20px; }
.erp-switch { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
.erp-switch h4 { font-size: 15px; }
.erp-switch p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: #eef1f7; border-radius: 24px; padding: 4px 6px 4px 14px; transition: all .2s; }
.switch.on { background: var(--blue); color: #fff; }
.switch .knob { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.erp-config-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.cfg-mode { border: 2px solid var(--border); border-radius: 12px; padding: 16px; }
.cfg-mode.on { border-color: var(--blue); background: #f5f8ff; }
.cfg-mode b { font-size: 15px; display: block; }
.cfg-mode span { color: var(--muted); font-size: 12.5px; display: block; margin: 4px 0; }
.cfg-mode small { color: var(--muted); font-size: 12px; }

/* 系统配置聚合模块 */
.dep { min-height: 420px; }
.dp-bar-title { font-weight: 700; font-size: 14px; }
.syscfg-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.syscfg-tabs button { border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: 13px; color: var(--muted); background: #fff; cursor: pointer; }
.syscfg-tabs button.on { color: var(--blue); border-color: var(--blue); background: #eef4ff; font-weight: 600; }
.btn-link { border: none; background: none; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.model-settings-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.model-settings-head .btn-ghost { flex: 0 0 auto; margin-top: 2px; }
.model-settings-head .panel-title { margin-bottom: 4px; }
.panel-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.dp-note { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.dp-note i { font-style: normal; }
.dp-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.dp-tabs button { border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: 13px; color: var(--muted); background: #fff; }
.dp-tabs button.on { color: var(--blue); border-color: var(--blue); background: #eef4ff; font-weight: 600; }
.dp-int-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dp-int-grid .form-grid textarea { min-height: 60px; resize: vertical; }

/* ================= 自定义知识库模块（V2.0） ================= */
.kb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.kb-env { display: flex; align-items: center; gap: 10px; }
.kb-env-tip { font-size: 12px; color: var(--muted); }
.kb-chip { display: inline-flex; align-items: center; font-size: 11px; color: var(--blue); background: #f0f5ff; border: 1px solid #cfdffc; padding: 2px 8px; border-radius: 20px; margin: 2px 4px 2px 0; }
.kb-scene-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.kb-scene-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: #f2f4fa; border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; cursor: pointer; transition: all .18s; }
.kb-scene-check.on { color: var(--text); border-color: var(--blue); background: #eef4ff; }
.kb-scene-check input { accent-color: var(--blue); }
.kb-inline-tip { font-size: 12px; color: var(--muted); font-weight: 400; }
.kb-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.kb-detail-title { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.kb-detail-title b { color: var(--text); }
.kb-id { margin-left: auto; color: var(--muted); font-size: 12px; }
.kb-tabs { margin-bottom: 14px; }
.kb-upload { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.kb-upload input[type="file"] { font-size: 13px; }
.kb-upload input[type="file"]:disabled { opacity: .5; cursor: not-allowed; }
.kb-docs { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px dashed var(--border); }
.kb-docs li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.kb-doc-type { font-size: 11px; font-weight: 700; color: #c0392b; background: #fdeeee; border: 1px solid #f3cece; padding: 2px 8px; border-radius: 6px; }
.kb-doc-name { color: var(--text); }
/* 业务联动引用标记 */
.kb-ref { margin-top: 6px; font-size: 11px; color: var(--green); background: #eefaf3; border: 1px solid #c7ecd8; padding: 4px 10px; border-radius: 8px; max-width: 480px; }
.quote-kb { align-self: flex-start; font-size: 12px; color: var(--green); background: #eefaf3; border: 1px solid #c7ecd8; padding: 5px 11px; border-radius: 8px; }
.dm-prompt-src { margin-top: 8px; font-size: 12px; color: var(--green); background: #eefaf3; border: 1px dashed #c7ecd8; padding: 6px 10px; border-radius: 8px; }

/* 响应式 */
@media (max-width: 980px) {
  .login-card { margin: 0; }
  .panel-row { grid-template-columns: 1fr; }
  .cfg-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 账号信息维护弹窗 */
.profile-mask {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 20, 35, .42); backdrop-filter: blur(3px);
}
.profile-card {
  width: 440px; max-width: calc(100vw - 40px); background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(20, 30, 60, .3); overflow: hidden;
}
.profile-head {
  display: flex; align-items: center; gap: 14px; padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.profile-head .avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.profile-head-info { flex: 1; min-width: 0; }
.profile-head-info h3 { margin: 0; font-size: 16px; color: var(--text); }
.profile-head-info p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.profile-close { color: var(--muted); }
.profile-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.ptab {
  border: none; background: transparent; font-size: 13px; color: var(--muted);
  padding: 11px 4px 9px; margin-right: 16px; cursor: pointer; border-bottom: 2px solid transparent;
}
.ptab.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.profile-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 13px; max-height: 330px; overflow-y: auto; }
.profile-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.profile-body label input {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; color: var(--text); background: #fff;
}
.profile-body label input:focus { outline: none; border-color: var(--blue); }
.profile-hint { font-style: normal; font-size: 11.5px; color: #b0b6c4; }
.psec-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.psec-row b { font-size: 13px; }
.psec-row p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.op-btn {
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
  font-size: 12.5px; color: var(--text); padding: 6px 14px; cursor: pointer;
}
.op-btn:hover { border-color: var(--blue); color: var(--blue); }
/* 详情按钮：浅灰细边框 + 深灰文字，弱化样式，与左侧业务入口视觉区分 */
.op-btn.weak {
  border-color: #e3e6eb; color: #6b7280; background: #fff;
}
.op-btn.weak:hover { border-color: var(--blue); color: var(--blue); background: #f7f9fb; }
/* 订单流程阶段按钮：统一可点击白底黑字浅边框，仅终态变绿 */
.ph-btn {
  position: relative; background: #fff; border: 1px solid #d7dce3; color: #222;
  font-size: 12.5px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.ph-btn:hover { border-color: var(--blue); color: var(--blue); }
.ph-btn.green { color: #1a9e5c; border-color: #9fd8b8; }
.ph-btn.green:hover { background: #eaf7f0; }
.ph-dot {
  position: absolute; top: 3px; right: 2px; width: 6px; height: 6px;
  border-radius: 50%; background: #f5b400; box-shadow: 0 0 0 2px #fff;
}
.ph-tag { display: inline-block; margin-left: 8px; font-size: 12px; color: #9aa3b2; }
.op-btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.profile-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px;
  border-top: 1px solid var(--border); background: #fafbfc;
}

/* =============================================================
 * AI 图片编辑工作台（Figma 风格三栏）  V1.0
 * 浅色面板 #FFFFFF / #F5F5F5，分割线 #E5E5E5，画布深灰 #2C2C2C
 * 文字 12px / 11px 辅助，圆角 2px，1px 细边框，16px 线性灰色图标
 * ============================================================= */

/* 工作台撑满内容区（清除父级内边距，并隐藏全局页脚避免抢占宽度） */
.content:has(> .figma-wb) { padding: 0; display: flex; min-height: 0; }
.content:has(> .figma-wb) .content-foot { display: none; }
.figma-wb { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }

/* 悬浮面板通用（白色圆角卡片，浮于画布上方，四周留白不锁死边缘） */
.fwb-panel {
  background: #ffffff; border: 1px solid #e3e6ec; box-sizing: border-box;
  box-shadow: 0 12px 36px rgba(20, 30, 60, .14), 0 2px 8px rgba(20, 30, 60, .06);
}
.fwb-panel .fwb-ph {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 11px 12px; border-bottom: 1px solid #eef0f4;
}
.fwb-ph-title {
  font-size: 12px; font-weight: 700; color: #2b2f38; letter-spacing: .2px;
  display: inline-flex; align-items: center; gap: 7px;
}
.fwb-ph-title::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, #0d99ff, #4dc3ff);
  box-shadow: 0 0 0 3px rgba(13, 153, 255, .16);
}
.fwb-fold {
  width: 22px; height: 22px; padding: 0; font-size: 12px; color: #666;
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.fwb-fold:hover { background: #e6e6e6; border-color: #ddd; color: #111; }
.fwb-fold.off { color: #555; background: #ececec; }

/* ---------- 左侧悬浮工具栏（可随设计功能扩展增加工具） ---------- */
.fwb-rail {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  z-index: 7; display: flex; flex-direction: column; gap: 4px; padding: 7px;
  background: #ffffff; border: 1px solid #e3e6ec; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, .14), 0 2px 8px rgba(20, 30, 60, .06);
}
.fwb-rail-btn {
  width: 34px; height: 34px; font-size: 16px; line-height: 1; color: #4a4f5a;
  background: transparent; border: none; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.fwb-rail-btn:hover { background: #ecf5ff; color: #0d99ff; }
.fwb-rail-btn.active { background: #0d99ff; color: #fff; }
.fwb-rail-btn.active:hover { background: #0c8ce8; color: #fff; }
.fwb-rail-btn.wide { width: auto; padding: 0 12px; font-size: 12px; font-weight: 600; gap: 3px; }
.fwb-rail-btn.danger:hover { background: #fff0f0; color: #e5484d; }
.fwb-rail-sep { height: 1px; background: #eef0f4; margin: 3px 0; }

.fwb-chip {
  font-size: 11px; color: #40454f; background: #f5f6f8; border: 1px solid #e6e8ee;
  border-radius: 7px; padding: 3px 9px; cursor: pointer; transition: all .15s;
}
.fwb-chip:hover { border-color: #0d99ff; color: #0d99ff; background: #f2f8ff; }
.fwb-chip.on { background: #ecf5ff; border-color: #0d99ff; color: #0d99ff; font-weight: 600; }

/* 右侧需求面板：可收起/展开 */
.fwb-reqside {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 20;
}
.fwb-req-toggle {
  flex: 0 0 auto; width: 36px; height: 36px; font-size: 15px; line-height: 1;
  color: #0d99ff; background: #ffffff; border: 1px solid #dde0e8; border-radius: 10px;
  cursor: pointer; box-shadow: 0 12px 26px rgba(20, 30, 60, .14); display: grid; place-items: center;
}
.fwb-req-toggle:hover { background: #ecf5ff; border-color: #cfe3ff; }
.fwb-reqbody { animation: fwb-pop .18s ease; }
@keyframes fwb-pop { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.fwb-reqbody .fwb-brief {
  width: 308px; max-height: calc(100vh - 180px); overflow-y: auto; margin: 0; box-sizing: border-box;
}
.fwb-reqbody .fwb-brief::-webkit-scrollbar { width: 6px; }
.fwb-reqbody .fwb-brief::-webkit-scrollbar-thumb { background: #d7e2f5; border-radius: 4px; }
.fwb-brief {
  margin: 4px 6px 8px; padding: 10px 12px; background: #f7faff;
  border: 1px solid #d9e6fb; border-radius: 12px; box-sizing: border-box;
}
.fwb-brief-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.fwb-brief-title { font-size: 12.5px; font-weight: 700; color: #2b3a55; display: inline-flex; align-items: center; gap: 5px; }
.fwb-brief-cust { font-size: 11.5px; font-weight: 600; color: #0d99ff; }
.fwb-brief-actions { display: inline-flex; align-items: center; gap: 8px; }
.req-copy-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #2b3a55; background: #fff; border: 1px solid #d7dde8; border-radius: 6px; padding: 2px 8px; cursor: pointer; line-height: 1.6; transition: color .15s, border-color .15s, background .15s; }
.req-copy-btn:hover { color: #0d99ff; border-color: #0d99ff; background: #f2f8ff; }
.req-copy-btn:active { transform: translateY(1px); }
.req-para-copy { margin-left: auto; flex: none; }
.fwb-brief-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: #5f6b80; margin-bottom: 7px; }
.fwb-brief-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 7px; }
.fwb-brief-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; background: #fff; border: 1px solid #e7eefb; border-radius: 8px; padding: 5px 8px; }
.fwb-brief-no { flex: 0 0 auto; font-size: 10px; color: #fff; background: #0d99ff; border-radius: 4px; padding: 1px 5px; font-weight: 700; }
.fwb-brief-name { flex: 0 1 auto; font-weight: 600; color: #2b3a55; }
.fwb-brief-spec { flex: 1; min-width: 0; color: #7b879c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwb-brief-qty { flex: 0 0 auto; font-weight: 700; color: #e08c00; }
.fwb-brief-log { border-top: 1px dashed #d9e6fb; padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.fwb-brief-logline { font-size: 11px; color: #2f80ff; }
.fwb-brief-tip { font-size: 11px; color: #9aa5b8; }
/* ---------- 无限画布舞台 : 多卡片节点 ---------- */
/* 白色画布底，带极浅点阵网格，营造设计器质感 */
.fwb-canvaswrap {
  position: absolute; inset: 0; overflow: hidden; z-index: 1;
  background-color: #ffffff;
  background-image: radial-gradient(#e8e9ee 1px, transparent 1px);
  background-size: 24px 24px; background-position: center;
  cursor: grab; cursor: -webkit-grab;
}
.fwb-canvaswrap.panning { cursor: grabbing; cursor: -webkit-grabbing; }

/* 无限画布位移层：一个无尺寸的零点定位容器，卡片相对它绝对定位 */
.fwb-stage {
  position: absolute; top: 0; left: 0; width: 0; height: 0;
  transform-origin: 0 0; will-change: transform;
}

/* 生成关系连线覆盖层：与 stage 同坐标系(1px 单位=1px 画布坐标)，overflow 可见，
   可绘制到 0×0 容器之外；pointer-events:none 不拦截卡片拖拽，z-index:0 处于卡片下层。 */
.fwb-links {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px;
  overflow: visible; pointer-events: none; z-index: 0;
}
/* 连线：点状虚线 + 弧度，起点空心圆、终点实心箭头，标出这轮关系「从哪张图到哪张图」 */
.fwb-link {
  fill: none; stroke: #0d99ff; stroke-width: 1.6;
  stroke-dasharray: 5 5; stroke-linecap: round;
}
/* 起点空心圆圈：白底蓝描边，比线端点更醒目，表明这轮关系从这张图出发 */
.fwb-link-dot { fill: #ffffff; stroke: #0d99ff; stroke-width: 2; }
/* 拉线预览（点「＋」后跟随光标的临时线）：实线更「活」，末端一点提示落点 */
.fwb-link-preview { fill: none; stroke: #0d99ff; stroke-width: 2; stroke-linecap: round; }
.fwb-link-preview-dot { fill: #0d99ff; stroke: #fff; stroke-width: 1.5; }

/* 画布卡片节点：可拖动、可拖拽右下角调整宽度 */
.fwb-card {
  position: absolute; top: 0; left: 0; background: #ffffff;
  border: 1px solid #e4e6ec; border-radius: 10px; box-sizing: border-box;
  box-shadow: 0 8px 22px rgba(20, 30, 60, .12), 0 1px 4px rgba(20, 30, 60, .06);
  cursor: grab; transition: box-shadow .15s, border-color .15s;
}
.fwb-card:active { cursor: grabbing; }
.fwb-card:hover { box-shadow: 0 12px 30px rgba(20, 30, 60, .16); }
.fwb-card.active { border-color: #0d99ff; box-shadow: 0 0 0 1.5px #0d99ff, 0 12px 30px rgba(13, 153, 255, .18); }
.fwb-card-head {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px;
  border-bottom: 1px solid #eef0f4; user-select: none;
}
.fwb-card-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #0d99ff, #4dc3ff); flex: 0 0 auto; }
/* PDCA 轮次徽标：显示该卡属于第几轮，避免轮次号与卡片名混在一起、丢失或错乱 */
.fwb-card-round {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; line-height: 1;
  color: #0d63ff; background: rgba(13, 99, 255, .1);
  padding: 3px 6px; border-radius: 8px; letter-spacing: .2px;
}
.fwb-card-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: #2b2f38;
}
.fwb-card-name-input {
  flex: 1; min-width: 0; height: 22px; padding: 0 5px; box-sizing: border-box;
  font-size: 12px; font-weight: 600; color: #2b2f38;
  border: 1px solid #0d99ff; border-radius: 4px; outline: none; background: #fff;
}
.fwb-card-body { position: relative; }
.fwb-card-body img { display: block; width: 100%; height: auto; object-fit: contain; background: #fff; }
.fwb-card-body.annot { cursor: crosshair; }
/* 任务文本框卡片：自上而下依次是「需求文字 → 引用素材 → LLM 任务规划」，纯 flex 纵向流式排布
   （不再用绝对定位，避免素材区与规划区互相重叠）。
   规划未出时=可编辑文本框 + 底部「运行」；规划完成后=需求文字只读、运行按钮整块移除不占位，
   规划清单承接剩余高度并独立滚动。 */
.fwb-card-task {
  position: relative; padding: 10px; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
  border: 1px dashed #8ecbff; border-radius: 10px;
}
.fwb-card-task-input {
  display: block; width: 100%; flex: 1 1 auto; min-height: 0; box-sizing: border-box;
  resize: none; border: none; outline: none; background: transparent;
  font-size: 12.5px; line-height: 1.6; color: #2b2f38; font-family: inherit;
}
.fwb-card-task-input::placeholder { color: #9aa4b2; }
/* 规划已出：需求文字转只读展示（不可再改），过高时自身也可滚动 */
.fwb-card-task-text {
  flex: 0 0 auto; max-height: 40%; overflow-y: auto; box-sizing: border-box;
  font-size: 12.5px; line-height: 1.6; color: #2b2f38;
  white-space: pre-wrap; word-break: break-word;
}
/* 引用素材区：紧跟在需求文字下方，与规划区以虚线分隔 */
.fwb-card-task-refs {
  flex: 0 0 auto; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f2;
}
.fwb-card-task-refs-hd { font-size: 10.5px; font-weight: 700; color: #5a6473; }
.fwb-card-task-refs-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; max-height: 62px; overflow-y: auto; }
.fwb-card-task-ref {
  position: relative; display: inline-flex; flex-direction: column; align-items: center;
  width: 52px; padding: 3px 3px 2px; background: #f5f8ff; border: 1px solid #d6e4fb; border-radius: 8px;
}
.fwb-card-task-ref img { width: 46px; height: 34px; object-fit: cover; border-radius: 5px; background: #fff; }
.fwb-card-task-ref-name {
  width: 46px; margin-top: 2px; font-size: 9px; color: #2b3a55; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fwb-card-task-ref-x {
  position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; line-height: 1;
  font-size: 9px; color: #fff; background: #98a4b6; border: none; border-radius: 50%; cursor: pointer;
}
.fwb-card-task-ref-x:hover { background: #e5484d; }
/* 规划清单区：排在素材之下，承接剩余高度，内容过多时自身出现滚动轴 */
.fwb-card-task-plan {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #dbe7f3;
}
.fwb-card-task-plan-hd {
  flex: 0 0 auto; margin-bottom: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; color: #0d99ff;
}
/* 编号清单：内容过多时在此处自动出现上下滚动轴 */
.fwb-card-task-plan-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  margin: 0; padding-left: 18px;
  font-size: 12px; line-height: 1.55; color: #2b2f38;
}
.fwb-card-task-plan-list li { margin-bottom: 4px; }
.fwb-card-task-plan-name { font-weight: 600; }
.fwb-card-task-plan-purpose { color: #6b7683; }
.fwb-card-task-plan-purpose::before { content: ' · '; }
/* 「运行」：未规划时贴在卡片底部右侧；规划完成后整个按钮从 DOM 移除（不占位置） */
.fwb-card-task-run {
  flex: 0 0 auto; align-self: flex-end; margin-top: 8px;
  height: 28px; padding: 0 18px; border: none; border-radius: 7px; cursor: pointer;
  background: #0d99ff; color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(13, 153, 255, .3);
}
.fwb-card-task-run:hover { background: #0b86e0; }
.fwb-card-task-run:disabled { background: #b9d9f5; cursor: not-allowed; box-shadow: none; }

/* 生成中提示（占满卡片图片区，占位框=成品大小，加载图标居中，与卡片同款描边质感） */
.fwb-card-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100%; box-sizing: border-box;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  border: 1px dashed #8ecbff; border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(13, 153, 255, .06), 0 6px 18px rgba(20, 30, 60, .06);
  color: #0d99ff; font-size: 13px; font-weight: 600;
  letter-spacing: 1px; overflow: hidden;
}
.fwb-card-loading i {
  display: block; width: 24px; height: 24px;
  border: 2.5px solid rgba(13,153,255,.22); border-top-color: #0d99ff; border-radius: 50%;
  animation: fwb-spin .8s linear infinite;
}
/* 正在生图占位框：显示「正在：本步要做的事」（来自后端实时阶段），替代笼统的「正在生成…」 */
.fwb-card-live {
  max-width: 92%; font-size: 12px; font-weight: 700; color: #0d63ff; letter-spacing: .3px;
  line-height: 1.4; text-align: center; word-break: break-all;
}
/* 占位框内的「第X步第Y轮」小徽标（与「正在：XXX」同行，直接写在空白图上） */
.fwb-card-live-step {
  display: inline-block; margin-right: 5px; padding: 1px 6px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: #0d63ff; background: rgba(13, 99, 255, .1);
  letter-spacing: .2px; vertical-align: middle;
}
.fwb-card-elapsed {
  font-size: 11px; font-weight: 500; color: #8a94a6; letter-spacing: .3px; font-variant-numeric: tabular-nums;
}
/* 心跳/探活提示：后台久久无新事件时显示「疑似卡住（已静默 Ns）」——仅提示，不自动终止 */
.fwb-card-beat {
  max-width: 92%; font-size: 11px; font-weight: 600; color: #c4761b; letter-spacing: .2px;
  background: #fff6e5; border: 1px solid #f2d9a8; border-radius: 10px; padding: 2px 8px;
  text-align: center; word-break: break-all;
}
/* 生成中占位卡片上的「取消」按钮：位于耗时下方，二次确认后终止本次生成 */
.fwb-card-cancel {
  margin-top: 2px; padding: 3px 14px; font-size: 12px; font-weight: 600; letter-spacing: .5px;
  color: #6b7280; background: #fff; border: 1px solid #d7dbe4; border-radius: 14px; cursor: pointer;
}
.fwb-card-cancel:hover { color: #d25a4d; border-color: #f0bdb6; background: #fdf1ef; }
/* 逐张轮次图生成耗时徽标：贴在图片右上角，展示「该图生成 MM:SS」 */
.fwb-card-gen-time {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: #fff; background: rgba(13, 99, 255, .82); padding: 3px 7px; border-radius: 10px;
  font-variant-numeric: tabular-nums; pointer-events: none; letter-spacing: .2px;
}
@keyframes fwb-spin { to { transform: rotate(360deg); } }
/* PDCA 检查阶段：把当前校验图置灰，叠一层蓝色旋转圈 + 「正在检查」。与「生图中的空白占位」区分开。 */
.fwb-card-checking { position: relative; width: 100%; box-sizing: border-box; overflow: hidden; border-radius: 10px; border: 1px solid #dbe6f5; background: #fff; }
.fwb-card-checking-img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) brightness(.72); }
.fwb-card-checking-mask {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(13, 153, 255, .08); color: #0d99ff; font-size: 13px; font-weight: 600; letter-spacing: 1px;
}
.fwb-card-checking-mask i { display: block; width: 24px; height: 24px; border: 2.5px solid rgba(13,153,255,.22); border-top-color: #0d99ff; border-radius: 50%; animation: fwb-spin .8s linear infinite; }
.fwb-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
/* 标注对象（标记图钉 / 画笔 / 方框）：指针工具可点击/拖动/删除 */
.fwb-draw .fwb-obj { pointer-events: all; cursor: move; }
.fwb-draw .fwb-obj.sel { filter: drop-shadow(0 0 4px rgba(13,153,255,.9)); }
.fwb-card-resize {
  position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px;
  background: #fff; border: 1.5px solid #0d99ff; border-radius: 4px; cursor: nwse-resize;
  box-sizing: border-box;
}
/* ComfyUI 风格输出口：选中图片卡后右侧出现的「＋」，点击以该图为资源新建任务框 */
.fwb-card-plus {
  position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  background: #0d99ff; color: #fff; font-size: 15px; line-height: 1;
  border: 2px solid #fff; border-radius: 50%; cursor: pointer;
  box-shadow: 0 2px 6px rgba(13, 153, 255, .45);
}
.fwb-card-plus:hover { background: #0b85e0; }

/* 悬浮：缩放控制 + 画布尺寸读条（左下） */
.fwb-zoombar {
  position: absolute; left: 16px; bottom: 24px; z-index: 7; display: inline-flex;
  align-items: center; gap: 2px; padding: 4px;
  background: #ffffff; border: 1px solid #e3e6ec; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(20, 30, 60, .1);
}
.fwb-zoombar .fwb-rail-btn { width: 30px; height: 30px; }
.fwb-readout {
  display: inline-flex; align-items: center; font-size: 11.5px; color: #5a5f6b;
  padding: 0 8px; white-space: nowrap;
}
.fwb-pipe { color: #c6cbd4; margin: 0 2px; }

.fwb-switch {
  flex: 0 0 26px; width: 26px; height: 14px; border-radius: 8px; background: #ccc;
  position: relative; cursor: pointer; transition: background .15s; display: inline-block;
}
.fwb-switch i { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: left .15s; }
.fwb-switch.on { background: #0d99ff; }
.fwb-switch.on i { left: 14px; }

.fwb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fwb-export {
  font-size: 12px; color: #fff; background: linear-gradient(135deg, #0d99ff, #1976e9);
  border: 1px solid #0d99ff; border-radius: 9px; padding: 8px 0; cursor: pointer; width: 100%;
  font-weight: 600; box-shadow: 0 2px 8px rgba(13, 153, 255, .25); transition: all .15s;
}
.fwb-export:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13, 153, 255, .32); }
.fwb-export-lg { padding: 10px 0; font-size: 13px; }

/* 右键上下文菜单 */
.fwb-ctx {
  position: fixed; z-index: 20; min-width: 150px; padding: 5px;
  background: #fff; border: 1px solid #e3e6ec; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, .18), 0 2px 8px rgba(20, 30, 60, .06);
  display: flex; flex-direction: column; gap: 2px;
}
.fwb-ctx button {
  text-align: left; font-size: 12.5px; color: #333; background: transparent; border: none;
  border-radius: 7px; padding: 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.fwb-ctx button:hover { background: #ecf5ff; color: #0d99ff; }
.fwb-ctx button.danger:hover { background: #fff0f0; color: #e5484d; }

/* 导出弹窗 */
.fwb-mask {
  position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 20, 35, .35); backdrop-filter: blur(2px);
}
.fwb-modal {
  width: 360px; max-width: calc(100% - 40px); background: #fff; border-radius: 14px;
  box-shadow: 0 24px 64px rgba(20, 30, 60, .28); overflow: hidden;
}
.fwb-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #eef0f4;
}
.fwb-modal-head h3 { margin: 0; font-size: 15px; color: #1f2430; }
.fwb-modal-x {
  width: 26px; height: 26px; font-size: 15px; color: #8a90a0; background: #f2f3f6;
  border: none; border-radius: 7px; cursor: pointer; line-height: 1;
}
.fwb-modal-x:hover { color: #e5484d; background: #ffecec; }
.fwb-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* 设计目的弹窗 */
.fwb-plan-modal { width: 520px; max-width: calc(100% - 40px); max-height: 82%; display: flex; flex-direction: column; }
.fwb-plan-sub { font-size: 12px; font-weight: 400; color: #8a90a0; margin-left: 4px; }
.fwb-plan-body { gap: 14px; overflow-y: auto; }
.fwb-plan-sec { display: flex; flex-direction: column; gap: 8px; }
.fwb-plan-h { margin: 0; font-size: 13px; color: #1f2430; }
.fwb-plan-goal {
  margin: 0; font-size: 13px; line-height: 1.7; color: #2b3140;
  background: #f5f8ff; border: 1px solid #e1eaff; border-radius: 8px; padding: 10px 12px;
}
.fwb-plan-checks {
  margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; line-height: 1.65; color: #444b5c;
}
.fwb-plan-checks li::marker { color: #4f7cff; }
.fwb-plan-keep li::marker { color: #9aa1b2; }
.fwb-plan-mutable li::marker { color: #2b5fe0; }
.fwb-plan-neg li::marker { color: #e5484d; }
.fwb-plan-cons li::marker { color: #a16a1f; }
.fwb-plan-style { margin: 0; font-size: 12.5px; color: #6b7280; }
.fwb-plan-foot { display: flex; justify-content: flex-end; padding-top: 2px; }

/* 设计文档弹窗（右键 → 设计文档）：完整展示【产品设计需求文档】原文 */
.fwb-doc-modal { width: 680px; }
.fwb-doc-empty { font-size: 13px; color: #8a90a0; padding: 18px 4px; text-align: center; }
.fwb-doc-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #eef0f4; border-radius: 10px; background: #fbfcff; }
.fwb-doc-title { margin: 0; font-size: 14px; font-weight: 600; color: #1f2430; }
.fwb-doc-code { font-size: 12px; font-weight: 400; color: #8a90a0; }
.fwb-doc-blocks { display: flex; flex-direction: column; gap: 5px; }
.fwb-doc-sec { font-size: 13px; font-weight: 600; color: #2b5fe0; margin-top: 4px; }
.fwb-doc-kv { font-size: 12.5px; line-height: 1.7; color: #2b3140; display: flex; gap: 6px; }
.fwb-doc-k { flex: 0 0 auto; color: #6b7280; }
.fwb-doc-k::after { content: '：'; }
.fwb-doc-v { flex: 1 1 auto; word-break: break-word; white-space: pre-wrap; }
.fwb-doc-li { position: relative; font-size: 12.5px; line-height: 1.7; color: #444b5c; padding-left: 14px; word-break: break-word; }
.fwb-doc-li::before { content: '•'; position: absolute; left: 2px; color: #4f7cff; }

/* 添加素材弹窗（右键 → 添加素材） */
.fwb-mat-modal { width: 620px; max-width: calc(100% - 40px); max-height: 82%; display: flex; flex-direction: column; }
.fwb-mat-tabs { display: flex; align-items: center; gap: 6px; padding: 10px 16px 0; border-bottom: 1px solid #eef0f4; }
.fwb-mat-tab { font-size: 13px; color: #555; background: transparent; border: none; cursor: pointer; padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fwb-mat-tab:hover { color: #0d99ff; }
.fwb-mat-tab.on { color: #0d99ff; font-weight: 600; border-bottom-color: #0d99ff; }
.fwb-mat-sel { margin-left: auto; font-size: 12px; color: #8a90a0; padding-bottom: 8px; }
.fwb-mat-body { gap: 14px; overflow-y: auto; }
.fwb-mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.fwb-mat-item { position: relative; border: 1px solid #e6e8ee; border-radius: 10px; overflow: hidden; background: #f7f8fa; cursor: pointer; transition: all .15s; }
.fwb-mat-item:hover { border-color: #b9d8ff; }
.fwb-mat-item.on { border-color: #0d99ff; box-shadow: 0 0 0 2px rgba(13,153,255,.25); }
.fwb-mat-item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.fwb-mat-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1px solid #d5d9e0; color: transparent; font-size: 12px; line-height: 20px; text-align: center; }
.fwb-mat-item.on .fwb-mat-check { background: #0d99ff; border-color: #0d99ff; color: #fff; }
.fwb-mat-name { font-size: 11px; color: #40454f; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwb-mat-empty { font-size: 13px; color: #8a90a0; padding: 40px 0; text-align: center; }

/* 画笔改图弹窗（右键 → 画笔改图）：底图 + 掩膜画布，刷出要修改的区域 */
.fwb-brush-modal { width: 780px; max-width: calc(100% - 40px); max-height: 88%; display: flex; flex-direction: column; }
.fwb-brush-body { gap: 12px; overflow-y: auto; }
.fwb-brush-tip { margin: 0; font-size: 12px; line-height: 1.6; color: #6b7280; }
.fwb-brush-tip b { color: #0d99ff; }
.fwb-brush-stage {
  position: relative; align-self: center; flex: 0 0 auto; line-height: 0;
  max-width: 100%; max-height: 58vh; overflow: hidden;
  border: 1px solid #e3e6ec; border-radius: 10px; background: #f2f3f6; cursor: crosshair;
}
.fwb-brush-img { display: block; max-width: 100%; max-height: 58vh; width: auto; height: auto; }
.fwb-maskcanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .62; touch-action: none; }
.fwb-brush-tools { display: flex; align-items: center; gap: 10px; }
.fwb-brush-range { flex: 1; min-width: 0; accent-color: #0d99ff; }
.fwb-brush-size { flex: 0 0 auto; min-width: 46px; text-align: right; font-size: 12px; color: #6b7280; }
.fwb-brush-prompt {
  width: 100%; box-sizing: border-box; min-height: 58px; resize: vertical;
  font-family: inherit; font-size: 12.5px; line-height: 1.6; color: #2b3140;
  border: 1px solid #d9dde5; border-radius: 9px; padding: 9px 11px; outline: none;
}
.fwb-brush-prompt:focus { border-color: #4f7cff; }
.fwb-brush-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.fwb-brush-modal .fwb-chip:disabled { opacity: .5; cursor: not-allowed; }
.fwb-brush-modal .fwb-export:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; transform: none; }

/* 导出弹窗选项行 */
.fwb-opt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #333; }
.fwb-opt-label { flex: 0 0 52px; color: #555; font-size: 12px; }
.fwb-opt .fwb-chips { flex: 1; gap: 4px; min-width: 0; }
.fwb-opt .fwb-chip { font-size: 11px; padding: 3px 6px; }
.fwb-opt-state { font-weight: 400; font-size: 11px; color: #888; min-width: 50px; }
.fwb-opt-input { width: 56px; padding: 3px 6px; font-size: 12px; border: 1px solid #d9d9d9; border-radius: 4px; outline: none; }
.fwb-opt-input:focus { border-color: #4f7cff; }
.fwb-opt-unit { font-size: 11px; color: #888; }
/* 宽/高双栏行 */
.fwb-opt-row { display: flex; gap: 12px; }
.fwb-opt-row .fwb-opt { flex: 1; min-width: 0; }
.fwb-opt-row .fwb-opt-input { width: 100%; }
.fwb-opt-tip { font-size: 11px; line-height: 1.5; color: #999; margin: 0; }

/* Toast */
.fwb-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(20,20,20,.85); color: #fff; font-size: 12px;
  border-radius: 2px; padding: 8px 16px; z-index: 999; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ============ 产品信息库（产品层 → 属性定义层 → SKU组合层） ============ */
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: #667; }
.demo-hint { color: #b0803c; background: #fff8ec; border: 1px dashed #f0d9ae; border-radius: 7px; padding: 8px 12px; font-size: 12px; margin-top: 14px; }

/* 产品详情页头 */
.detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.detail-title { font-size: 17px; font-weight: 700; color: #1b2333; }

/* 双 Tab */
.det-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.det-tab { border: none; background: transparent; padding: 9px 18px; font-size: 13px; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .18s; }
.det-tab:hover { color: var(--blue); }
.det-tab.on { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }

.detail-body .attr-bar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 10px; }

/* 属性可选值 chips */
.attr-value { display: inline-flex; align-items: center; gap: 4px; background: #eef4ff; color: #2b5bd7; border: 1px solid #d3e0ff; border-radius: 999px; padding: 3px 8px; font-size: 12px; margin: 0 6px 6px 0; }
.drop-x { cursor: pointer; color: #8494bd; font-size: 11px; padding: 0 2px; border-radius: 50%; }
.drop-x:hover { color: #e5484d; background: #ffecec; }
.attr-add { display: inline-flex; align-items: center; gap: 4px; }
.attr-add input { border: 1px dashed #c9d4e8; border-radius: 999px; padding: 3px 10px; font-size: 12px; width: 96px; background: #fbfcff; }
.attr-add input:focus { outline: none; border-color: var(--blue); border-style: solid; }

/* 从工艺库选：属性值联动工艺库下拉 */
.proc-pick { position: relative; display: inline-flex; vertical-align: middle; margin: 0 6px 6px 0; }
.proc-pick-drop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 220px; max-height: 240px; overflow: auto; background: #fff; border: 1px solid #e3e9f4; border-radius: 8px; box-shadow: 0 8px 24px rgba(30, 50, 90, .14); padding: 8px; }
.proc-pick-kw { width: 100%; box-sizing: border-box; border: 1px solid #c9d4e8; border-radius: 6px; padding: 4px 8px; font-size: 12px; margin-bottom: 8px; background: #fbfcff; }
.proc-pick-kw:focus { outline: none; border-color: var(--blue); }
.proc-pick-empty { font-size: 12px; color: #9aa5b8; padding: 8px 4px; }
.proc-pick-group { margin-bottom: 6px; }
.proc-pick-title { font-size: 11px; color: #8494bd; padding: 4px 2px; border-bottom: 1px dashed #e5ebf4; margin-bottom: 6px; }
.proc-pick-item { display: inline-block; cursor: pointer; font-size: 12px; color: #334; background: #f4f7fc; border: 1px solid #e0e7f1; border-radius: 999px; padding: 2px 9px; margin: 0 4px 5px 0; }
.proc-pick-item:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 未定价 SKU 标黄 */
tr.noprice { background: #fff8e6 !important; }
tr.noprice:hover { background: #fff3d4 !important; }
.noprice-tip { color: #b0803c; background: #fff8ec; border: 1px dashed #f0d9ae; border-radius: 7px; padding: 8px 12px; font-size: 12px; margin-top: 12px; }

/* 价格维护：默认(通用价) + 大客户协议价 */
.price-maint { border: 1px solid #e3e9f4; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: #fafbfe; }
.price-maint-title { font-size: 13px; font-weight: 600; color: #2b3a55; margin-bottom: 10px; }
.price-maint-title em { font-style: normal; font-weight: 400; color: #8a97b0; font-size: 12px; margin-left: 6px; }
.price-maint-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.price-maint-row:last-child { margin-bottom: 0; }
.price-maint-row.none { background: #fff8ec; border: 1px dashed #f0d9ae; border-radius: 8px; padding: 6px 8px; }
.pm-label { display: flex; flex-direction: column; line-height: 1.3; min-width: 132px; }
.pm-label b { font-size: 13px; color: #2b3a55; }
.pm-label em { font-style: normal; font-size: 11px; color: #8a97b0; }
.price-maint-row input[type="number"] { width: 96px; border: 1px solid #d3dbea; border-radius: 7px; padding: 6px 8px; font-size: 13px; background: #fff; }
.price-maint-row input[type="number"]:focus { outline: none; border-color: var(--blue); }
.price-maint-row select { border: 1px solid #d3dbea; border-radius: 7px; padding: 6px 8px; font-size: 12px; background: #fff; }
.price-maint-empty { font-size: 12px; color: #8a97b0; background: #f0f3f8; border-radius: 8px; padding: 10px 12px; }
.price-maint-row.add button { border-style: dashed; }
.cust-pick-list { max-height: 300px; overflow: auto; }
.cust-pick-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 13px; color: #2b3a55; background: #f4f7fc; border: 1px solid #e3e9f4; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.cust-pick-item:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.cust-pick-item em { font-style: normal; font-size: 11px; color: #8a97b0; }
.cust-pick-item:hover em { color: #fff; }
.pm-owner-hint { display: block; font-size: 11px; color: #8a97b0; margin-top: 4px; }
.kb-chip.vip { color: #c0362c; background: #fff0ee; border-color: #f4c4bf; }
.sku-combos { color: #374151; font-size: 12.5px; line-height: 1.9; }
.sku-combo-chip { display: inline-block; background: #f2f6ff; border: 1px solid #d8e4ff; color: #2f57a8; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin: 0 6px 4px 0; white-space: nowrap; }
.sku-combo-empty { color: var(--muted); }
.sku-fallback { display: block; font-style: normal; color: #b0803c; font-size: 11.5px; margin-top: 4px; }
/* 独立 SKU 新增 / 修改页 */
.sku-edit-panel { max-width: 900px; padding: 20px; }
.sku-edit-sub { display: flex; gap: 14px; align-items: baseline; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.sku-edit-sub b { color: var(--text); font-size: 15px; }
.sku-edit-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.sku-edit-section-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.sku-edit-section-title em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.sku-edit-attr { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.sku-edit-attr:last-child { border-bottom: none; }
.sku-edit-attr-name { flex: 0 0 100px; font-size: 12.5px; color: var(--muted); font-weight: 600; padding-top: 4px; }
.sku-edit-attr-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.sku-edit-fields { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 12px; }
.sku-edit-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sku-edit-fields select, .sku-edit-fields input { border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; font-size: 13px; min-width: 130px; background: #fff; color: var(--text); }
.sku-edit-owner { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.sku-edit-owner b { color: var(--text); }
.sku-edit-owner span { margin-left: 8px; color: #b0803c; }
.sku-edit-preview { background: #f7f9ff; border: 1px dashed #c9d8ff; border-radius: 9px; padding: 10px 12px; font-size: 13px; color: #2f57a8; margin-bottom: 14px; }

/* 批量生成 SKU 弹窗 */
.batch-tip { font-size: 12px; color: #6b7280; background: #f6f8fb; border-radius: 7px; padding: 9px 12px; margin: 0 0 12px; }
.batch-check { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.batch-check label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.batch-check input { accent-color: var(--blue); }
.batch-count { font-size: 13px; color: #1b2333; background: #eef4ff; border: 1px solid #d3e0ff; border-radius: 8px; padding: 10px 12px; text-align: center; margin-bottom: 14px; }
.batch-count .mono { font-size: 15px; color: var(--blue); font-weight: 700; }

/* ===== 报价行 SKU 选择触发按钮（替代原生下拉） ===== */
.sku-sel-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px;
  font-size: 13.5px; font-weight: 600; color: var(--text); background: #fff; cursor: pointer;
  text-align: left; white-space: nowrap;
}
.sku-sel-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sku-sel-trigger:hover { border-color: var(--blue); }
.sku-sel-trigger:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.sku-sel-trigger.empty { color: var(--muted); font-weight: 500; font-size: 13px; }
.sku-sel-trigger .caret { flex: none; color: var(--muted); font-size: 11px; font-weight: 400; }

/* ===== SKU 选择弹窗 ===== */
.sku-picker-modal { width: 980px; max-width: 100%; display: flex; flex-direction: column; }
.picker-body {
  display: grid; grid-template-columns: 250px 250px 1fr; gap: 14px;
  min-height: 360px; max-height: 54vh; margin: 10px 0 6px;
}
.picker-sec { display: flex; flex-direction: column; gap: 9px; min-width: 0; min-height: 0; }
.picker-sec-title { font-size: 13px; font-weight: 600; color: var(--text); flex: none; }
.picker-search { width: 100%; box-sizing: border-box; font-size: 12.5px; }
.picker-prods { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; border: 1px solid var(--border); border-radius: 9px; }
.picker-prods li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; font-size: 12.5px; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--border); }
.picker-prods li:last-child { border-bottom: none; }
.picker-prods li:hover { background: #f7f9ff; }
.picker-prods li.on { background: #eef1fe; color: var(--blue); font-weight: 600; }
.picker-prods .pk-cnt { font-size: 11px; color: var(--muted); flex: none; }
.picker-prods li.on .pk-cnt { color: var(--blue); }
.picker-prods .pk-empty { color: var(--muted); font-size: 12.5px; justify-content: center; cursor: default; }
.picker-prods .pk-empty:hover { background: transparent; }
.pk-empty { padding: 16px 8px; color: var(--muted); font-size: 12.5px; text-align: center; }
.pk-attrs { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }
.pk-attr { display: flex; flex-direction: column; gap: 6px; }
.pk-attr-name { font-size: 12px; color: var(--muted); font-weight: 600; flex: none; }
.pk-attr-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-val { border: 1px solid var(--border); background: #fff; color: #475069; border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.pk-val:hover { border-color: var(--blue); color: var(--blue); }
.pk-val.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.picker-sku-sec { overflow: hidden; }
.picker-sku-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.picker-sku-title .btn-ghost.sm { padding: 4px 10px; }
.picker-sku-title .btn-ghost.sm:disabled { opacity: .5; cursor: not-allowed; }
.picker-table-wrap { flex: 1; min-height: 0; overflow-y: auto; }
/* 弹窗内快速新增 SKU：以当前属性组合为基准 + 手动基准单价 */
.pk-new { flex: none; border: 1px solid #cdd9f7; background: #f7f9ff; border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 8px; }
.pk-new-body { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.pk-new-combo { flex: 1 1 100%; font-size: 12px; color: var(--text); line-height: 1.4; word-break: break-all; }
.pk-new-label { color: var(--muted); margin-right: 6px; }
.pk-new-hint { margin: -2px 0 0; font-size: 11px; color: #8a94a8; line-height: 1.4; }
.pk-new-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pk-new-field select, .pk-new-field input { border: 1px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12px; background: #fff; color: var(--text); }
.pk-new-field input { width: 110px; }
.pk-new-field select:focus, .pk-new-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.pk-new-actions { display: flex; justify-content: flex-end; gap: 8px; }
.picker-table { table-layout: auto; }
.picker-table th { font-size: 12px; }
.picker-table td, .picker-table th { padding: 9px 11px; font-size: 12px; }
.picker-table tbody tr { cursor: pointer; }
.picker-table tbody tr.on td { background: #eef1fe; }
.picker-table tbody tr.on td:first-child { color: var(--blue); font-weight: 600; }
.picker-table .amount { text-align: right; white-space: nowrap; }
.sku-picker-modal .req-actions { flex: none; margin-top: 12px; }

/* ============ 工艺管理（process.js） ============ */
.proc-type-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.proc-type-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #eef4ff; color: var(--blue); font-size: 12px; }
.proc-type-tag em { font-style: normal; font-weight: 600; opacity: .8; }
.proc-type-tag.muted { background: #f2f3f5; color: var(--muted); }
.proc-combo-hint { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.proc-combo-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.proc-combo-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .15s; }
.proc-combo-row:hover { border-color: var(--blue); background: #f5f8ff; }
.proc-combo-row input { accent-color: var(--blue); }
.proc-combo-row .proc-type-tag { margin-left: auto; }
.muteder { color: var(--muted); }
.sku-def-hint { font-size: 12px; line-height: 1.5; color: var(--blue); background: #eef4ff; border: 1px solid #d6e4ff; border-radius: 8px; padding: 8px 10px; margin-top: 4px; }

/* =============================================================
 * 登录页 · 账号密码登录 + 账号管理（人员管理）
 * ============================================================= */
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #333; }
.login-form label input {
  padding: 10px 12px; font-size: 14px; border: 1px solid #d5dae8; border-radius: 9px; outline: none; transition: border-color .15s;
}
.login-form label input:focus { border-color: var(--blue); }
.login-error { color: #d24b4b; font-size: 12.5px; min-height: 16px; }
.login-form .login-remember { flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; -webkit-user-select: none; user-select: none; }
.login-form .login-remember input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }

.acct-msg {
  margin-bottom: 14px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px;
  color: #0f7a3d; background: #e9f8ef; border: 1px solid #bde8cf;
}
.role-badge { display: inline-block; color: #fff; font-size: 12px; border-radius: 999px; padding: 3px 10px; }
.state-badge { font-size: 12px; border-radius: 999px; padding: 3px 10px; }
.state-badge.on  { color: #0f7a3d; background: #e9f8ef; border: 1px solid #bde8cf; }
.state-badge.off { color: #9a6a00; background: #fff6e6; border: 1px solid #f3dda0; }
.row-op { display: flex; gap: 6px; }
.acct-card { width: 460px; }
.acct-card .profile-body label select {
  padding: 8px 10px; font-size: 13px; border: 1px solid #d5dae8; border-radius: 8px; background: #fff; outline: none;
}
.acct-card .profile-body label select:disabled { background: #f2f3f5; color: #888; }
.acct-switch { flex-direction: row !important; align-items: center; gap: 10px !important; }
.acct-switch .switch { position: relative; display: inline-block; width: 46px; height: 26px; background: #e0e4ec; border-radius: 24px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.acct-switch .switch.on { background: var(--blue); }
.acct-switch .switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .18s; }
.acct-switch .switch.on .knob { transform: translateX(20px); }
.acct-tip { font-size: 12px; color: #d24b4b; }

/* =============================================================
 * 账号安全 · 修改密码表单
 * ============================================================= */
.pwd-box { border: 1px solid #e5e9f3; border-radius: 10px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 12px; background: #fafbff; }
.pwd-box label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.pwd-box .pwd-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.pwd-msg { font-size: 12px; color: #d24b4b; margin: 0; flex: 1; }
.pwd-msg.ok { color: #0f7a3d; }

/* 登录页：密码输入框与登录按钮之间增加空隙 */
.login-card .btn-block { margin-top: 14px; }

/* =============================================================
 * 素材库 · 参考图库（上传 / 展示 / 删除）
 * ============================================================= */
.sd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.sd-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.sd-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.06); }
.sd-thumb { aspect-ratio: 4 / 3; background: #f5f6fa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-meta { padding: 8px 10px 4px; }
.sd-name { font-size: 13px; font-weight: 600; color: #24292f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.sd-del { margin: 6px 10px 10px; }
/* ============ 属性知识（挂在材质/工艺属性项上） ============ */
.st.none { color: var(--muted); background: #f2f4f8; }

.craft-modal { width: 960px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.craft-modal .modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); margin-bottom: 0; flex: none; }
.craft-modal .modal-head h3 { display: flex; align-items: center; gap: 10px; }
.craft-body { padding: 4px 22px 18px; overflow-y: auto; }
.craft-section { border-top: 1px solid var(--border); padding: 16px 0 6px; }
.craft-section:first-child { border-top: none; }
.craft-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.craft-sec-head b { font-size: 14px; }
.craft-sec-head span { color: var(--muted); font-size: 12px; flex: 1; min-width: 180px; }
.form-grid textarea { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; background: #fff; color: var(--text); font-family: inherit; resize: vertical; }
.form-grid textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.craft-empty { color: var(--muted); font-size: 12.5px; padding: 6px 0 8px; }
.craft-row { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
.craft-row.param { grid-template-columns: 1.2fr 1fr .6fr 1.4fr auto; }
.craft-row.source { grid-template-columns: 1.4fr 1.6fr .8fr auto; }
.craft-row input, .craft-row select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: #fff; color: var(--text); min-width: 0; }
.craft-row input:focus, .craft-row select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.craft-source-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: #fafbfe; }
.craft-source-card textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; resize: vertical; color: var(--text); }
.craft-source-card textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.craft-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fff; flex: none; }
.craft-foot-hint { color: var(--muted); font-size: 12px; }
.craft-foot .req-actions { margin-top: 0; }
@media (max-width: 900px) {
  .craft-row.param, .craft-row.source { grid-template-columns: 1fr 1fr; }
  .craft-foot { flex-direction: column; align-items: stretch; }
}

/* 属性管理内的知识入口 */
.craft-know-btn {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid #c6d5ff; background: #f7f9ff; color: var(--blue);
  white-space: nowrap; cursor: pointer;
}
.craft-know-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.craft-know-btn.empty { border-style: dashed; border-color: #d5dbe8; color: var(--muted); background: #fff; }
.craft-know-btn.empty:hover { color: var(--blue); border-color: var(--blue); background: #f7f9ff; }
.craft-know-btn.queued { color: #a06a00; border-color: #f0d9a0; background: #fff8e8; }
.craft-know-btn.done { color: #0f7a3d; border-color: #bde8cf; background: #eefaf3; }
.craft-know-btn.failed { color: #b84444; border-color: #f0c7c7; background: #fdf2f2; }

/* 工艺智能体：待审批变更 */
.craft-approval { flex: none; border-top: 1px solid #f0d9a0; background: #fffbf0; padding: 12px 14px; }
.craft-approval-head { display: flex; flex-direction: column; gap: 3px; }
.craft-approval-head b { font-size: 13px; color: #8a5a00; }
.craft-approval-head span { font-size: 11.5px; color: #a9823d; }
.craft-approval-list { margin: 8px 0 10px; padding-left: 18px; color: #6b5322; font-size: 12px; line-height: 1.7; max-height: 110px; overflow-y: auto; }
.craft-approval-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* 工艺智能体：逐条审批 */
.craft-approval-list { padding-left: 0; list-style: none; }
.craft-approval-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #efdfbd; }
.craft-approval-item:last-child { border-bottom: none; }
.craft-approval-item-text { flex: 1; min-width: 0; }
.craft-approval-item-actions { display: flex; gap: 6px; flex: none; }
.craft-mini-btn { font-size: 11.5px; padding: 3px 9px; border-radius: 6px; border: 1px solid #c6d5ff; background: #f7f9ff; color: var(--blue); cursor: pointer; white-space: nowrap; }
.craft-mini-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.craft-mini-btn.danger { border-color: #f0c7c7; background: #fdf2f2; color: #b84444; }
.craft-mini-btn.danger:hover { background: #b84444; color: #fff; border-color: #b84444; }
.craft-mini-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 智能客服线索 ---------- */
.lead-last { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.lead-modal {
  background: #fff; border-radius: 18px; width: min(860px, 94vw); max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 70px rgba(20, 30, 60, .28);
}
.lead-modal .modal-head { padding: 18px 22px 10px; margin: 0; border-bottom: 1px solid var(--border); }
.lead-meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; color: var(--muted); font-size: 12px; }
.lead-scope {
  margin: 0; padding: 8px 22px; background: #f7f9ff; color: #6b7a99;
  font-size: 12px; border-bottom: 1px solid #eef2f8;
}
.lead-brief {
  margin: 10px 22px 0; padding: 12px 14px; background: #f7f9ff;
  border: 1px solid #e3ebff; border-radius: 10px; font-size: 12.5px; color: #3d4a63;
}
.lead-brief-title { font-weight: 600; margin-bottom: 6px; color: #1f2d47; }
.lead-brief-sub { font-weight: 400; color: #8b97ad; margin-left: 6px; font-size: 11px; }
.lead-brief-row { display: flex; gap: 8px; line-height: 1.6; margin-top: 4px; }
.lead-brief-row b { flex: 0 0 64px; color: #6b7a99; font-weight: 600; }
.lead-brief-row span { flex: 1; word-break: break-word; }
.lead-msgs {
  padding: 18px 22px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #fbfcff 0%, #ffffff 60%);
}
.lead-msg { max-width: 78%; align-self: flex-start; background: #f4f6fa; border-radius: 2px 14px 14px 14px; padding: 10px 12px; }
.lead-msg.ai { align-self: flex-end; background: #eaf2ff; border-radius: 14px 2px 14px 14px; }
.lead-msg.staff { align-self: flex-end; background: #e8f7ee; border-radius: 14px 2px 14px 14px; }
.lead-msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.lead-role { font-size: 11px; color: #6b7a99; font-weight: 600; }
.lead-time { font-size: 11px; color: #a0a8b8; }
.lead-text { font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.lead-composer {
  display: flex; gap: 10px; align-items: flex-end; padding: 12px 22px 16px;
  border-top: 1px solid var(--border); background: #fff;
}
.lead-input {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; line-height: 1.5; font-family: inherit;
}
.lead-input:focus { outline: none; border-color: #7aa7ff; box-shadow: 0 0 0 3px rgba(122, 167, 255, .15); }
.kb-chip.chip-warn { background: #fff4e5; color: #b45309; }
