/* ============================================================================
   新遇绘创·客制化键盘管理系统 —— 全局样式
   自定义属性主题 / Mobile First / BEM / 暗色主题 [data-theme="dark"]
   ============================================================================ */

/* ---------- 主题变量（对齐参考项目：极深黑底 + 青色霓虹 单色发光系统） ---------- */
:root {
    --c-bg: hsl(222 27% 6%);
    --c-surface: hsl(230 19% 13%);
    --c-surface-2: hsl(230 19% 17%);
    --c-border: hsla(0 0% 100% / 0.08);
    --c-text: hsl(0 0% 100%);
    --c-text-soft: hsla(0 0% 100% / 0.5);
    --c-primary: hsl(189 100% 50%);
    --c-primary-soft: hsla(189 100% 50% / 0.1);
    --c-success: hsl(145 65% 42%);
    --c-warning: hsl(35 90% 52%);
    --c-danger: hsl(5 80% 55%);
    --c-info: hsl(189 100% 50%);
    --c-accent: hsl(214 100% 50%);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px hsla(0 0% 0% / 0.5);
    --shadow-lg: 0 16px 48px hsla(0 0% 0% / 0.6);
    --space: 16px;
    --sidebar-w: 230px;
    --topbar-h: 56px;
    --font: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "Roboto Mono", "JetBrains Mono", "SF Mono", Menlo, monospace;
    --glow: 0 0 20px hsla(189, 100%, 50%, 0.3);
    --glow-sm: 0 0 10px hsla(189, 100%, 50%, 0.25);
    --glow-lg: 0 0 30px hsla(189, 100%, 50%, 0.4);
    --glass: hsla(0 0% 100% / 0.05);
}

[data-theme="dark"] {
    --c-bg: hsl(222 27% 6%);
    --c-surface: hsl(230 19% 13%);
    --c-surface-2: hsl(230 19% 17%);
    --c-border: hsla(0 0% 100% / 0.08);
    --c-text: hsl(0 0% 100%);
    --c-text-soft: hsla(0 0% 100% / 0.5);
    --c-primary: hsl(189 100% 50%);
    --c-primary-soft: hsla(189 100% 50% / 0.1);
    --c-success: hsl(145 65% 42%);
    --c-warning: hsl(35 90% 52%);
    --c-danger: hsl(5 80% 55%);
    --c-info: hsl(189 100% 50%);
    --shadow: 0 10px 30px hsla(0 0% 0% / 0.5);
    --shadow-lg: 0 16px 48px hsla(0 0% 0% 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
.icon { width: 20px; height: 20px; fill: currentColor; vertical-align: middle; flex: none; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 14px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}
.topbar__menu { display: none; background: none; border: 0; color: var(--c-text); cursor: pointer; padding: 6px; }
.topbar__brand { display: flex; align-items: center; gap: 8px; color: var(--c-text); font-weight: 700; }
.topbar__logo {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, var(--c-primary), var(--c-info));
    font-size: 14px;
}
/* 导航栏 Logo 图片（白底 JPEG 用 multiply 混合模式在深色顶栏上透明化） */
img.topbar__logo {
    background: transparent; color: transparent; font-size: 0;
    width: 30px; height: 30px; padding: 0; border-radius: 8px;
    object-fit: contain; mix-blend-mode: multiply;
}
.topbar__name {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 56vw; font-size: 13px; letter-spacing: .1px;
}
.topbar__spacer { flex: 1; }
.topbar__bell, .topbar__theme, .topbar__logout {
    position: relative; display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px; color: var(--c-text-soft);
    background: var(--c-surface-2); cursor: pointer;
}
.topbar__bell:hover, .topbar__theme:hover, .topbar__logout:hover { color: var(--c-primary); }
.topbar__badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--c-danger); color: #fff; font-size: 11px;
    display: grid; place-items: center;
}
.topbar__user { display: flex; align-items: center; gap: 8px; }
.topbar__avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--c-primary); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.topbar__uname { font-weight: 600; }
.role--admin { color: var(--c-danger); }
.role--staff { color: var(--c-info); }
.role--agent { color: var(--c-success); }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
    width: var(--sidebar-w); flex: none;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    padding: 12px 10px;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--c-text-soft); font-weight: 500;
}
.nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav-item.is-active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; }

.main { flex: 1; padding: var(--space); min-width: 0; }
.main--center { display: grid; place-items: center; min-height: 100vh; padding: 20px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--space);
    box-shadow: var(--shadow);
}
.card__title { font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: var(--space); }
.grid--metrics { grid-template-columns: repeat(2, 1fr); }
.grid--2 { grid-template-columns: 1fr; }

/* ---------- 指标卡 ---------- */
.metric {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.metric__label { color: var(--c-text-soft); font-size: 13px; }
.metric__value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.metric__sub { color: var(--c-text-soft); font-size: 12px; margin-top: 4px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 9px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--c-border); background: var(--c-surface-2);
    color: var(--c-text); font-weight: 600; cursor: pointer; font-size: 14px;
    transition: filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn--danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn--success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn--sm { padding: 6px 10px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- 表单 ---------- */
.form-field { margin-bottom: 14px; }
.form-field__label { display: block; font-weight: 600; margin-bottom: 6px; }
.input, .select, .textarea {
    width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--c-border); background: var(--c-surface);
    color: var(--c-text); font-size: 14px; font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--c-primary-soft); border-color: var(--c-primary); }
.textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.table th { color: var(--c-text-soft); font-weight: 700; background: var(--c-surface-2); position: sticky; top: 0; }
.table tbody tr:hover { background: var(--c-surface-2); }
.row--warn td { background: rgba(245, 158, 11, .12); }
.row--danger td { background: rgba(239, 68, 68, .14); }
.row--ok td { background: rgba(22, 163, 74, .10); }

/* ---------- 标签 / 徽章 ---------- */
.tag {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: var(--c-surface-2); color: var(--c-text-soft);
}
.tag--success { background: rgba(22,163,74,.15); color: var(--c-success); }
.tag--warning { background: rgba(245,158,11,.15); color: var(--c-warning); }
.tag--danger  { background: rgba(239,68,68,.15); color: var(--c-danger); }
.tag--info    { background: rgba(14,165,233,.15); color: var(--c-info); }
.tag--primary { background: var(--c-primary-soft); color: var(--c-primary); }

/* ---------- 标签页 Tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--c-border); margin-bottom: 16px; }
.tab {
    padding: 9px 14px; cursor: pointer; border: 0; background: none;
    color: var(--c-text-soft); font-weight: 600; border-bottom: 2px solid transparent;
}
.tab.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* ---------- 时间线（订单状态） ---------- */
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--c-border); }
.timeline__item { position: relative; padding: 0 0 18px 14px; }
.timeline__item::before {
    content: ""; position: absolute; left: -18px; top: 4px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-border);
}
.timeline__item.is-done::before { background: var(--c-success); border-color: var(--c-success); }
.timeline__item.is-current::before { background: var(--c-primary); border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.timeline__title { font-weight: 700; }
.timeline__time { color: var(--c-text-soft); font-size: 12px; }

/* ---------- 进度条 ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.progress__bar { height: 100%; background: var(--c-primary); border-radius: 999px; transition: width .3s; }

/* ---------- 骨架屏 ---------- */
.skeleton { background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-border) 37%, var(--c-surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton--line { height: 14px; margin: 8px 0; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 40px 16px; color: var(--c-text-soft); }
.empty-state__icon { width: 56px; height: 56px; opacity: .4; }
.empty-state__tip { margin: 10px 0 16px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
    min-width: 220px; max-width: 340px; padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--c-info); animation: toastIn .25s ease;
}
.toast--success { border-left-color: var(--c-success); }
.toast--error { border-left-color: var(--c-danger); }
.toast--warning { border-left-color: var(--c-warning); }
.toast--danger { border-left-color: var(--c-danger); }
.toast--info { border-left-color: var(--c-info); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-host { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.modal-host.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
/* AI 智能搜索浮层：叠在表单弹窗之上，且不破坏底层 #modalHost（否则会误删含 <select> 的表单弹窗） */
.ai-search-host { z-index: 95; }
.modal__mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal__panel {
    position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: calc(100vh - 48px); overflow-y: auto;
    margin: auto; background: var(--c-surface);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 20px; border: 1px solid var(--c-border);
}
.modal__title { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---------- 杂项 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.muted { color: var(--c-text-soft); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-info { color: var(--c-info); }
.text-right { text-align: right; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex--wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kb-error { text-align: center; padding: 60px 20px; }
.kb-error h1 { font-size: 48px; color: var(--c-danger); }
.divider { height: 1px; background: var(--c-border); margin: 14px 0; }
.skeleton-block { min-height: 200px; }
.hide { display: none !important; }

/* ---------- 登录页 ---------- */
.login-card { width: 100%; max-width: 380px; }
.login-card .topbar__logo { width: 48px; height: 48px; font-size: 22px; margin: 0 auto 12px; }
img.login__logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; mix-blend-mode: multiply; }

/* ---------- 配置器向导 ---------- */
.wizard { display: grid; grid-template-columns: 1fr; gap: 16px; }
.wizard__steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.wizard__step {
    flex: none; min-width: 84px; text-align: center; padding: 8px; border-radius: var(--radius-sm);
    background: var(--c-surface-2); color: var(--c-text-soft); font-size: 12px; border: 1px solid transparent;
}
.wizard__step.is-active { border-color: var(--c-primary); color: var(--c-primary); font-weight: 700; }
.wizard__step.is-done { color: var(--c-success); }
.wizard__step.is-clickable { cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.wizard__step.is-clickable:hover { background: var(--c-surface); border-color: var(--c-primary); color: var(--c-primary); }
.wizard__panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; }
.cost-bar { position: sticky; bottom: 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-lg); }
.cost-bar__row { display: flex; justify-content: space-between; margin: 4px 0; }
.cost-bar__total { font-size: 20px; font-weight: 800; }

/* ---------- 响应式（>= 720px） ---------- */
@media (min-width: 720px) {
    .grid--metrics { grid-template-columns: repeat(4, 1fr); }
    .grid--2 { grid-template-columns: 2fr 1fr; }
    .wizard { grid-template-columns: 1fr 320px; align-items: start; }
    .main { padding: 24px; }
}

/* ---------- 响应式（移动端抽屉） ---------- */
@media (max-width: 719px) {
    .topbar__menu { display: grid; }
    .topbar__name { display: none; }
    .topbar__uname { display: none; }
    .sidebar {
        position: fixed; left: 0; top: var(--topbar-h); bottom: 0; z-index: 25;
        transform: translateX(-100%); transition: transform .2s; overflow-y: auto;
    }
    .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
    .role-label-text { display: none; }
}

/* ============================================================================
   补齐样式（批次2）：模板/JS 实际使用的 BEM 类此前在 main.css 大面积缺失，
   导致表单/徽章/工具栏/通知/详情弹窗/配置器向导几乎全是裸 HTML。
   以下按现有主题变量补齐并统一命名，不改动模板与 JS。
   ============================================================================ */

/* ---------- 页面容器与页头 ---------- */
.page { max-width: 1280px; margin: 0 auto; }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page__head--row { align-items: flex-end; }
.page__head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page__title { font-size: 20px; font-weight: 800; margin: 0; }
.page__head p { margin: 4px 0 0; }

/* 页面区块统一纵向间距（修复卡片紧贴问题：工作台/财务管理/数据看板等） */
.page > section,
.page > .card,
.page > .metrics,
.page > .grid-2,
.page > .tabs,
.page > .scenario-tabs,
.page > .toolbar { margin-bottom: var(--space); }
.page > :last-child { margin-bottom: 0; }

/* ---------- 登录页（BEM 版） ---------- */
.login { width: 100%; max-width: 400px; margin: 0 auto; }
.login__card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow-lg); }
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login__logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 800; background: linear-gradient(135deg, var(--c-primary), var(--c-info)); }
.login__title { font-size: 22px; font-weight: 800; margin: 0; }
.login__sub { margin: 2px 0 0; color: var(--c-text-soft); font-size: 13px; }
.login__hint { margin-top: 16px; font-size: 12px; color: var(--c-text-soft); text-align: center; }

/* ---------- 表单（BEM 版，与既有 .form-field 共存） ---------- */
.form { /* 弹窗表单容器，无额外修饰 */ }
.form__row { margin-bottom: 14px; }
.form__row--inline { display: flex; align-items: center; gap: 10px; }
.form__label { display: block; font-weight: 600; margin-bottom: 6px; }
.form__help { margin: 6px 0 0; font-size: 12px; color: var(--c-text-soft); }
.form__readonly { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--c-surface-2); color: var(--c-text-soft); border: 1px dashed var(--c-border); }
.form__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form__section { border-top: 1px solid var(--c-border); margin: 16px 0; padding-top: 12px; font-weight: 700; }
.form__cost { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }

/* ---------- 输入框变体 ---------- */
.input--filter { width: auto; min-width: 160px; padding: 8px 10px; }
.input--search { min-width: 220px; }
.input--check { width: auto; }

/* ---------- 按钮幽灵态 ---------- */
.btn--ghost { background: transparent; border-color: var(--c-border); color: var(--c-text-soft); }
.btn--ghost:hover { background: var(--c-surface-2); color: var(--c-text); }

/* ---------- 徽章（badge） ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--c-surface-2); color: var(--c-text-soft); }
.badge--ok { background: rgba(22,163,74,.16); color: var(--c-success); }
.badge--muted { background: var(--c-surface-2); color: var(--c-text-soft); }
.badge--warn { background: rgba(245,158,11,.16); color: var(--c-warning); }
.badge--danger { background: rgba(239,68,68,.16); color: var(--c-danger); }
.badge--info { background: rgba(14,165,233,.16); color: var(--c-info); }

/* ---------- 指标卡（.metric 改为 flex 容器，图标可选） ---------- */
.metrics { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: var(--space); }
#finBiz { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: var(--space); }
.biz-link { color: inherit; font-weight: 700; text-decoration: none; }
.biz-link:hover { text-decoration: underline; }
.metric { display: flex; align-items: center; gap: 14px; }
.metric__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c-primary-soft); color: var(--c-primary); flex: none; }
.metric__icon .icon { width: 22px; height: 22px; }
.metric__body { min-width: 0; }
.metric--blue   .metric__icon { background: var(--c-primary-soft); color: var(--c-primary); }
.metric--green  .metric__icon { background: rgba(22,163,74,.15); color: var(--c-success); }
.metric--purple .metric__icon { background: rgba(124,131,255,.18); color: #a5abff; }
.metric--red    .metric__icon { background: rgba(239,68,68,.16); color: var(--c-danger); }
.metric--amber  .metric__icon { background: rgba(245,158,11,.16); color: var(--c-warning); }
.metric--gray   .metric__icon { background: var(--c-surface-2); color: var(--c-text-soft); }

/* ---------- 卡片头 ---------- */
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.card__more { font-size: 13px; color: var(--c-primary); font-weight: 600; }

/* ---------- 工具栏 / 分页 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar__new { margin-left: auto; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pager__info { color: var(--c-text-soft); font-size: 13px; }
.table__act { text-align: right; white-space: nowrap; }

/* ---------- 详情弹窗 ---------- */
.detail__row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--c-border); }
.detail__row:last-child { border-bottom: 0; }
.detail__key { width: 110px; flex: none; color: var(--c-text-soft); }
.detail__val { flex: 1; min-width: 0; word-break: break-word; }

/* 分区详情弹窗 */
.detail--sections { display: flex; flex-direction: column; gap: 4px; }
.detail-sec { padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.detail-sec:last-child { border-bottom: 0; }
.detail-sec__title { font-weight: 600; font-size: 14px; color: var(--c-text); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.detail-sec__title .icon { width: 16px; height: 16px; color: var(--c-primary); }
.detail-sec__rows { display: flex; flex-direction: column; }
.detail-sec__body { font-size: 13px; }

/* 配件拿料清单（组装人员逐项勾选） */
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface-2); cursor: pointer; transition: background .15s, border-color .15s; }
.pick-item:hover { border-color: var(--c-primary); }
.pick-item__cb { width: 16px; height: 16px; flex: none; }
.pick-item__name { width: 64px; flex: none; font-weight: 600; color: var(--c-text); }
.pick-item__val { flex: 1; min-width: 0; color: var(--c-text-soft); }
.pick-item__cost { flex: none; font-variant-numeric: tabular-nums; color: var(--c-text); }
.pick-item.is-done { opacity: .55; }
.pick-item.is-done .pick-item__val { text-decoration: line-through; }

