/* ==========================================================================
   小熊知识库管理系统 · UI 设计语言 v2
   设计原则：白色侧栏、蓝色主色、克制精致、重留白、轻阴影、统一组件
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
    /* 品牌主色（全系统唯一主色 · 蓝色 #2563EB） */
    --brand-900: #1E3A8A;
    --brand-800: #1E40AF;
    --brand-700: #1D4ED8;   /* 主色 hover */
    --brand-600: #2563EB;   /* 主按钮、链接、高亮 */
    --brand-500: #3B82F6;
    --brand-300: #93C5FD;
    --brand-200: #BFDBFE;
    --brand-100: #DBEAFE;   /* 浅底色标签 */
    --brand-50:  #EFF6FF;   /* 极浅底色背景 */

    /* 强调色（与主色统一为蓝，保证"全系统只有蓝色一个主色"） */
    --accent: #2563EB;
    --accent-dark: #1D4ED8;
    --accent-light: #60A5FA;
    --accent-bg: rgba(37, 99, 235, 0.08);

    /* 交互蓝 */
    --blue-600: #2563EB;
    --blue-700: #1D4ED8;
    --blue-500: #3B82F6;

    /* 灰阶（Slate 中性色） */
    --bg: #F8FAFC;              /* 页面背景 */
    --surface: #FFFFFF;         /* 卡片背景 */
    --surface-2: #F1F5F9;       /* 表头 / hover 背景 */
    --surface-3: #F1F5F9;       /* hover 背景 */
    --sidebar-bg: #FFFFFF;      /* 白色侧边栏 */
    --sidebar-text: #64748B;
    --sidebar-text-active: #2563EB;
    --sidebar-hover: #F1F5F9;
    --sidebar-active-bg: #EFF6FF;
    --sidebar-active-indicator: #2563EB;
    --sidebar-group-title: #94A3B8;
    --sidebar-border: #F1F5F9;

    /* 分割线：浅色低对比 */
    --border: #E2E8F0;
    --border-strong: #CBD5E1;
    --border-hairline: rgba(15, 23, 42, 0.06);

    /* 文本层级 */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-disabled: #CBD5E1;
    --text-invert: #FFFFFF;

    /* 语义色（浅色语义底） */
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --info: #6366F1;
    --info-bg: #E0E7FF;

    /* 圆角规范（小6 / 按钮输入8 / 卡片弹窗12 / 大容器16 / 圆形9999） */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;

    /* 阴影：轻阴影 */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 24px -4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 24px -4px rgba(0, 0, 0, 0.08);
    --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.12);

    /* 字体栈（Noto Sans SC 优先） */
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC',
                 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

    /* 字号分级（全站统一，禁止页面内随意写 font-size） */
    --fs-11: 11px;   /* 极微：辅助说明、时间戳 */
    --fs-12: 12px;   /* 微：标签、徽章、表头 */
    --fs-13: 13px;   /* 小：次要信息、表格辅助 */
    --fs-14: 14px;   /* 基准：正文、表格、表单 */
    --fs-15: 15px;   /* 中：卡片标题、弹窗标题 */
    --fs-17: 17px;   /* 大：区块标题 */
    --fs-20: 20px;   /* 特大：页面标题 */
    --fs-26: 26px;   /* 数字：指标数值 */
    --fs-32: 32px;   /* 巨大：核心指标 */

    /* 字重分级 */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* 聚焦环（统一交互反馈） */
    --ring-brand: 0 0 0 3px rgba(37, 99, 235, 0.12);
    --ring-danger: 0 0 0 3px rgba(239, 68, 68, 0.15);

    /* 危险色梯度 */
    --danger-hover: #DC2626;
    --danger-fg: #B91C1C;

    /* 兼容旧变量（历史模板遗留） */
    --gold: var(--brand-600);
    --gold-light: var(--brand-300);
    --gold-dark: var(--brand-700);
    --gold-bg: var(--brand-50);
    --card-bg: var(--surface);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html { background-color: var(--bg); }

body {
    background-color: var(--bg);
    font-family: var(--font-sans);
    color: var(--text-primary);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-700); text-decoration: none; transition: color 0.2s ease, opacity 0.2s ease; }
a:hover { color: var(--brand-600); }

/* 网站ICP/公安备案信息（固定右下角，低调不遮挡内容） */
.kb-page-footer {
    position: fixed;
    right: 14px;
    bottom: 6px;
    z-index: 900;
    font-size: 0.72rem;
    color: var(--text-weaken, #9aa0a6);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 6px;
    padding: 2px 8px;
    backdrop-filter: blur(2px);
    white-space: nowrap;
}
.kb-page-footer a { color: var(--text-weaken, #9aa0a6); }
.kb-page-footer a:hover { color: var(--brand-600); text-decoration: underline; }
.kb-footer-sep { margin: 0 4px; }

code {
    background: var(--surface-3);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

/* 滚动条：极细、隐形化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.14);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.26); background-clip: content-box; }

/* ---------- 3. 顶栏（56px、毛玻璃、细线分隔、左侧面包屑） ---------- */
.topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid var(--border-hairline);
}

/* 顶栏面包屑（首页 / 当前页） */
.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-left: 12px;
    white-space: nowrap;
    overflow: hidden;
}
.app-breadcrumb a {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}
.app-breadcrumb a:hover { color: var(--brand-600); }
.app-breadcrumb .bc-sep { font-size: 0.7rem; color: var(--text-disabled); }
.app-breadcrumb .active { color: var(--text-primary); font-weight: 500; }

.topbar .brand {
    color: var(--text-primary);
    font-size: 0.94rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
}
.topbar .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.86rem;
    flex-shrink: 0;
}
.topbar .brand small {
    display: block;
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    line-height: 1;
    margin-top: 2px;
    text-transform: uppercase;
}

.topbar .right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar .search-box { position: relative; width: 260px; }
.topbar .search-box input {
    background: var(--surface-3);
    border: 1px solid transparent;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 6px 12px 6px 32px;
    font-size: 0.82rem;
    width: 100%;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.topbar .search-box input::placeholder { color: var(--text-muted); }
.topbar .search-box input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
}
.topbar .search-box i.bi-search {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
    pointer-events: none;
}

.topbar .user-info {
    color: var(--text-secondary);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 7px;
}
.topbar .user-info i { font-size: 1rem; color: var(--text-muted); }
.topbar .user-info .role-badge {
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.66rem;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-weight: 500;
    letter-spacing: 0;
}
.topbar .logout-btn {
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.topbar .logout-btn:hover { color: var(--brand-700); }

/* 顶部搜索下拉 */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border-hairline);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1080;
    display: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
}
.search-dropdown .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.84rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    display: block;
    transition: background 0.15s ease;
}
.search-dropdown .dropdown-item:hover { background: var(--surface-3); color: var(--text-primary); }
.search-dropdown .group-label {
    padding: 8px 12px 2px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- 4. 布局与侧边栏（纯白、248px、大留白） ---------- */
.layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 248px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 16px 12px 32px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); background-clip: content-box; }

