/* 抽取自 admin.html，由重构脚本生成 */
/* 手机/平板上点按钮、链接时不要闪一块半透明方块（系统默认的 tap highlight） */
html { -webkit-tap-highlight-color: transparent; }
button, a, select, input, label, .card, .panel { -webkit-tap-highlight-color: transparent; }
/* CSS Variables - Professional B2B Color Scheme */
        :root {
            --primary: #1E3A5F;
            --primary-light: #2C5282;
            --primary-dark: #152D4A;
            --success: #10B981;
            --warning: #F59E0B;
            --danger: #DC2626;
            --info: #3B82F6;
            --bg-page: #F8FAFC;
            --bg-card: #FFFFFF;
            /* 主文本色：过去模板里同时存在 #000 / #111827 / var(--text-primary) / #1E293B / #333 五种深灰，
               现统一收敛到这一个值（取原使用量最大的 var(--text-primary) 一档，接近 Ant Design 的正文色）。
               想改回纯黑，只改这一行即可全站生效。 */
            --text-primary: #1F2937;
            --text-secondary: #64748B;
            --text-muted: #94A3B8;
            --text-body: #374151;
            --text-hint: #9CA3AF;
            --text-secondary-2: #6B7280;
            --border-2: #E5E7EB;
            --border-strong: #CBD5E1;
            --border: #E2E8F0;
            --border-light: #F1F5F9;
            --row-hover: #FAFBFD;   /* 列表行悬停底色 */
            --purple: #7C3AED;
            /* ===== 全站统一布局尺寸（原散落在 _sidebar.html 的内联 :root 里，
                   导致 _layout_boot.html 等不含侧边栏的页面取不到值，只能各写一份兜底默认值）===== */
            --nav-height: 64px;        /* 顶部导航栏高度 */
            --nav-content-gap: 20px;   /* 导航栏到页面第一个内容元素的间距 */
            --content-pad: 20px;       /* 内容区左右及底部内边距 */
            --card-gap: 16px;          /* 卡片之间 */
            --card-pad: 20px;          /* 卡片内边距 */
            --section-gap: 20px;       /* 区块之间 */
            --title-gap: 6px;          /* 大标题与描述之间 */
            --title-card-gap: 16px;    /* 标题区到下方卡片 */
            --card-radius: 12px;       /* 卡片圆角 */
            --sb-width: 220px;         /* 左侧导航展开宽度 */
            --sb-collapsed: 64px;      /* 左侧导航收拢宽度 */
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
            --shadow-md: 0 2px 4px rgba(0,0,0,0.06);
            --radius: 8px;
            --radius-sm: 4px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
            background: var(--bg-page);
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.5;
        }
        
        /* Header */
        .header {
            background: var(--primary);
            color: #ffffff;
            padding: 16px 32px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: var(--shadow-md);
        }
        
        .header-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        
        .header h1 {
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.5px;
        }
        
        .header .btn {
            background: rgba(255,255,255,0.12);
            color: #ffffff;
            border: none;
            padding: 8px 16px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: background 0.2s;
        }
        
        .header .btn:hover {
            background: rgba(255,255,255,0.2);
        }
        
        .header .btn svg {
            width: 14px;
            height: 14px;
        }
        
        .header select {
            background: rgba(255,255,255,0.12);
            color: #ffffff;
            border: none;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        
        .header select option {
            background: white;
            color: #333;
        }

        /* 全局下拉框选中项样式 */
        select {
            color-scheme: light;
        }

        select option:checked,
        select option:selected {
            background-color: var(--primary) !important;
            color: #ffffff !important;
            background-image: linear-gradient(var(--primary), var(--primary)) !important;
        }

        select option:hover {
            background-color: var(--primary) !important;
            color: #ffffff !important;
        }

        /* 列表框模式(size>1)下的选中项样式 */
        select[size] option:checked,
        select[size] option:selected {
            background-color: var(--primary) !important;
            color: #ffffff !important;
            background-image: none !important;
        }

        select[size] option:hover {
            background-color: var(--primary) !important;
            color: #ffffff !important;
        }

        /* 强制覆盖所有option选中状态 */
        select option:checked::before,
        select option:selected::before {
            content: '';
            display: inline-block;
            width: 0;
        }

        /* Firefox */
        select option:checked {
            background: var(--primary) !important;
            color: #fff !important;
        }



        /* 隐藏滚动条 */
        .custom-select-dropdown::-webkit-scrollbar {
            width: 6px;
        }

        .custom-select-dropdown::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .custom-select-dropdown::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        .custom-select-dropdown::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
        

        /* Navigation Tabs */
        .nav-tabs {
            background: var(--bg-card);
            padding: 0 32px;
            display: flex;
            gap: 4px;
            border-bottom: 1px solid var(--border);
        }
        
        .nav-tab {
            padding: 14px 24px;
            cursor: pointer;
            font-size: 14px;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .nav-tab svg {
            width: 16px;
            height: 16px;
        }
        
        .nav-tab:hover {
            color: var(--primary);
            /* 原来这里有一行 background: var(--bg-page)，悬停整块变灰。
               按钮类元素统一不加灰色底，用文字色变化作为悬停反馈。 */
        }
        
        .nav-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
            font-weight: 600;
        }
        
        .container {
            max-width: none;
            margin: 0;
            padding: 0;
        }
        
        /* Stats Cards */
        .stats-bar {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        
        .stat-mini {
            background: var(--bg-card);
            padding: 14px 20px;
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            display: flex;
            align-items: center;
            gap: 12px;
            border: 1px solid var(--border-light);
            transition: all 0.2s;
            text-decoration: none;
            color: inherit;
        }
        
        .stat-mini:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        
        .stat-mini .icon {
            width: 36px;
            height: 36px;
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .stat-mini .icon svg {
            width: 18px;
            height: 18px;
        }
        
        .stat-mini .icon.blue { background: #EBF4FF; color: var(--primary-light); }
        .stat-mini .icon.green { background: #ECFDF5; color: var(--success); }
        .stat-mini .icon.orange { background: #FFFBEB; color: var(--warning); }
        .stat-mini .icon.red { background: #FEF2F2; color: var(--danger); }
        
        .stat-mini .number {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.2;
        }
        
        .stat-mini .label {
            font-size: 12px;
            color: var(--text-muted);
        }
        
        /* Alert Cards */
        .alert-card {
            border-radius: var(--radius);
            padding: 14px 20px;
            margin-bottom: 20px;
            border: 1px solid;
        }
        
        .alert-card.warning {
            background: #FEF2F2;
            border-color: #FECACA;
        }
        
        .alert-card.orange {
            background: #FFFBEB;
            border-color: #FDE68A;
        }
        
        .alert-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }
        
        .alert-header h3 {
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .alert-card.warning .alert-header h3 { color: var(--danger); }
        .alert-card.orange .alert-header h3 { color: var(--warning); }
        
        .alert-header h3 svg {
            width: 16px;
            height: 16px;
        }
        
        .alert-badge {
            padding: 2px 10px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
        }
        
        .alert-card.warning .alert-badge { background: var(--danger); color: white; }
        .alert-card.orange .alert-badge { background: var(--warning); color: white; }
        
        .alert-items {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .alert-item {
            background: var(--bg-card);
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            min-width: 160px;
            box-shadow: var(--shadow-sm);
            border-left: 3px solid;
        }
        
        .alert-card.warning .alert-item { border-left-color: var(--danger); }
        .alert-card.orange .alert-item { border-left-color: var(--warning); }
        
        .alert-item-name {
            font-weight: 600;
            font-size: 13px;
            color: var(--text-primary);
        }
        
        .alert-item-date {
            font-size: 12px;
            color: var(--text-secondary);
            margin: 4px 0;
        }
        
        .alert-item-type {
            font-size: 11px;
            color: var(--text-muted);
        }

        .alert-item-phone {
            font-size: 12px;
            color: var(--text-secondary);
        }

        /* 提醒中的电话高亮：跟随卡片主题色（超时卡片红、回访/交付卡片橙，不混色） */
        .alert-item-phone .phone-value {
            font-weight: 700;
            color: var(--warning);
            background: rgba(245, 158, 11, 0.12);
            padding: 1px 6px;
            border-radius: 4px;
        }
        .alert-card.warning .alert-item-phone .phone-value {
            color: var(--danger);
            background: rgba(220, 38, 38, 0.08);
        }

        /* 提醒中的时间高亮（红色=超时提醒，橙色=回访/交付提醒） */
        .alert-item-date .reminder-time {
            font-weight: 700;
            color: var(--danger);
            background: rgba(220, 38, 38, 0.08);
            padding: 1px 6px;
            border-radius: 4px;
        }

        .alert-card.orange .alert-item-date .reminder-time {
            color: var(--warning);
            background: rgba(245, 158, 11, 0.12);
        }
        
        .alert-item-link {
            display: inline-block;
            margin-top: 6px;
            font-size: 12px;
            text-decoration: none;
        }
        
        .alert-card.warning .alert-item-link { color: var(--danger); }
        .alert-card.orange .alert-item-link { color: var(--warning); }
        
        /* Filter Bar */
        .filter-bar {
            background: var(--bg-card);
            padding: 16px 20px;
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            margin-bottom: 20px;
            border: 1px solid var(--border-light);
        }
        
        .search-row {
            display: flex;
            gap: 12px;
            margin-bottom: 12px;
            flex-wrap: wrap;
            align-items: center;
        }
        
        .search-container {
            flex: 1 1 400px;
            min-width: 280px;
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 13px;
            transition: border-color 0.2s;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
        }
        
        .filter-row {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            align-items: center;
        }
        
        .filter-group {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .filter-group label {
            font-size: 12px;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        
        .filter-group select {
            padding: 6px 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 12px;
            background: white;
            cursor: pointer;
            color: var(--text-primary);
        }
        
        .filter-group select:focus {
            outline: none;
            border-color: var(--primary);
        }
        
        /* ===== 全局按钮尺寸变量（修改这里统一控制所有按钮大小） ===== */
        :root {
            --btn-padding-lg: 10px 16px;    /* 大按钮：批量操作、新建、缓存监控等 */
            --btn-font-size-lg: 13px;
            --btn-padding-md: 8px 16px;     /* 中等按钮：设置页面 */
            --btn-font-size-md: 13px;
            --btn-padding-sm: 5px 10px;     /* 小按钮：表格操作、分页 */
            --btn-font-size-sm: 12px;
        }
        
        /* ===== 全局按钮三种尺寸 ===== */
        /* 默认：大按钮（批量操作用，如批量删除、导出等） */
        /* 全局button默认样式：新增页面不写类名也自动统一 */
        button {
            background: #fff;
            color: var(--text-secondary);
            border: 1px solid var(--border-strong);
            padding: var(--btn-padding-lg);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: var(--btn-font-size-lg);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s;
            font-family: inherit;
            font-weight: 400;
        }

        
        /* 中等按钮：设置页面用（保存、管理目录等） */
        .settings-page .btn-outline {
            padding: var(--btn-padding-md);
            font-size: var(--btn-font-size-md);
        }
        
        /* 大按钮：缓存监控操作栏（继承全局大按钮，覆盖设置页的中等按钮） */
        .cache-actions .btn-outline {
            padding: var(--btn-padding-lg);
            font-size: var(--btn-font-size-lg);
        }
        
        /* 分页按钮：小按钮 */
        .pagination-bar .btn-outline {
            padding: var(--btn-padding-sm);
            font-size: var(--btn-font-size-sm);
            height: 30px;              /* 与右侧下拉框同高，避免一高一矮 */
        }

        /* 分页内的下拉框：和同排按钮一样高（原生 select 与 cs-enhance 自定义下拉默认都偏高） */
        .pagination-bar select {
            height: 30px !important;
            min-height: 30px !important;
            padding: 0 8px !important;
            font-size: 12px !important;
            line-height: 28px !important;
            border: 1px solid #D1D5DB;
            border-radius: 6px;
            background: #fff;
            color: var(--text-body);
            box-sizing: border-box;
        }
        .pagination-bar .cs-global-display {
            height: 30px !important;
            min-height: 30px !important;
            padding: 0 26px 0 10px !important;   /* 右侧留出箭头位置 */
            font-size: 12px !important;
            line-height: 28px !important;
            border-radius: 6px !important;
        }
        
        /* 小按钮：列表中的操作按钮（查看/删除等） */
        table .btn-outline {
            padding: var(--btn-padding-sm);
            font-size: var(--btn-font-size-sm);
            gap: 4px;
        }
        
        /* 显式小按钮类（优先级高于settings-page） */
        .btn-outline.btn-sm,
        .settings-page .btn-outline.btn-sm,
        table .btn-outline.btn-sm {
            padding: var(--btn-padding-sm) !important;
            font-size: var(--btn-font-size-sm) !important;
            gap: 4px;
        }

        /* 特小按钮：目录树行内操作等紧凑场景 */
        :root {
            --btn-padding-xs: 2px 8px;
            --btn-font-size-xs: 11px;
        }
        .btn-outline.btn-xs,
        .settings-page .btn-outline.btn-xs,
        table .btn-outline.btn-xs {
            padding: var(--btn-padding-xs) !important;
            font-size: var(--btn-font-size-xs) !important;
            gap: 3px;
            line-height: 1.5;
        }

        /* 网盘模式选择大卡片按钮 */
        .mode-card-btn {
            border: 2px solid var(--border-strong) !important;
            border-radius: 10px !important;
            background: #fff !important;
            transition: all .2s;
            min-height: 120px;
        }
        .mode-card-btn:hover {
            border-color: var(--text-muted) !important;
            /* 去掉灰色悬停底：按钮统一不填充灰色 */
        }
        .mode-card-btn.mode-card-active {
            border-color: var(--primary) !important;
            background: var(--bg-page) !important;
        }
        
        #confirmDeleteOk:hover {
            background: var(--danger) !important;
            color: #fff !important;
            border-color: var(--danger) !important;
        }
        
        .btn-danger-outline {
            background: #fff;
            color: var(--danger);
            border: 1px solid var(--danger);
        
        
            text-decoration: none;}
        
        .btn-danger-outline:hover {
            background: var(--danger) !important;
            color: #fff !important;
            border-color: var(--danger) !important;
        }
        
        .btn-outline svg {
            width: 14px;
            height: 14px;
        }
        
        /* 列表中小按钮的图标尺寸 */
        table .btn-outline svg {
            width: 12px;
            height: 12px;
        }
        
        /* Table */
        .table-container {
            background: var(--bg-card);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            /* 圆角靠裁剪实现，所以 overflow 必须是 hidden/auto；
               列宽改成自适应后，极端窄屏下表格可能比容器宽，这里允许横向滚动而不是被裁掉 */
            overflow-x: auto;
            overflow-y: hidden;
            border: 1px solid var(--border);
        }

        /* 行内下拉菜单打开时临时解除裁剪：菜单始终向下展开，也不会被容器切掉 */
        .table-container.menu-open {
            overflow: visible;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
        }
        
        th {
            /* 用比页面背景深一档的灰：原来用 --bg-page(var(--bg-page))，和白色卡片几乎分不出，
               导致没有内联样式的表格看起来「表头是白的、行之间没线」 */
            background: var(--border-light);
            padding: 12px 10px;
            text-align: center;
            font-size: 12px;
            color: var(--text-body);
            font-weight: 600;
            white-space: nowrap;
            border-bottom: 1px solid var(--border);
        }
        
        td {
            padding: 12px 10px;
            /* 分隔线原来用 --border-light(var(--border-light))，几乎看不见；加深到 --border-2(var(--border-2)) */
            border-bottom: 1px solid var(--border-2);
            font-size: 13px;
            vertical-align: middle;
            line-height: 1.5;
            text-align: center;
        }
        
        tr:hover {
            background: var(--bg-page);
        }
        
        /* 表格内通用标签样式（预算、类型、状态等标识字段） */
        .cell-tag {
            display: inline-block;
            padding: 4px 10px;
            background: var(--border-light);
            border-radius: 6px;
            font-size: 13px;
            color: #000000;
            line-height: 1.4;
        }
        
        /* 操作列固定最右侧（表格横向滚动时冻结在可视区最右） */
        #orderList th.col-action,
        #orderList td.col-action {
            position: sticky;
            right: 0;
            z-index: 2;
            background: #ffffff;
            box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06);
        }
        /* 冻结列必须有不透明底色，且要和「表头底色 / 行悬停底色」一致，
           否则横向滚动时会看到这一列和旁边明显深浅不同 */
        #orderList th.col-action {
            z-index: 3;
            background: var(--border-light);
        }
        #orderList tbody tr:hover td.col-action {
            background: var(--row-hover);
        }
        
        /* Status Tags */
        .status-tag {
            display: inline-block;
            padding: 3px 8px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 500;
        }
        
        .status-tag.new {
            background: #ECFDF5;
            color: var(--success);
        }
        
        .status-tag.read {
            background: var(--bg-page);
            color: var(--text-muted);
        }
        
        
        /* Follow Status Tags */
        .follow-tag {
            display: inline-block;
            padding: 3px 8px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 500;
        }
        
        .follow-tag.pending {
            background: #FEF3C7;
            color: #92400E;
        }
        
        .follow-tag.contacted {
            background: #DBEAFE;
            color: #1E40AF;
        }
        
        .follow-tag.completed {
            background: #D1FAE5;
            color: #065F46;
        }
        
        .follow-tag.cancelled {
            background: #FEE2E2;
            color: #991B1B;
        }
        
        
        
        /* Customer Tags */
        .tag-container {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            flex-wrap: wrap;
        }
        
        .customer-tag {
            display: inline-block;
            padding: 2px 8px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        
        .customer-tag:hover {
            opacity: 0.8;
        }
        
        .customer-tag.high-intent {
            background: #FEE2E2;
            color: #991B1B;
        }
        
        .customer-tag.key-follow {
            background: #DBEAFE;
            color: #1E40AF;
        }
        
        .customer-tag.considering {
            background: #FEF3C7;
            color: #92400E;
        }
        
        .customer-tag.budget-high {
            background: #FEF9C3;
            color: #854D0E;
        }
        
        .customer-tag.signed {
            background: #D1FAE5;
            color: #065F46;
        }
        
        .customer-tag.quality {
            background: #CCFBF1;
            color: #0F766E;
        }
        
        .customer-tag.potential {
            background: #E0E7FF;
            color: #3730A3;
        }
        
        .customer-tag.lost {
            background: var(--border-light);
            color: var(--text-secondary);
        }
        
        /* Tag Dropdown */
        .tag-dropdown-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            font-size: 10px;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 2px;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        
        .tag-dropdown-btn::after {
            content: '\25BC';
            font-size: 8px;
            opacity: 0.7;
        }
        
        .tag-dropdown-btn:hover {
            color: var(--text-primary);
            border-color: var(--border-strong);
            /* 去掉灰色悬停底 */
        }
        
        .tag-dropdown-menu {
            position: absolute;
            top: 100%;
            left: 0;
            z-index: 1000;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow-md);
            z-index: 1000;
            min-width: 140px;
            padding: 4px;
            max-height: 200px;
            overflow-y: auto;
        }
        
        /* 向上展开的下拉菜单 */
        .tag-dropdown-menu.up {
            top: auto;
            bottom: 100%;
        }
        
        .tag-dropdown-menu div {
            padding: 6px 10px;
            cursor: pointer;
            font-size: 12px;
            border-radius: 2px;
            transition: background 0.15s;
        }
        
        .tag-dropdown-menu div:hover {
            background: var(--bg-page);
        }
        
        /* Status Tags */
        .status-tag.modified {
            background: #FEF3C7;
            color: #92400E;
        }
        
        
        /* Empty State */
        .empty {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-muted);
        }
        
        .empty-icon {
            width: 48px;
            height: 48px;
            margin: 0 auto 16px;
            opacity: 0.5;
        }
        
        .result-count {
            padding: 12px 0;
            font-size: 13px;
            color: var(--text-secondary);
        }
        
        
        /* Overdue Row */
        tr.overdue-row {
            background: #FEF2F2 !important;
        }
        
        tr.overdue-row:hover {
            background: #FEE2E2 !important;
        }
        
        /* Blacklist Tag */
        .blacklist-tag {
            display: inline-block;
            background: var(--danger);
            color: white;
            padding: 1px 4px;
            border-radius: 2px;
            font-size: 10px;
            font-weight: 500;
            margin-right: 4px;
        }
        
        /* Overdue Tag */
        .overdue-tag {
            display: inline-block;
            background: var(--danger);
            color: white;
            padding: 1px 4px;
            border-radius: 2px;
            font-size: 10px;
            font-weight: 500;
            margin-right: 4px;
        }
        
        /* Pagination */
        .pagination {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 20px;
            padding: 14px 20px;
            background: var(--bg-page);
            border-radius: var(--radius);
        }
        
        .pagination-info {
            color: var(--text-secondary);
            font-size: 13px;
        }
        
        .pagination-info strong {
            color: #000000;
        }
        
        .pagination-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .pagination-controls a,
        .pagination-controls span {
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            text-decoration: none;
            transition: all 0.2s;
        }
        
        .pagination-controls a {
            background: #000000;
            color: white;
        }
        
        .pagination-controls a:hover {
            /* 原来是 #333333 灰底，改成品牌深色：按钮悬停不填灰 */
            background: var(--primary);
        }
        
        .pagination-controls span {
            background: var(--bg-card);
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }
        
        .pagination-controls select {
            padding: 6px 10px;
            border: 1px solid #000000;
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: var(--text-primary);
            background: white;
            cursor: pointer;
        }
        
        /* Search History Dropdown */
        .search-history-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            max-height: 300px;
            overflow-y: auto;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow-md);
            z-index: 1000;
            margin-top: 4px;
        }
        
        .search-history-dropdown .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 14px;
            cursor: pointer;
            border-bottom: 1px solid var(--border-light);
            transition: background 0.15s;
        }
        
        .search-history-dropdown .history-item:hover {
            background: var(--bg-page);
        }
        
        .search-history-dropdown .history-keyword {
            color: var(--text-primary);
            font-size: 13px;
        }
        
        .search-history-dropdown .history-count {
            color: var(--text-muted);
            font-size: 11px;
            background: var(--bg-page);
            padding: 2px 8px;
            border-radius: 10px;
        }
        
        .search-history-dropdown .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 14px;
            background: var(--bg-page);
            border-bottom: 1px solid var(--border);
            font-size: 12px;
            color: var(--text-muted);
        }
        
        .search-history-dropdown .clear-history {
            color: var(--danger);
            cursor: pointer;
            font-size: 12px;
        }
        
        .search-history-dropdown .clear-history:hover {
            text-decoration: underline;
        }
        
        .search-history-dropdown .no-history {
            padding: 14px;
            text-align: center;
            color: var(--text-muted);
            font-size: 12px;
        }
        
        /* Modal Styles */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.4);
            z-index: 6000;
            align-items: center;
            justify-content: center;
        }
        
        .modal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--bg-card);
            padding: 24px;
            border-radius: var(--radius);
            min-width: 320px;
            width: auto;
            max-width: 90vw;
            box-shadow: 0 8px 30px rgba(0,0,0,0.15);
        }
        
        .modal h3 {
            margin: 0 0 12px;
            color: var(--text-primary);
            font-size: 16px;
            font-weight: 600;
        }
        
        .modal p {
            color: var(--text-secondary);
            font-size: 13px;
            margin-bottom: 16px;
        }
        
        .modal p span {
            color: var(--primary);
            font-weight: 600;
        }
        
        .modal select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 13px;
            margin-bottom: 16px;
        }
        
        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }
        
        .modal-buttons button {
            padding: 8px 16px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .modal-buttons .cancel-btn {
            background: var(--bg-card);
            border: 1px solid var(--border);
            color: var(--text-secondary);
        }
        
        .modal-buttons .cancel-btn:hover {
            /* 原来是灰底，改成描边+文字变色：按钮不填充灰色 */
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .modal-buttons .confirm-btn {
            background: var(--warning);
            border: none;
            color: white;
        }
        
        .modal-buttons .confirm-btn:hover {
            opacity: 0.9;
        }
        
        .modal-buttons .danger-btn {
            background: var(--danger);
            border: none;
            color: white;
        }

        /* 弹窗内 outline 按钮：清晰边框，避免白底白字看不清 */
        .modal-buttons .btn-outline {
            background: #fff;
            border: 1px solid var(--border-strong);
            color: var(--text-secondary);
        }
        .modal-buttons .btn-outline:hover {
            border-color: #000;
            color: #000;
        }
        .modal-buttons .btn-danger-outline {
            background: #fff;
            border: 1px solid var(--danger);
            color: var(--danger);
        }
        .modal-buttons .btn-danger-outline:hover {
            background: var(--danger) !important;
            color: #fff !important;
            border-color: var(--danger) !important;
        }

        /* Tag Options */
        .tag-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            padding: 12px;
            background: var(--bg-page);
            border-radius: var(--radius-sm);
        }
        
        .tag-options button {
            padding: 6px 12px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            border-radius: 14px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
        }
        
        .tag-options button:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .tag-options button.selected {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
            font-weight: 600;
        }
        
        /* Toast */
        .toast {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--bg-card);
            padding: 20px 28px;
            border-radius: var(--radius);
            box-shadow: 0 8px 30px rgba(0,0,0,0.2);
            text-align: center;
            min-width: 180px;
            max-width: calc(100vw - 40px);
            z-index: 9999;
        }
        
        .toast-icon {
            width: 32px;
            height: 32px;
            margin: 0 auto 10px;
        }
        
        .toast-message {
            font-size: 13px;
            color: var(--text-primary);
            font-weight: 500;
            white-space: normal;
            word-break: break-word;
            overflow-wrap: anywhere;
            line-height: 1.5;
        }
        
        
        
        /* 网盘上传状态标签 */
        .upload-status-tag {
            display: inline-block;
            padding: 3px 8px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
        }
        .upload-status-tag.not-uploaded {
            background: var(--border-light);
            color: var(--text-secondary);
        }
        .upload-status-tag.uploaded {
            background: #D1FAE5;
            color: #065F46;
        }
        /* Delivery Status Tags（样式与跟进状态一致：浅色底、小圆角、无边框） */
        .delivery-status-tag {
            display: inline-block;
            padding: 3px 8px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .delivery-status-tag.pending {
            background: #FEF3C7;
            color: #92400E;
        }
        
        .delivery-status-tag.delivered {
            background: #D1FAE5;
            color: #065F46;
        }
        
        /* Column widths */
        .col-name { min-width: 80px; }
        .col-phone { min-width: 110px; }
        .col-type { min-width: 100px; }
        .col-budget { min-width: 90px; }
        .col-date { min-width: 100px; }
        .col-delivery { min-width: 100px; }
        .col-status { min-width: 80px; }
        .col-follow { min-width: 80px; }
        .col-tag { min-width: 120px; }
        .col-action { min-width: 110px; }
        .col-style { min-width: 100px; }
        
        /* Responsive */
        @media (max-width: 1200px) {
            .col-style { display: none; }
        }
        
        @media (max-width: 768px) {
            .col-budget, .col-follow { display: none; }
        }
        
        /* Table cell text alignment */
        td { text-align: center; }
        td:first-child, th:first-child { text-align: center; }
        
        /* Sort links */
        .sort-link {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            margin-left: 4px;
        }
        
        .sort-link:hover {
            color: var(--primary-light);
        }
        
        /* Checkbox styling */
        input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }
        

