/* ========== 基础样式 ========== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    /* 侧边栏 */
    --sidebar-width: 170px;
    --sidebar-collapsed-width: 60px;
    --sidebar-bg: #212529;
    --sidebar-hover-bg: #2c3034;
    --sidebar-active-bg: #0d6efd;
    --sidebar-text: #adb5bd;
    --sidebar-text-active: #ffffff;
    --sidebar-border: #2c3034;
    --topbar-height: 50px;
    --sidebar-transition: 0.25s ease;
}

/* 暗色主题 */
[data-theme="dark"] {
    --light-color: #1a1a2e;
    --dark-color: #eaeaea;
    --card-bg: #16213e;
    --body-bg: #0f0f23;
    --text-color: #eaeaea;
    --border-color: #2a2a4a;
}

[data-theme="dark"] body {
    background-color: var(--body-bg);
    color: var(--text-color);
}

[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .table {
    color: var(--text-color);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* ========== 登录页面 ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

/* ========== 侧边栏布局 ========== */
/* 侧边栏（默认折叠仅图标，hover/expanded 展开） */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-collapsed-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--sidebar-transition);
    overflow: hidden;
}

.sidebar.expanded {
    width: var(--sidebar-width);
}

/* 侧边栏头部 - 品牌 */
.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-header a {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-header a i {
    font-size: 1.25rem;
    min-width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-brand-text {
    margin-left: 0;
    width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.sidebar.expanded .sidebar-brand-text {
    margin-left: 8px;
    width: auto;
    opacity: 1;
    pointer-events: auto;
}

/* 侧边栏菜单区域 */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

/* 侧边栏导航列表 */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-section-title {
    font-size: 0;
    text-transform: uppercase;
    color: #6c757d;
    padding: 10px 0 2px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
}

.sidebar-nav .nav-section-title::after {
    content: '···';
    font-size: 0.7rem;
    color: #6c757d;
}

.sidebar.expanded .nav-section-title {
    font-size: 0.7rem;
    text-align: left;
    padding: 12px 16px 4px;
}

.sidebar.expanded .nav-section-title::after {
    content: none;
}

.sidebar-nav .nav-item {
    position: relative;
}

/* 默认折叠态：图标居中 */
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    color: var(--sidebar-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 0.9rem;
    position: relative;
}

/* 展开态：图标+文字左对齐 */
.sidebar.expanded .nav-link {
    justify-content: flex-start;
    padding: 9px 16px;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

/* 折叠态 active：左侧蓝条指示 */
.sidebar-nav .nav-link.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: var(--sidebar-text-active);
    border-left: 3px solid var(--sidebar-active-bg);
}

/* 展开态 active：保持蓝色左边框 */
.sidebar.expanded .nav-link.active {
    border-left-color: var(--sidebar-active-bg);
}

.sidebar-nav .nav-link i {
    min-width: 28px;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-link .nav-text {
    margin-left: 0;
    width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.sidebar.expanded .nav-link .nav-text {
    margin-left: 8px;
    width: auto;
    opacity: 1;
    pointer-events: auto;
}

/* 折叠态纯CSS tooltip（hover图标时显示菜单名） */
.sidebar-nav .nav-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 6px;
    padding: 4px 10px;
    background-color: #333;
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1050;
}

.sidebar-nav .nav-link:hover::after {
    opacity: 1;
}

/* 展开时隐藏tooltip（文字已可见） */
.sidebar.expanded .nav-link::after {
    display: none;
}

/* 侧边栏底部 - 折叠按钮（hover模式下隐藏） */
.sidebar-footer {
    display: none;
}

/* 侧边栏遮罩（移动端） */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* 顶部栏（始终基于折叠宽度定位） */
.top-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-collapsed-width);
    height: var(--topbar-height);
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1030;
}

[data-theme="dark"] .top-header {
    background-color: #1a1a2e;
    border-bottom-color: #2a2a4a;
}

/* 返回按钮（桌面+移动端通用） */
#mobile-back-btn {
    font-size: 16px;
    color: #555;
    padding: 6px 10px;
    flex-shrink: 0;
    margin-right: 4px;
}
#mobile-back-btn:hover {
    color: #0d6efd;
}
[data-theme="dark"] #mobile-back-btn {
    color: #aaa;
}
[data-theme="dark"] #mobile-back-btn:hover {
    color: #5b9cff;
}

.top-header .btn-link {
    color: #6c757d;
    font-size: 1.1rem;
    padding: 4px 8px;
}

[data-theme="dark"] .top-header .btn-link {
    color: #adb5bd;
}

.top-header .btn-link:hover {
    color: #333;
}

[data-theme="dark"] .top-header .btn-link:hover {
    color: #fff;
}

#sidebar-mobile-toggle {
    display: none;
}

/* 主内容包裹器（始终基于折叠宽度） */
.main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
    min-height: 100vh;
}

/* ========== 主布局 ========== */
.main-content {
    padding-top: var(--topbar-height);
    min-height: 100vh;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* ========== 移动端元素（桌面端隐藏） ========== */
.mobile-bottom-nav {
    display: none;
}
#mobile-page-title {
    display: none;
}
/* 桌面端页面标题（顶部栏内，返回按钮右侧） */
.desktop-page-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 8px;
    display: flex;
    align-items: center;
}
[data-theme="dark"] .desktop-page-title {
    color: #adb5bd;
}
/* 桌面端：隐藏页面内的主标题h4（已移至顶部栏），保留操作按钮和子标题 */
@media (min-width: 768px) {
    .module-header .module-title {
        display: none;
    }
    /* module-header内操作按钮保留，但需要调整布局 */
    .module-header {
        min-height: 0;
        margin-bottom: 0 !important;
    }
    .module-header:empty {
        display: none;
    }
}
#mobile-header-action {
    display: none;
}
#mobile-header-action-2 {
    display: none;
}

/* ========== 侧边栏移动端适配 ========== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.mobile-open ~ .sidebar-backdrop {
        display: block;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .top-header {
        left: 0 !important;
    }

    #sidebar-mobile-toggle {
        display: block;
    }
}

/* ========== 移动端菜单页（桌面端隐藏） ========== */
.mobile-menu-page {
    display: none;
}