/* 侧边栏 Header：Logo + 系统名 + 英文副标题 */
.sidebar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--brand-600);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.01em;
}
.sidebar-brand small {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar .nav-group { margin-bottom: 22px; }
.sidebar .group-title {
    color: var(--sidebar-group-title);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0 10px 8px;
    text-transform: uppercase;
}
.sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--sidebar-text);
    padding: 8px 10px;
    min-height: 38px;
    font-size: 0.86rem;
    font-weight: 400;
    border-radius: var(--radius-sm);
    transition: background 0.18s ease, color 0.18s ease;
    margin-bottom: 1px;
    border: none;
}
.sidebar .nav-link:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
}
.sidebar .nav-link.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-active-bg);
    font-weight: 600;
}
/* 选中项左侧 3px 蓝色指示条（圆角右侧） */
.sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--sidebar-active-indicator);
}
.sidebar .nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    color: var(--sidebar-text);
    font-weight: 400;
    transition: color 0.18s ease;
}
.sidebar .nav-link:hover i { color: var(--sidebar-text-active); }
.sidebar .nav-link.active i { color: var(--sidebar-text-active); }

.main-content {
    flex: 1;
    padding: 32px 40px 64px;
    min-width: 0;
    overflow-x: auto;
}

/* ---------- 5. 页头（极简，重留白） ---------- */
.page-header { margin-bottom: 24px; }
.page-header h4 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 9px;
}
.page-header h4 { color: var(--text-primary); }
.page-header h4 i { color: var(--brand-600); font-size: 1.2rem; }
.page-header p { color: var(--text-secondary); font-size: 0.84rem; margin: 0; }
.page-header .breadcrumb { font-size: 0.78rem; margin: 0; background: none; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* 品牌页头（改为极简白底，去除重渐变） */
.brand-hero {
    padding: 0 0 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-hairline);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    background: none;
    border-radius: 0;
    box-shadow: none;
}
.brand-hero h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-hero h2 i { color: var(--brand-600); font-size: 1.35rem; font-weight: 400; }
.brand-hero .subtitle { color: var(--text-secondary); font-size: 0.86rem; margin-top: 6px; }

/* ---------- 6. 卡片（轻薄、弱边框） ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-hairline);
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-radius: var(--radius) var(--radius) 0 0;
    letter-spacing: -0.01em;
}
.card-body { padding: 18px; }

/* 统计卡片 */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.8rem; margin-top: 6px; }
.stat-card .stat-icon { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 8px; }

/* ---------- 7. 按钮（圆角 8px、三级体系、危险隔离） ----------
   宪法：主蓝 / 次灰 / 幽灵描边 + 危险隔离
   主按钮一屏最多一个；危险操作必须红色 */
.btn {
    border-radius: var(--radius-sm);
    font-size: var(--fs-13);
    padding: 7px 18px;
    font-weight: var(--fw-medium);
    transition: all 0.12s ease;
    letter-spacing: -0.005em;
    line-height: 1.4;
    box-shadow: var(--shadow-xs);
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}
.btn-outline-primary { border-color: var(--border-strong); color: var(--brand-700); background: transparent; }
.btn-outline-primary:hover {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
/* 兼容：历史模板用 btn-warning 表达"主操作"，统一指向品牌橙 */
.btn-warning {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-warning:hover, .btn-warning:focus {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}
.btn-outline-warning { border-color: var(--border-strong); color: var(--text-secondary); }
.btn-outline-warning:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--border-strong); }
.btn-outline-secondary { border-color: var(--border-strong); color: var(--text-secondary); background: transparent; }
.btn-outline-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.btn-outline-info { border-color: var(--border-strong); color: var(--brand-700); }
.btn-outline-info:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-outline-success { border-color: var(--border-strong); color: var(--success); }
.btn-outline-success:hover { background: var(--success); border-color: var(--success); color: #fff; }
.btn-secondary { background: var(--surface-3); border-color: transparent; color: var(--text-primary); }
.btn-secondary:hover { background: #ebebed; border-color: transparent; color: var(--text-primary); }
.btn-light { background: var(--surface); border-color: var(--border-strong); color: var(--text-primary); }
.btn-light:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text-primary); }
/* 成功按钮：全站取消绿色的主操作按钮，统一并入蓝色（绿色仅用于状态小标签） */
.btn-success { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-success:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }
/* 危险操作：低强调场景（表格行内删除等）用柔和红 */
.btn-danger-quiet { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn-danger-quiet:hover { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn-sm { padding: 4px 13px; font-size: var(--fs-12); }
.btn-lg { padding: 10px 24px; font-size: var(--fs-15); }
.btn:focus-visible { box-shadow: var(--ring-brand); outline: none; }
.btn-danger:focus-visible, .btn-danger-quiet:focus-visible { box-shadow: var(--ring-danger); outline: none; }
.btn:disabled, .btn.disabled { opacity: 0.4; cursor: not-allowed; }
.btn-link { color: var(--brand-600); text-decoration: none; }

/* ---------- 8. 表格（去网格化、细线、大行高） ---------- */
.table { font-size: var(--fs-13); margin-bottom: 0; color: var(--text-primary); }
.table > :not(caption) > * > * { border-color: var(--border-hairline); }
.table thead th {
    background: var(--surface-2);
    color: var(--text-secondary);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-12);
    border-bottom: 1px solid var(--border);
    padding: 11px 14px;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.01em;
}
.table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-hairline);
}
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--surface-3); }
.table-light { background: var(--surface-2) !important; }
.table-bordered > :not(caption) > * > * { border-color: var(--border-hairline); }

/* 数字/等宽列 */
.table .col-num, .table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- 9. Badge（克制、低饱和、语义固定） ----------
   宪法：每种颜色 = 一个固定含义
   橙=主数据/在售  绿=正常/完整  黄=待补全  红=停用/危险  灰=草稿/中性 */