/* 表单内搜索 + AI 智能搜索 */
.form__search { display: flex; gap: 8px; margin-bottom: 8px; }
.form__search .input--search { flex: 1; }
.form__ai-search { flex: none; white-space: nowrap; }
.form__ai-search .icon { width: 14px; height: 14px; }

/* AI 智能搜索结果列表（按匹配度排序，用户点选后确认回传） */
.ai-results { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-results__head { font-size: 13px; color: var(--c-text-soft); }
.ai-result { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface-2); color: var(--c-text); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ai-result:hover { border-color: var(--c-primary); }
.ai-result.is-sel { border-color: var(--c-primary); background: var(--c-primary-soft); box-shadow: 0 0 0 2px var(--c-primary-soft); }
.ai-result__name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-result__bar { width: 90px; height: 6px; border-radius: 99px; background: var(--c-border); overflow: hidden; flex: none; }
.ai-result__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); }
.ai-result__pct { width: 40px; text-align: right; font-size: 12px; color: var(--c-text-soft); flex: none; }

/* 供应商报价管理 */
.supplier-manager { display: flex; flex-direction: column; gap: 8px; }
.sup-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface-2); }
.sup-row--pref { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.sup-row__main { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sup-row__name { font-weight: 600; min-width: 120px; }
.sup-row__f { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--c-text-soft); }
.sup-row__f .input { width: 92px; }
.sup-row__acts { display: flex; gap: 6px; flex: none; }

/* 宽弹窗（订单详情 / 供应商管理等） */
.modal__panel--wide { max-width: 760px; }
@media (max-width: 800px) { .modal__panel--wide { max-width: 94vw; } }

/* ---------- 列表页通用栅格 ---------- */
.grid-2 { display: grid; gap: var(--space); grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.ta-right { text-align: right; }

/* ---------- 工作台：待办 / 快捷入口 ---------- */
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--c-surface-2); color: var(--c-text); font-weight: 500; }
.todo__item:hover { background: var(--c-border); }
.todo__item--warn { background: rgba(245,158,11,.12); }
.todo__text { flex: 1; }
.todo__count { font-weight: 800; color: var(--c-warning); }
.quicklinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.quicklink { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font-weight: 600; }
.quicklink:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }
.quicklink .icon { color: var(--c-primary); }

/* 工作台预览行（通知 / 库存预警共用） */
.notif-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed var(--c-border); color: var(--c-text); }
.notif-row:last-of-type { border-bottom: 0; }
.notif-row:hover { background: var(--c-surface-2); }
.notif-row__icon { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--c-text-soft); background: var(--c-surface-2); }
.notif-row__icon.metric--red { color: var(--c-danger); background: rgba(239,68,68,.14); }
.notif-row__icon.metric--blue { color: var(--c-primary); background: var(--c-primary-soft); }
.notif-row__icon.metric--amber { color: var(--c-warning); background: rgba(245,158,11,.14); }
.notif-row__icon.metric--purple { color: #a5abff; background: rgba(124,131,255,.16); }
.notif-row__icon.metric--green { color: var(--c-success); background: rgba(22,163,74,.14); }
.notif-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif-row__title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-row__time { color: var(--c-text-soft); font-size: 12px; }
.notif-row__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); flex: none; }
.notif-row__more { padding: 10px 4px 2px; font-size: 12.5px; }
.notif-row__more a { color: var(--c-primary); font-weight: 600; }

/* ---------- 通知中心 ---------- */
.notif { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notif__item { display: flex; gap: 10px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface); }
.notif__item.is-unread { background: var(--c-primary-soft); border-color: transparent; }
.notif__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); margin-top: 6px; flex: none; }
.notif__body { flex: 1; min-width: 0; }
.notif__title { font-weight: 700; }
.notif__msg { color: var(--c-text-soft); font-size: 13px; margin: 2px 0; }
.notif__time { color: var(--c-text-soft); font-size: 12px; }
.notif__mark { margin-top: 6px; }