/* ========== 移动端布局（<768px）========== */
@media (max-width: 767.98px) {
    /* --- 防止水平滚动 --- */
    html, body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
    }

    /* --- 显示/隐藏控制 --- */
    #mobile-page-title {
        display: block;
    }
    .desktop-only {
        display: none !important;
    }
    /* 隐藏原有hamburger按钮（底部栏菜单替代） */
    #sidebar-mobile-toggle {
        display: none !important;
    }
    /* 侧边栏和遮罩层叠在底部导航栏之上 */
    .sidebar {
        z-index: 1060 !important;
    }
    .sidebar-backdrop {
        z-index: 1050 !important;
    }

    /* --- 顶部栏改造 --- */
    .top-header {
        height: 44px;
        padding: 0 12px;
        left: 0 !important;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        -webkit-justify-content: center;
        justify-content: center;
    }
    #mobile-back-btn {
        position: absolute;
        left: 4px;
        top: 50%;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
        z-index: 2;
        color: #333;
    }
    .mobile-page-title {
        font-size: 16px;
        font-weight: 600;
        color: #333;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60%;
    }
    [data-theme="dark"] .mobile-page-title {
        color: #eaeaea;
    }
    /* 顶部栏右侧操作按钮（JS控制d-none显隐） */
    #mobile-header-action {
        display: block;
        position: absolute;
        right: 8px;
        top: 50%;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
        z-index: 2;
        color: #333;
        font-size: 18px;
        padding: 4px 8px;
    }
    #mobile-header-action.d-none {
        display: none !important;
    }
    [data-theme="dark"] #mobile-header-action {
        color: #eaeaea;
    }

    /* --- 主内容区域适配 --- */
    .main-content {
        padding-top: 44px;
        padding-bottom: 56px;
    }
    /* 移动端：让 #page-content 成为固定高度的滚动容器，使 position:sticky 可靠工作 */
    #page-content {
        height: calc(100vh - 44px - 56px - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    /* 减少页面内边距 */
    .main-content > .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    /* card-header内搜索区域：强制一行，不溢出 */
    .card-header .d-flex.gap-2 {
        width: 100%;
        min-width: 0;
    }
    .card-header .input-group {
        min-width: 0;
    }

    /* --- 底部导航栏 --- */
    .mobile-bottom-nav {
        display: -webkit-flex;
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        height: 56px;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        z-index: 1040;
        padding-top: 4px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        padding-bottom: constant(safe-area-inset-bottom, 0px);
    }
    [data-theme="dark"] .mobile-bottom-nav {
        background: #1a1a2e;
        border-top-color: #2a2a4a;
    }
    .mobile-bottom-nav-item {
        -webkit-flex: 1;
        flex: 1;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-direction: column;
        flex-direction: column;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: center;
        justify-content: center;
        text-decoration: none;
        color: #999;
        font-size: 10px;
        padding: 4px 0;
        -webkit-transition: color 0.2s;
        transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 2px;
    }
    .mobile-bottom-nav-item.active {
        color: var(--primary-color);
    }
    .mobile-bottom-nav-item:hover {
        text-decoration: none;
    }
    /* 底部导航栏通知红点徽章 */
    .mobile-nav-badge {
        position: absolute;
        top: -2px;
        right: -10px;
        font-size: 9px;
        font-weight: bold;
        line-height: 1;
        padding: 2px 5px;
        border-radius: 10px;
        background: #dc3545;
        color: #fff;
        white-space: nowrap;
        -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2);
        box-shadow: 0 1px 3px rgba(0,0,0,.2);
        pointer-events: none;
    }
    [data-theme="dark"] .mobile-bottom-nav-item {
        color: #666;
    }
    [data-theme="dark"] .mobile-bottom-nav-item.active {
        color: #5b9cff;
    }

    /* 底部安全区 padding */
    .main-content {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    /* Toast提示上移，避免被底部导航栏遮挡 */
    .toast-container {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ICP footer 被底部栏遮挡，隐藏 */
    .icp-footer {
        display: none;
    }

    /* 移动端隐藏 Slogan，避免占用垂直空间导致 TAB 被挤出视口 */
    .platform-slogan {
        display: none !important;
    }

    /* 仓库页面容器高度修正（减去底部导航栏） */
    #page-content > .d-flex.flex-column[style*="100vh"] {
        height: calc(100vh - 44px - 56px) !important;
    }

    /* --- 移动端菜单页（复用顶部栏，底部导航可见） --- */
    .mobile-menu-page {
        display: none;
        position: fixed;
        top: 44px;
        left: 0;
        right: 0;
        bottom: 56px;
        background: #f5f7fa;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1035;
    }
    .mobile-menu-page.open {
        display: block;
    }
    [data-theme="dark"] .mobile-menu-page {
        background: #0f0f1a;
    }

    /* 菜单页内容区 */
    .mobile-menu-body {
        padding: 16px 14px 24px;
    }

    /* 分类卡片 */
    .mobile-menu-category {
        background: #fff;
        border-radius: 14px;
        margin-bottom: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        overflow: hidden;
    }
    [data-theme="dark"] .mobile-menu-category {
        background: #1a1a2e;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    /* 分类头部（带彩色左侧边条） */
    .mobile-menu-cat-header {
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        padding: 12px 14px 8px;
        gap: 8px;
    }
    .mobile-menu-cat-bar {
        width: 4px;
        height: 18px;
        border-radius: 2px;
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
    }
    .mobile-menu-cat-bar.cat-core    { background: #4a6cf7; }
    .mobile-menu-cat-bar.cat-office  { background: #10b981; }
    .mobile-menu-cat-bar.cat-ops     { background: #f59e0b; }
    .mobile-menu-cat-bar.cat-system  { background: #6b7280; }

    .mobile-menu-cat-label {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }
    [data-theme="dark"] .mobile-menu-cat-label {
        color: #e5e7eb;
    }

    /* 功能项网格（4列） */
    .mobile-menu-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        -webkit-gap: 4px;
        gap: 4px;
        padding: 8px 10px 14px;
    }
    /* iOS12 fallback: grid 不支持时降级为 flex */
    @supports not (display: grid) {
        .mobile-menu-grid {
            display: -webkit-flex;
            display: flex;
            -webkit-flex-wrap: wrap;
            flex-wrap: wrap;
        }
        .mobile-menu-grid-item {
            width: 25%;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
        }
    }

    /* 功能项 */
    .mobile-menu-grid-item {
        display: -webkit-flex;
        display: flex;
        -webkit-flex-direction: column;
        flex-direction: column;
        -webkit-align-items: center;
        align-items: center;
        padding: 10px 4px 8px;
        border-radius: 12px;
        text-decoration: none;
        color: #374151;
        -webkit-tap-highlight-color: transparent;
        -webkit-transition: background 0.15s;
        transition: background 0.15s;
        cursor: pointer;
    }
    .mobile-menu-grid-item:active {
        background: #f0f4ff;
    }
    [data-theme="dark"] .mobile-menu-grid-item {
        color: #d1d5db;
    }
    [data-theme="dark"] .mobile-menu-grid-item:active {
        background: rgba(74,108,247,0.15);
    }

    /* 圆角图标容器 */
    .mobile-menu-icon-wrap {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: center;
        justify-content: center;
        margin-bottom: 6px;
        font-size: 18px;
        color: #fff;
    }
    /* 四类主题色 */
    .mobile-menu-icon-wrap.cat-core {
        background: linear-gradient(135deg, #4a6cf7 0%, #6366f1 100%);
    }
    .mobile-menu-icon-wrap.cat-office {
        background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    }
    .mobile-menu-icon-wrap.cat-ops {
        background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    }
    .mobile-menu-icon-wrap.cat-system {
        background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    }

    .mobile-menu-grid-label {
        font-size: 11px;
        color: #4b5563;
        text-align: center;
        line-height: 1.3;
        word-break: keep-all;
    }
    [data-theme="dark"] .mobile-menu-grid-label {
        color: #9ca3af;
    }

    /* ===== P0: 增大触控目标区域（Apple HIG 44px / Material 48dp） ===== */
    .dropdown-menu .dropdown-item {
        padding-top: 8px;
        padding-bottom: 8px;
        min-height: 44px;
    }
    .dropdown-menu .form-check-input {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }
    .form-check {
        min-height: 32px;
        padding-left: 1.8em;
    }
    .form-check-input {
        width: 1.2em;
        height: 1.2em;
    }
    .form-select, .form-control {
        min-height: 38px;
    }

    /* ===== P2b: 卡片/列表触控反馈 ===== */
    .list-group-item-action:active,
    .card.customer-card:active,
    .mobile-menu-grid-item:active {
        background-color: rgba(13, 110, 253, 0.05) !important;
        transform: scale(0.985);
        transition: transform 0.08s ease, background-color 0.08s ease;
    }

    /* ===== P3b: 搜索框宽度自适应 ===== */
    .card-header .input-group {
        max-width: none !important;
    }
    .card-header .d-flex.gap-2 input:not(.input-group .form-control),
    .card-header .d-flex.gap-2 select:not(.input-group select) {
        width: 100% !important;
        min-width: 0;
    }
}

/* ========== 卡片样式 ========== */

/* ===== P2a: 骨架屏加载动画 ===== */
@keyframes skeleton-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a4a 25%, #1a1a2e 50%, #2a2a4a 75%);
    background-size: 200% 100%;
}
.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}
.skeleton-line:last-child {
    width: 60%;
}
.skeleton-title {
    height: 18px;
    width: 45%;
    margin-bottom: 14px;
}
.skeleton-badge {
    height: 12px;
    width: 60px;
    display: inline-block;
}

.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header .card-title {
    margin-bottom: 0;
    font-size: 1rem;
}

/* ========== 模块标题背景色 ========== */
.card-header-order-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-bottom: 2px solid #ffc107;
}

.card-header-overdue-debt {
    background: linear-gradient(135deg, #ffe5e5 0%, #ffd6d6 100%);
    border-bottom: 2px solid #e57373;
}

.card-header-followed {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-bottom: 2px solid #ffc107;
}

.card-header-safe {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-bottom: 2px solid #4caf50;
}

.card-header-loss-risk {
    background: linear-gradient(135deg, #cff4fc 0%, #9eeaf9 100%);
    border-bottom: 2px solid #0dcaf0;
}

.card-header-new-customer {
    background: linear-gradient(135deg, #d1e7dd 0%, #a3cfbb 100%);
    border-bottom: 2px solid #198754;
}

.card-header-product-replace {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-bottom: 2px solid #fd7e14;
}

.card-header-product-recommend {
    background: linear-gradient(135deg, #d1e7dd 0%, #badbcc 100%);
    border-bottom: 2px solid #20c997;
}

.card-header-bestseller {
    background: linear-gradient(135deg, #cff4fc 0%, #9eeaf9 100%);
    border-bottom: 2px solid #0dcaf0;
}

.card-header-monthly-new {
    background: linear-gradient(135deg, #e2d9f3 0%, #c5b3e6 100%);
    border-bottom: 2px solid #6f42c1;
}

.card-header-products {
    background: linear-gradient(135deg, #cfe2ff 0%, #9ec5fe 100%);
    border-bottom: 2px solid #0d6efd;
}

.card-header-customer-info {
    background: linear-gradient(135deg, #e2e3e5 0%, #c6c8ca 100%);
    border-bottom: 2px solid #6c757d;
}

.card-header-rd-bestseller {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-bottom: 2px solid #ff9800;
    font-weight: 600;
}

.card-header-rd-peer {
    background: linear-gradient(135deg, #cff4fc 0%, #9eeaf9 100%);
    border-bottom: 2px solid #0dcaf0;
    font-weight: 600;
}

.card-header-rd-market {
    background: linear-gradient(135deg, #d1e7dd 0%, #a3cfbb 100%);
    border-bottom: 2px solid #198754;
    font-weight: 600;
}

/* 暗色主题适配 */
[data-theme="dark"] .card-header-order-warning {
    background: linear-gradient(135deg, #4a4528 0%, #3d3a1f 100%);
    border-bottom-color: #ffc107;
}

[data-theme="dark"] .card-header-overdue-debt {
    background: linear-gradient(135deg, #4a2828 0%, #3d1f1f 100%);
    border-bottom-color: #e57373;
}

[data-theme="dark"] .card-header-followed {
    background: linear-gradient(135deg, #4a4528 0%, #3d3a1f 100%);
    border-bottom-color: #ffc107;
}

[data-theme="dark"] .card-header-safe {
    background: linear-gradient(135deg, #1a3a28 0%, #153020 100%);
    border-bottom-color: #4caf50;
}

[data-theme="dark"] .card-header-loss-risk {
    background: linear-gradient(135deg, #1a3a40 0%, #153035 100%);
    border-bottom-color: #0dcaf0;
}

[data-theme="dark"] .card-header-new-customer {
    background: linear-gradient(135deg, #1a3a28 0%, #153020 100%);
    border-bottom-color: #198754;
}

[data-theme="dark"] .card-header-product-replace {
    background: linear-gradient(135deg, #4a3a28 0%, #3d3020 100%);
    border-bottom-color: #fd7e14;
}

[data-theme="dark"] .card-header-product-recommend {
    background: linear-gradient(135deg, #1a3a30 0%, #153028 100%);
    border-bottom-color: #20c997;
}

[data-theme="dark"] .card-header-bestseller {
    background: linear-gradient(135deg, #1a3a40 0%, #153035 100%);
    border-bottom-color: #0dcaf0;
}

[data-theme="dark"] .card-header-monthly-new {
    background: linear-gradient(135deg, #2a2840 0%, #252238 100%);
    border-bottom-color: #6f42c1;
}

[data-theme="dark"] .card-header-products {
    background: linear-gradient(135deg, #1a2a40 0%, #152538 100%);
    border-bottom-color: #0d6efd;
}

[data-theme="dark"] .card-header-customer-info {
    background: linear-gradient(135deg, #2a2a30 0%, #252528 100%);
    border-bottom-color: #6c757d;
}

[data-theme="dark"] .card-header-rd-bestseller {
    background: linear-gradient(135deg, #4a3a20 0%, #3d3018 100%);
    border-bottom-color: #ff9800;
}

[data-theme="dark"] .card-header-rd-peer {
    background: linear-gradient(135deg, #1a3a40 0%, #153035 100%);
    border-bottom-color: #0dcaf0;
}

[data-theme="dark"] .card-header-rd-market {
    background: linear-gradient(135deg, #1a3a28 0%, #153020 100%);
    border-bottom-color: #198754;
}

.card-body {
    padding: 1.25rem;
}

/* ========== 统计卡片 ========== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.15;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* ========== 数据表格 ========== */
/* 表头吸顶：滚动时列名始终可见 */
.table-responsive {
    border-radius: 0.5rem;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

/* 用户管理：全量不分页展示，页面含筛选卡+计数行，需更大的高度预留；
   数据少于一屏时全部可见，多于一屏时容器内滚动+表头吸顶 */
.table-responsive.user-table-scroll {
    max-height: calc(100vh - 380px);
    min-height: 240px;
}

/* 用户管理：保存/删除后高亮刚操作的那一行（或移动端卡片），便于定位（黄底深色字，符合配色规范） */
tr.user-row-flash > td,
.user-card.user-row-flash {
    background-color: #fff3cd !important;
    transition: background-color .35s ease;
}

/* 角色管理：全量不分页展示 + 顶部筛选行，高度预留对齐用户管理 */
.table-responsive.role-table-scroll {
    max-height: calc(100vh - 380px);
    min-height: 240px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

[data-theme="dark"] .table thead th {
    background-color: #1a1a2e;
    border-bottom-color: #2a2a4a;
}

[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light th,
[data-theme="dark"] .table-light td {
    background-color: #1a1a2e !important;
    color: var(--text-color) !important;
}

/* 消息 Toast 容器：必须显式给定高于吸顶表头(z-index:2)的层级。
   原因：.toast-container 是 position:fixed 但无 z-index（auto），在根层叠上下文中
   属于「定位且 z-index 为 auto」组；而表格 thead 的 position:sticky;z-index:2 属于
   「正 z-index」组、绘制更靠后，会把右下角的消息弹窗盖住（同行调货-录入采购入库等
   多表格列表页复现）。给定 1090 与 Bootstrap .toast 同级，确保弹窗始终在表格表头之上。 */
.toast-container {
    z-index: 1090;
}

[data-theme="dark"] .table-bordered {
    border-color: #2a2a4a;
}

[data-theme="dark"] .table-bordered th,
[data-theme="dark"] .table-bordered td {
    border-color: #2a2a4a;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.08);
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ========== 徽章样式 ========== */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-followed {
    background-color: var(--success-color);
}

.badge-unfollowed {
    background-color: var(--warning-color);
    color: #000;
}

/* ========== 进度条 ========== */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 0.25rem;
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
    border-radius: 2rem;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* ========== 客户列表卡片 ========== */
.customer-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.customer-card .customer-name {
    font-weight: 600;
    color: #333;
}

.customer-card .customer-score {
    font-size: 1.25rem;
    font-weight: 700;
}

.customer-card .trend-up {
    color: var(--success-color);
}

.customer-card .trend-down {
    color: var(--danger-color);
}

/* ========== 迷你图表 ========== */
.mini-chart {
    height: 60px;
}

/* ========== 加载遮罩 ========== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

[data-theme="dark"] #loading-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========== 模块标题 ========== */
.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.module-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* ========== 快捷操作按钮 ========== */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    margin: -0.25rem; /* iOS 12 兼容：用margin替代gap */
}
.quick-actions > * {
    margin: 0.25rem; /* iOS 12 兼容：用margin替代gap */
}

.quick-actions .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* ========== 驾驶舱8列布局（Bootstrap原生只支持到row-cols-6） ========== */
@media (min-width: 992px) {
    .row.row-cols-lg-8 > * {
        flex: 0 0 auto;
        width: 12.5%;
    }
}

/* ========== 响应式调整 ========== */
@media (max-width: 767.98px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-icon {
        font-size: 2rem;
    }

    /* 详情页头部移动端优化 */
    .detail-header {
        padding: 1.25rem;
    }
    .detail-header .detail-title {
        font-size: 1.15rem;
    }
    .detail-header .row > .col-md-8 {
        margin-bottom: 0.5rem;
    }
    .detail-header .btn-warning {
        width: 100%;
        font-size: 0.9rem;
    }
    /* 客户工作台头部：按钮行占满宽度、图表缩小 */
    .hc-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .hc-header-actions .btn {
        flex: 1;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .module-header {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }
    .module-header > * {
        margin-bottom: 0.5rem;
    }
    .module-header > *:last-child {
        margin-bottom: 0;
    }
    
    .module-header .module-title {
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
    }
    
    .module-header .btn {
        flex: 1 1 calc(50% - 4px);
        max-width: calc(50% - 4px);
        font-size: 0.8rem;
    }
    
    .login-box {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    /* 产品洞察页搜索框移动端适配（不影响 input-group 内的搜索按钮） */
    .card-header .d-flex.gap-2 {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .card-header .d-flex.gap-2 input:not(.input-group .form-control),
    .card-header .d-flex.gap-2 select:not(.input-group select) {
        width: 100% !important;
        min-width: 0;
    }
    
    .card-header .d-flex.gap-2 > button,
    .card-header .d-flex.gap-2 > label {
        width: 100%;
    }

    /* input-group 内的搜索按钮保持紧凑尺寸 */
    .card-header .input-group {
        flex-wrap: nowrap;
        flex: 1;
        min-width: 0;
        max-width: 280px !important;
    }
    
    /* 模块标题保持一行显示 */
    .card-header.d-flex {
        flex-wrap: nowrap;
        font-size: 0.85rem;
    }
    
    .card-header .badge {
        flex-shrink: 0;
        font-size: 0.7rem;
        padding: 0.2em 0.5em;
        white-space: nowrap;
    }
    
    .card-header > span:first-child {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 产品洞察页搜索框card-header换行 */
    .card-header.flex-wrap {
        flex-wrap: wrap !important;
    }
}

@media (max-width: 575.98px) {
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .quick-actions {
        width: 100%;
    }
    
    .quick-actions .btn {
        flex: 1;
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1a2e;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a3a5a;
}

/* ========== 切换按钮组 ========== */
.view-toggle .btn {
    padding: 0.375rem 1rem;
}

.view-toggle .btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* ========== 详情页面 ========== */
.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-header .back-btn {
    color: white;
    opacity: 0.8;
}

.detail-header .back-btn:hover {
    opacity: 1;
}

.detail-header .detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-header .detail-score {
    font-size: 2.5rem;
    font-weight: 700;
}

/* ========== 迷你趋势图 ========== */
.mini-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
}

.mini-chart-container canvas {
    display: block;
}

.mini-chart-label {
    font-size: 0.75rem;
    margin-top: 2px;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .detail-header .detail-score {
        font-size: 1.8rem;
    }
    /* 移动端综合评分与柱状图间距 */
    .detail-header .text-md-end {
        margin-right: 1rem;
    }
    .mini-chart-container {
        min-width: 120px;
        margin-right: 0.75rem;
    }
    .mini-chart-container canvas {
        width: 120px !important;
        height: 60px !important;
    }
}

/* ========== 标签页 ========== */
.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background-color: transparent;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

/* ========== 分页 ========== */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
}

/* ========== iOS 12 兼容性修复 ========== */
/* Safari 12 知道 gap(grid) 但不支持 flex gap，@supports 检测不可靠 */
/* 由 ios12-compat.js 在 <html> 上添加 .no-flex-gap 类来激活 */
.no-flex-gap .d-flex.gap-1 > *,
.no-flex-gap .d-flex.flex-wrap.gap-1 > * {
    margin: 0.125rem;
}
.no-flex-gap .d-flex.gap-2 > *,
.no-flex-gap .d-flex.flex-wrap.gap-2 > * {
    margin: 0.25rem;
}
.no-flex-gap .d-flex.gap-3 > *,
.no-flex-gap .d-flex.flex-wrap.gap-3 > * {
    margin: 0.5rem;
}
.no-flex-gap .d-flex.gap-4 > *,
.no-flex-gap .d-flex.flex-wrap.gap-4 > * {
    margin: 0.75rem;
}
.no-flex-gap .d-flex.gap-1,
.no-flex-gap .d-flex.gap-2,
.no-flex-gap .d-flex.gap-3,
.no-flex-gap .d-flex.gap-4 {
    gap: 0 !important;
}
.no-flex-gap .g-2 > * {
    padding: 0.25rem;
}
.no-flex-gap .g-3 > * {
    padding: 0.5rem;
}
/* #modules-row flex gap fallback */
.no-flex-gap #modules-row {
    gap: 0 !important;
}
.no-flex-gap #modules-row > * {
    margin: 8px;
}

/* ========== 区域地图（GIS / Leaflet） ========== */
#modules-row.gis-modules {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.gis-map-card {
    flex: 1 1 auto;
    min-width: 0;
}

.gis-map-card .card-body {
    position: relative;
    overflow: hidden;
}

.gis-sidebar {
    flex: 0 0 190px;
    width: 190px;
    position: sticky;
    top: 70px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gis-sideblock {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}

[data-theme="dark"] .gis-sideblock {
    background: #1f2733;
    border-color: #374151;
}

.gis-side-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    white-space: nowrap;
}

[data-theme="dark"] .gis-side-title {
    color: #94a3b8;
}

.gis-dim-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gis-dim-list .dimension-btn {
    text-align: left;
    font-size: 12.5px;
    padding: 5px 8px;
}

.gis-sideblock .gis-side-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 12.5px;
    margin-bottom: 6px;
}

.gis-sideblock .gis-side-btn:last-of-type {
    margin-bottom: 0;
}

#gis-base-switch {
    width: 100%;
}

#gis-base-switch .btn {
    font-size: 12.5px;
    text-align: left;
}

.gis-fullscreen-btn {
    white-space: nowrap;
}

body.gis-fullscreen-open {
    overflow: hidden;
}

.gis-page.gis-fullscreen .gis-map-card {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.gis-page.gis-fullscreen .gis-map-card .card-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}

.gis-page.gis-fullscreen .gis-map {
    height: 100% !important;
}

.gis-page.gis-fullscreen .gis-sidebar,
.gis-page.gis-fullscreen .gis-ranking-card {
    visibility: hidden;
}

.gis-ranking-card {
    flex: 0 0 320px;
    width: 320px;
    position: sticky;
    top: 70px;
}

.gis-map {
    width: 100%;
    height: 620px;
    background: #e9eef5;
    z-index: 0;
}

#ranking-container {
    overflow-y: auto;
}

.gis-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    font-size: 13px;
}

/* Leaflet 基础适配（控件/署名/暗色底图） */
.gis-map .leaflet-container {
    font-family: inherit;
    background: #e9eef5;
}

.gis-map .leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.78);
}

.gis-map .leaflet-bar a {
    color: #334155;
}

[data-theme="dark"] .gis-map {
    background: #1b2430;
}

[data-theme="dark"] .gis-map .leaflet-tile-pane {
    filter: brightness(0.72) saturate(0.85);
}

[data-theme="dark"] .gis-map .leaflet-control-attribution {
    background: rgba(20, 26, 34, 0.78);
    color: #c7d0dc;
}

[data-theme="dark"] .gis-map .leaflet-bar a {
    background: #232c38;
    color: #e2e8f0;
    border-color: #3a4553;
}

[data-theme="dark"] .gis-map .leaflet-bar a:hover {
    background: #2e3a49;
}

/* 行政区名称/数值标签 */
/* 近视野显示业务区域气泡时，区县名让位，避免重复叠字 */
.gis-pills-visible .gis-district-label {
    display: none;
}

.gis-district-label {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.gis-district-label::before {
    display: none;
}

.gis-dlabel {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

.gis-dlabel-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 3px rgba(0, 0, 0, 0.5);
}

.gis-dlabel-value {
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.gis-dlabel-empty,
.gis-dlabel-muted {
    font-size: 11px;
    font-weight: 600;
    color: #f8fafc;
    background: rgba(51, 65, 85, 0.72);
    padding: 1px 5px;
    border-radius: 4px;
    text-shadow: none;
}

/* 无数据区县在浅色底图上用深灰色胶囊，避免白字看不清 */
.gis-dlabel-muted {
    color: #f8fafc;
    background: rgba(51, 65, 85, 0.72);
}

/* 业务区域标注（气泡 + 锚点圆点） */
.gis-region-icon {
    width: 0 !important;
    height: 0 !important;
    background: transparent;
    border: none;
}

.gis-region-pill {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, calc(-100% - var(--gis-lift, 12px)));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-left: 4px solid #157347;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
    white-space: nowrap;
    cursor: pointer;
    transition: box-shadow 0.12s ease;
}

.gis-region-pill::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(255, 255, 255, 0.96);
}

/* 远视野（全区域视图）：单行紧凑标签，尽量放下所有区域名称+数值 */
.gis-far-labels .gis-region-pill {
    flex-direction: row;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border-left-width: 3px;
    border-radius: 5px;
}

.gis-far-labels .gis-region-name {
    font-size: 9px !important;
    line-height: 1.15;
}

.gis-far-labels .gis-region-value {
    font-size: 10px !important;
    line-height: 1.15;
}

.gis-far-labels .gis-region-pill::after {
    bottom: -5px;
    border-left-width: 5px;
    border-right-width: 5px;
    border-top-width: 5px;
}

.gis-region-icon:hover .gis-region-pill {
    transform: translate(-50%, calc(-100% - var(--gis-lift, 12px))) scale(1.03);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.3);
}

.gis-region-name {
    font-weight: 700;
    color: #1f2937;
    line-height: 1.15;
}

.gis-region-value {
    font-weight: 800;
    line-height: 1.15;
}

.gis-labels-hidden .gis-region-pill,
.gis-labels-hidden .gis-region-stem,
.gis-hide-empty-labels .gis-region-icon.is-empty .gis-region-pill,
.gis-hide-empty-labels .gis-region-icon.is-empty .gis-region-stem {
    display: none;
}

.gis-hide-empty-labels .gis-region-icon.is-empty .gis-region-dot {
    width: 9px;
    height: 9px;
    opacity: 0.9;
}

.gis-labels-hidden .gis-region-dot {
    width: 14px;
    height: 14px;
}

.gis-region-stem {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    background: rgba(15, 23, 42, 0.32);
    transform: translate(-50%, -100%);
    border-radius: 1px;
    display: none;
}

.gis-region-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.3);
    transform: translate(-50%, -50%);
}

[data-theme="dark"] .gis-region-pill {
    background: rgba(28, 36, 46, 0.96);
    border-color: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .gis-region-pill::after {
    border-top-color: rgba(28, 36, 46, 0.96);
}

[data-theme="dark"] .gis-region-name {
    color: #e8eef6;
}

/* 行政区点击弹窗 */
.gis-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

.gis-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
    min-width: 220px;
}

.gis-popup-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-weight: 700;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.gis-popup-rate {
    font-size: 16px;
    font-weight: 800;
}

.gis-popup-meta {
    padding: 8px 14px;
    font-size: 12px;
    color: #6b7280;
    border-bottom: 1px solid #eef2f7;
}

.gis-popup-empty {
    padding: 14px;
    font-size: 13px;
    color: #6b7280;
}

.gis-popup-list {
    max-height: 220px;
    overflow: auto;
}

.gis-popup-region {
    display: flex;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    padding: 9px 14px;
    background: #ffffff;
    font-size: 13px;
    text-align: left;
}

.gis-popup-region:hover {
    background: #f0f7ff;
}

.gis-popup-region-value {
    color: #0d6efd;
    font-weight: 700;
    white-space: nowrap;
}

[data-theme="dark"] .gis-popup .leaflet-popup-content-wrapper {
    background: #1f2733;
    color: #e5eaf2;
}

[data-theme="dark"] .gis-popup-title {
    background: #26303d;
    border-color: #374151;
}

[data-theme="dark"] .gis-popup-meta {
    border-color: #374151;
    color: #9aa7b8;
}

[data-theme="dark"] .gis-popup-region {
    background: #1f2733;
    border-color: #2f3a48;
    color: #e5eaf2;
}

[data-theme="dark"] .gis-popup-region:hover {
    background: #2a3544;
}

/* 区域标注悬浮提示 */
.gis-region-tip {
    background: #0f172a;
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
    border-radius: 8px;
    font-size: 12px;
    padding: 8px 10px;
}

.gis-region-tip.leaflet-tooltip-top::before {
    border-top-color: #0f172a;
}

.gis-tip-title {
    font-weight: 800;
    margin-bottom: 4px;
    font-size: 13px;
}

.gis-tip-line {
    line-height: 1.5;
}

.gis-tip-hint {
    margin-top: 5px;
    color: #93c5fd;
    font-size: 11px;
}

/* 图例 */
.gis-legend {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 8px;
    padding: 7px 10px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    font-size: 11px;
    line-height: 1.5;
}

.gis-legend-hint {
    margin-top: 3px;
    font-size: 10px;
    color: #64748b;
}

[data-theme="dark"] .gis-legend-hint {
    color: #94a3b8;
}

.gis-legend-title {
    font-weight: 700;
    margin-bottom: 3px;
    color: #334155;
}

.gis-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 230px;
}

.gis-legend-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: #475569;
}

.gis-legend-item i {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    margin-right: 4px;
}

[data-theme="dark"] .gis-legend {
    background: rgba(25, 32, 42, 0.92);
    color: #c9d3e0;
}

[data-theme="dark"] .gis-legend-title {
    color: #e2e8f0;
}

[data-theme="dark"] .gis-legend-item {
    color: #b8c4d4;
}

/* 地图顶部提示条 */
.gis-notice {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    z-index: 900;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffe69c;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    max-width: 92%;
}

/* 区域排行 */
.gis-rank-list {
    margin-bottom: 0;
}

.gis-rank-item {
    cursor: pointer;
    padding: 9px 12px;
}

.gis-rank-item:hover {
    background: #f5f9ff;
}

.gis-rank-name {
    font-weight: 600;
}

.gis-rank-bar {
    height: 4px;
    border-radius: 2px;
    background: #eef2f7;
    margin-top: 6px;
    overflow: hidden;
}

.gis-rank-bar span {
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: width 0.35s ease;
}

[data-theme="dark"] .gis-rank-item:hover {
    background: #242f3d;
}

[data-theme="dark"] .gis-rank-bar {
    background: #2b3644;
}

/* 地图设置表格 */
.gis-settings-table td {
    padding: 0.35rem 0.4rem;
}

.gis-settings-table input,
.gis-settings-table select {
    min-width: 96px;
}

/* 平板/移动端 */
@media (max-width: 1199.98px) {
    #modules-row.gis-modules {
        flex-wrap: wrap;
    }

    .gis-sidebar {
        flex: 1 1 100%;
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .gis-sideblock {
        flex: 1 1 240px;
    }

    .gis-dim-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .gis-dim-list .dimension-btn {
        flex: 0 0 auto;
    }

    .gis-sideblock .gis-side-btn {
        display: inline-block;
        width: auto;
        margin-right: 6px;
        margin-bottom: 6px;
    }

    .gis-map-card {
        flex: 1 1 520px;
    }

    .gis-ranking-card {
        flex: 0 0 280px;
        width: 280px;
    }
}

@media (max-width: 991.98px) {
    #modules-row.gis-modules {
        flex-wrap: wrap;
    }

    .gis-ranking-card {
        flex: 1 1 100%;
        width: 100%;
        position: static;
    }

    #ranking-container {
        max-height: 320px !important;
    }
}

@media (max-width: 767.98px) {
    #modules-row.gis-modules {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .gis-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .gis-sideblock {
        flex: 1 1 100%;
        padding: 8px;
    }

    .gis-dim-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .gis-dim-list .dimension-btn {
        flex: 1 1 46%;
        text-align: center;
        font-size: 0.72rem;
        padding: 4px 6px;
    }

    .gis-sideblock .gis-side-btn {
        display: inline-block;
        width: auto;
        margin-right: 6px;
        margin-bottom: 6px;
    }

    .gis-map-card,
    .gis-ranking-card {
        width: 100% !important;
        flex: none !important;
    }

    .gis-map {
        height: 420px;
    }

    #ranking-container {
        max-height: none !important;
    }

    .gis-region-pill {
        padding: 2px 7px;
    }

    .gis-dlabel-name {
        font-size: 10px;
    }

    .gis-legend {
        font-size: 10px;
        padding: 5px 8px;
    }

    .gis-legend-items {
        max-width: 170px;
    }

    .gis-popup .leaflet-popup-content {
        min-width: 190px;
    }

    .dimension-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}


/* 手机端经手人业绩看板：一行两张，压缩字号避免溢出 */
@media (max-width: 575.98px) {
    .handler-dashboard-section .card-body {
        padding: 0.65rem 0.35rem;
    }

    .handler-dashboard-section .card-body .fs-4 {
        font-size: 1.05rem;
    }

    .handler-dashboard-section .card-body h6 {
        font-size: 0.78rem;
        margin-bottom: 0.25rem;
    }

    .handler-dashboard-section .card-body .badge {
        font-size: 0.65rem;
    }

    .handler-dashboard-section .card-body i.fa-2x {
        font-size: 1.4em;
    }
}

/* ========== 日程管理日历 ========== */
.schedule-calendar {
    table-layout: fixed;
}

.schedule-calendar th {
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--light-color);
}

.calendar-cell {
    height: 100px;
    vertical-align: top;
    padding: 4px 6px !important;
    position: relative;
}

.calendar-empty {
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .calendar-empty {
    background: rgba(255,255,255,0.02);
}

.calendar-today {
    background: rgba(13, 110, 253, 0.06) !important;
}

[data-theme="dark"] .calendar-today {
    background: rgba(13, 110, 253, 0.15) !important;
}

.calendar-weekend {
    background: rgba(0,0,0,0.015);
}

[data-theme="dark"] .calendar-weekend {
    background: rgba(255,255,255,0.015);
}

.calendar-day-num {
    font-weight: 600;
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.calendar-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.calendar-item {
    font-size: 0.65rem !important;
    padding: 1px 4px !important;
    line-height: 1.4;
    cursor: default;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-clickable {
    cursor: pointer;
    transition: background-color 0.15s;
}
.calendar-clickable:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}
.calendar-selected {
    background-color: rgba(13, 110, 253, 0.12) !important;
    border-color: #0d6efd !important;
}

.cal-nav-bar {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .calendar-cell {
        height: auto;
        min-height: 56px;
        padding: 3px 4px !important;
    }
    .calendar-item {
        font-size: 0.7rem !important;
    }
    .schedule-calendar th {
        font-size: 0.75rem;
    }
    .cal-nav-bar {
        margin-top: 4px;
    }
    .cal-nav-bar .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    .cal-nav-bar .fw-bold {
        font-size: 0.9rem;
        min-width: 80px !important;
    }
}

/* ========== 公司资料 - 文档阅读器样式 ========== */
.doc-reader-content {
    font-size: 15px;
    line-height: 1.85;
    color: #2c3e50;
    max-width: 900px;
    margin: 0 auto;
}

.doc-reader-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 1.8em 0 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid #e9ecef;
}

.doc-reader-content h1:first-child {
    margin-top: 0;
}

.doc-reader-content h1.doc-title {
    font-size: 2rem;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

.doc-reader-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 1.5em 0 0.6em;
    padding-left: 0.6em;
    border-left: 4px solid var(--primary-color);
}

.doc-reader-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #34495e;
    margin: 1.3em 0 0.5em;
}

.doc-reader-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #495057;
    margin: 1.1em 0 0.4em;
}

.doc-reader-content h2.doc-subtitle {
    text-align: center;
    color: #6c757d;
    border-left: none;
    padding-left: 0;
    font-weight: 400;
}

.doc-reader-content p {
    margin-bottom: 0.8em;
    text-align: justify;
}

.doc-reader-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2em auto;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.doc-reader-content .doc-figure {
    text-align: center;
    margin: 1.5em 0;
}

.doc-reader-content .doc-figure img {
    margin-bottom: 0.4em;
}

.doc-reader-content .doc-figure figcaption {
    font-size: 0.85em;
    color: #999;
}

.doc-reader-content table {
    margin: 1em 0;
    font-size: 0.9em;
}

.doc-reader-content table th {
    background-color: #f1f3f5 !important;
    font-weight: 600;
    white-space: nowrap;
}

.doc-reader-content ul, .doc-reader-content ol {
    padding-left: 1.5em;
    margin-bottom: 0.8em;
}

.doc-reader-content li {
    margin-bottom: 0.3em;
}

.doc-reader-content blockquote {
    border-left: 4px solid #dee2e6;
    padding: 0.5em 1em;
    margin: 1em 0;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.doc-reader-content code {
    background: #f1f3f5;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    color: #d63384;
}

.doc-reader-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85em;
    line-height: 1.5;
}

.doc-reader-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.doc-reader-content .sheet-title {
    background: #e3f2fd;
    padding: 0.5em 0.8em;
    border-radius: 4px;
    font-size: 1.1rem;
    margin-top: 1.5em;
}

.doc-reader-content .pdf-page {
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px dashed #dee2e6;
}

.doc-reader-content .pdf-page-header {
    font-size: 0.75em;
    color: #adb5bd;
    text-align: right;
    margin-bottom: 0.5em;
}

.doc-reader-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.doc-reader-content strong, .doc-reader-content b {
    font-weight: 600;
    color: #1a1a2e;
}

/* 暗色主题下的文档阅读器 */
[data-theme="dark"] .doc-reader-content {
    color: #d4d4d4;
}

[data-theme="dark"] .doc-reader-content h1,
[data-theme="dark"] .doc-reader-content h2,
[data-theme="dark"] .doc-reader-content h3,
[data-theme="dark"] .doc-reader-content h4 {
    color: #e0e0e0;
}

[data-theme="dark"] .doc-reader-content h1 {
    border-bottom-color: #444;
}

[data-theme="dark"] .doc-reader-content table th {
    background-color: #2a2a4a !important;
}

[data-theme="dark"] .doc-reader-content blockquote {
    background: #1a1a2e;
    border-left-color: #444;
}

[data-theme="dark"] .doc-reader-content .sheet-title {
    background: #1a2a4a;
}

[data-theme="dark"] .doc-reader-content strong,
[data-theme="dark"] .doc-reader-content b {
    color: #f0f0f0;
}

/* ========== AI回答Markdown样式 ========== */
.ai-content h1, .ai-content h2, .ai-content h3,
.ai-content h4, .ai-content h5, .ai-content h6 {
    margin-top: 0.6em;
    margin-bottom: 0.3em;
    font-weight: 600;
    line-height: 1.4;
}
.ai-content h1 { font-size: 1.25em; }
.ai-content h2 { font-size: 1.15em; }
.ai-content h3 { font-size: 1.08em; }
.ai-content h4, .ai-content h5, .ai-content h6 { font-size: 1em; }

.ai-content p { margin-bottom: 0.5em; }
.ai-content ul, .ai-content ol { padding-left: 1.4em; margin-bottom: 0.5em; }
.ai-content li { margin-bottom: 0.2em; }
.ai-content blockquote {
    border-left: 3px solid #dee2e6;
    padding: 0.3em 0.8em;
    margin: 0.5em 0;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}
.ai-content code {
    background: #f1f3f5;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
    color: #d63384;
}
.ai-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 0.8em;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85em;
    margin: 0.5em 0;
}
.ai-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}
.ai-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin: 0.5em 0;
}
.ai-content table th, .ai-content table td {
    border: 1px solid #dee2e6;
    padding: 0.3em 0.6em;
}
.ai-content table th {
    background: #f1f3f5;
    font-weight: 600;
}

.source-doc-link:hover {
    background-color: #d1ecf1 !important;
    border-color: #17a2b8 !important;
}

/* ========== AI销售策略Markdown样式 ========== */
.strategy-md-content,
.minutes-md-content {
    line-height: 1.8;
    font-size: 15px;
}
.strategy-md-content h1, .minutes-md-content h1 { font-size: 1.4em; margin-top: 1em; margin-bottom: 0.4em; font-weight: 700; color: #1a1a2e; border-bottom: 2px solid #e9ecef; padding-bottom: 0.3em; }
.strategy-md-content h2, .minutes-md-content h2 { font-size: 1.2em; margin-top: 0.8em; margin-bottom: 0.3em; font-weight: 600; color: #2c3e50; }
.strategy-md-content h3, .minutes-md-content h3 { font-size: 1.08em; margin-top: 0.6em; margin-bottom: 0.3em; font-weight: 600; color: #34495e; }
.strategy-md-content strong, .minutes-md-content strong { color: #1a1a2e; }
.strategy-md-content ul, .strategy-md-content ol,
.minutes-md-content ul, .minutes-md-content ol { padding-left: 1.5em; }
.strategy-md-content li, .minutes-md-content li { margin-bottom: 0.3em; }
.strategy-md-content blockquote,
.minutes-md-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 0.5em 1em;
    margin: 0.5em 0;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}
.minutes-md-content table { width: 100%; border-collapse: collapse; margin: 0.8em 0; font-size: 14px; }
.minutes-md-content th, .minutes-md-content td { border: 1px solid #dee2e6; padding: 0.4em 0.8em; text-align: left; }
.minutes-md-content th { background: #f8f9fa; font-weight: 600; }

/* ========== 搜索关键词高亮 ========== */
mark.search-highlight {
    background-color: #fff3cd;
    color: inherit;
    padding: 0.05em 0.15em;
    border-radius: 2px;
    border-bottom: 2px solid #ffc107;
    transition: background-color 0.2s;
}

mark.search-highlight-active {
    background-color: #ff9800 !important;
    color: #fff !important;
    border-bottom-color: #e65100;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.4);
}

[data-theme="dark"] mark.search-highlight {
    background-color: #5c4a00;
    border-bottom-color: #ffc107;
}

[data-theme="dark"] mark.search-highlight-active {
    background-color: #e65100 !important;
    border-bottom-color: #ff6d00;
}

/* ========== 平台Slogan ========== */
.platform-slogan {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 12px 0 8px;
    letter-spacing: 1px;
    -webkit-user-select: none;
    user-select: none;
    border-top: 1px solid #eee;
    margin-top: auto;
}
.platform-slogan i {
    font-size: 10px;
    opacity: 0.6;
}
[data-theme="dark"] .platform-slogan {
    color: #777;
    border-top-color: #333;
}

/* ========== ICP 备案号 ========== */
.login-icp {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 0;
    z-index: 1;
}
.login-icp a {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    text-decoration: none;
}
.login-icp a:hover {
    color: rgba(255,255,255,0.9);
    text-decoration: underline;
}
.icp-footer {
    text-align: center;
    font-size: 12px;
    padding: 8px 0;
    color: #999;
    margin-top: auto;
}
.icp-footer a {
    color: #999;
    text-decoration: none;
}
.icp-footer a:hover {
    color: #666;
    text-decoration: underline;
}
[data-theme="dark"] .icp-footer a {
    color: #666;
}
[data-theme="dark"] .icp-footer a:hover {
    color: #999;
}

/* ========== 扫码组件 ========== */
.scanner-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    min-height: 200px;
}
.scanner-viewport video {
    width: 100%;
    display: block;
    -o-object-fit: cover;
    object-fit: cover;
}
.scanner-guide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    pointer-events: none;
}
.scanner-guide-box {
    position: relative;
    width: 75%;
    height: 45%;
    min-width: 200px;
    min-height: 80px;
}
.scanner-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #00ff00;
    border-style: solid;
    border-width: 0;
}
.scanner-corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.scanner-corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.scanner-corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.scanner-corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }
.scanner-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: -webkit-linear-gradient(left, transparent 0%, #00ff00 50%, transparent 100%);
    background: linear-gradient(90deg, transparent 0%, #00ff00 50%, transparent 100%);
    -webkit-animation: scanline-move 2s ease-in-out infinite;
    animation: scanline-move 2s ease-in-out infinite;
}
@-webkit-keyframes scanline-move {
    0%, 100% { top: 10%; opacity: 0.5; }
    50% { top: 90%; opacity: 1; }
}
@media (max-width: 767.98px) {
    /* 仅压缩 zbar 相机视图，给手动输入区留出首屏空间；不改变相机取流分辨率 */
    #scanner-modal #scanner-reader.scanner-viewport {
        height: 37.5vw;
        min-height: 130px;
        max-height: 180px;
        overflow: hidden;
    }
    #scanner-modal #scanner-reader.scanner-viewport video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* 保留足够的二维码取景面积和静区余量，ROI 仍按实际视频尺寸逆映射。 */
    #scanner-modal .scanner-viewport .scanner-guide-box {
        height: 60%;
        min-height: 80px;
    }
}


/* ========== 帮助按钮 ========== */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #999;
    color: #777;
    font-size: 11px;
    font-weight: 600;
    font-family: serif;
    cursor: pointer;
    background: transparent;
    margin-left: 6px;
    line-height: 1;
    padding: 0;
    vertical-align: middle;
    transition: all 0.2s;
    flex-shrink: 0;
}
.help-btn:hover {
    color: #333;
    border-color: #555;
    background: rgba(0,0,0,0.05);
}
[data-theme="dark"] .help-btn {
    border-color: #666;
    color: #888;
}
[data-theme="dark"] .help-btn:hover {
    border-color: #aaa;
    color: #ccc;
    background: rgba(255,255,255,0.1);
}
/* 详情页头部（渐变背景）内的帮助按钮：白色 */
.detail-header .help-btn {
    border-color: rgba(255,255,255,0.8);
    color: #fff;
}
.detail-header .help-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.2);
}

/* ========== 数据管理表格：吸顶表头 ========== */
#dm-table-wrap {
    max-height: calc(100vh - 260px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
#dm-table-wrap thead th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
[data-theme="dark"] #dm-table-wrap thead th {
    background-color: #1a1a2e;
}

/* ========== 帮助弹窗内容 ========== */
.help-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    margin: 1em 0 0.4em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
}
.help-content h3:first-child {
    margin-top: 0;
}
.help-content p {
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: 0.5em;
}
.help-content ul, .help-content ol {
    font-size: 13.5px;
    padding-left: 1.5em;
    margin-bottom: 0.5em;
}
.help-content li {
    margin-bottom: 0.25em;
}
[data-theme="dark"] .help-content h3 {
    color: #ccc;
    border-bottom-color: #444;
}

/* ========== 仓库管理：移动端扫码按钮突出 ========== */
.wh-scan-hero {
    display: none;
}
/* ========== 波次拣货：移动端英雄区（桌面端隐藏） ========== */
.wave-scan-hero {
    display: none;
}
/* ========== 车队管理：每日检查里程输入框蓝光高亮 ========== */
.insp-mileage-highlight {
    border-color: #6ea8fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    font-weight: 600;
}
.insp-mileage-highlight:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ========== 车队管理：退货登记 移动端客户/商品搜索框并排一行 ========== */
.return-search-pair {
    display: flex;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}
.return-search-pair .form-control {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
}
/* iOS 12 不支持 flex gap：用 margin 降级保证两框间隔 */
.return-search-pair .form-control + .form-control {
    margin-left: .5rem;
}
@media (max-width: 767.98px) {
    /* 移动端：控件区占满整行宽度，搜索框各占一半、右边缘与卡片对齐 */
    .return-toolbar-controls {
        width: 100%;
    }
}
@media (min-width: 768px) {
    /* 桌面端：两个搜索框按内容宽度排列，与其它控件同处一行 */
    .return-search-pair {
        flex: 0 1 auto;
        width: auto;
    }
    .return-search-pair .form-control {
        width: auto;
        max-width: 180px;
    }
}

/* ========== 价格行情：数据修正 工具栏移动端收缩 ========== */
/* 日期范围与搜索框在移动端各占整行，输入框弹性收缩，避免被裁切 */
@media (max-width: 767.98px) {
    .pe-date-range {
        width: 100%;
    }
    .pe-date-range #pe-filter-start,
    .pe-date-range #pe-filter-end {
        flex: 1 1 0%;
        width: 0 !important;
        min-width: 0;
    }
    .pe-search-group {
        width: 100%;
    }
    .pe-search-group #pe-keyword {
        flex: 1 1 auto;
        min-width: 0 !important;
    }
}

/* ===== 每日检查 桌面端紧凑化 ===== */

/* 提交检查卡片：宽度由栅格列（col-lg-5）控制，卡片填满所在列 */
.insp-submit-card {
    max-width: 100%;
}

/* 检查项列表紧凑化 */
.insp-list-group .list-group-item.insp-item {
    padding: 0.5rem 0.75rem;
}

/* 分组标题紧凑化 */
.insp-list-group .list-group-item.bg-light {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* 检查项名称与操作按钮间距控制 */
.insp-item .insp-name {
    max-width: calc(100% - 80px);
}

.insp-item .insp-actions {
    flex-shrink: 0;
}

/* 照片区域跟随宽度限制 */
.insp-submit-card #insp-photo-section {
    max-width: 100%;
}

/* 桌面端（≥768px）进一步紧凑 */
@media (min-width: 768px) {
    .insp-submit-card .card-body {
        padding: 1rem 1.25rem;
    }

    /* 顶部表单区紧凑 */
    .insp-submit-card .row.g-2.mb-3 {
        margin-bottom: 0.5rem !important;
    }

    /* 检查项容器间距缩小 */
    #insp-items-container.mb-3 {
        margin-bottom: 0.5rem !important;
    }

    /* 备注和照片区间距缩小 */
    .insp-submit-card .form-control.mb-2,
    .insp-submit-card .form-control.mb-3 {
        margin-bottom: 0.35rem !important;
    }
}

/* 出入库/送货登记：手动输入编号横条（扫不了时的兜底，入口即单据类型；移动端+桌面端都显示） */
.wh-manual-bar {
    padding-top: 6px !important;
    padding-bottom: 4px !important;
}
/* 说明文字独占一行，类型按钮一行等宽铺满（桌面端限宽避免过度拉伸） */
.wh-manual-bar .wh-manual-btns {
    display: -webkit-flex;
    display: flex;
    max-width: 460px;
}
.wh-manual-bar .wh-manual-btn {
    padding: 3px 6px;
    font-size: 12.5px;
    border-radius: 6px;
    white-space: nowrap;
}
.wh-manual-bar .wh-manual-btns .wh-manual-btn {
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    min-width: 0;
}
/* 单类型（送货员登记）不拉伸 */
.wh-manual-bar .wh-manual-btns .wh-manual-btn:only-child {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}
.wh-manual-bar .wh-manual-btns .wh-manual-btn + .wh-manual-btn {
    margin-left: 6px;
}
@media (max-width: 767.98px) {
    /* --- 通用TAB栏移动端：水平滚动不换行，绝不被压缩 --- */
    #wh-tabs,
    #hotel-tabs,
    #fleet-tabs,
    #feedback-tabs,
    #procurement-tabs,
    #oc-tabs,
    #ordering-tabs,
    #workbench-tabs,
    #detail-tabs,
    #product-tabs,
    #product-detail-tabs,
    #approval-tabs,
    #daily-exec-tabs,
    #price-tabs {
        -webkit-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
        -webkit-flex-shrink: 0 !important;
        flex-shrink: 0 !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-top: 6px !important;
        padding-bottom: 0 !important;
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff !important;
    }
    #wh-tabs .nav-item,
    #hotel-tabs .nav-item,
    #fleet-tabs .nav-item,
    #feedback-tabs .nav-item,
    #procurement-tabs .nav-item,
    #oc-tabs .nav-item,
    #ordering-tabs .nav-item,
    #workbench-tabs .nav-item,
    #detail-tabs .nav-item,
    #product-tabs .nav-item,
    #product-detail-tabs .nav-item,
    #approval-tabs .nav-item,
    #daily-exec-tabs .nav-item,
    #price-tabs .nav-item {
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
    }
    #wh-tabs .nav-link,
    #hotel-tabs .nav-link,
    #fleet-tabs .nav-link,
    #feedback-tabs .nav-link,
    #procurement-tabs .nav-link,
    #oc-tabs .nav-link,
    #ordering-tabs .nav-link,
    #workbench-tabs .nav-link,
    #detail-tabs .nav-link,
    #product-tabs .nav-link,
    #product-detail-tabs .nav-link,
    #approval-tabs .nav-link,
    #daily-exec-tabs .nav-link,
    #price-tabs .nav-link {
        font-size: 12.5px;
        padding: 6px 10px;
        white-space: nowrap;
    }
    #wh-tabs .nav-link .fas,
    #wh-tabs .nav-link .far,
    #hotel-tabs .nav-link .fas,
    #hotel-tabs .nav-link .far,
    #fleet-tabs .nav-link .fas,
    #fleet-tabs .nav-link .far,
    #feedback-tabs .nav-link .fas,
    #feedback-tabs .nav-link .far,
    #procurement-tabs .nav-link .fas,
    #procurement-tabs .nav-link .far,
    #oc-tabs .nav-link .fas,
    #oc-tabs .nav-link .far,
    #ordering-tabs .nav-link .fas,
    #ordering-tabs .nav-link .far,
    #workbench-tabs .nav-link .fas,
    #workbench-tabs .nav-link .far,
    #detail-tabs .nav-link .fas,
    #detail-tabs .nav-link .far,
    #product-tabs .nav-link .fas,
    #product-tabs .nav-link .far,
    #product-detail-tabs .nav-link .fas,
    #product-detail-tabs .nav-link .far,
    #approval-tabs .nav-link .fas,
    #approval-tabs .nav-link .far,
    #daily-exec-tabs .nav-link .fas,
    #daily-exec-tabs .nav-link .far,
    #price-tabs .nav-link .fas,
    #price-tabs .nav-link .far {
        margin-right: 2px !important;
        font-size: 11px;
    }
    /* 隐藏TAB滚动条 */
    #wh-tabs::-webkit-scrollbar,
    #hotel-tabs::-webkit-scrollbar,
    #fleet-tabs::-webkit-scrollbar,
    #feedback-tabs::-webkit-scrollbar,
    #procurement-tabs::-webkit-scrollbar,
    #oc-tabs::-webkit-scrollbar,
    #ordering-tabs::-webkit-scrollbar,
    #workbench-tabs::-webkit-scrollbar,
    #detail-tabs::-webkit-scrollbar,
    #product-tabs::-webkit-scrollbar,
    #product-detail-tabs::-webkit-scrollbar,
    #approval-tabs::-webkit-scrollbar,
    #daily-exec-tabs::-webkit-scrollbar,
    #price-tabs::-webkit-scrollbar {
        display: none;
    }
    #wh-tabs,
    #hotel-tabs,
    #fleet-tabs,
    #feedback-tabs,
    #procurement-tabs,
    #oc-tabs,
    #ordering-tabs,
    #workbench-tabs,
    #detail-tabs,
    #product-tabs,
    #product-detail-tabs,
    #approval-tabs,
    #daily-exec-tabs,
    #price-tabs {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    /* 酒店餐饮/采购管理：隐藏模块标题和多余间距 */
    .module-header {
        display: none !important;
    }
    #procurement-tabs,
    #oc-tabs,
    #ordering-tabs {
        margin-bottom: 8px !important;
    }

    /* --- 知识库TAB栏移动端：紧凑一行显示 --- */
    #kb-tabs {
        -webkit-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
    }
    #kb-tabs .nav-link {
        font-size: 13px;
        padding: 5px 10px;
        white-space: nowrap;
    }
    #kb-tabs .nav-link .fas,
    #kb-tabs .nav-link .far {
        margin-right: 2px !important;
        font-size: 11px;
    }
    /* 知识库聊天区域移动端适配 */
    #kb-chat-row {
        height: calc(100vh - 120px) !important;
    }
    #kb-chat-row .card-body#chat-messages {
        padding: 8px !important;
    }
    #kb-chat-row .card-footer {
        padding: 8px !important;
    }
    #kb-chat-row #chat-input {
        font-size: 15px;
    }

    /* 知识库统计栏移动端优化 */
    #kb-stats-bar {
        padding: 6px 10px !important;
    }
    #kb-stats-bar .fw-bold {
        font-size: 0.85rem;
    }
    #kb-mini-stats .badge {
        font-weight: 500;
    }

    /* 知识库FAQ手风琴样式 */
    #welcome-faq details summary::-webkit-details-marker { display: none; }
    #welcome-faq details summary::marker { display: none; content: ''; }
    #welcome-faq details[open] .faq-arrow { transform: rotate(90deg); }
    #welcome-faq .quick-q:hover { background: rgba(0,0,0,.04); border-radius: 4px; }

    /* --- 扫码按钮英雄区：大按钮 + 渐变背景 --- */
    .wh-scan-hero {
        display: block;
        padding: 10px 12px 6px;
        background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
        border-radius: 0;
        margin: 0;
    }
    .wh-scan-hero .btn {
        width: 100%;
        padding: 12px 0;
        font-size: 16px;
        font-weight: 600;
        border-radius: 10px;
        letter-spacing: 1px;
    }
    .wh-scan-hero .btn .fas {
        font-size: 18px;
    }
    .wh-scan-hero .wh-hero-sub {
        display: -webkit-flex;
        display: flex;
        margin-top: 8px;
        margin-bottom: 2px;
    }
    .wh-scan-hero .wh-hero-sub .btn {
        -webkit-flex: 1;
        flex: 1;
        padding: 6px 0;
        font-size: 13px;
        font-weight: 500;
        border-radius: 8px;
        letter-spacing: 0;
    }

    /* --- 出入货登记：出库/入库两个扫码按钮左右并排（仅此 TAB，不影响其它 TAB 英雄区） --- */
    .wh-scan-hero-duo {
        display: -webkit-flex;
        display: flex;
    }
    .wh-scan-hero-duo > .btn {
        -webkit-flex: 1;
        flex: 1;
        width: auto;
        margin-right: 8px;
    }
    .wh-scan-hero-duo > .wh-hero-sub {
        -webkit-flex: 1;
        flex: 1;
        margin-top: 0;
        margin-bottom: 0;
    }
    .wh-scan-hero-duo > .wh-hero-sub .btn {
        width: 100%;
        padding: 12px 0;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: 1px;
    }

    /* --- 出入库登记：销售单/采购单/同价调拔出库/同价调拔入库 四按钮两行 --- */
    .wh-scan-hero-4 {
        padding-bottom: 0;
    }
    .wh-scan-hero-4 .wh-hero-row {
        display: -webkit-flex;
        display: flex;
        margin-bottom: 8px;
    }
    .wh-scan-hero-4 .wh-hero-row > .btn {
        -webkit-flex: 1;
        flex: 1;
        width: auto;
        padding: 12px 0;
        font-size: 16px;
        font-weight: 600;
        border-radius: 10px;
        letter-spacing: 1px;
    }
    .wh-scan-hero-4 .wh-hero-row > .btn + .btn {
        margin-left: 8px;
    }

    /* --- 工具栏精简 --- */
    .wh-toolbar-mobile {
        padding: 8px 10px !important;
        -webkit-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    .wh-toolbar-mobile .input-group {
        width: 100% !important;
        margin: 0 !important;
    }
    .wh-toolbar-mobile .form-select {
        width: auto !important;
        -webkit-flex: 1;
        flex: 1;
        min-width: 0;
    }
    /* 隐藏工具栏中原来的扫码和新增按钮（已移到hero区） */
    .wh-toolbar-mobile .wh-btn-desktop {
        display: none !important;
    }
    /* 移动端按钮文字精简（隐藏冗余文本，只保留关键字） */
    .wh-btn-desktop-text {
        display: none !important;
    }

    /* --- 表格隐藏次要列 --- */
    .wh-col-hide-mobile {
        display: none !important;
    }

    /* --- 表格单元格紧凑 --- */
    .wh-table-mobile td,
    .wh-table-mobile th {
        padding: 6px 5px !important;
        font-size: 12.5px !important;
    }
    .wh-table-mobile th {
        font-size: 11.5px !important;
        white-space: nowrap;
    }

    /* --- 酒店餐饮客户列表移动端 --- */
    .hotel-search-main {
        width: 100% !important;
        -webkit-flex: 1 1 100% !important;
        flex: 1 1 100% !important;
        min-width: 0;
    }
    .hotel-search-main select {
        max-width: 80px !important;
        -webkit-flex: 0 0 80px !important;
        flex: 0 0 80px !important;
    }
    .hotel-search-card .d-flex {
        -webkit-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    .hotel-btn-nearby {
        -webkit-flex: 1;
        flex: 1;
    }
    #hotel-filter-panel .d-flex.ms-auto {
        margin-left: 0 !important;
        width: 100%;
    }
    #hotel-filter-panel .d-flex.ms-auto .input-group {
        width: 100% !important;
        -webkit-flex: 1;
        flex: 1;
    }

    /* --- 酒店餐饮客户卡片移动端 --- */
    .hotel-customer-card {
        -webkit-transition: background-color .15s;
        transition: background-color .15s;
    }
    .hotel-customer-card:active {
        background-color: #f8f9fa;
    }
    .hotel-chain-card {
        -webkit-transition: background-color .15s;
        transition: background-color .15s;
    }
    .hotel-chain-card:active {
        background-color: #f8f9fa;
    }
    /* --- 采购管理移动端卡片 --- */
    .procurement-card {
        border-left: 3px solid #198754;
        -webkit-transition: border-color .15s;
        transition: border-color .15s;
    }
    .procurement-card:active {
        border-left-color: #ffc107;
        background-color: #f8f9fa;
    }
    .chain-tag {
        display: inline-block;
        font-size: 12px;
        line-height: 1.4;
        color: #6c757d;
        white-space: normal;
        word-wrap: break-word;
        word-break: break-all;
    }

    /* --- 连锁探索-主要分类移动端下拉框 --- */
    .mobile-cat-btn {
        background: transparent !important;
        border-color: #dee2e6 !important;
        color: #6c757d !important;
        font-size: 13px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        line-height: 1.3 !important;
        min-height: 32px;
        padding: 4px 24px 4px 8px !important;
    }
    .mobile-cat-btn:hover,
    .mobile-cat-btn:focus,
    .mobile-cat-btn.show {
        background: #f8f9fa !important;
        border-color: #adb5bd !important;
        color: #495057 !important;
        -webkit-box-shadow: none !important;
        box-shadow: none !important;
    }
    .mobile-cat-btn::after {
        margin-left: 4px;
    }
    .mobile-cat-menu {
        border-radius: 8px;
        -webkit-box-shadow: 0 4px 16px rgba(0,0,0,.12);
        box-shadow: 0 4px 16px rgba(0,0,0,.12);
    }
    .mobile-cat-item {
        padding: 4px 6px;
        border-bottom: 1px solid #f0f0f0;
    }
    .mobile-cat-item:last-child {
        border-bottom: none;
    }
    .mobile-cat-label {
        color: #6c757d !important;
        font-size: 13px;
        white-space: normal !important;
        word-wrap: break-word !important;
        word-break: break-all;
        line-height: 1.3;
        padding-left: 4px;
    }

    /* --- 波次二次分拣移动端 --- */
    .ss-mobile-header {
        -webkit-flex-direction: column !important;
        flex-direction: column !important;
        -webkit-align-items: flex-start !important;
        align-items: flex-start !important;
    }
    .ss-mobile-header .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 6px;
    }
    .ss-mobile-header .ms-auto input {
        width: 100% !important;
    }

    /* ========== 波次拣货：移动端优化 ========== */
    /* 隐藏桌面端头部（标题+按钮行） */
    .wave-header-desktop {
        display: none !important;
    }
    /* 英雄区：快速审单大按钮 + 渐变背景 */
    .wave-scan-hero {
        display: block;
        padding: 10px 12px 6px;
        background: linear-gradient(135deg, #17a2b8 0%, #0d7d8f 100%);
        border-radius: 0;
        margin: 0 -12px 0 -12px;
    }
    .wave-scan-hero .btn-light {
        width: 100%;
        padding: 12px 0;
        font-size: 16px;
        font-weight: 600;
        border-radius: 10px;
        letter-spacing: 1px;
    }
    .wave-scan-hero .btn-light .fas {
        font-size: 18px;
    }
    .wave-scan-hero .wave-hero-sub {
        display: -webkit-flex;
        display: flex;
        margin-top: 8px;
        margin-bottom: 2px;
    }
    .wave-scan-hero .wave-hero-sub .btn {
        -webkit-flex: 1;
        flex: 1;
        padding: 6px 0;
        font-size: 13px;
        font-weight: 500;
        border-radius: 8px;
        letter-spacing: 0;
    }
    .wave-scan-hero .wave-hero-sub .form-select {
        -webkit-flex: 1;
        flex: 1;
        font-size: 13px;
        padding: 4px 8px;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.4);
        background: rgba(255,255,255,0.15);
        color: #fff;
    }
    .wave-scan-hero .wave-hero-sub .form-select option {
        color: #333;
        background: #fff;
    }
    .wave-scan-hero .wave-hero-sub .badge {
        -webkit-flex: 1;
        flex: 1;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 500;
        border-radius: 8px;
        padding: 6px 0;
    }
    .wave-scan-hero .wave-hero-sub .wave-hero-task-selector {
        -webkit-flex: 1;
        flex: 1;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        min-width: 0;
    }
    .wave-scan-hero .wave-hero-sub .wave-dropdown-indicator {
        color: rgba(255,255,255,0.85);
        font-size: 14px;
        margin-right: 4px;
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
    }
    .wave-scan-hero .wave-hero-sub .wave-hero-task-selector > .form-select,
    .wave-scan-hero .wave-hero-sub .wave-hero-task-selector > .badge {
        -webkit-flex: 1;
        flex: 1;
        min-width: 0;
    }
    .wave-scan-hero .wave-hero-sub > * + * {
        margin-left: 8px;
    }

    /* 待打印波次：移动端隐藏经手人切换 */
    #wave-filter-handler {
        display: none !important;
    }

    /* TAB栏：水平滚动不换行 */
    #wave-tabs {
        -webkit-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
        -webkit-flex-shrink: 0 !important;
        flex-shrink: 0 !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-top: 6px !important;
        padding-bottom: 0 !important;
        margin-bottom: 8px !important;
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff !important;
    }
    #wave-tabs .nav-item {
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
    }
    #wave-tabs .nav-link {
        font-size: 12.5px;
        padding: 6px 10px;
        white-space: nowrap;
    }
    #wave-tabs .nav-link .fas,
    #wave-tabs .nav-link .far {
        margin-right: 2px !important;
        font-size: 11px;
    }
    /* 隐藏TAB滚动条 */
    #wave-tabs::-webkit-scrollbar {
        display: none;
    }
    #wave-tabs {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ========== 多话术选项卡样式 ========== */