/* ===== 大屏适配：>=1920px 放宽内容宽度，充分利用宽屏 ===== */
@media (min-width: 1920px) {
    .container { max-width: 2400px; }
}
@media (min-width: 2560px) {
    .container { max-width: 2560px; }
}


/* ===== 全局输入框 focus 统一样式（深蓝色边框） ===== */
body input[type="text"]:focus,
body input[type="number"]:focus,
body input[type="email"]:focus,
body input[type="password"]:focus,
body input[type="tel"]:focus,
body input[type="url"]:focus,
body input[type="date"]:focus,
body input[type="time"]:focus,
body input[type="datetime-local"]:focus,
body input:not([type]):focus,
body select:focus,
body textarea:focus {
    outline: none !important;
    border: 1px solid var(--primary) !important;
    
}


        /* 通用卡片样式 */
        .card {
            background: var(--bg-card);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-light);
            overflow: hidden;
            padding: 20px;
            margin-bottom: 20px;
        }

        .card-header {
            background: var(--bg-page);
            padding: 16px 20px;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border);
            margin: -20px -20px 20px -20px;
        }

        .card-body {
            padding: 0;
        }

        /* ===== 全局统一卡片样式（q-section） ===== */
        .q-section {
            background: #fff;
            border: 1px solid var(--border);
            border-radius: 12px;
            margin-bottom: 20px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        }

        .q-section-header {
            background: #fff;
            padding: 20px 20px 12px;
            border-bottom: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .q-section-title {
            font-weight: 600;
            font-size: 15px;
            color: #1E293B;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .q-item {
            padding: 0 20px 20px;
            border-bottom: none;
        }

        .q-item:last-child {
            border-bottom: none;
        }

        .q-item-row {
            display: flex;
            gap: 14px;
            align-items: flex-start;
            margin-bottom: 14px;
        }

        /* 通用内容头部样式 */
        .content-header {
            margin-bottom: 16px;
        }

        .content-header h2 {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 6px;
        }

        .content-header p {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
            line-height: 1.5;
        }

        /* ===== 全局字段错误提示样式（红色边框+下方错误提示） ===== */
        .global-input-error {
            border: 1px solid #dc2626 !important;
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
        }
        .global-input-error:focus {
            border: 1px solid #dc2626 !important;
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
        }
        .global-field-error {
            display: none;
            color: #dc2626;
            font-size: 12.5px;
            margin-top: 6px;
            padding-left: 2px;
            line-height: 1.4;
            animation: globalFadeInDown 0.2s ease;
        }
        .global-field-error.show { display: block; }
        .global-field-error::before {
            content: '!';
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #dc2626;
            color: #fff;
            font-size: 10px;
            font-weight: bold;
            margin-right: 5px;
            vertical-align: middle;
            line-height: 1;
        }
        @keyframes globalFadeInDown {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ============================================================
           全局组件统一规范（2026-10-21）
           ============================================================ */

        /* ===== 1. 全局确认弹窗（z-index最高，确保在顶层） ===== */
        .global-confirm-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.4);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 999998;
        }
        .global-confirm-overlay.show { display: flex; }
        .global-confirm-box {
            background: #fff;
            border-radius: 12px;
            padding: 24px 28px;
            min-width: 420px;
            max-width: 90vw;
            width: auto;
            box-shadow: 0 16px 48px rgba(0,0,0,0.18);
            text-align: center;
            animation: boxPop 0.18s ease;
        }
        .global-confirm-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 16px;
            white-space: nowrap;
        }
        .global-confirm-message {
            font-size: 14px;
            color: #4B5563;
            line-height: 1.6;
            margin-bottom: 20px;
            white-space: nowrap;
            max-width: 700px;
        }
        .global-confirm-buttons {
            display: flex;
            gap: 20px;
            justify-content: center;
        }

        @keyframes boxPop {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        /* ===== 2. 按钮尺寸规范（sm/md/lg） ===== */
        .btn-outline {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 16px;
            font-size: 14px;
            line-height: 1.4;
            border-radius: 6px;
            border: 1px solid #D1D5DB;
            background: #fff;
            color: var(--text-body);
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
            box-sizing: border-box;
            text-decoration: none;   /* 按钮不该有下划线：<a class="btn-outline"> 会继承浏览器默认链接下划线 */
        }
        .btn-outline:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: #fff;
        }
        .btn-outline.btn-sm {
            height: 30px;
            padding: 4px 10px;
            font-size: 13px;
        }
        .btn-outline.btn-md {
            height: 34px;
            padding: 6px 12px;
            font-size: 13px;
        }
        .btn-outline.btn-lg {
            height: 40px;
            padding: 10px 20px;
            font-size: 14px;
        }
        .btn-outline.btn-danger-outline {
            border-color: var(--danger);
            color: var(--danger);
            background: #fff;
        }
        .btn-outline.btn-danger-outline:hover {
            background: var(--danger);
            color: #fff;
            border-color: var(--danger);
        }
        /* 主按钮：原来各页手写 background:var(--primary) / 渐变，统一到这里。
           用法：<button class="btn-primary btn-md">保存</button> */
        .btn-primary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 16px;
            font-size: 14px;
            line-height: 1.4;
            border-radius: 6px;
            border: 1px solid var(--primary);
            background: var(--primary);
            color: #fff;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
            box-sizing: border-box;
            text-decoration: none;
        }
        .btn-primary:hover {
            background: var(--primary-light);
            border-color: var(--primary-light);
            color: #fff;
        }
        .btn-primary:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        .btn-primary.btn-sm { height: 30px; padding: 4px 10px; font-size: 13px; }
        .btn-primary.btn-md { height: 34px; padding: 6px 12px; font-size: 13px; }
        .btn-primary.btn-lg { height: 40px; padding: 10px 20px; font-size: 14px; }
        /* 危险主按钮（删除确认框的「确定」） */
        .btn-primary.btn-danger {
            background: var(--danger);
            border-color: var(--danger);
        }
        .btn-primary.btn-danger:hover {
            background: #B91C1C;
            border-color: #B91C1C;
        }

        /* 深色底上的反色按钮（图片查看器、预览遮罩）
           原来 5 个按钮各写一遍 rgba(255,255,255,.15) + rgba(255,255,255,.3) */
        .btn-ghost-light {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 14px;
            font-size: 14px;
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.15);
            color: #fff;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .btn-ghost-light:hover {
            background: rgba(255, 255, 255, 0.28);
            border-color: rgba(255, 255, 255, 0.5);
        }

        /* 富文本工具栏按钮（公告编辑器的 RTE 工具栏原来 30 个按钮各写内联样式 + onmouseover） */
        .rte-tool-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            min-width: 26px;
            height: 26px;
            padding: 4px 6px;
            border: none;
            border-radius: 4px;
            background: none;
            color: var(--text-body);
            font-size: 13px;
            line-height: 1;
            cursor: pointer;
            transition: background 0.12s ease, color 0.12s ease;
        }
        .rte-tool-btn:hover {
            background: var(--bg-page);
            color: var(--primary);
        }
        .rte-tool-btn.is-active {
            background: var(--border-light);
            color: var(--primary);
        }

        /* 隐藏滚动条但保留滚动能力：统一写法，替换各页面散落的 40+ 条规则 */
        .no-scrollbar {
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        .no-scrollbar::-webkit-scrollbar {
            width: 0;
            height: 0;
        }

        /* ===== 3. 卡片样式 ===== */
        .global-card {
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
            border: 1px solid var(--border-2);
            transition: all 0.2s ease;
            overflow: hidden;
        }
        .global-card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
            transform: translateY(-2px);
        }
        .global-card-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-2);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .global-card-title {
            font-size: 15px;
            font-weight: 600;
            color: #111827;
            margin: 0;
        }
        .global-card-body {
            padding: 20px;
        }

        /* ===== 4. 列表项样式 ===== */
        .global-list-item {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-2);
            cursor: pointer;
            transition: all 0.15s ease;
            position: relative;
        }
        .global-list-item:hover {
            background: var(--bg-page);
        }
        .global-list-item.active {
            background: #F0F4F8;
            box-shadow: inset 3px 0 0 var(--primary);
        }
        .global-list-item:last-child {
            border-bottom: none;
        }

        /* ===== 5. 空状态样式 ===== */
        .global-empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 24px;
            color: var(--text-hint);
            text-align: center;
        }
        .global-empty-icon {
            width: 48px;
            height: 48px;
            margin-bottom: 16px;
            opacity: 0.5;
        }
        .global-empty-text {
            font-size: 14px;
            line-height: 1.6;
        }

        /* ===== 6. Toast消息提示（z-index最高，确保在顶层） ===== */
        .global-toast-container {
            position: fixed;
            top: 90px;
            right: 24px;
            z-index: 999999;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 8px;
            pointer-events: none;
            max-width: calc(100vw - 48px);
        }
        .global-toast {
            background: var(--bg-card);
            border-radius: 8px;
            padding: 12px 18px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 200px;
            /* 加宽：长提示（如“开启邮件通知前请先填写：……”）尽量一行显示完 */
            max-width: min(720px, calc(100vw - 48px));
            font-size: 14px;
            line-height: 1.5;
            color: var(--text-body);
            animation: toastSlideIn 0.3s ease;
            pointer-events: auto;
            border: 1px solid var(--border-2);
        }
        .global-toast-msg {
            word-break: break-word;
        }
        .global-toast.success { border-left: 3px solid var(--success); }
        .global-toast.error { border-left: 3px solid var(--danger); }
        .global-toast.warning { border-left: 3px solid var(--warning); }
        .global-toast-icon {
            flex-shrink: 0;
            font-weight: bold;
        }
        .global-toast.success .global-toast-icon { color: var(--success); }
        .global-toast.error .global-toast-icon { color: var(--danger); }
        .global-toast.warning .global-toast-icon { color: var(--warning); }

        @keyframes toastSlideIn {
            from { opacity: 0; transform: translateX(20px); }
            to { opacity: 1; transform: translateX(0); }
        }

        /* ===== Toast 容器：原来 10 个页面各自复制一份（含 material.html 同文件重复两行），
           统一到这里。detail.html 是不加载 admin.css 的独立客户端页面，仍保留自带样式。 ===== */
        #toastModal.modal-overlay {
            background: transparent !important;
            pointer-events: none !important;
            align-items: flex-start !important;
            justify-content: flex-end !important;
            padding: 90px 24px 0 0 !important;
        }
        #toastModal .toast {
            position: relative !important;
            top: auto !important;
            right: auto !important;
            left: auto !important;
            transform: none !important;
            margin: 0 !important;
            border-radius: var(--radius, 6px) !important;
            padding: 10px 16px !important;
            min-height: 40px !important;
            height: auto !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
            border: none !important;
            background: var(--bg-card) !important;
            min-width: auto !important;
            max-width: 360px !important;
            text-align: left !important;
            display: flex !important;
            align-items: center !important;
            justify-content: flex-start !important;
            pointer-events: auto !important;
            animation: toastSlideIn 0.3s ease !important;
            font-size: 14px !important;
            line-height: 1.5 !important;
            color: rgba(0, 0, 0, 0.85) !important;
            box-sizing: border-box !important;
        }
        #toastModal .toast-check {
            flex-shrink: 0;
            font-weight: bold;
            line-height: 1.5;
        }
        #toastModal .toast-icon {
            display: none !important;
        }
        #toastModal .toast-message {
            margin: 0 !important;
            line-height: 1.5 !important;
            white-space: normal !important;
            word-break: break-word !important;
            overflow-wrap: anywhere !important;
            flex: 1;
        }

        /* ===== 7. 搜索栏/筛选栏 ===== */
        .global-search-bar {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .global-search-input {
            flex: 1;
            height: 34px;
            padding: 0 12px;
            border: 1px solid #D1D5DB;
            border-radius: 6px;
            font-size: 13px;
            outline: none;
            transition: border-color 0.15s ease;
            box-sizing: border-box;
            min-width: 0;
        }
        .global-search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
        }

        /* ===== 8. 标签/徽章 ===== */
        .global-badge {
            display: inline-flex;
            align-items: center;
            padding: 2px 8px;
            font-size: 12px;
            font-weight: 500;
            border-radius: 4px;
            line-height: 1.5;
        }
        .global-badge.primary {
            background: #EFF6FF;
            color: #1E40AF;
        }
        .global-badge.success {
            background: #F0FDF4;
            color: #166534;
        }
        .global-badge.danger {
            background: #FEF2F2;
            color: #991B1B;
        }
        .global-badge.warning {
            background: #FFFBEB;
            color: #92400E;
        }
        .global-badge.gray {
            background: #F3F4F6;
            color: #4B5563;
        }

        /* ===== 9. 表单标签与输入框 ===== */
        .global-form-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-body);
            margin-bottom: 6px;
        }
        .global-form-label .required {
            color: var(--danger);
            margin-left: 2px;
        }
        .global-form-group {
            margin-bottom: 14px;
        }
        .global-form-row {
            display: flex;
            gap: 12px;
            margin-bottom: 14px;
        }
        .global-form-row > * {
            flex: 1;
            min-width: 0;
        }

        /* ===== 表单输入框 ===== */
        .global-input {
            width: 100%;
            height: 34px;
            padding: 0 12px;
            border: 1px solid #D1D5DB;
            border-radius: 6px;
            font-size: 13px;
            outline: none;
            transition: border-color 0.15s ease;
            box-sizing: border-box;
        }
        .global-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
        }
        .global-textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #D1D5DB;
            border-radius: 6px;
            font-size: 13px;
            outline: none;
            transition: border-color 0.15s ease;
            box-sizing: border-box;
            resize: vertical;
            min-height: 80px;
            line-height: 1.6;
        }
        .global-textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
        }

        /* ===== 10. 分页组件 ===== */
        .global-pagination {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 0;
            font-size: 13px;
            color: var(--text-secondary-2);
        }
        .global-pagination-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .global-pagination-controls {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .global-pagination-btn {
            min-width: 32px;
            height: 32px;
            padding: 0 8px;
            border: 1px solid #D1D5DB;
            border-radius: 6px;
            background: #fff;
            color: var(--text-body);
            font-size: 13px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s ease;
        }
        .global-pagination-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        .global-pagination-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }
        .global-pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* ===== 11. 表格样式 ===== */
        .global-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .global-table th {
            background: #F9FAFB;
            padding: 10px 16px;
            text-align: left;
            font-weight: 600;
            color: var(--text-body);
            border-bottom: 1px solid var(--border-2);
            white-space: nowrap;
        }
        .global-table td {
            padding: 10px 16px;
            border-bottom: 1px solid #F3F4F6;
            color: #4B5563;
        }
        .global-table tbody tr:hover {
            background: var(--bg-page);
        }

        /* ===== 12. Section区块标题 ===== */
        .global-section-title {
            font-size: 15px;
            font-weight: 600;
            color: #111827;
            margin: 0 0 12px 0;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border-2);
        }

        /* ===== 13. 复选框/单选框 ===== */
        .global-checkbox {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: var(--primary);
        }
        .global-radio {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        /* ===== 14. 下拉选择框 ===== */
        .global-select {
            width: 100%;
            height: 34px;
            padding: 0 10px;
            border: 1px solid #D1D5DB;
            border-radius: 6px;
            font-size: 13px;
            outline: none;
            background: #fff;
            cursor: pointer;
            box-sizing: border-box;
        }
        .global-select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
        }

        /* ===== 15. 侧边栏布局 ===== */
        .global-sidebar {
            width: 240px;
            background: #fff;
            border-right: 1px solid var(--border-2);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
        }
        .global-sidebar-item {
            padding: 10px 16px;
            cursor: pointer;
            color: #4B5563;
            font-size: 14px;
            transition: all 0.15s ease;
            border-left: 3px solid transparent;
        }
        .global-sidebar-item:hover {
            background: var(--bg-page);
            color: var(--primary);
        }
        .global-sidebar-item.active {
            background: #F0F4F8;
            color: var(--primary);
            border-left-color: var(--primary);
            font-weight: 500;
        }

        /* ===== 16. 开关组件 Switch ===== */
        .global-switch {
            position: relative;
            display: inline-block;
            width: 38px;
            height: 20px;
            flex-shrink: 0;
        }
        .global-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .global-switch .slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: var(--border-strong);
            border-radius: 20px;
            transition: 0.2s;
        }
        .global-switch .slider:before {
            content: "";
            position: absolute;
            height: 16px;
            width: 16px;
            left: 2px;
            bottom: 2px;
            background: #fff;
            border-radius: 50%;
            transition: 0.2s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }
        .global-switch input:checked + .slider {
            background: var(--primary);
        }
        .global-switch input:checked + .slider:before {
            transform: translateX(18px);
        }

        /* ===== 17. 警告提示 Alert ===== */
        .global-alert {
            padding: 10px 14px;
            border-radius: 6px;
            font-size: 13px;
            line-height: 1.5;
            display: flex;
            align-items: flex-start;
            gap: 8px;
            box-sizing: border-box;
        }
        .global-alert.success {
            background: #F0FDF4;
            color: #166534;
            border: 1px solid #BBF7D0;
        }
        .global-alert.error {
            background: #FEF2F2;
            color: #991B1B;
            border: 1px solid #FECACA;
        }
        .global-alert.warning {
            background: #FFFBEB;
            color: #92400E;
            border: 1px solid #FDE68A;
        }
        .global-alert.info {
            background: #F0F4F8;
            color: var(--primary);
            border: 1px solid #C7D2E0;
        }
        .global-alert-icon {
            flex-shrink: 0;
            font-weight: bold;
        }

        /* ===== 18. 加载状态 Loading ===== */
        .global-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            color: var(--text-secondary-2);
            font-size: 13px;
            gap: 12px;
        }
        .global-spinner {
            width: 28px;
            height: 28px;
            border: 3px solid var(--border-2);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: globalSpin 0.8s linear infinite;
        }
        @keyframes globalSpin {
            to { transform: rotate(360deg); }
        }

        /* ===== 19. 标签页 Tabs ===== */
        .global-tabs {
            display: flex;
            border-bottom: 1px solid var(--border-2);
            gap: 4px;
        }
        .global-tab {
            padding: 8px 16px;
            cursor: pointer;
            font-size: 13px;
            color: var(--text-secondary-2);
            border: none;
            background: transparent;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            transition: all 0.15s ease;
        }
        .global-tab:hover {
            color: var(--primary);
        }
        .global-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
            font-weight: 500;
        }

        /* ===== 20. 进度条 Progress ===== */
        .global-progress {
            width: 100%;
            height: 6px;
            background: var(--border-2);
            border-radius: 3px;
            overflow: hidden;
        }
        .global-progress-bar {
            height: 100%;
            background: var(--primary);
            border-radius: 3px;
            transition: width 0.3s ease;
        }
        .global-progress-bar.success { background: var(--success); }
        .global-progress-bar.warning { background: var(--warning); }
        .global-progress-bar.danger { background: #EF4444; }

        /* ===== 21. 文件上传区域 Upload Zone ===== */
        .global-upload-zone {
            border: 2px dashed #D1D5DB;
            border-radius: 10px;
            padding: 32px 20px;
            text-align: center;
            color: var(--text-secondary-2);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            background: #FBFCFE;
            box-sizing: border-box;
        }
        .global-upload-zone:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: #F0F4F8;
        }
        .global-upload-zone.dragover {
            border-color: var(--primary);
            background: #F0F4F8;
        }

        /* ===== 22. 弹窗关闭按钮 Modal Close ===== */
        .global-modal-close {
            position: absolute;
            top: 14px;
            right: 18px;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--text-hint);
            font-size: 22px;
            line-height: 1;
            font-weight: 400;
            user-select: none;
            border: none;
            background: transparent;
            border-radius: 6px;
            transition: all 0.15s ease;
            padding: 0;
        }
        .global-modal-close:hover {
            color: var(--primary);
            /* 去掉灰色圆底：关闭按钮悬停只做颜色反馈 */
        }