/* 分组切换标签 */
.notif-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.notif-tabs__tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
    background: var(--c-surface); border: 1px solid var(--c-border);
    color: var(--c-text-soft); font-size: 13px; font-weight: 600;
    transition: border-color .15s, color .15s, background .15s;
}
.notif-tabs__tab:hover { color: var(--c-text); border-color: var(--c-primary); }
.notif-tabs__tab.is-active { color: #fff; background: var(--c-primary); border-color: var(--c-primary); box-shadow: var(--glow-sm); }
.notif-tabs__count {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
    background: var(--c-surface-2); color: var(--c-text-soft);
}
.notif-tabs__tab.is-active .notif-tabs__count { background: rgba(0,0,0,.22); color: #fff; }

/* 通知项差异化（按类型配色 / 图标 / 分类标签） */
.notif__item {
    position: relative; align-items: flex-start;
    border-left: 3px solid var(--cat, var(--c-border));
    padding-left: 14px; gap: 12px;
}
.notif__item--warn    { --cat: var(--c-warning); }
.notif__item--info    { --cat: var(--c-info); }
.notif__item--accent  { --cat: var(--c-accent); }
.notif__item--ok      { --cat: var(--c-success); }
.notif__item--primary { --cat: var(--c-primary); }
.notif__item--muted   { --cat: var(--c-text-soft); }
.notif__icon {
    width: 36px; height: 36px; flex: none; border-radius: 10px; margin-top: 2px;
    display: grid; place-items: center; color: var(--cat, var(--c-text-soft));
    background: color-mix(in srgb, var(--cat, var(--c-text-soft)) 16%, transparent);
}
.notif__item.is-unread { border-left-color: var(--cat); }
.notif__bar { display: none; }
.notif__top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.notif__cat {
    display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700; color: var(--cat);
    background: color-mix(in srgb, var(--cat) 16%, transparent);
}
.notif__unread {
    font-size: 11px; font-weight: 700; color: var(--c-primary);
    padding: 1px 8px; border-radius: 999px; background: var(--c-primary-soft);
}
.notif__time { margin-left: auto; color: var(--c-text-soft); font-size: 12px; white-space: nowrap; }
.notif__title { font-weight: 700; }
.notif__msg { color: var(--c-text-soft); font-size: 13px; margin-top: 2px; line-height: 1.5; }

/* 免打扰提示条 */
.notif-dnd {
    margin-top: 8px; padding: 14px 16px; border-radius: var(--radius-sm);
    background: var(--c-surface-2); border: 1px dashed var(--c-border);
    color: var(--c-text-soft); font-size: 13px;
}

/* 通知项操作区（标为已读 / 清除） */
.notif__actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; margin-top: 2px; }
.notif__clear { color: var(--c-text-soft); }
.notif__clear:hover { color: var(--c-danger); border-color: var(--c-danger); }

/* 批量选择模式 */
.notif__item.is-selectable { cursor: pointer; }
.notif__item.is-selected { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.notif__check { position: relative; flex: none; width: 20px; height: 20px; margin-top: 4px; cursor: pointer; }
.notif__check-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.notif__check-box {
    display: block; width: 20px; height: 20px; border-radius: 6px;
    border: 1.5px solid var(--c-border); background: var(--c-surface); transition: .15s;
}
.notif__check-input:checked + .notif__check-box {
    background: var(--c-primary); border-color: var(--c-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 14px; background-repeat: no-repeat; background-position: center;
}

/* 选择工具条 */
.notif-selectbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; margin: 0 0 14px; border-radius: var(--radius-sm);
    background: var(--c-primary-soft); border: 1px solid var(--c-primary);
    flex-wrap: wrap;
}
.notif-selectbar__info { font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.notif-selectbar__info b { color: var(--c-primary); }
.notif-selectbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-selectbar[hidden] { display: none; }

/* 幽灵按钮 */
.btn--ghost { background: transparent; border: 1px solid var(--c-border); color: var(--c-text-soft); }

/* 开关组件 */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--c-surface-2); border: 1px solid var(--c-border); transition: .2s;
}
.switch__thumb {
    position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: var(--c-text-soft); transition: .2s;
}
.switch input:checked + .switch__track { background: var(--c-primary); border-color: var(--c-primary); box-shadow: var(--glow-sm); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); background: #fff; }
.switch-row { display: inline-flex; align-items: center; gap: 8px; padding: 0 4px; }
.switch-row__label { font-size: 13px; color: var(--c-text-soft); font-weight: 600; }

/* 接收设置弹窗辅助 */
.form__row--inline { align-items: center; justify-content: space-between; gap: 16px; }
.form__row--time { align-items: center; gap: 10px; }
.form__row--time .input--time { width: auto; flex: none; }
.form__row--time .form__sep { color: var(--c-text-soft); }
.form__sub { display: block; font-size: 12px; color: var(--c-text-soft); font-weight: 400; margin-top: 2px; }

/* ---------- 配置器向导（补充类，改为纵向堆叠） ---------- */
.wizard { display: flex; flex-direction: column; gap: 16px; }
.wizard__progress { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.wizard__body { min-height: 200px; }
.wizard__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.wizard__cost { font-size: 14px; }
.wizard__cost strong { font-size: 18px; color: var(--c-primary); }
.wizard__btns { display: flex; gap: 10px; }
.wizard__num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-surface-2); color: var(--c-text-soft); font-size: 12px; font-weight: 700; }
.wizard__label { font-size: 12px; }
.wizard__step.is-active .wizard__num { background: var(--c-primary); color: #fff; }
.wizard__step.is-done  .wizard__num { background: var(--c-success); color: #fff; }

/* ---------- 配置器步骤与确认摘要 ---------- */
.step { background: var(--c-surface); }
.step__title { margin: 0 0 14px; font-size: 16px; font-weight: 700; }

/* 配置器最后一步：左右两栏（表单 / 实时配置单），电脑端适配 */
/* 默认横排（flex row）：表单自适应 + 右侧摘要固定宽度 */
.step--summary { display: flex; gap: 24px; align-items: start; }
.step--summary > * { min-width: 0; }
.config-form { flex: 1 1 0%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.config-form .form__row { margin-bottom: 10px; min-width: 0; }
.config-form .form__row--full { grid-column: 1 / -1; }
/* 右侧配置摘要面板 */
.config-aside { flex: 0 0 280px; position: sticky; top: 78px; max-height: calc(100vh - 98px); overflow-y: auto; padding-right: 4px; }
.config-aside .confirm-summary { margin-top: 0; }
.config-aside .muted { margin-top: 10px; font-size: 12px; }
/* 摘要行紧凑化 */
.config-aside .confirm-summary__row { padding: 2px 0; font-size: 12px; }
.config-aside .confirm-summary__row--total { padding-top: 5px; }

/* 收件信息智能识别面板 */
.recipient-parser { background: var(--c-surface-2); border: 1px dashed var(--c-border); border-radius: var(--radius-sm); padding: 12px; }
.recipient-parser__actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.recipient-parser__actions .muted { font-size: 12px; }

/* 窄屏幕回退竖排 */
@media (max-width: 800px) {
    .step--summary { flex-direction: column; }
    .config-form { grid-template-columns: 1fr; }
    .config-aside { flex: none; position: static; max-height: none; }
}

.confirm-summary { margin-top: 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 12px; background: var(--c-surface-2); }
.confirm-summary__row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.confirm-summary__row--total { font-weight: 800; border-top: 1px solid var(--c-border); margin-top: 4px; padding-top: 8px; }

/* ---------- 配置器配件列表（展开式选择）---------- */
.pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
    padding: 12px 14px; margin-bottom: 8px; background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); cursor: pointer; color: var(--c-text);
    transition: border-color .15s, box-shadow .15s, background .15s; }
.pick:hover { border-color: var(--c-primary); }
.pick.is-selected { border-color: var(--c-primary); background: var(--c-primary-soft); box-shadow: var(--glow-sm); }
.pick__main { min-width: 0; }
.pick__name { font-weight: 600; font-size: 14px; }
.pick__meta { font-size: 12px; color: var(--c-text-soft); margin-top: 3px; }
.pick__badge { flex: 0 0 auto; }
.qty-row { margin-top: 14px; border-top: 1px dashed var(--c-border); padding-top: 14px; }
.qty-row .muted { display: block; margin-top: 4px; }

/* ---------- 杂项 ---------- */
.reset-pwd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; font-weight: 800; color: var(--c-primary); background: var(--c-primary-soft); border: 1px dashed var(--c-primary); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; word-break: break-all; }
.topbar__role { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--c-surface-2); }