.script-tab-pane {
    display: none;
}
.script-tab-pane.show {
    display: block;
}

/* ========== 通知中心样式 ========== */
#notif-dropdown .dropdown-item.notif-item {
    white-space: normal;
    border-bottom: 1px solid #f0f0f0;
}
#notif-dropdown .dropdown-item.notif-item:last-child {
    border-bottom: none;
}
#notif-dropdown .dropdown-item.notif-item:active {
    background-color: #e9ecef;
}
.notif-card {
    -webkit-transition: border-color .15s, background-color .15s;
    transition: border-color .15s, background-color .15s;
}
.notif-card:active {
    background-color: #f8f9fa;
}
#notif-type-tabs .notif-type-btn.active {
    -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.15);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ========== 产品洞对统计卖片式导航 ========== */
/* 区域一：采购类型概览卡片 */
.stats-type-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px 6px 8px;
    cursor: pointer;
    -webkit-transition: -webkit-transform .18s, -webkit-box-shadow .18s;
    transition: transform .18s, box-shadow .18s;
    -webkit-user-select: none;
    user-select: none;
}
.stats-type-card:hover {
    -webkit-transform: scale(1.04);
    transform: scale(1.04);
    -webkit-box-shadow: 0 4px 14px rgba(102,126,234,.25);
    box-shadow: 0 4px 14px rgba(102,126,234,.25);
    border-color: #a78ce6;
}
.stats-type-card:active {
    -webkit-transform: scale(0.98);
    transform: scale(0.98);
}
.stats-type-card.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
    -webkit-box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}