.badge {
    font-size: var(--fs-12);
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.5;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.75; }
.bg-gold { background: var(--brand-600); color: #fff; }
.badge-soft-primary { background: var(--brand-50); color: var(--brand-700); }
.badge-soft-accent { background: var(--brand-50); color: var(--brand-700); }
.badge-soft-success { background: var(--success-bg); color: var(--success); }
.badge-soft-warning { background: var(--warning-bg); color: var(--warning); }
.badge-soft-danger { background: var(--danger-bg); color: var(--danger); }
.badge-soft-neutral { background: var(--surface-3); color: var(--text-secondary); }
.badge-solid-primary { background: var(--brand-600); color: #fff; }
.badge-solid-danger { background: var(--danger); color: #fff; }

/* ---- Bootstrap 原始色统一软化为柔和变体（拦截 86 处历史写法） ---- */
.bg-secondary { background: var(--surface-3) !important; color: var(--text-secondary) !important; }
.bg-light { background: var(--surface-3) !important; color: var(--text-secondary) !important; }
.bg-white { background: var(--surface) !important; }
.bg-primary { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.bg-info { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.bg-success { background: var(--success-bg) !important; color: var(--success) !important; }
.bg-warning { background: var(--warning-bg) !important; color: var(--warning) !important; }
.bg-danger { background: var(--danger-bg) !important; color: var(--danger) !important; }
.bg-dark { background: var(--surface-3) !important; color: var(--text-primary) !important; }
.text-bg-secondary, .text-bg-primary, .text-bg-info, .text-bg-success,
.text-bg-warning, .text-bg-danger, .text-bg-dark, .text-bg-light {
    background: var(--surface-3) !important; color: var(--text-secondary) !important;
}
.text-bg-success { background: var(--success-bg) !important; color: var(--success) !important; }
.text-bg-warning { background: var(--warning-bg) !important; color: var(--warning) !important; }
.text-bg-danger { background: var(--danger-bg) !important; color: var(--danger) !important; }
.text-bg-primary, .text-bg-info { background: var(--brand-50) !important; color: var(--brand-700) !important; }

/* ---------- 10. 表单（细腻、聚焦橙晕） ---------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    font-size: var(--fs-14);
    padding: 8px 12px;
    color: var(--text-primary);
    background-color: var(--surface);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-secondary); margin-bottom: 6px; }
.form-control-sm, .form-select-sm { font-size: var(--fs-13); padding: 5px 10px; }
.input-group-text {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

/* ---------- 11. Modal（宪：全站一套弹窗视觉） ----------
   统一圆角 / 头部 / 主体 / 按钮栏 / 遮罩 / 动画
   三档尺寸：S(确认) / M(表单，默认) / L(复杂) */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    background: transparent;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 1px solid var(--border-hairline);
    padding: 18px 22px;
    align-items: center;
    gap: 12px;
}
.modal-header .modal-title {
    font-size: var(--fs-15);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-body { padding: 22px; font-size: var(--fs-14); }
.modal-footer {
    border-top: 1px solid var(--border-hairline);
    padding: 14px 22px;
    background: var(--surface-2);
    gap: 10px;
}
.modal-header .btn-close { opacity: 0.35; transition: opacity 0.18s; }
.modal-header .btn-close:hover { opacity: 0.7; }
.modal-backdrop.show { opacity: 0.32; }
.modal-title i { color: var(--brand-600); }
.modal-title i.text-danger, .modal-title .text-danger { color: var(--danger) !important; }

/* 弹窗内危险强调块 */
.modal-danger-note {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: var(--fs-13);
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* 通用自定义弹窗（媒体/说明书类页面使用）—— 与 Bootstrap modal 视觉对齐 */
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 560px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box h4 {
    margin: 0 0 18px;
    color: var(--text-primary);
    font-size: var(--fs-15);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-box label {
    display: block;
    font-size: var(--fs-13);
    color: var(--text-secondary);
    font-weight: var(--fw-medium);
    margin-bottom: 5px;
}
.modal-box select, .modal-box input[type=text], .modal-box input[type=number], .modal-box textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: var(--fs-14);
    margin-bottom: 14px;
    box-sizing: border-box;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.modal-box select:focus, .modal-box input:focus, .modal-box textarea:focus {
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
    outline: none;
}
.modal-footer-bar { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* SQL 表结构弹窗 */
.sql-modal .modal-box { max-height: 88vh; overflow-y: auto; }
.sql-detail-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sql-detail-purpose {
    background: var(--surface-2);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: var(--fs-13);
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.sql-section-title {
    display: flex;
    align-items: center;
    font-size: var(--fs-13);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-hairline);
}
.sql-section-title i { color: var(--brand-600); }
.sql-table-cols td code { font-size: var(--fs-12); }

/* SQL 表结构列表：用途列限宽省略，悬浮显示全文 */
.st-purpose {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* 通用遮罩（避免与 Bootstrap .modal-backdrop 冲突） */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 3000;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.app-modal-backdrop.show { display: flex !important; animation: appFadeIn 0.18s ease; }
.app-modal-backdrop .modal-box { animation: appModalPop 0.22s cubic-bezier(0.2, 0.8, 0.3, 1); }

@keyframes appFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes appModalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- 11b. App 统一确认弹窗（confirm/alert 替换） ---------- */
.app-confirm-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 4000;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.app-confirm-mask.show { display: flex !important; animation: appFadeIn 0.18s ease; }
.app-confirm {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    animation: appModalPop 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.app-confirm-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 22px 10px;
}
.app-confirm-head .ac-ic {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: var(--brand-50);
    color: var(--brand-600);
}
.app-confirm-head .ac-ic.warn { background: var(--danger-bg); color: var(--danger); }
.app-confirm-head .ac-ic.ok { background: var(--success-bg); color: var(--success); }
.app-confirm-head h3 {
    margin: 0;
    font-size: var(--fs-15);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.app-confirm-head p {
    margin: 6px 0 0;
    font-size: var(--fs-13);
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}
.app-confirm-head p b { color: var(--text-primary); font-weight: var(--fw-semibold); }
.app-confirm-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-hairline);
    background: var(--surface-2);
}
.app-confirm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    transition: all 0.18s;
}
.app-confirm-close:hover { background: var(--surface-3); color: var(--text-primary); }

/* ---------- 12. Alert（轻底色、无重边框） ---------- */
.alert { border-radius: var(--radius); font-size: 0.85rem; border: 1px solid transparent; padding: 12px 16px; }
.alert-info { background: var(--info-bg); color: var(--brand-700); border-color: var(--brand-100); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bg); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bg); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }

/* ---------- 13. 进度条 ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); }
.progress-bar { background: var(--brand-600); }

/* ---------- 14. 空状态（留白充分） ---------- */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-secondary); }
.empty-state i { font-size: 2.4rem; color: var(--border-strong); margin-bottom: 14px; display: block; }
.empty-state p { margin: 0 0 4px; }
.empty-state .small { color: var(--text-muted); font-size: 0.8rem; }

/* ---------- 15. 分页 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; }
.pager .text-muted { font-size: 0.8rem; }

/* ---------- 16. 工具栏 ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }

/* ---------- 17. 在线编辑表 ---------- */
.edit-table td { padding: 6px 8px !important; vertical-align: middle; }
.edit-table thead th {
    background: transparent !important;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.edit-table .cell-input, .edit-table select.cell-input {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    outline: none;
    color: var(--text-primary);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.edit-table .cell-input:hover { border-color: var(--border); background: var(--surface-2); }
.edit-table .cell-input:focus {
    border-color: var(--brand-500);
    background: var(--surface);
    box-shadow: var(--ring-brand);
}
.edit-table .cell-text { padding: 5px 8px; min-height: 30px; line-height: 22px; }
.edit-table .modified, .edit-table tr.modified td { background: var(--accent-bg) !important; }

.save-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 10;
    border-radius: 0 0 var(--radius) var(--radius);
}
.edit-mode-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--brand-100);
    color: var(--brand-700);
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 500;
}

/* 通用工具条卡片 */
.surface-toolbar {
    background: var(--surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 14px 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: none;
}
.surface-toolbar select,
.surface-toolbar > input[type=text] {
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.84rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.surface-toolbar > input[type=text] { min-width: 220px; }
.surface-toolbar select:focus,
.surface-toolbar > input[type=text]:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
}
.surface-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border-hairline);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow-x: auto;
}

/* 归属维度标签 */
.owner-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 500;
    margin-right: 6px;
}
.owner-badge.owner-code { background: var(--brand-100); color: var(--brand-700); }
.owner-badge.owner-model { background: var(--surface-3); color: var(--text-secondary); }
.owner-badge.owner-sub_category { background: var(--success-bg); color: var(--success); }