/* ---------- 响应式增强（>= 720px） ---------- */
@media (min-width: 720px) {
    .metrics { grid-template-columns: repeat(4, 1fr); }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .quicklinks { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================================
   视觉与动效优化（批次3）：模态过渡 / 列表淡入 / 页面切换 / 悬停反馈 / loading
   ============================================================================ */

/* ---------- 模态框面板进出场 ---------- */
.modal__mask { opacity: 0; transition: opacity .2s ease; }
.modal-host.is-open .modal__mask { opacity: 1; }
.modal__panel { transform: translateY(10px) scale(.98); opacity: 0; transition: transform .22s ease, opacity .22s ease; }
.modal-host.is-open .modal__panel { transform: none; opacity: 1; }

/* ---------- 列表行淡入（错峰，封顶 14 行避免长表卡顿） ---------- */
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.table tbody tr { animation: rowIn .26s ease both; }
.table tbody tr:nth-child(1)  { animation-delay: .02s; }
.table tbody tr:nth-child(2)  { animation-delay: .04s; }
.table tbody tr:nth-child(3)  { animation-delay: .06s; }
.table tbody tr:nth-child(4)  { animation-delay: .08s; }
.table tbody tr:nth-child(5)  { animation-delay: .10s; }
.table tbody tr:nth-child(6)  { animation-delay: .12s; }
.table tbody tr:nth-child(7)  { animation-delay: .14s; }
.table tbody tr:nth-child(8)  { animation-delay: .16s; }
.table tbody tr:nth-child(9)  { animation-delay: .18s; }
.table tbody tr:nth-child(10) { animation-delay: .20s; }
.table tbody tr:nth-child(11) { animation-delay: .22s; }
.table tbody tr:nth-child(12) { animation-delay: .24s; }
.table tbody tr:nth-child(n+13) { animation-delay: .26s; }

/* ---------- 页面内容淡入 ---------- */
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main > .page, .main--center > .login { animation: pageIn .3s ease both; }

/* ---------- 卡片 / 磁贴悬停微抬升 ---------- */
.card, .metric, .quicklink, .notif__item, .todo__item { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease, background .2s ease; }
.card:hover, .metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- 按钮按压缩放 + 平滑过渡 ---------- */
.btn { transition: filter .15s ease, transform .08s ease, background .15s ease, border-color .15s ease, color .15s ease; }
.btn:active { transform: translateY(1px) scale(.99); }

/* ---------- 导航 / 顶栏图标过渡 ---------- */
.nav-item { transition: background .15s ease, color .15s ease; }
.topbar__bell, .topbar__theme, .topbar__logout { transition: color .15s ease, background .15s ease; }

/* ---------- Loading 动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 参考项目视觉对齐：青色霓虹 毛玻璃体系（T37） ===== */
/* 卡片 / 弹窗 / 磁贴：毛玻璃 + 微光边框 */
.card, .metric, .modal__panel, .quicklink, .login__card, .notif__item, .wizard__panel, .todo__item {
    background: linear-gradient(180deg, hsla(230, 19%, 17%, 0.72), hsla(230, 19%, 13%, 0.72));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--c-border);
}
/* 主按钮：青色霓虹填充 + 深黑字 + 发光 */
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: hsl(222 27% 6%); font-weight: 700; }
.btn--primary:hover { filter: none; background: var(--c-primary); box-shadow: var(--glow); }
.btn--success { color: #fff; }
.btn--danger { color: #fff; }
/* 悬停霓虹浮现 */
.card:hover, .metric:hover, .quicklink:hover { box-shadow: var(--glow); border-color: hsla(189, 100%, 50%, 0.3); }
.modal__panel { box-shadow: var(--shadow-lg), var(--glow); }
.login__card { box-shadow: var(--shadow-lg), var(--glow-lg); }
/* 侧边栏 / 导航激活态霓虹 */
.sidebar { background: hsl(222 27% 8%); }
.nav-item.is-active { background: var(--c-primary-soft); color: var(--c-primary); box-shadow: var(--glow-sm); }
/* 输入框聚焦青色环 */
.input:focus, .select:focus, .textarea:focus {
    outline: 2px solid hsla(189, 100%, 50%, 0.5);
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px hsla(189, 100%, 50%, 0.15);
}
/* 数值统一等宽字体（金额 / 编号 / 数量 纵向对齐） */
.metric__value, .money, .wizard__cost strong, .badge,
.table td[align="right"], .table th[align="right"] {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--c-border); border-top-color: var(--c-primary); animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
.spinner--center { display: block; margin: 40px auto; }
.spinner--sm { width: 18px; height: 18px; border-width: 2px; }

/* ---------- 尊重系统“减少动态效果”偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- AI 助手（对话） ---------- */
.assistant { display: flex; flex-direction: column; min-height: 60vh; }
.assistant__scenes { display: flex; gap: 8px; padding: 12px 16px 0; border-bottom: 1px solid var(--c-border); }
.assistant__scenes .tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--c-muted); padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px; }
.assistant__scenes .tab.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.assistant__log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; max-height: 56vh; }
.chat-bubble { display: flex; }
.chat-bubble__body { max-width: 78%; padding: 10px 14px; border-radius: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.chat-bubble--user { justify-content: flex-end; }
.chat-bubble--user .chat-bubble__body { background: var(--c-primary); color: #04121a; border-bottom-right-radius: 4px; }
.chat-bubble--assistant .chat-bubble__body { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); border-bottom-left-radius: 4px; }
.chat-bubble__engine { display: block; font-size: 11px; color: var(--c-muted); margin-top: 4px; padding-left: 2px; }
.chat-bubble.is-typing .chat-bubble__body { opacity: .7; }
.chat-bubble.is-typing .chat-bubble__body::after { content: '▋'; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.assistant__input { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--c-border); }
.assistant__input .input { flex: 1; }

/* 推荐问题 chips */
.assistant__suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
.assistant__suggest:empty { display: none; }
.suggest-chip {
    border: 1px solid var(--c-border); background: var(--c-surface-2); color: var(--c-text);
    border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest-chip:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }

/* 底部操作条 */
.assistant__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px 12px; border-top: 1px solid var(--c-border); }