.stats-type-icon {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 4px;
}
.stats-type-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.2;
    margin-bottom: 2px;
}
.stats-type-sku {
    font-size: 1.45rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1.1;
}
.stats-type-hint {
    font-size: 0.65rem;
    color: #adb5bd;
    margin-top: 2px;
}
.stats-view-all {
    font-size: 0.6rem;
    color: #667eea;
    cursor: pointer;
    margin-top: 2px;
    -webkit-transition: color .15s;
    transition: color .15s;
}
.stats-view-all:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* 区域二：详情卡片（趋势/评分分布） */
.stats-detail-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 14px;
    height: 100%;
}
.stats-detail-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #dee2e6;
}

/* 指标行 */
.stats-metric-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 6px 8px;
    margin: 0 -8px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
    cursor: pointer;
    border-radius: 6px;
    -webkit-transition: background .15s;
    transition: background .15s;
}
.stats-metric-row:last-child {
    border-bottom: none;
}
.stats-metric-row:hover {
    background: rgba(0, 0, 0, 0.04);
}
.stats-metric-row.stats-zero:hover {
    background: rgba(0, 0, 0, 0.02);
}
.stats-metric-label {
    font-size: 0.8rem;
    color: #6c757d;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}
.stats-metric-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    min-width: 36px;
    text-align: right;
}
.stats-metric-value.stats-clickable {
    font-weight: 700;
    cursor: pointer;
    padding: 1px 5px;
    border-radius: 4px;
    -webkit-transition: background .15s;
    transition: background .15s;
}