/* 开关（Apple 风格） */
.app-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.app-switch input { opacity: 0; width: 0; height: 0; }
.app-switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-strong);
    transition: 0.25s ease;
    border-radius: var(--radius-pill);
}
.app-switch .slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    transition: 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.app-switch input:checked + .slider { background: var(--brand-600); }
.app-switch input:checked + .slider:before { transform: translateX(18px); }

/* ---------- 18. 归属选择器 ---------- */
.owner-picker { position: relative; }
.owner-picker-loading {
    position: absolute;
    right: 12px;
    top: 9px;
    color: var(--brand-600);
    font-size: 0.78rem;
    display: none;
}
.owner-results {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: -8px;
    margin-bottom: 12px;
    max-height: 160px;
    overflow-y: auto;
    display: none;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.owner-results.show { display: block; }
.owner-group-title {
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-hairline);
    letter-spacing: 0.5px;
}
.existing-media-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.existing-media-item {
    width: 72px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.existing-media-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.existing-media-type {
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.text-danger-soft { color: #d9534f; }
.owner-result-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--border-hairline);
}
.owner-result-item:last-child { border-bottom: none; }
.owner-result-item:hover { background: var(--surface-2); }
.owner-result-item .muted { color: var(--text-muted); font-size: 0.78rem; margin-left: 6px; }
.owner-selected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-50);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    color: var(--brand-700);
    margin-bottom: 12px;
}
.owner-selected button {
    border: none;
    background: none;
    color: var(--brand-700);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.6;
}
.owner-selected button:hover { opacity: 1; }

