/* 智造ERP - 样式 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --ink: #16233c;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e6ecf4;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --sidebar: #101c33;
  --sidebar-2: #182942;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(15, 35, 70, .05), 0 12px 28px rgba(15, 35, 70, .04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; min-width: 236px; background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
}
.logo {
  height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #06b6d4); color: #fff; font-size: 19px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.logo-text b { color: #fff; font-size: 17px; letter-spacing: .5px; display: block; line-height: 1.2; }
.logo-text span { color: #7c8ba5; font-size: 10px; letter-spacing: 1.6px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.side-scroll::-webkit-scrollbar { width: 5px; }
.side-scroll::-webkit-scrollbar-thumb { background: #2c3d59; border-radius: 4px; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  padding: 10px 12px 6px; font-size: 10px; letter-spacing: 1.4px; color: #5f7291; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; color: #b9c6d9; font-size: 13.5px; transition: .15s; user-select: none;
}
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(37,99,235,.28), rgba(37,99,235,.08)); color: #fff; font-weight: 600; }
.nav-item .ni { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.nav-item .arrow { margin-left: auto; font-size: 10px; transition: transform .2s; color: #6c7f9c; }
.nav-item.open .arrow { transform: rotate(90deg); }
.nav-sub { display: none; padding: 2px 0 6px 38px; }
.nav-sub.open { display: block; }
.nav-sub a {
  display: block; padding: 7px 10px; border-radius: 6px; color: #8fa1bb; font-size: 12.5px; cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-sub a:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-sub a.active { color: #fff; background: rgba(37,99,235,.18); border-left-color: #3b82f6; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #64748b; }
.side-foot b { color: #94a3b8; }

.main { margin-left: 236px; flex: 1; min-width: 0; }
.topbar {
  height: 68px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 26px; position: sticky; top: 0; z-index: 15;
}
.crumb { color: var(--ink-3); font-size: 13px; }
.crumb b { color: var(--ink); font-weight: 600; }
.global-search { margin-left: auto; position: relative; width: 280px; }
.global-search input {
  width: 100%; height: 36px; border: 1px solid var(--line); background: #f8fafc; border-radius: 18px;
  padding: 0 14px 0 36px; outline: none; color: var(--ink); font-size: 13px;
}
.global-search input:focus { background: #fff; border-color: #93b4f7; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.icon-search { position: absolute; left: 13px; top: 11px; width: 13px; height: 13px; border: 2px solid #94a3b8; border-radius: 50%; }
.icon-search:after { content: ''; position: absolute; right: -5px; bottom: -3px; width: 7px; height: 2px; background: #94a3b8; transform: rotate(45deg); border-radius: 2px; }
.search-results {
  position: absolute; top: 42px; right: 0; width: 380px; max-height: 420px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(15,35,70,.16); display: none; padding: 8px;
}
.search-results.show { display: block; }
.search-group { font-size: 11px; color: var(--ink-3); padding: 8px 10px 4px; }
.search-hit { display: block; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.search-hit:hover { background: var(--primary-soft); color: var(--primary); }
.top-date { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.top-divider { width: 1px; height: 24px; background: var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #8b5cf6); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.top-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.top-user small { display: block; color: var(--ink-3); font-size: 10px; }

.content { padding: 24px 26px 46px; max-width: 1680px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h2 { margin: 0 0 5px; font-size: 21px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* 通用组件 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; }
.card-actions { display: flex; gap: 8px; }
.card-body { padding: 4px 18px 18px; }
.card-body.tight { padding: 0 18px 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 7px; background: #fff; color: var(--ink-2); cursor: pointer;
  font-size: 12.5px; font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 8px rgba(37,99,235,.22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { border-color: #b9c9e2; color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; }
.btn-link { border: 0; background: none; color: var(--primary); padding: 2px 5px; cursor: pointer; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }
.btn-icon { border: 0; background: none; cursor: pointer; font-size: 15px; padding: 0 4px; color: var(--ink-3); }
.btn-icon-danger:hover { color: var(--danger); }

.input {
  width: 100%; height: 36px; border: 1px solid #dbe3ef; border-radius: 7px; padding: 0 10px;
  outline: none; background: #fff; color: var(--ink); font-size: 13px; transition: .15s;
}
.input:focus { border-color: #7ea8f4; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.input-sm { height: 30px; font-size: 12px; padding: 0 9px; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
select.input { cursor: pointer; }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; line-height: 1.5; white-space: nowrap; font-weight: 500; }
.badge-green { background: #e8f8f1; color: #0f9d6e; }
.badge-blue { background: #eaf2ff; color: #2563eb; }
.badge-orange { background: #fff4e2; color: #d97706; }
.badge-red { background: #feecec; color: #dc2626; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-purple { background: #f3edff; color: #7c3aed; }
.badge-cyan { background: #e6f8fb; color: #0891b2; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  border: 0; background: none; padding: 10px 15px; color: var(--ink-2); cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.kpi:after { content: ''; position: absolute; right: -18px; top: -18px; width: 74px; height: 74px; border-radius: 50%; background: var(--kpi-bg, #eff6ff); opacity: .7; }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; position: relative; z-index: 1; }
.kpi-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--kpi-bg, #eff6ff); color: var(--kpi-color, #2563eb); font-size: 14px; }
.kpi-value { font-size: 23px; font-weight: 700; margin: 10px 0 4px; letter-spacing: -.5px; position: relative; z-index: 1; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--ink-3); position: relative; z-index: 1; }
.kpi-foot b { color: var(--success); }
.kpi-foot b.down { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 1180px) { .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; } }

/* 表格 */
.table-wrap { width: 100%; }
.table-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 0 0 12px; }
.search-box { position: relative; width: 220px; }
.search-box .icon-search { left: 11px; top: 9px; }
.search-box .input { padding-left: 32px; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.table-count { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.table-hint { font-size: 11px; color: var(--ink-3); opacity: .75; white-space: nowrap; }
.table-count b { color: var(--primary); }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.data-table th {
  background: #f8fafc; color: var(--ink-2); font-weight: 600; text-align: left; padding: 11px 13px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.data-table td { padding: 11px 13px; border-bottom: 1px solid #f0f3f8; color: var(--ink-2); }
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .ta-right { text-align: right; }
.data-table .ta-center { text-align: center; }
.data-table b { color: var(--ink); }
.data-table tbody tr[data-row-index] { cursor: pointer; }
.data-table tbody tr[data-row-index]:hover { background: #f6f9ff; }
.empty-cell { text-align: center; color: var(--ink-3); padding: 38px 10px !important; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; font-size: 12px; color: var(--ink-3); }
.link-id { color: var(--primary); font-weight: 600; cursor: pointer; }
.link-id:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 6px; align-items: center; }

/* 图表 */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-label { fill: #94a3b8; font-size: 11px; }
.chart-value { fill: #475569; font-size: 11px; font-weight: 600; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.legend { flex: 1; min-width: 130px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; color: var(--ink-2); }
.legend-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-row b { margin-left: auto; color: var(--ink); font-size: 12px; }
.donut-main { fill: #16233c; font-size: 20px; font-weight: 700; }
.progress { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.progress-bar { height: 6px; border-radius: 4px; background: var(--primary); flex: 1; max-width: 100px; }
.bar-green { background: var(--success); }
.bar-orange { background: var(--warning); }
.bar-red { background: var(--danger); }
.progress span { font-size: 11px; color: var(--ink-3); width: 34px; }
.mini-stat { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat b { color: var(--ink); }
.alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.alert-item:last-child { border-bottom: 0; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--warning); }
.alert-dot.red { background: var(--danger); }
.alert-dot.blue { background: var(--primary); }
.alert-item span { color: var(--ink-2); flex: 1; }
.alert-item small { color: var(--ink-3); display: block; margin-top: 2px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.quick-action {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 14px 8px; text-align: center;
  cursor: pointer; transition: .15s; color: var(--ink-2); font-size: 12px;
}
.quick-action:hover { border-color: #a9c5f7; background: var(--primary-soft); color: var(--primary); transform: translateY(-2px); }
.quick-action i { display: block; font-size: 20px; font-style: normal; margin-bottom: 7px; }

/* 弹窗 */
#modal-root { display: none; }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 28, 51, .48); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; box-shadow: 0 24px 70px rgba(10,25,50,.28); animation: pop .18s ease-out; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 3px; }
.modal-close:hover { color: var(--danger); }
.modal-form { overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 18px 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.span-2 { grid-column: span 2; }
.field-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.field-label i { color: var(--danger); font-style: normal; }
.field-help { font-size: 11px; color: var(--ink-3); }
.check-line { height: 36px; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfdff; border-radius: 0 0 14px 14px; }
.confirm-body { padding: 22px 20px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 18px; padding: 18px 20px; overflow-y: auto; background: #fff; }
.detail-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.detail-label { font-size: 11px; color: var(--ink-3); }
.detail-value { font-size: 13px; color: var(--ink); word-break: break-all; line-height: 1.55; }

.items-editor { border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: #fafcff; }
.items-head, .item-row { display: grid; grid-template-columns: 2.3fr .7fr .8fr .9fr 28px; gap: 7px; align-items: center; }
.items-head { font-size: 11px; color: var(--ink-3); padding: 0 2px 7px; }
.item-row { margin-bottom: 7px; }
.item-amount { text-align: right; font-size: 12px; color: var(--ink); font-weight: 600; }
.items-total { text-align: right; font-size: 12px; color: var(--ink-2); margin-top: 9px; }
.items-total b { color: var(--primary); font-size: 14px; }

/* Toast */
#toast-root { position: fixed; right: 24px; top: 82px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px; min-width: 200px; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--success); border-radius: 8px; padding: 11px 14px; box-shadow: 0 10px 28px rgba(15,35,70,.14);
  font-size: 12.5px; color: var(--ink-2); animation: slidein .2s ease-out;
}
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--primary); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.toast-error .toast-dot { background: var(--danger); }
.toast-info .toast-dot { background: var(--primary); }
.toast-out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* 详情页 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.detail-item { background: #f8fafc; border-radius: 8px; padding: 11px 13px; }
.detail-item label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 5px; }
.detail-item b { font-size: 13px; color: var(--ink); }
.section-title { font-size: 13px; font-weight: 650; margin: 18px 0 10px; padding-left: 9px; border-left: 3px solid var(--primary); }
.formula { background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 12px; font-size: 12px; color: var(--ink-2); line-height: 1.9; }

/* 登录 */
#login-overlay { position: fixed; inset: 0; z-index: 300; background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 55%, #eef9f7 100%); display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(15,35,70,.16); padding: 36px 34px 28px; text-align: center; }
.login-logo { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; font-size: 25px; font-weight: 800; box-shadow: 0 8px 20px rgba(37,99,235,.28); }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card > p { margin: 0 0 20px; color: var(--ink-3); font-size: 12.5px; }
.login-note { background: #f8fafc; border-radius: 9px; padding: 12px 14px; font-size: 12px; line-height: 1.7; color: var(--ink-2); margin-bottom: 18px; text-align: left; }
.login-error { background: #feecec; color: #b91c1c; border-radius: 8px; padding: 10px 12px; font-size: 12px; margin-bottom: 14px; text-align: left; }
.login-btn { width: 100%; height: 42px; font-size: 14px; }
.login-foot { margin-top: 16px; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.login-tabs { display: flex; gap: 6px; background: #f1f5f9; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.login-tab { flex: 1; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 13px; cursor: pointer; transition: .15s; }
.login-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(15,35,70,.1); }
.login-pane { text-align: left; }
.login-field { margin-bottom: 10px; }
.login-field input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 13px; font-size: 14px; outline: none; transition: .15s; box-sizing: border-box; }
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-field-error { min-height: 16px; color: var(--danger); font-size: 11px; margin: -6px 0 4px; }
.login-code-row { display: flex; gap: 8px; }
.login-code-row input { flex: 1; }
.code-btn { width: 116px; height: 42px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.login-wx-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; margin: 4px 0 16px; }
.login-wx-btn { background: linear-gradient(135deg, #22c55e, #16a34a); border-color: transparent; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--ink-3); font-size: 11px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ===== AI 智能体中心 ===== */
.nav-item.nav-ai { background: linear-gradient(90deg, rgba(139,92,246,.22), rgba(37,99,235,.08)); color: #e9e2ff; }
.nav-item.nav-ai .ni { color: #c4b5fd; }
.ai-badge { margin-left: auto; font-size: 10px; font-weight: 700; background: #8b5cf6; color: #fff; border-radius: 999px; padding: 1px 7px; }
.agent-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(120deg, #eef2ff, #f5f0ff 55%, #ecfeff); border: 1px solid #e0e7ff; border-radius: 16px; padding: 22px 24px; margin-bottom: 22px; }
.agent-hero-mark { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 26px; color: #fff; background: linear-gradient(135deg, #8b5cf6, #2563eb); box-shadow: 0 8px 20px rgba(139,92,246,.3); }
.agent-hero h3 { margin: 0 0 6px; font-size: 17px; }
.agent-hero p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.7; max-width: 720px; }
.agent-hero-stat { margin-left: auto; text-align: center; flex: none; }
.agent-hero-stat b { display: block; font-size: 30px; color: #7c3aed; line-height: 1; }
.agent-hero-stat span { font-size: 11px; color: var(--ink-3); }
.agent-section { margin-bottom: 22px; }
.agent-section-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; margin: 0 0 12px; }
.agent-section-title .sec-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 13px; }
.agent-section-title small { font-weight: 400; color: var(--ink-3); font-size: 11px; margin-left: 4px; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.agent-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 16px 16px 12px; cursor: pointer; transition: .16s; position: relative; overflow: hidden; }
.agent-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--agent-color); opacity: .85; }
.agent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--agent-color); }
.agent-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.agent-avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 700; background: var(--agent-color); }
.agent-role { font-size: 10.5px; color: var(--ink-3); background: #f4f6fa; border-radius: 999px; padding: 3px 9px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-kb-badge { flex: none; margin-left: auto; font-size: 10px; color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.agent-card h4 { margin: 0 0 6px; font-size: 14px; }
.agent-card p { margin: 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.6; min-height: 38px; }
.agent-card-foot { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; }
.agent-enter { font-size: 11.5px; color: var(--agent-color); font-weight: 600; }
/* 岗位页内嵌智能体条 */
.agent-rolebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(90deg, #f5f3ff, #f0f6ff); border: 1px solid #e5e0ff; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.agent-rolebar-label { font-size: 12px; font-weight: 650; color: #6d28d9; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.agent-rolebar-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e5e7eb; background: #fff; border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 11.5px; cursor: pointer; color: var(--ink-2); transition: .15s; }
.agent-chip:hover { border-color: var(--agent-color); color: var(--agent-color); box-shadow: 0 2px 8px rgba(15,35,70,.08); }
.agent-chip i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; color: #fff; background: var(--agent-color); }
/* 对话面板 */
.chat-panel { width: 100%; max-width: 720px; height: min(760px, 90vh); background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(15,35,70,.2); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #faf9ff, #fff); }
.chat-head-icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 19px; font-weight: 700; }
.chat-head-title { flex: 1; }
.chat-head-title h3 { margin: 0 0 2px; font-size: 15px; }
.chat-head-title span { font-size: 11px; color: var(--ink-3); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; background: #fafbfd; }
.chat-msg { display: flex; margin-bottom: 16px; }
.chat-msg.chat-user { justify-content: flex-end; }
.chat-bubble { max-width: 88%; border-radius: 12px; padding: 12px 15px; font-size: 13px; line-height: 1.75; }
.chat-user .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.chat-ai .chat-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; box-shadow: 0 1px 3px rgba(15,35,70,.04); }
.chat-ai-head { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.chat-ai-dot { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; }
.chat-role { color: #7c3aed; font-weight: 600; }
.md-h2, .md-h3 { font-weight: 700; margin: 8px 0 4px; }
.md-h2 { font-size: 14px; } .md-h3 { font-size: 13px; }
.md-li { padding-left: 6px; margin: 2px 0; }
.chat-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: typing 1s infinite ease-in-out; }
.chat-typing i:nth-child(2) { animation-delay: .15s; } .chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-error { color: var(--danger); }
.chat-quicks { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px 0; }
.chat-quick { border: 1px solid #ddd6fe; background: #faf8ff; color: #6d28d9; border-radius: 999px; padding: 6px 12px; font-size: 11.5px; cursor: pointer; transition: .15s; }
.chat-quick:hover { background: #ede9fe; }
.chat-input-row { display: flex; gap: 10px; padding: 12px 18px; align-items: flex-end; }
.chat-input { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; outline: none; }
.chat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.chat-send { flex: none; height: 44px; padding: 0 22px; }
.chat-foot { padding: 0 18px 12px; font-size: 10.5px; color: var(--ink-3); }
.agent-guide p { font-size: 12.5px; line-height: 1.8; color: var(--ink-2); margin: 0 0 10px; }
.agent-guide-note { color: #b45309 !important; background: #fffbeb; border-radius: 8px; padding: 8px 12px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.show { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .global-search { width: 160px; }
  .top-date, .top-user span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.span-2 { grid-column: auto; }
}