/* ===== 统一数据表格 =====
   项目里 14 个表格各写一套样式，其中 9 个连基础类都没有（表头无背景、宽度不撑满）。
   统一到 .data-table；已有内联 style 的单元格优先级更高，不会被这里覆盖。 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-body);
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-2);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--row-hover);
}

/* ===== 全局列表（global_list 组件）：列宽自适应 =====
   不写死列宽、也不用 table-layout:fixed（那是「平均切」而不是「按内容摊」）。
   现在：各列按内容自适应，浏览器再把剩余宽度横向摊平——
   手机号/邮箱这类长内容列自然宽一点，ID/状态这类短列不会白占地方。
   作用于所有用 global_list 组件的列表页：订单 / 交付 / 客户池 / 归档、公告、日志、回收站、分享、用户。 */
.table-container .data-table {
    table-layout: auto;
    width: 100%;
}
.table-container .data-table th,
.table-container .data-table td {
    padding: 10px 8px;
    font-size: 12.5px;
    overflow-wrap: anywhere;   /* 超长内容在列内折行，不撑破表格 */
}
/* 模板里各列写死的 80/90/160/96/100px 是参差不齐的根源，这里统一清掉交给浏览器自适应 */
#orderList th,
#orderList td {
    width: auto !important;
}

/* ===== 通用工具类（收编高频内联样式）=====
   这些样式在模板里各写了几十遍（最多的写了 47 次），改一次要翻遍所有页面。
   这里只做「与内联完全等价」的收编，替换后视觉零变化。
   用 !important 是为了保持原本内联 style 的优先级 —— 改成普通类后会被页面上的其他类覆盖。 */