/* 助手回复内文：Markdown 渲染 */
.chat-bubble__body p { margin: 0 0 7px; }
.chat-bubble__body p:last-child { margin-bottom: 0; }
.chat-bubble__body .md-h { font-weight: 700; margin: 2px 0 6px; font-size: 14.5px; }
.chat-bubble__body .md-ul, .chat-bubble__body .md-ol { margin: 4px 0 8px; padding-left: 20px; }
.chat-bubble__body .md-ul li, .chat-bubble__body .md-ol li { margin: 2px 0; }
.chat-bubble__body .md-code {
    display: block; margin: 6px 0; padding: 10px 12px; border-radius: 8px;
    background: var(--c-surface-2); border: 1px solid var(--c-border);
    font-family: var(--font-mono); font-size: 12.5px; white-space: pre-wrap; overflow-x: auto;
}
.chat-bubble__body code { font-family: var(--font-mono); font-size: 12.5px; background: var(--c-surface-2); padding: 1px 5px; border-radius: 5px; }
.chat-bubble__body strong { font-weight: 700; }

/* 复制按钮 */
.chat-bubble__copy {
    float: right; margin: 0 0 4px 10px; border: 1px solid var(--c-border); background: var(--c-surface-2);
    color: var(--c-text-soft); border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer;
    opacity: 0; transition: opacity .15s, color .15s, border-color .15s;
}
.chat-bubble--assistant:hover .chat-bubble__copy { opacity: 1; }
.chat-bubble__copy:hover { color: var(--c-primary); border-color: var(--c-primary); }

/* 打字中三点动画 */
.chat-bubble.is-typing .chat-bubble__body::after { content: ''; }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-muted); animation: typing 1.1s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }


/* ---------- 多场景仪表盘（场景切换 tab） ---------- */
.scenario-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.scenario-tabs .tab { background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; transition: all .2s; }
.scenario-tabs .tab.is-active { color: #04121a; background: var(--c-primary); border-color: var(--c-primary); box-shadow: var(--glow-sm); }

/* ---------- 配置模板载入弹窗（可展开表格） ---------- */
.tpl-modal { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.tpl-row { border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface-2); overflow: hidden; }
.tpl-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; background: none; border: 0; color: var(--c-text); cursor: pointer; }
.tpl-row__head:hover { background: var(--c-primary-soft); }
.tpl-row__name { font-weight: 700; font-size: 14px; }
.tpl-row__chev { transition: transform .2s ease; flex: 0 0 auto; }
.tpl-row.is-open .tpl-row__chev { transform: rotate(90deg); }
.tpl-row__detail { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--c-border); }
.tpl-row.is-open .tpl-row__detail { display: block; animation: pageIn .2s ease both; }
/* 配置配件弹窗内容区（可滚动，避免超出屏幕） */
.section { max-height: 60vh; overflow-y: auto; padding-right: 4px; }