/* 趋势色点 */
.stats-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.stats-dot.dot-success  { background: #28a745; }
.stats-dot.dot-secondary { background: #6c757d; }
.stats-dot.dot-danger    { background: #dc3545; }

/* 评分色块 */
.stats-score-block {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.stats-score-block.score-success { background: #28a745; }
.stats-score-block.score-primary  { background: #007bff; }
.stats-score-block.score-info     { background: #17a2b8; }
.stats-score-block.score-warning  { background: #ffc107; }
.stats-score-block.score-danger   { background: #dc3545; }

/* 数字hover颜色（匹配评分色块类） */
.stats-metric-value.stats-clickable.text-success:hover  { background: rgba(40,167,69,.12); }
.stats-metric-value.stats-clickable.text-secondary:hover { background: rgba(108,117,125,.12); }
.stats-metric-value.stats-clickable.text-danger:hover   { background: rgba(220,53,69,.12); }
.stats-metric-value.stats-clickable.score-success:hover  { background: rgba(40,167,69,.12); color: #155724; }
.stats-metric-value.stats-clickable.score-primary:hover  { background: rgba(0,123,255,.12); color: #004085; }
.stats-metric-value.stats-clickable.score-info:hover     { background: rgba(23,162,184,.12); color: #0c5460; }
.stats-metric-value.stats-clickable.score-warning:hover  { background: rgba(255,193,7,.2);  color: #856404; }
.stats-metric-value.stats-clickable.score-danger:hover   { background: rgba(220,53,69,.12); color: #721c24; }

/* 评分数字默认颜色 */
.stats-metric-value.score-success  { color: #28a745; }
.stats-metric-value.score-primary  { color: #007bff; }
.stats-metric-value.score-info     { color: #17a2b8; }
.stats-metric-value.score-warning  { color: #856404; }
.stats-metric-value.score-danger   { color: #dc3545; }

/* 移动端适配 */
@media (max-width: 767px) {
    .stats-type-icon  { font-size: 1.15rem; }
    .stats-type-name  { font-size: 0.68rem; }
    .stats-type-sku   { font-size: 1.15rem; }
    .stats-type-hint  { font-size: 0.58rem; }
    .stats-type-card  { padding: 8px 4px 6px; }
    .stats-detail-card { padding: 10px 10px; }
    .stats-metric-label { font-size: 0.75rem; }
    .stats-metric-value { font-size: 0.82rem; }
    .stats-metric-row { padding: 8px 6px; margin: 0 -6px; }
    .stats-view-all { font-size: 0.55rem; }
}

/* 桌面端统计表格 */
.stats-desktop-table {
    font-size: 0.85rem;
}
.stats-desktop-table th {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    font-size: 0.8rem;
    padding: 8px 6px;
}
.stats-desktop-table td {
    vertical-align: middle;
    padding: 6px;
}
.stats-desktop-table td a:hover {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

/* 移动端指标行选中态 */
.stats-metric-row.active {
    background: rgba(102, 126, 234, 0.08);
    border-left: 3px solid #667eea;
    border-radius: 6px;
}

/* 筛选标签区 */
.stats-filter-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ========== 波次拣货移动端卡片 ========== */
.wave-mobile-card {
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.wave-mobile-card .wave-link {
    color: #667eea;
    text-decoration: none;
}
.wave-mobile-card .wave-link:hover {
    text-decoration: underline;
}
.wave-mobile-card .wave-printed-link {
    color: #667eea;
    text-decoration: none;
}
.wave-mobile-card .wave-printed-link:hover {
    text-decoration: underline;
}

/* ========== 二次分拣订单卡片 ========== */
.ss-order-card {
    border-radius: 8px;
    border: 1.5px solid #6c757d;
    box-shadow: none;
    overflow: hidden;
}
.ss-order-card > .card-header {
    background-color: #fff;
    border-bottom: 1.5px solid #6c757d;
}
/* 序号徽章：固定宽度，统一尺寸 */
.ss-order-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 24px;
    border-radius: 12px;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== ASR 语音转写麦克风按钮（发言框右下角） ========== */
.speech-textarea-wrap {
    position: relative;
}
.speech-textarea-wrap textarea {
    padding-right: 40px;  /* 给按钮留出空间 */
}
.asr-mic-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #0d6efd;
    background: #fff;
    color: #0d6efd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: all 0.2s;
    z-index: 5;
}
.asr-mic-btn:hover {
    background: #e8f0fe;
}
.asr-mic-btn.asr-recording {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
    animation: asr-pulse 1.2s infinite;
}
@keyframes asr-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(220,53,69,0); }
}

/* ========== 系统演示模式 ========== */
.demo-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}
.demo-placeholder-card {
    text-align: center;
    padding: 3rem 2.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(99,102,241,.06) 0%, rgba(168,85,247,.06) 100%);
    border: 1px solid rgba(99,102,241,.12);
    max-width: 400px;
    width: 100%;
}
.demo-placeholder-icon {
    font-size: 3.5rem;
    color: #8b5cf6;
    margin-bottom: 1rem;
    opacity: .8;
}
.demo-placeholder-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: .5rem;
}
.demo-placeholder-text {
    font-size: 1.1rem;
    color: #8b5cf6;
    font-weight: 500;
    margin-bottom: .5rem;
}
.demo-placeholder-sub {
    font-size: .875rem;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0;
}
.demo-badge {
    font-size: .55rem !important;
    padding: .15em .4em !important;
    vertical-align: middle;
    margin-left: .35rem;
    border-radius: .25rem;
}
.demo-grid-badge {
    display: inline-block;
    font-size: .6rem;
    padding: 1px 5px;
    margin-left: 3px;
    border-radius: .2rem;
    background: #ffc107;
    color: #212529;
    vertical-align: middle;
}

/* ===== 功能规划介绍页 ===== */
.page-intro {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}
.page-intro-header {
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(99,102,241,.07) 0%, rgba(168,85,247,.07) 100%);
    border: 1px solid rgba(99,102,241,.12);
    margin-bottom: 1.5rem;
}
.page-intro-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: .75rem;
    box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.page-intro-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin-bottom: .35rem;
}
.page-intro-tagline {
    font-size: .95rem;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0;
}
.page-intro-section-title {
    font-size: .85rem;
    font-weight: 600;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.page-intro-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(139,92,246,.3), transparent);
}
.page-intro-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.page-intro-feature-card {
    padding: .85rem;
    border-radius: .65rem;
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    transition: box-shadow .2s, border-color .2s;
}
.page-intro-feature-card:hover {
    border-color: rgba(99,102,241,.3);
    box-shadow: 0 2px 8px rgba(99,102,241,.1);
}
.page-intro-feature-icon {
    width: 36px; height: 36px;
    border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    color: #fff;
    margin-bottom: .5rem;
}
.page-intro-feature-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: .25rem;
}
.page-intro-feature-desc {
    font-size: .78rem;
    color: var(--bs-secondary-color, #6c757d);
    line-height: 1.4;
    margin: 0;
}
.page-intro-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1rem;
    border-radius: .75rem;
    background: rgba(99,102,241,.03);
    border: 1px dashed rgba(99,102,241,.15);
    margin-bottom: 1.5rem;
}
.page-intro-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}
.page-intro-flow-step-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .95rem;
    margin-bottom: .4rem;
    box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
.page-intro-flow-step-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--bs-body-color);
}
.page-intro-flow-step-sub {
    font-size: .65rem;
    color: var(--bs-secondary-color, #6c757d);
}
.page-intro-flow-arrow {
    color: #8b5cf6;
    font-size: 1.2rem;
    opacity: .6;
}
.page-intro-scenario {
    padding: 1rem 1.25rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, rgba(16,185,129,.05) 0%, rgba(6,182,212,.05) 100%);
    border: 1px solid rgba(16,185,129,.12);
    margin-bottom: 1.5rem;
}
.page-intro-scenario-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .5rem;
    font-size: .85rem;
    color: var(--bs-body-color);
}
.page-intro-scenario-item:last-child { margin-bottom: 0; }
.page-intro-scenario-item i {
    color: #10b981;
    margin-top: 2px;
    flex-shrink: 0;
}
.page-intro-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, rgba(99,102,241,.04) 0%, rgba(168,85,247,.04) 100%);
}
.page-intro-footer-icon {
    font-size: 2rem;
    color: #8b5cf6;
    margin-bottom: .5rem;
    opacity: .7;
}
.page-intro-footer-text {
    font-size: .9rem;
    color: #8b5cf6;
    font-weight: 500;
    margin-bottom: .25rem;
}
.page-intro-footer-sub {
    font-size: .78rem;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0;
}
/* 同行调货 TAB 四阶段背景色：采集浅蓝 / 对账浅绿 / 付款浅橙 / 综合浅灰 */
#pt-tabs .nav-link.pt-phase-collect { background-color: #e7f1fb; }
#pt-tabs .nav-link.pt-phase-recon   { background-color: #e6f6ec; }
#pt-tabs .nav-link.pt-phase-payment { background-color: #fdf1e3; }
#pt-tabs .nav-link.pt-phase-misc    { background-color: #f1f3f5; }
/* 激活态保持白底高亮，与 Bootstrap 默认 nav-tabs 一致 */
#pt-tabs .nav-link.active {
    background-color: #fff;
    font-weight: 600;
}
/* 暗色主题：改用半透明深色调，激活态用卡片背景色 */
[data-theme="dark"] #pt-tabs .nav-link.pt-phase-collect { background-color: rgba(13, 110, 253, .18); }
[data-theme="dark"] #pt-tabs .nav-link.pt-phase-recon   { background-color: rgba(25, 135, 84, .18); }
[data-theme="dark"] #pt-tabs .nav-link.pt-phase-payment { background-color: rgba(253, 126, 20, .18); }
[data-theme="dark"] #pt-tabs .nav-link.pt-phase-misc    { background-color: rgba(173, 181, 189, .15); }

/* 人事薪酬 TAB 三色分组（人员薪酬=蓝 / 数据费用=绿 / 配置=橙），样式对齐同行调货 pt-phase-* */
#hr-tabs .nav-link.hr-group-hr   { background-color: #e7f1fb; }
#hr-tabs .nav-link.hr-group-data { background-color: #e6f6ec; }
#hr-tabs .nav-link.hr-group-cfg  { background-color: #fdf1e3; }

[data-theme="dark"] #hr-tabs .nav-link.hr-group-hr   { background-color: rgba(13, 110, 253, .18); }
[data-theme="dark"] #hr-tabs .nav-link.hr-group-data { background-color: rgba(25, 135, 84, .18); }
[data-theme="dark"] #hr-tabs .nav-link.hr-group-cfg  { background-color: rgba(253, 126, 20, .18); }
[data-theme="dark"] #pt-tabs .nav-link.active {
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* 采购管理 TAB 四组分背景色：来货登记浅紫 / 付款结算浅蓝 / 经营分析浅绿 / 跟进与配置浅橙（与同行调货 TAB 风格一致） */
#procurement-tabs .nav-link.wo-grp-arrival { background-color: #f0e9fb; }
#procurement-tabs .nav-link.wo-grp-settle { background-color: #e7f1fb; }
#procurement-tabs .nav-link.wo-grp-analyze { background-color: #e6f6ec; }
#procurement-tabs .nav-link.wo-grp-follow { background-color: #fdf1e3; }
/* 激活态保持白底高亮，与 Bootstrap 默认 nav-tabs 一致 */
#procurement-tabs .nav-link.active {
    background-color: #fff;
    font-weight: 600;
}
/* 暗色主题：改用半透明深色调，激活态用卡片背景色 */
[data-theme="dark"] #procurement-tabs .nav-link.wo-grp-arrival { background-color: rgba(111, 66, 193, .20); }
[data-theme="dark"] #procurement-tabs .nav-link.wo-grp-settle { background-color: rgba(13, 110, 253, .18); }
[data-theme="dark"] #procurement-tabs .nav-link.wo-grp-analyze { background-color: rgba(25, 135, 84, .18); }
[data-theme="dark"] #procurement-tabs .nav-link.wo-grp-follow { background-color: rgba(253, 126, 20, .18); }
[data-theme="dark"] #procurement-tabs .nav-link.active {
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* 波次拣货 TAB 四组背景色：作业主线浅蓝 / 核查记录浅绿 / 稽核追溯浅橙 / 统计配置浅灰（仅颜色区分，功能不分组；样式对齐同行调货 pt-phase-*） */
#wave-tabs .nav-link.wave-grp-work  { background-color: #e7f1fb; }
#wave-tabs .nav-link.wave-grp-check { background-color: #e6f6ec; }
#wave-tabs .nav-link.wave-grp-audit { background-color: #fdf1e3; }
#wave-tabs .nav-link.wave-grp-misc  { background-color: #f1f3f5; }
/* 激活态保持白底高亮，与 Bootstrap 默认 nav-tabs 一致 */
#wave-tabs .nav-link.active {
    background-color: #fff;
    font-weight: 600;
}
/* 暗色主题：改用半透明深色调，激活态用卡片背景色 */
[data-theme="dark"] #wave-tabs .nav-link.wave-grp-work  { background-color: rgba(13, 110, 253, .18); }
[data-theme="dark"] #wave-tabs .nav-link.wave-grp-check { background-color: rgba(25, 135, 84, .18); }
[data-theme="dark"] #wave-tabs .nav-link.wave-grp-audit { background-color: rgba(253, 126, 20, .18); }
[data-theme="dark"] #wave-tabs .nav-link.wave-grp-misc  { background-color: rgba(173, 181, 189, .15); }
[data-theme="dark"] #wave-tabs .nav-link.active {
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* 同行调货对账列表行聚焦效果：点击行高亮浅绿色背景，便于对账 */
.pt-recon-focused { background-color: #e6f6ec !important; }
.pt-recon-focused td { background-color: #e6f6ec !important; }
[data-theme="dark"] .pt-recon-focused { background-color: rgba(25, 135, 84, .12) !important; }
[data-theme="dark"] .pt-recon-focused td { background-color: rgba(25, 135, 84, .12) !important; }

/* 出货成本-经手人出货成本：每件成本输入行淡黄背景突出（覆盖 table-light 表头底色） */
.hr-oc-cost-head {
    background-color: #fff3cd !important;
}
[data-theme="dark"] .hr-oc-cost-head {
    background-color: rgba(255, 193, 7, .18) !important;
}
.hr-oc-cost-head .oc-cost-input {
    background-color: #fff8e1;
}

/* 同行调货：导出采购退货单按钮 - 红酒色（outline），替代原黄色 warning */
.btn-outline-wine {
    color: #722F37;
    border-color: #722F37;
}
.btn-outline-wine:hover {
    color: #fff;
    background-color: #722F37;
    border-color: #722F37;
}
.btn-outline-wine:focus, .btn-outline-wine.focus {
    box-shadow: 0 0 0 .2rem rgba(114, 47, 55, .5);
}
.btn-outline-wine:active, .btn-outline-wine.active {
    color: #fff;
    background-color: #5e2630;
    border-color: #5e2630;
}
[data-theme="dark"] .btn-outline-wine {
    color: #c98a93;
    border-color: #8a434d;
}
[data-theme="dark"] .btn-outline-wine:hover {
    color: #fff;
    background-color: #722F37;
    border-color: #722F37;
}

/* ========== 单据类型徽章配色标准（全平台统一，详见 docs/项目记忆总览.md「单据类型配色标准」） ==========
   入库类=绿(bg-success)、退货类=红(bg-danger)、同价调拔出库=黄(bg-warning text-dark)、
   同价调拔入库=橙(bg-orange，Bootstrap 无此色，此处补齐)、波次单=蓝(bg-primary)。
   前端统一用 Utils.billTypeBadge(name) 渲染，不要在页面里另写颜色判断。 */
.bg-orange {
    background-color: #fd7e14 !important;
}