/* ---------- 级联选型号 + 一物多挂 ---------- */
.modal-box-xw { max-width: 760px; }
.cascade-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.cascade-row select { flex: 1; min-width: 0; margin-bottom: 0; }
.cascade-search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.cascade-search input[type=text] { flex: 1; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.85rem; }
.batch-box { margin-bottom: 12px; }
.batch-label { display: block; font-size: 0.78rem; margin-bottom: 4px; }
.batch-box textarea { width: 100%; box-sizing: border-box; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.85rem; resize: vertical; }
.batch-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.sel-box { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 8px 10px; margin-bottom: 12px; }
.sel-box-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.sel-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.sel-empty { width: 100%; text-align: center; color: var(--text-muted); font-size: 0.78rem; padding: 12px 0; }
.sel-tag { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 0.8rem; }
.sel-tag-code { font-weight: 500; color: var(--text-primary); }
.sel-tag-name { color: var(--text-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-tag-del { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: 0.9rem; line-height: 1; border-radius: 50%; }
.sel-tag-del:hover { color: var(--danger); background: var(--danger-bg); }

/* 已选型号计数条（可点开展开） */
.sel-bar {
    display: flex; justify-content: space-between; align-items: center; cursor: pointer;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); margin-bottom: 6px; font-size: 0.85rem; user-select: none;
}
.sel-bar:hover { border-color: var(--border-strong); }
.sel-bar b { color: var(--brand-500); }
.sel-bar-hint { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }
.sel-list.sel-list-hidden { display: none; }

/* 小类搜索结果（小类全选） */
.sub-results { display: none; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 6px; background: var(--surface); }
.sub-results.show { display: block; }
.sub-res-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.sub-res-item:last-child { border-bottom: 0; }
.sub-res-item:hover { background: var(--surface-2); }
.sub-res-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sub-res-name { font-weight: 500; color: var(--text-primary); }
.sub-res-empty { justify-content: center; color: var(--text-muted); font-style: italic; }

/* 上传拖放区（选择图片） */
.upload-dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 20px 12px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-2); text-align: center; cursor: pointer; transition: .15s; margin-bottom: 8px;
}
.upload-dropzone:hover { border-color: var(--brand-500); background: var(--brand-50); }
.upload-dropzone i { font-size: 1.8rem; color: var(--brand-500); }
.ud-title { font-weight: 600; color: var(--text-primary); }
.ud-sub { font-size: 0.78rem; color: var(--text-muted); }
.ud-summary { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; margin-bottom: 6px; }
.ud-summary i { color: var(--success, #198754); }
.upload-files { display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.upload-file { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.8rem; }
.upload-file img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.uf-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 4px; background: var(--brand-50); color: var(--brand-500); }
.uf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-size { color: var(--text-muted); white-space: nowrap; }

/* 统一确认弹窗（小） */
.modal-box-sm { max-width: 420px; }
.confirm-msg { font-size: 0.85rem; color: var(--text-primary); line-height: 1.6; margin-bottom: 4px; }

/* 轻提示 Toast（底部居中） */
.app-toast {
    position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
    padding: 12px 20px; border-radius: var(--radius); font-size: var(--fs-13);
    color: var(--text-primary); background: var(--surface);
    border: 1px solid var(--hairline);
    opacity: 0; pointer-events: none; transition: .25s; z-index: 2000;
    box-shadow: var(--shadow); max-width: 80vw;
    display: flex; align-items: center; gap: 10px; font-weight: var(--fw-medium);
}
.app-toast i { font-size: 16px; }
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 新类名（AppConfirm.toast） */
.app-toast.ok i { color: var(--success); }
.app-toast.err i { color: var(--danger); }
.app-toast.info i { color: var(--brand-600); }
/* 兼容旧类名（历史页面使用） */
.app-toast.t-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.app-toast.t-error { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.app-toast.t-info { background: var(--info-bg); color: var(--brand-700); border-color: transparent; }

/* 穿梭框 */
.transfer-box { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.transfer-pane {
    flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.transfer-header {
    background: var(--surface-2); padding: 6px 12px; font-size: 0.8rem;
    font-weight: 600; color: var(--text-primary);
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}
.transfer-list { flex: 1; min-height: 180px; max-height: 260px; overflow-y: auto; padding: 4px; }
.transfer-item {
    display: flex; align-items: center; gap: 6px; padding: 6px 8px;
    font-size: 0.8rem; border-radius: 4px; cursor: pointer;
}
.transfer-item:hover { background: var(--brand-50); }
.transfer-item .t-code { font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.transfer-item .t-name { color: var(--text-muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.transfer-item-done { justify-content: flex-start; }
.transfer-item-done .t-del {
    margin-left: auto; border: none; background: none; color: var(--danger);
    opacity: .55; cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 3px;
}
.transfer-item-done .t-del:hover { opacity: 1; }
.transfer-empty { text-align: center; color: var(--text-muted); font-size: .78rem; padding: 40px 0; }
.transfer-empty i { font-size: 1.6rem; color: var(--border-strong); }
.transfer-empty p { margin: 6px 0 0; }
.transfer-middle {
    display: flex; flex-direction: column; gap: 6px; justify-content: center; align-items: center;
}
.transfer-pager {
    display: flex; gap: 8px; align-items: center; justify-content: center;
    padding: 5px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--text-muted);
}
.transfer-pager .btn-sm { padding: 1px 8px; line-height: 1.2; }
/* 分页条：外层负责「左统计 / 右控件」，内层 .pager-controls 自己换行，
   避免容器与内层双层 flex 在换行时互相干扰导致错位重叠（通用分页组件 AppPager 使用） */
.pager { flex-wrap: wrap; row-gap: 10px; justify-content: space-between; }
.pager .btn-sm { padding: 2px 9px; line-height: 1.3; }
.pager .form-select-sm { padding: 3px 6px; }
.pager-controls {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
    gap: 6px; margin-left: auto;
}
.pager-info { font-size: .8rem; }
.pager .pager-ellipsis { padding: 0 4px; }
.pager .per-page-select { width: auto; min-width: 72px; flex: 0 0 auto; }
/* 关系管理分页条：贴卡片底部，顶部加分隔线 */
.pager#foot { padding: 14px 18px; margin-top: 0; border-top: 1px solid var(--border); }
/* 型号数量标记 */
.transfer-item .t-count {
    margin-left: auto; font-size: .72rem; color: var(--text-muted);
    background: var(--surface-2); padding: 1px 6px; border-radius: 10px; white-space: nowrap;
}
.transfer-item .t-count-full {
    margin-left: auto; font-size: .72rem; font-weight: 700; color: #fff;
    background: #e5484d; padding: 1px 6px; border-radius: 10px; white-space: nowrap;
}

/* ---------- 19. 通用工具类 ---------- */
.text-muted { color: var(--text-muted) !important; }
.text-muted-soft {
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-height: 52px;
    overflow: hidden;
    line-height: 1.5;
}
.url-cell { font-size: 0.82rem; word-break: break-all; }
.url-cell a { color: var(--brand-600); text-decoration: none; }
.url-cell a:hover { text-decoration: underline; }

.hint-box {
    background: var(--brand-50);
    border: none;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--brand-700);
    line-height: 1.6;
}
.hint-box b { color: var(--brand-700); }
.file-name-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: -8px 0 12px;
}
.issues-box {
    margin-top: 8px;
    padding: 12px 14px;
    background: var(--warning-bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--warning);
    max-height: 160px;
    overflow: auto;
}

/* ---------- 20. 媒体页组件 ---------- */
.app-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-hairline);
}
.app-tab {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.app-tab:hover { color: var(--text-primary); }
.app-tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); font-weight: 500; }

.media-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-3);
    border: 1px solid var(--border-hairline);
    cursor: pointer;
    display: block;
}
.media-thumb-ph {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    border: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}
.type-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    background: var(--brand-100);
    color: var(--brand-700);
    font-weight: 500;
    margin-right: 4px;
}
.type-pill.off {
    background: var(--surface-3);
    color: var(--text-muted);
    border: none;
    font-weight: 400;
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.owner-check { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.owner-check label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
    margin: 0;
}
.owner-check input { width: 16px; height: 16px; accent-color: var(--brand-600); cursor: pointer; }

.preview-box { max-width: 90vw; max-height: 90vh; }
.preview-box img { max-width: 100%; max-height: 85vh; border-radius: var(--radius-lg); }

/* ---------- 21. 登录页（Apple 极简白） ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}
.login-card {
    width: 400px;
    max-width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px 36px;
}
.login-card .login-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--text-primary);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}
.login-card h4 {
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.login-card .login-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 26px;
}
.login-card .input-group-text { background: var(--surface-3); border-color: var(--border-strong); }
.login-card .demo-hint {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-hairline);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ---------- 22. 结果遮罩 ---------- */
.results-wrap { position: relative; min-height: 80px; }
.results-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--radius);
    z-index: 10;
}
.results-loading.show { display: flex; }
.results-loading .spinner-border {
    width: 1.8rem;
    height: 1.8rem;
    color: var(--brand-600);
}
.results-loading .loading-text {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 400;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* ---------- 22.5 视图切换 Tab ---------- */
.view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.view-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.view-tab .vt-sub {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
}
.view-tab:hover {
    border-color: var(--brand-300, var(--brand-500));
    color: var(--text-primary);
}
.view-tab.is-active {
    border-color: var(--brand-500);
    background: var(--brand-50);
    color: var(--brand-700);
    box-shadow: var(--ring-brand);
}
.view-tab.is-active .vt-sub { color: var(--brand-700); opacity: 0.8; }
.view-tab i { margin-right: 4px; }

/* ---------- 23. 指标卡 ---------- */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.metric-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border);
    color: inherit;
}
.metric-card.is-active {
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
}
.metric-card .m-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metric-card .m-value {
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.metric-card .m-sub {
    margin-top: 10px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metric-card .m-sub .miss { color: var(--danger); font-weight: 500; }
.metric-card .m-sub .ok { color: var(--success); font-weight: 500; }

/* ---------- 24. 可搜索下拉 Combo ---------- */
.combo { position: relative; }
.combo > .combo-trigger {
    height: 38px;
    width: 240px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.combo > .combo-trigger:hover { border-color: var(--text-muted); }
.combo.open > .combo-trigger {
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
}
.combo .combo-trigger .combo-key {
    flex: none;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-right: 8px;
    border-right: 1px solid var(--border-hairline);
}
.combo .combo-trigger .combo-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.combo .combo-trigger .combo-label.is-ph { color: var(--text-muted); }
.combo .combo-trigger .caret { flex: none; color: var(--text-muted); font-size: 0.68rem; transition: transform 0.2s ease; }
.combo.open .combo-trigger .caret { transform: rotate(180deg); }
.combo .combo-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 300px;
    background: var(--surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
}
.combo.open .combo-panel { display: block; }
/* combo 在模态体内：跟随容器整宽，避免与表单控件错位 */
.app-modal-backdrop .combo { display: block; width: 100%; }
.combo .combo-filter {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    margin-bottom: 6px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.combo .combo-filter:focus { border-color: var(--brand-500); box-shadow: var(--ring-brand); }
.combo .combo-list { max-height: 240px; overflow-y: auto; }
.combo .combo-opt {
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease;
}
.combo .combo-opt:hover { background: var(--surface-2); }
.combo .combo-opt.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 500; }
.combo .combo-empty { padding: 14px 10px; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

/* ---------- 25. 工具栏内搜索框 ---------- */
.surface-toolbar .search-input { position: relative; flex: 1 1 240px; min-width: 210px; max-width: 340px; }
.surface-toolbar .search-input i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
}
.surface-toolbar .search-input input[type=text],
.surface-toolbar .search-input input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 14px 0 36px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.surface-toolbar .search-input input::placeholder { color: var(--text-muted); }
.surface-toolbar .search-input input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--ring-brand);
}

/* ---------- 26. 表格内展开/排序/徽标 ---------- */

/* 型号编码胶囊（品牌橙引导 · 全站统一） */
.model-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: var(--radius-pill);
    background: var(--brand-100);
    color: var(--brand-700);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}