.tpl-parts { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 12px; }
.tpl-part { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--c-border); }
.tpl-part span:first-child { color: var(--c-text-soft); }
.tpl-row__use { width: 100%; }

/* ============================================================================
   浅色主题 [data-theme="light"] —— 通过覆盖变量整体切换（浅底 + 深字 + 青色主色）
   ============================================================================ */
[data-theme="light"] {
    --c-bg: hsl(210 30% 96%);
    --c-surface: hsl(0 0% 100%);
    --c-surface-2: hsl(210 24% 94%);
    --c-border: hsla(222 20% 20% / 0.12);
    --c-text: hsl(222 30% 14%);
    --c-text-soft: hsla(222 20% 20% / 0.6);
    --c-muted: hsla(222 20% 20% / 0.6);
    --c-primary: hsl(191 95% 38%);
    --c-primary-soft: hsla(191 95% 38% / 0.1);
    --c-info: hsl(191 95% 38%);
    --c-success: hsl(145 60% 36%);
    --c-warning: hsl(35 90% 45%);
    --c-danger: hsl(5 75% 50%);
    --c-accent: hsl(214 90% 46%);
    --glass: hsla(222 20% 20% / 0.04);
    --glow: 0 0 18px hsla(191, 95%, 38%, 0.2);
    --glow-sm: 0 0 10px hsla(191, 95%, 38%, 0.18);
    --glow-lg: 0 0 28px hsla(191, 95%, 38%, 0.28);
    --shadow: 0 8px 24px hsla(222 30% 20% / 0.1);
    --shadow-lg: 0 14px 40px hsla(222 30% 20% / 0.16);
}
/* 浅色下毛玻璃卡片改为白底（避免暗色渐变透出发灰） */
[data-theme="light"] .card,
[data-theme="light"] .metric,
[data-theme="light"] .modal__panel,
[data-theme="light"] .quicklink,
[data-theme="light"] .login__card,
[data-theme="light"] .notif__item,
[data-theme="light"] .wizard__panel,
[data-theme="light"] .todo__item {
    background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.92), hsla(210, 24%, 98%, 0.92));
}
/* 浅色下顶栏 / 侧边栏 */
[data-theme="light"] .topbar { background: hsl(0 0% 100%); }
[data-theme="light"] .sidebar { background: hsl(210 28% 98%); }
[data-theme="light"] .modal__mask { background: rgba(20, 28, 45, .35); }
/* 浅色下主按钮文字保持白色（青底白字对比更佳） */
[data-theme="light"] .btn--primary { color: #fff; }
[data-theme="light"] .chat-bubble--user .chat-bubble__body,
[data-theme="light"] .scenario-tabs .tab.is-active,
[data-theme="light"] .assistant__scenes .tab.is-active { color: #fff; }

/* ============ AI 智能识别（配置器） ============ */
.ai-config__input { margin-bottom: 14px; }
.ai-config__input textarea { resize: vertical; }
.ai-config__actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ai-config__result { max-height: 62vh; overflow: auto; padding-right: 6px; }

.ai-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    margin: 4px 0 16px; padding: 14px;
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    background: var(--c-surface-2);
}
.ai-meta__rm-row { grid-column: 1 / -1; }
.ai-meta .form__label { font-size: 13px; margin-bottom: 4px; }

.ai-block {
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    margin-bottom: 12px; background: var(--c-surface); overflow: hidden;
}
.ai-block__head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}
.ai-block__idx {
    width: 22px; height: 22px; flex: none; border-radius: 50%;
    background: var(--c-primary-soft); color: var(--c-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.ai-block__label { font-weight: 700; min-width: 46px; }
.ai-intent { flex: 1; min-width: 150px; padding: 7px 10px; font-size: 13px; }
.ai-toolbar { display: flex; gap: 6px; flex: none; }

.ai-cands-wrap { padding: 10px 12px; }
.ai-cands { display: flex; flex-direction: column; gap: 6px; }
.ai-cand {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); cursor: pointer;
    background: var(--c-surface); transition: border-color .15s, background .15s;
}
.ai-cand:hover { border-color: var(--c-primary); }
.ai-cand.is-out { opacity: .68; }
.ai-cand__cb { flex: none; width: 16px; height: 16px; accent-color: var(--c-primary); }
.ai-cand__main { flex: 1; min-width: 0; }
.ai-cand__name { display: block; font-weight: 600; }
.ai-cand__meta { display: block; margin-top: 2px; font-size: 12px; color: var(--c-text-soft); }
.ai-cand__match { display: flex; align-items: center; gap: 8px; flex: none; }
.ai-match-bar {
    width: 70px; height: 6px; border-radius: 999px;
    background: var(--c-surface-2); overflow: hidden;
}
.ai-match-bar i {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--c-primary), var(--c-success));
}
.ai-match-num { min-width: 34px; text-align: right; font-size: 12px; font-weight: 700; color: var(--c-text-soft); }

/* 低匹配度候选（非低置信块内的弱项）：降低视觉权重，避免误认 */
.ai-cand.is-weak { opacity: .55; border-style: dashed; }

/* 低置信 / 无匹配警告 */
.ai-cands__warn {
    margin-bottom: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--c-warning, #d97706);
    background: rgba(217, 119, 6, .08);
    border-radius: var(--radius-sm);
}

/* ---------- 操作日志：详情单元格截断，悬浮看全文 ---------- */
.log-detail {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