.u-label { font-size: 12px !important; color: var(--text-body) !important; display: block !important; margin-bottom: 6px !important; }
.u-label-strong { display: block !important; font-size: 13px !important; font-weight: 600 !important; color: var(--text-body) !important; margin-bottom: 6px !important; }
.u-card-title { font-size: 13px !important; font-weight: 600 !important; color: #000000 !important; margin-bottom: 6px !important; display: flex !important; align-items: center !important; gap: 6px !important; }
.u-subtitle { font-weight: 500 !important; color: #666 !important; margin-bottom: 2px !important; }
.u-input { width: 100% !important; padding: 8px 10px !important; border: 1px solid var(--border) !important; border-radius: 6px !important; font-size: 14px !important; }
.u-input-soft { padding: 10px 12px !important; border: 1px solid #DDE3EC !important; border-radius: 8px !important; font-size: 13px !important; color: #000000 !important; background: var(--bg-page) !important; }
.u-chip { cursor: pointer !important; padding: 3px 10px !important; background: #EEF2FF !important; color: #4F46E5 !important; border-radius: 12px !important; font-size: 12px !important; user-select: none !important; }
.u-btn-flex { flex: 1 !important; justify-content: center !important; }
.u-row-gap { display: flex !important; gap: 10px !important; margin-top: 10px !important; }
.u-divider-dashed { border-top: 1px dashed var(--border-2) !important; margin: 16px 0 !important; }
.u-text-muted { font-size: 12px !important; color: var(--text-muted) !important; }
.u-text-muted-2 { font-size: 12px !important; color: var(--text-secondary-2) !important; }
/* 历史页脚类名，仅为兼容保留：真正的页脚统一由 templates/_site_footer.html 输出。
   这里不能再带 margin-top，否则任何残留使用该类的页面页脚都会被顶开、
   沉不到视口底部（备案看起来「飘在页面中间」的元凶之一）。 */
.u-footer-text { text-align: center !important; padding: 18px 16px !important; color: #94A3B8 !important; font-size: 12px !important; line-height: 1.9 !important; }