.model-code::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-600);
    flex: none;
}
.model-code:hover, a.model-code:hover { background: var(--brand-200); color: var(--brand-800); }

/* 可点击行：悬停时型号胶囊转为实心橙，并出现橙色渐变指示条 */
.table tbody tr.row-link,
.table tbody tr.row-clickable { position: relative; cursor: pointer; }
.table tbody tr.row-link > td:first-child,
.table tbody tr.row-clickable > td:first-child { position: relative; }
.table tbody tr.row-link > td:first-child::before,
.table tbody tr.row-clickable > td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--brand-600), var(--brand-500));
    opacity: 0;
    transition: opacity 0.18s ease;
}
.table tbody tr.row-link:hover,
.table tbody tr.row-clickable:hover { background: var(--brand-50); }
.table tbody tr.row-link:hover > td:first-child::before,
.table tbody tr.row-clickable:hover > td:first-child::before { opacity: 1; }
.table tbody tr.row-link:hover .model-code,
.table tbody tr.row-clickable:hover .model-code { background: var(--brand-600); color: #fff; }
.table tbody tr.row-link:hover .model-code::before,
.table tbody tr.row-clickable:hover .model-code::before { background: #fff; }

.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--brand-600); }
.table thead th.sorted { color: var(--brand-600); font-weight: 600; }
.table thead th .sort-ind { display: inline-block; margin-left: 4px; font-size: 0.64rem; color: var(--text-muted); vertical-align: middle; }
.table thead th.sorted .sort-ind { color: var(--brand-600); }
.table tbody tr.row-clickable { transition: background 0.18s ease; }
.table tbody tr.row-clickable.expanded { background: var(--surface-2); }
.table tbody tr.row-clickable.expanded > td:first-child::before { opacity: 1; }
.table tbody tr.sub-row > td { background: var(--surface-2); padding: 10px 16px 10px 44px !important; }
.table .code { font-family: var(--font-mono); font-size: 0.82rem; }
.table td.num.is-zero { color: var(--text-muted); font-weight: 400; }
.row-expander {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 5px;
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: 0.58rem;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    vertical-align: middle;
}
tr.expanded .row-expander { transform: rotate(90deg); background: var(--brand-600); color: #fff; }
.sub-row .sub-seq { color: var(--text-muted); font-size: 0.76rem; }
.sub-row .sub-code { font-family: var(--font-mono); font-size: 0.82rem; }
.cell-empty { color: var(--text-muted); font-style: normal; }
.missing-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 0.68rem;
    font-weight: 500;
    vertical-align: middle;
}

.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: var(--info-bg);
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
}
.status-tag.status-off {
    background: var(--danger-bg);
    color: var(--danger);
}
.StatusSel {
    width: 92px;
    font-size: 0.72rem;
    padding: 3px 6px;
    border-radius: var(--radius);
}

.uploadZone {
    border: 1.5px dashed var(--border-strong) !important;
    background: var(--surface-2);
    cursor: pointer;
    border-radius: var(--radius) !important;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.uploadZone:hover { background: var(--surface-3); border-color: var(--text-muted) !important; }

/* ---------- 28. 角色权限矩阵（芯片式勾选） ---------- */
/* 设计意图：把「复选框 + 文字」升级为可点击芯片；
   选中=品牌橙实心，未选=中性描边。扫描时靠颜色即可读出角色能力边界。 */

.perm-matrix { display: flex; flex-direction: column; gap: 18px; }

.perm-group {
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.perm-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-hairline);
    cursor: pointer;
    user-select: none;
    transition: background 0.18s ease;
}
.perm-group-head:hover { background: var(--surface-3); }
.perm-group-head .pg-caret {
    font-size: 0.62rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
.perm-group.is-collapsed .perm-group-head .pg-caret { transform: rotate(-90deg); }
.perm-group.is-collapsed .perm-group-body { display: none; }
/* 分组头用「小圆点 + 名称 + 迷你进度」，避免一长串文字把标题行压垮 */
.perm-group-head .pg-head-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
}
.perm-group-head .pg-name {
    font-size: var(--fs-14);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    flex-shrink: 0;
}
.perm-group-head .pg-count {
    flex-shrink: 0;
    font-size: var(--fs-12);
    font-weight: var(--fw-semibold);
    color: var(--brand-700);
    background: var(--brand-100);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-variant-numeric: tabular-nums;
}
.perm-group-head .pg-count.is-zero { color: var(--text-muted); background: var(--surface-3); }

/* 极简进度条：宽度即授权比例，余光可读 */
.perm-group-head .pg-bar {
    flex: 1;
    min-width: 40px;
    max-width: 160px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
}
.perm-group-head .pg-bar-fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--brand-500);
    transition: width 0.25s ease;
}
.perm-group.is-empty .pg-bar-fill { background: var(--text-muted); opacity: 0.4; }

.perm-group-body { padding: 14px 16px 16px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.perm-chip { position: relative; display: inline-flex; }
.perm-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.perm-chip label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: var(--fs-13);
    font-weight: var(--fw-medium);
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease,
                color 0.18s ease, box-shadow 0.18s ease;
}
.perm-chip label::before {
    content: "\f28a";
    font-family: "bootstrap-icons";
    font-size: 0.78rem;
    opacity: 0.35;
    transition: opacity 0.18s ease;
}
.perm-chip label:hover { border-color: var(--brand-300); color: var(--text-primary); }
.perm-chip input:checked + label {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}
.perm-chip input:checked + label::before { content: "\f26b"; opacity: 1; }
.perm-chip input:focus-visible + label { box-shadow: var(--ring-brand); }
.perm-chip input:disabled + label {
    cursor: not-allowed;
    background: var(--surface-3);
    border-color: var(--border-hairline);
    color: var(--text-muted);
}
.perm-chip input:checked:disabled + label {
    background: var(--brand-200);
    border-color: var(--brand-300);
    color: var(--brand-900);
}

/* 角色卡片头部右侧的紧凑统计 */
.role-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-12);
    color: var(--text-secondary);
    white-space: nowrap;
}
.role-stat b { color: var(--text-primary); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* ---------- 29. 部门/角色 通用分组标题 ---------- */
.section-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border-hairline);
    border-left: 3px solid var(--brand-600);
    border-radius: var(--radius-sm);
    background: var(--brand-50);
    font-size: var(--fs-13);
    color: var(--text-secondary);
}
.section-hint i { color: var(--brand-600); margin-top: 1px; }
.section-hint b { color: var(--text-primary); font-weight: var(--fw-semibold); }

/* 部门列的双行紧凑排版 */
.dept-cell { font-size: var(--fs-12); line-height: 1.6; }
.dept-cell .dept-main { color: var(--text-primary); font-weight: var(--fw-medium); }
.dept-cell .dept-sub { color: var(--text-muted); }

/* ---------- 30. 响应式 ---------- */
@media (max-width: 992px) {
    .topbar { padding: 0 16px; }
    .topbar .search-box { width: 180px; }
    .topbar .brand small { display: none; }
    .main-content { padding: 24px 20px 48px; }
}
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        gap: 4px;
        border-right: none;
        border-bottom: 1px solid var(--border-hairline);
    }
    .sidebar .nav-group { margin: 0; display: contents; }
    .sidebar .group-title { display: none; }
    .sidebar .nav-link {
        padding: 7px 12px;
        font-size: 0.82rem;
    }
}

/* ---------- 30. 产品档案：顶部锚点导航 ---------- */
/* 设计意图：档案页高度大、区块多；用一条粘顶细导航替代「滚很久找区块」，
   当前区块用橙色下划线高亮，靠颜色即可定位阅读位置。 */
.arch-anchor {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
}
.arch-anchor a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-13);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease;
}
.arch-anchor a:hover { background: var(--brand-50); color: var(--brand-700); }
.arch-anchor a.is-active { background: var(--brand-100); color: var(--brand-700); font-weight: var(--fw-semibold); }
.arch-anchor a i { color: var(--brand-500); }
/* 锚点跳转后的落点留白，避免被粘性导航盖住 */
.arch-section { scroll-margin-top: 68px; }

/* ---------- 31. 规格分组折叠 ---------- */
/* 设计意图：规格分组多时先看目录；分组头可点，折叠态只留标题与计数。 */
.spec-group-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 12px;
    margin-bottom: 6px;
    background: linear-gradient(90deg, var(--brand-50), transparent);
    border-left: 3px solid var(--brand-500);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.16s ease;
}
.spec-group-head:hover { background: linear-gradient(90deg, var(--brand-100), transparent); }
.spec-group-head .sg-caret {
    font-size: 0.6rem;
    color: var(--brand-600);
    transition: transform 0.2s ease;
}
.spec-group.is-collapsed .spec-group-head .sg-caret { transform: rotate(-90deg); }
.spec-group.is-collapsed .kv-grid { display: none; }
.spec-group-head .sg-name {
    font-size: var(--fs-13);
    font-weight: var(--fw-bold, 700);
    color: var(--brand-700);
}
.spec-group-head .sg-count {
    font-size: var(--fs-11);
    font-weight: var(--fw-semibold);
    color: var(--brand-700);
    background: var(--surface);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-pill);
    padding: 1px 9px;
    font-variant-numeric: tabular-nums;
}

/* ---------- 32. 规格值一键复制 ---------- */
/* 设计意图：客服重度使用需频繁复制参数；hover 才浮现，避免常态视觉噪音。 */
.card .kv-row { position: relative; }
.card .kv-row .copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.62rem;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.card .kv-row:hover .copy-btn { opacity: 1; }
.card .kv-row .copy-btn:hover { color: var(--brand-600); border-color: var(--brand-300); }
.card .kv-row .copy-btn.is-done { color: var(--success); border-color: var(--success); opacity: 1; }

/* ---------- 33. 搜索结果：小类命中分组 ---------- */
/* 设计意图：按小类搜索会返回几百条型号，先给「小类摘要芯片 + 数量」帮助确认范围，
   再用可折叠分组承载型号，避免一屏铺满看不懂。 */
.subcat-hit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 8px 6px 0;
    padding: 5px 12px;
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-pill);
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: var(--fs-13);
    font-weight: var(--fw-medium);
}
.subcat-hit .sh-count {
    font-size: var(--fs-11);
    font-weight: var(--fw-semibold);
    background: var(--brand-600);
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 1px 8px;
    font-variant-numeric: tabular-nums;
}
.result-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius);
    font-size: var(--fs-13);
    color: var(--text-secondary);
}
.result-summary b { color: var(--brand-700); font-variant-numeric: tabular-nums; }
.result-summary .rs-sep { width: 1px; height: 14px; background: var(--border-strong); }

/* 小类搜索：型号编码网格 —— 客服只需「快速扫到并点进目标型号」，
   因此去掉所有统计列，让编码本身成为唯一视觉主体，一屏可容纳更多选项。 */
.model-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 8px;
}
.model-code-grid .grid-code {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-decoration: none;
    min-width: 0;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.model-code-grid .grid-code:hover {
    border-color: var(--brand-300);
    background: var(--brand-50);
    transform: translateY(-1px);
}
.model-code-grid .grid-code .model-code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.model-code-grid .grid-code-name {
    font-size: var(--fs-11);
    color: var(--text-muted);
    line-height: 1.3;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.model-code-grid .grid-code:hover .grid-code-name { color: var(--brand-700); }
@media (max-width: 576px) {
    .model-code-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
}

/* ---------- 34. 产品对比：表头与内容分层 · 差异仅用橙色文字 ---------- */
/* 设计意图：
   1) 表头用深一档底色 + 下边框与「内容行」明确分层，避免相同项的白底与表头混在一起看不出边界；
   2) 差异不使用任何底色/色条/色块，仅把「规格项」文字变橙加粗，安静但一眼可辨；
   3) 相同项排在表格上方、差异项排在下方，配合分组底色区隔，便于先扫一致、再核差异。 */
.compare-table {
    --cmp-head-bg: #eef1f5;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-13);
}
.compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--cmp-head-bg);
    border-bottom: 2px solid var(--border-strong);
    font-size: var(--fs-12);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    white-space: nowrap;
    padding: 9px 10px;
}
.compare-table thead th .ct-code {
    font-family: var(--font-mono);
    font-size: var(--fs-13);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
}
.compare-table td {
    padding: 8px 10px;
    vertical-align: top;
    border-bottom: 1px solid var(--border-hairline);
    background: var(--surface);
}
/* 规格项列：稍深底色，形成「标签列 | 数据列」的纵向分层 */
.compare-table .ct-key {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 110px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    background: var(--surface-2);
    border-right: 1px solid var(--border-hairline);
}
.compare-table thead .ct-key {
    z-index: 3;
    background: var(--cmp-head-bg);
}
.compare-table .ct-val { max-width: 260px; word-break: break-word; }

/* 差异项：只把规格项文字变橙加粗，不加任何底色/标签 */
.compare-table tr.row-diff > .ct-key {
    color: var(--brand-600);
    font-weight: var(--fw-bold);
    background: var(--brand-50);
}
/* 相同项：规格项保持常规中性色 */
.compare-table tr.row-same > .ct-key { color: var(--text-secondary); }

/* 分组分隔：相同项与差异项之间画一条更明显的分界线 */
.compare-table tr.row-diff:first-of-type > td { border-top: 2px solid var(--border-strong); }

.compare-table tbody tr:hover > td { background: var(--surface-3); }
.compare-table tbody tr:hover > .ct-key { background: var(--surface-3); }

/* ---------- 型号列表页（models.html）增强 ---------- */

/* 斑马纹：宽表横向扫读时帮助对齐行，偶数行用极浅底色 */
.table-zebra tbody tr:nth-child(even) > td { background: var(--surface-2); }
.table-zebra.table-hover tbody tr:hover > td { background: var(--surface-3); }

/* 表头吸顶：20/50/100 条长列表滚动时保持列名可见 */
.table-zebra thead th { position: sticky; top: 0; z-index: 2; }

/* 长文本列：单行省略，hover 由 title 提示完整内容 */
.table .cell-ellipsis {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 操作列：按钮横向排列不换行 */
.table .cell-actions { white-space: nowrap; }
.table .cell-actions .btn + .btn { margin-left: 4px; }

/* 排序表头指示器：未排序时弱化，避免视觉噪音 */
.table thead th.sortable .sort-ind { opacity: 0.35; }
.table thead th.sortable:hover .sort-ind,
.table thead th.sortable.sorted .sort-ind { opacity: 1; }
.table thead th.sortable:focus-visible { outline: none; box-shadow: var(--ring-brand); }

/* 工具条内搜索框占主位 */
.surface-toolbar .search-input.grow { flex: 2 1 320px; max-width: 460px; }

/* 结果区加载态：局部刷新时给明确反馈，避免用户重复点击 */
#result-card.is-loading { position: relative; opacity: 0.55; pointer-events: none; }
#result-card.is-loading::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: kb-spin 0.7s linear infinite;
}
@keyframes kb-spin { to { transform: rotate(360deg); } }

/* 底部信息条：左统计、中分页、右每页条数 */
.models-footer { background: var(--surface-2); border-top: 1px solid var(--border-hairline); }
.models-footer .per-page-select { width: auto; min-width: 72px; }

@media (prefers-reduced-motion: reduce) {
    #result-card.is-loading::after { animation: none; }
}

/* ---------- 35. 侧边栏（白色主题，折叠态收窄为图标栏） ---------- */
.sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); }
.sidebar .nav-group { margin-bottom: 20px; }

/* 折叠态：仅桌面生效，收窄为图标栏 */
@media (min-width: 769px) {
    .sidebar.collapsed { width: 66px; padding: 16px 9px 32px; overflow-x: hidden; }
    .sidebar.collapsed .sidebar-head { padding: 4px 2px 14px; justify-content: center; border-bottom-color: var(--sidebar-border); }
    .sidebar.collapsed .sidebar-brand { display: none; }
    .sidebar.collapsed .nav-group { margin-bottom: 16px; }
    .sidebar.collapsed .group-title {
        font-size: 0;
        padding: 0 0 8px;
        margin: 6px 6px 4px;
        border-radius: 4px;
        background: none;
        border-left-width: 0;
        border-top: 1px solid var(--sidebar-border);
    }
    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding: 9px 0;
        gap: 0;
        min-height: 38px;
    }
    .sidebar.collapsed .nav-link .side-label,
    .sidebar.collapsed .nav-link .side-ai-tag { display: none; }
    .sidebar.collapsed .nav-link.active::before { left: 0; }
}

/* 目录分组折叠 / 展开：点击分组标题切换该组菜单显隐 */
.sidebar .group-title.group-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; }
.sidebar .group-title.group-toggle .group-caret { font-size: 0.6rem; color: var(--text-muted); transition: transform 0.18s ease; margin-left: 6px; }
.sidebar .nav-group.group-collapsed .group-title.group-toggle .group-caret { transform: rotate(-90deg); }
.sidebar .nav-group.group-collapsed > .nav-link { display: none; }
.sidebar.collapsed .group-title.group-toggle .group-caret { display: none; }

/* ---------- 36. 顶栏侧边栏折叠按钮 ---------- */
.sidebar-toggle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}
.sidebar-toggle:hover { background: var(--brand-100); color: var(--brand-700); }
.sidebar-toggle:focus-visible { outline: none; box-shadow: var(--ring-brand); }

/* ---------- 37. QA知识页面组件 ---------- */
.qa-shared-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    padding: 0 2px;
}
.qa-shared-toggle input { accent-color: var(--brand-600); cursor: pointer; }
.qa-shared-badge {
    display: inline-block;
    padding: 1px 9px;
    border-radius: var(--radius-pill);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 0.76rem;
    font-weight: 500;
}
.qa-reply-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.modal-combo-row { display: flex; gap: 8px; margin: 6px 0 12px; }
.modal-combo-row .combo { flex: 1; }

/* ---------- 37b. QA 知识页（列表 + 模态重构） ---------- */

.qa-sub-combo { min-width: 240px; }
.qa-sub-combo > .combo-trigger .combo-label { overflow: hidden; text-overflow: ellipsis; }

/* 表格列：问题 / 回复 强制单行截断，保证行高一致 */
.qa-col-q { width: 30%; }
.qa-col-r { width: 30%; }
.qa-col-op { width: 132px; }

/* 模态表单：分组区块，用留白与标题建立层级（modality「保持任务简单短小」） */
.qa-form { max-width: 560px; margin: 0 auto; }
.qa-section + .qa-section { margin-top: 22px; }
.qa-section-head {
    font-size: var(--fs-12);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}
.qa-section-head .qa-opt { color: var(--text-muted); font-weight: var(--fw-normal); }
.qa-hint {
    font-size: var(--fs-12);
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 8px 0 0;
}
.qa-req { color: var(--danger); margin-left: 2px; }

/* 模态内 combo：整宽、与输入框同高（44px 热区） */
.app-modal-backdrop .qa-sub-combo > .combo-trigger { width: 100%; height: 44px; }

/* 术语行内说明（小类共用 / 型号） */
.qa-term {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--surface-3);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--text-primary);
}

/* 型号绑定区：虚线选填框，与必填输入框形成视觉区分 */
.qa-optional-box { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.qa-optional-box .batch-box { margin-bottom: 0; }
.qa-selected {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 10px 0 0;
    padding: 6px 10px 6px 12px;
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-sm);
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: var(--fs-13);
}
.qa-selected .sel-tag-del { margin-left: 2px; }

/* 模态按钮组：热区 ≥ 44px，主按钮在右（macOS 惯例） */
.qa-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.qa-actions .btn { min-height: 40px; padding: 9px 22px; font-size: var(--fs-14); }

/* 导入步骤条：让「下载模板 → 上传 → 确认」的顺序可见（feedback） */
.qa-steps { display: flex; gap: 18px; margin: 0 0 18px; flex-wrap: wrap; }
.qa-step { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--text-secondary); }
.qa-step .qa-step-no {
    width: 22px; height: 22px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: var(--fs-12);
    font-weight: var(--fw-semibold);
}
.qa-step.is-done { color: var(--text-primary); }
.qa-step.is-done .qa-step-no { background: var(--brand-600); color: #fff; }

/* 下载模板：常驻入口，不做成孤立按钮 */
.qa-template {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    margin-bottom: 18px;
}
.qa-template .qa-template-text { font-size: var(--fs-13); color: var(--text-secondary); line-height: 1.5; min-width: 0; }
.qa-template .qa-template-text b { color: var(--text-primary); }

/* 文件选择：原生 file 控件宽度不齐，统一为整宽块 */
.app-modal-backdrop input[type=file] {
    display: block; width: 100%; box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: var(--fs-13);
    color: var(--text-secondary);
}
.app-modal-backdrop .file-name-hint { margin: 8px 0 0; }



