/* ============ 基础样式 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #007bff;
    --primary-hover: #0056b3;
    --danger: #dc3545;
    --danger-hover: #c82333;
    --success: #28a745;
    --warning: #ffc107;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ 整体布局 - 左侧边栏 + 右侧内容 ============ */
.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

#contentContainer {
    height: 100%;
    position: relative;
    z-index: 200;
}

.nav-item {
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-left-color: white;
    font-weight: 600;
}

.nav-item .icon {
    font-size: 1.1rem;
}

/* B14：侧边栏未送达角标（「我的通知」用；有告警判定命中时脉动提醒） */
.nav-item .nav-badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 10px;
    background: #d93025;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}

.nav-item .nav-badge.nav-badge-warn {
    animation: navBadgePulse 1.6s ease-in-out infinite;
}

@keyframes navBadgePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

.nav-item .text {
    font-size: 0.9rem;
}

/* B13：采集账号用量趋势迷你柱（近 7 天，最后一根是今天） */
.trend-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    vertical-align: middle;
}

.trend-bars i {
    display: block;
    width: 4px;
    min-height: 2px;
    background: #93c5fd;
    border-radius: 1px;
}

.trend-bars i.today {
    background: #2563eb;
}

/* E2：窄屏隐藏次要列。
   用法：同一列的 <th> 与行内 <td> 都要加同一个 class（只加表头会错位）。
   col-hide-md = 次要列（销量/下次采集/上次…），col-hide-sm = 再次一级。 */
@media (max-width: 1400px) {
    .col-hide-md { display: none !important; }
}

@media (max-width: 1150px) {
    .col-hide-sm { display: none !important; }
}

/* 菜单分区（section标签形式） */
.nav-section {
    margin: 6px 10px 2px;
    padding: 6px 10px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
}

/* 父级分类菜单 */
.nav-category {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px 10px 16px;
    font-size: 0.82rem;
    opacity: 0.75;
    border-radius: 6px;
    margin: 2px 8px;
    transition: all 0.2s;
}

.nav-category:hover {
    opacity: 1;
    background: rgba(255,255,255,0.08);
}

.nav-category .icon {
    font-size: 0.95rem;
}

.nav-category .text {
    flex: 1;
    font-size: 0.82rem;
}

.nav-category .submenu-arrow {
    font-size: 0.55rem;
    opacity: 0.6;
}

.nav-category.open {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

/* 子菜单 */
.nav-submenu {
    display: none;
    margin: 0 8px 4px;
    padding: 4px 0;
    background: rgba(0,0,0,0.12);
    border-radius: 0 0 8px 8px;
}

.nav-submenu.open {
    display: block;
}

.nav-submenu .nav-item.sub {
    padding: 8px 14px 8px 20px;
    font-size: 0.82rem;
    border-radius: 6px;
    margin: 1px 4px;
    gap: 10px;
}

.nav-submenu .nav-item.sub .icon {
    font-size: 0.9rem;
}

.nav-submenu .nav-item.sub:hover {
    background: rgba(255,255,255,0.1);
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: background 0.15s;
    text-align: left;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item svg {
    opacity: 0.6;
}

.dropdown-item:hover svg {
    opacity: 1;
}

/* ============ 卡片 ============ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin-bottom: 20px;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 允许换行：说明文字要能整行掉到第二行（见下面的 :is(...) 规则） */
    flex-wrap: wrap;
    padding-bottom: 10px;
    font-size: 1.1rem;
}

/* ---------- 卡片标题行：「标题 + 数量」一行，「说明」另起一行 ----------
 *
 * 2026-09-29 用户报的通用问题："很多页面数量跑到中间去了"。
 * 根因：`.card h3` 是 `justify-content: space-between`，一旦有人往 h3 里再塞一句说明，
 * 子元素变成"标题 / 数量 / 说明"三个 —— space-between 就把**中间那个（数量）**摆在正中间。
 * 当时统计：37 个 h3 里带计数，其中 11 个已经踩了这个坑（10 个用 `<small>` 写说明、
 * 1 个用 `<span class="text-muted">`）。
 *
 * 修法（选了"让它成为默认行为"而不是逐页挪文字，否则新页面还会再犯）：
 *   · 说明元素占满整行 → 自动折到第二行，标题行就只剩"标题 + 数量"两个，
 *     space-between 自然把数量送回**最右**；
 *   · 长说明在标题行本来也舒展不开，这一改顺带解决"提示字很多"。
 * 选择器判据：`small` 或"没有 id 的 .text-muted"——计数 span 一律带 id（`xxxCount`），
 * 所以不会误伤数量本身。
 */
.card h3 > small,
.card h3 > span.text-muted:not([id]) {
    flex-basis: 100%;
    margin-top: 2px;
}
/* 标题行里原先靠 `float:right` 摆到右边的控件（如「账单与钱包」「套餐档位」页的月份选择器/按钮）。
 * ⚠️ float 对 flex 子元素是**无效**的，那两页本来就没真靠右；改用 auto margin 才是 flex 里的做法。 */
.card h3 > [style*="float:right"] {
    margin-left: auto;
}
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-header-row h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.1rem;
}

/* ============ 表单 ============ */
.form {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

/* ⚠️ `.form-row`（字段行）定义在文件后半部分的「表单字段行」那一段 —— 2026-10-09 起是
   `grid-template-columns: 110px minmax(0, 1fr)` 的**两列网格**（label 槽 + 控件列），
   提示条落在控件列。这里原来那份 flex 版已删除（两版并存时后人会照着旧的改，白改）。 */

.form-group {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-wrap: wrap;          /* 让 .form-hint 自动换到下一行 */
    align-items: center;
    gap: 12px;
}

/* 老写法：`<small class="text-muted">` 直接放在字段行里当提示用（2026-10-09 之前很多页这么写）。
   2026-10-09 起口径与 `.form-hint` 统一：**独占整行、与字段行左缘对齐** ——
   之前它是普通 flex item，空间够就贴在控件右边（实测 data-products 那行就贴在 x=779），
   看着像"提示挤在控件旁边"。新代码请直接写 `.form-hint`。 */
.form-group > small.text-muted,
.form-group > small.form-hint,
.form-row > small.text-muted {
    flex-basis: 100%;
    grid-column: 1 / -1;
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.5;
}

/* 表单提示文字：**独占整行**（flex-basis:100% 让它在 flex 容器里换到下一行）。
   2026-10-09：去掉了 `margin-left: 112px` —— 那个数字假定了"label 槽宽 100px"，
   可各页 label 槽并不一样宽（有的 180px），于是有的页提示跟控件对齐、有的页错位；
   统一成"从字段行左缘铺到右缘"，与 `.form-row` 里那条同一口径。 */
.form-group .form-hint {
    flex-basis: 100%;
    width: auto;
    align-self: stretch;
    margin-left: 0;
    margin-top: 6px;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    line-height: 1.5;
}

/* 表单提示条视觉变体：info / warning / error。
   可与 .form-hint 配合用于控件下方，也可单独用于区块级提示。 */
.form-hint-info,
.form-group .form-hint.form-hint-info,
.form-hint-warning,
.form-group .form-hint.form-hint-warning,
.form-hint-error,
.form-group .form-hint.form-hint-error {
    padding: 8px 12px;
    border: 1px solid;
    border-radius: var(--radius);
}

.form-hint-info,
.form-group .form-hint.form-hint-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}
.form-hint-info strong,
.form-group .form-hint.form-hint-info strong { color: #1e3a8a; }

.form-hint-warning,
.form-group .form-hint.form-hint-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}
.form-hint-warning strong,
.form-group .form-hint.form-hint-warning strong { color: #7c2d12; }

.form-hint-error,
.form-group .form-hint.form-hint-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.form-hint-error strong,
.form-group .form-hint.form-hint-error strong { color: #7f1d1d; }

/* ---- 表单提示 → label 的 hover 气泡（2026-11-08） ----
   由 common.js 自动把 `.form-hint` 搬进同组 label 的 `.tip-pop`，页面不用手写。
   为什么要全局：以前每个字段下面挂一行小字，字段一多表单就被说明撑长；现在说明只在
   鼠标移到左侧 label 时弹出（键盘 Tab 到 label 也能弹）。 */
.label-tip {
    position: relative;
    display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px;
    cursor: help;
}
/* label 槽是定宽右对齐的（`.form-group > label:first-child`），所以文字+i 保持右对齐，
   别让这一行的标签跳到左边。 */
.label-tip .tip-i {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; flex-shrink: 0;
    background: #e0f2fe; color: #0284c7;
    border-radius: 50%; font-size: 10px; font-weight: 700; font-style: normal;
    line-height: 1;
}
.label-tip .tip-pop {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0;
    z-index: 80;
    width: 340px; max-width: min(340px, 56vw); max-height: 42vh; overflow-y: auto;
    padding: 8px 10px;
    background: #1f2937; color: #fff;
    font-size: 12px; font-weight: 400; line-height: 1.65;
    text-align: left;                 /* label 是右对齐的，气泡文字必须左起 */
    white-space: normal; word-break: break-word;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.label-tip .tip-pop strong { color: #fff; }
.label-tip .tip-pop a { color: #93c5fd; }
/* 提示为空（动态提示还没填）时，"i" 和气泡都别出现 */
.label-tip.tip-empty .tip-i { display: none; }
.label-tip.tip-empty .tip-pop { display: none !important; }
.label-tip:hover .tip-pop,
.label-tip:focus-within .tip-pop,
.label-tip.open .tip-pop { display: block; }
/* 搬进气泡里的 `.form-hint` 要脱掉"字段下方提示"的排版和外框（info/warning/error 底色） */
.label-tip .tip-pop .form-hint,
.label-tip .tip-pop .form-hint-info,
.label-tip .tip-pop .form-hint-warning,
.label-tip .tip-pop .form-hint-error {
    display: block;
    flex-basis: auto; width: auto; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent;
    color: inherit; font-size: 12px; line-height: 1.65;
}
.label-tip .tip-pop .form-hint + .form-hint { margin-top: 6px; }

/* 字段行左侧的**定宽 label 槽**（右对齐）。
   ⚠️ 2026-10-09：选择器从 `.form-group label`（**所有** label）收窄成 `.form-group > label:first-child`
   —— 原来"选项行"（`<label class="check-inline"><input type=checkbox> 文案</label>`、
   多选下拉里的 `.ms-item` 等**也是 label**）会被连带命中，压成 100px、文字全挤成好几行
   （用户 2026-10-09 报的"「参与采集与转链」换行了"就是这个；多选下拉那边早先也踩过、
   当时只能在 `.ms .ms-item` 上打补丁 —— 现在根因修掉，那个补丁留着也无害）。 */
.form-group > label:first-child {
    flex-shrink: 0;
    width: 100px;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.form-group input,
.form-group select,
.form-group textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
    resize: vertical;
    min-height: 60px;
}

.checkbox-group {
    min-width: auto;
    flex: 0;
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* ============================================================
   开关组件 (toggle switch)
   用法:
     <label class="switch">
       <input type="checkbox" id="x">
       <span class="switch-slider"></span>
       <span class="switch-label">显示文案</span>
     </label>
   表单中建议配合 .form-hint 在开关下方显示说明文字
   ============================================================ */
.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.switch input[type="checkbox"] {
    /* 真正控件不显示,只承载状态 */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.switch-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background-color .2s ease;
    flex-shrink: 0;
}
.switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    transition: transform .2s ease;
}
.switch input:checked + .switch-slider {
    background: var(--primary, #3b82f6);
}
.switch input:checked + .switch-slider::after {
    transform: translateX(18px);
}
.switch input:focus-visible + .switch-slider {
    box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
.switch input:disabled + .switch-slider {
    opacity: .45;
    cursor: not-allowed;
}
.switch-label {
    font-size: 14px;
    color: var(--text-primary, #111827);
}

/* 紧凑型行内开关:用于筛选栏 / 表格内 / binding 行 */
.switch.switch-sm .switch-slider {
    width: 32px;
    height: 18px;
}
.switch.switch-sm .switch-slider::after {
    width: 14px;
    height: 14px;
    top: 2px;
    left: 2px;
}
.switch.switch-sm input:checked + .switch-slider::after {
    transform: translateX(14px);
}
.switch.switch-sm .switch-label {
    font-size: 13px;
}

/* 表单字段行里的开关：与输入框保持同高，避免一行高一行矮（2026-11-05） */
.form-group > .switch,
.form-row > .switch {
    min-height: 37px;
}

/* ============ 按钮 ============ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}

.btn:hover::after {
    background: rgba(255,255,255,0.1);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
}

.btn-success:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
    transform: translateY(-1px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 按钮图标 */
.btn .btn-icon {
    margin-right: 6px;
}

/* ============ 列表 ============ */
.list {
    margin-top: 15px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: background 0.2s;
}

.list-item:hover {
    background: #e9ecef;
}

.list-item .info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.list-item .info strong {
    color: var(--text);
}

.list-item .info span {
    color: var(--text-muted);
    font-size: 13px;
}

.list-item .actions {
    display: flex;
    gap: 8px;
}

/* ============ 内嵌标签页 ============ */
.tab-nav-inner {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn-inner {
    padding: 8px 18px;
    background: #e9ecef;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.tab-btn-inner:hover {
    background: #dee2e6;
}

.tab-btn-inner.active {
    background: var(--primary);
    color: white;
}

/* ============ 图表容器 ============ */
.chart-container {
    margin-top: 15px;
    overflow-x: auto;
}

.chart-container table {
    width: 100%;
    border-collapse: collapse;
}

.chart-container th,
.chart-container td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.chart-container th {
    background: #f8f9fa;
    font-weight: 600;
}

.chart-container tr:hover {
    background: #f8f9fa;
}

/* 防浏览器自动填充（2026-10-09）：搜索框初始 readonly、聚焦时由页面 onfocus 解开。
   为什么需要它：Chrome/Safari 对"它认为是登录用户名"的输入框会**忽略 autocomplete=off**，
   而且填充是异步发生的（在"载入即清空"之后才填）——只有 readonly 字段会被自动填充跳过。
   这里只把灰底改成白底，让它看起来跟普通输入框一样。 */
.filter-input[readonly] {
    background: #fff;
    cursor: text;
}

/* ============ 隐藏 ============ */
.hidden {
    display: none !important;
}

/* ============ Tab内容区 ============ */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============ Dashboard 统计卡片 ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-item[onclick]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ============ 空状态 ============ */
.empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: #f8f9fa;
    border-radius: var(--radius);
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    
}

@media (max-width: 768px) {
    /* 表单字段行：窄屏把 label 槽再收窄一点（不然控件只剩一半） */
    .form-row { grid-template-columns: 88px minmax(0, 1fr); }
    
    
    .nav-item {
        padding: 15px 10px;
        justify-content: center;
    }
    
    .nav-item .text {
        display: none;
    }
    
    .nav-item .icon {
        font-size: 1.3rem;
    }
    
    /* .form-row 的窄屏处理在文件后半「表单字段行」那段（grid 收窄 label 槽） */
    .form-group {
        min-width: 100%;
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .list-item .actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    
    .card {
        padding: 15px;
    }
}

/* ============ Tab系统 ============ */
.tab-bar {
    display: flex;
    gap: 2px;
    background: #e9ecef;
    padding: 8px 8px 0;
    overflow-x: auto;
    flex-shrink: 0;
}

/* ============ 通用样式 ============ */
.hidden {
    display: none !important;
}

.filter-card {
    padding: 12px 15px;
}

/* filter-card 顶部提示文字：布局由基类控制，配色由修饰类控制 */
.filter-tip {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: .85em;
}
.filter-tip--legend { color: var(--text-secondary, #6b7280); background: var(--bg-muted, #f5f5f5); } /* 状态图例/普通说明 */
.filter-tip--warn   { color: #856404; background: #fff3cd; } /* 提示（黄） */
.filter-tip--danger { color: #991b1b; background: #fee2e2; } /* 警告（红） */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
/* filter-bar 内的 form-group 保持行内布局 */
.filter-bar .form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.filter-bar .form-group label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

/* 表单内边距（直接放在 form 内的弹框） */
.notif-form {
    padding: 24px 28px;
}

/* 弹框内表单：统一间距，无需页面手动设 margin-bottom */
.modal-body .form-group {
    margin-bottom: 12px;
}
/* 只对"弹窗直接子元素"的最后一个字段去掉底边距：
   原写法是后代选择器，会连带命中各分区(如 .wechat-config-section)内部的最后一个字段，
   把它 12px 底边距清零，导致紧跟其后的字段(如新增的"归属")贴在一起。
   分区内部最后一个字段保留 12px，与其后的字段/页脚自然分开。 */
.modal-body > .form-group:last-child {
    margin-bottom: 0;
}
/* form-section 内用 margin-top 控制间距，避免与 margin-bottom 叠加 */
.modal-body .form-section > .form-group {
    margin-bottom: 0;
}
.modal-body .form-section > .form-group ~ .form-group {
    margin-top: 8px;
}

/* 弹框内表单控件样式，优先级高于下方 .form-group input */
.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}
.modal-body .form-group textarea { resize: vertical; }

.filter-input,
.filter-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 100px;
}

.filter-input {
    min-width: 150px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #007bff;
}

.filter-spacer {
    flex: 1;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.pool-tab {
    background: #fff;
    color: #6c757d;
    border: 1px solid #dce0e5;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.pool-tab:hover { background: #f8f9fa; }
.pool-tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.pool-tab span { opacity: 0.7; font-size: 12px; }

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* ============ 弹框样式 ============ */
/* ============ Tab 遮罩层 ============ */
/* tab-content 在 flex 布局下由 flex:1 + overflow:auto 撑满 */

.tab-mask {
    /* 同 `.drawer-mask`/`.confirm-mask`：面板自己滚，遮罩用 fixed + 打开时量面板可见矩形
       （app.js::openModal 调 common.js::_fitOverlayMask），否则滚过之后遮罩会上移。 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.tab-mask:not(.hidden) {
    visibility: visible;
    opacity: 1;
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    pointer-events: none;
}
.modal:not(.hidden) {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* 遮罩框（弹窗可用的那块区域）：左/上/右/下都来自 app 外壳的固定尺寸，**只在这里定义一次**。
   实测（1440×950 与 1280×800 两档一致）：侧边栏 220 + tab 内容区 padding 10 = 左 230；
   顶栏 50 + tab 标题栏 40 + padding 10 = 上 100；右 10；下 20。
   注意遮罩**下边不可靠**（`.layui-tab-item { min-height:100% }`，长页面里遮罩比视口还高），
   所以限高还要跟视口取交集 —— 门里那条不变量 F（弹窗 ⊆ 遮罩∩视口）就是兜这个的。 */
:root, .main-layout {
    --modal-frame-left: 230px;
    --modal-frame-top: 100px;
    --modal-frame-right: 10px;
    --modal-frame-bottom: 20px;
    /* ⚠️ 这几条**必须和 --modal-frame-left 声明在同一个规则里**：自定义属性继承的是"算好的值"，
       写在 `:root` 上的 `calc(...var(--modal-frame-left)...)` 会在 :root 处就把 230px 代进去，
       下面那些"只改 left"的覆盖（收起侧边栏 / 窄屏）就带不动宽度 —— 实测 560px 视口下
       弹窗宽度被算成 296px 而不是 456px（左边距 12 / 右边距 172，明显偏左）。*/
    --modal-frame-w: calc(100vw - var(--modal-frame-left) - var(--modal-frame-right));
    --modal-frame-h: calc(100vh - var(--modal-frame-top) - var(--modal-frame-bottom));
    --modal-frame-pad: 12px;      /* 弹窗与遮罩框边缘至少留的缝 */
    --modal-max-w: calc(var(--modal-frame-w) - 2 * var(--modal-frame-pad));
    --modal-max-h: calc(var(--modal-frame-h) - 2 * var(--modal-frame-pad));
}
/* 侧边栏收起（.hide-side）时内容区左边界变 20+10 —— 遮罩框跟着挪，否则弹窗会偏右 */
.main-layout.hide-side { --modal-frame-left: 30px; }
/* 窄屏（≤600px）侧边栏整个隐藏、内容区左边界 60+10 */
@media (max-width: 600px) {
    .main-layout { --modal-frame-left: 70px; }
}

.modal-content {
    position: fixed;
    /* 居中于**遮罩框**（不是视口）——否则弹窗会顶出遮罩上沿/压住 tab 标题栏 */
    top: calc(var(--modal-frame-top) + var(--modal-frame-h) / 2);
    left: calc(var(--modal-frame-left) + var(--modal-frame-w) / 2);
    transform: translate(-50%, -50%) scale(0.95);
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 720px;
    max-width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    z-index: 201;
}
.modal:not(.hidden) .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

/* ============ 弹窗尺寸三档（2026-10-12，用户："做一个表单大小的通用样式，按小/中/大定义宽高"）============
   页面**不再**各写 `style="max-width:520px"` 之类的直接尺寸 —— 改成挂档位类：
     · `.modal-sm`  480px 宽 / 遮罩可用高的 70%
     · `.modal-md`  720px 宽 / 85%   ← **常规档**（也是没挂类时的默认宽度）
     · `.modal-lg`  920px 宽 / 95%（字段多、值很长：采集配置 / 微信模板字段 / 联盟账号 / 监控规则…）

   ⚠️ 尺寸是 **min(档位值, 遮罩可用尺寸)** —— 2026-10-12 用户追加要求："除了定义表单的小/中/大
   自身宽高，还要**兼顾到表单所依托的遮罩的大小**"。原来弹窗是 `position:fixed` + `vh`（按**视口**
   算），而遮罩（`.modal`，只盖内容区）比视口小：实测 1440×950 下 88vh=836 的弹窗会**顶出遮罩上沿 43px**，
   压住 tab 标题栏。现在弹窗按"遮罩框"定位与限高，见下面 `--modal-frame-*`。

   ⚠️ 选择器**必须同时写 `.modal-scrollable .modal-content.modal-x`**：文件后面那条
   `.modal-scrollable .modal-content { max-height: 70vh }` 在后面、会按"谁在后面"压回去
   （`.modal-config` 早先就这么踩过一次，见它的注释）。同时写两个选择器 = 提权，跟顺序无关。 */
.modal-content.modal-sm,
.modal-scrollable .modal-content.modal-sm {
    width: min(480px, var(--modal-max-w));
    max-height: min(calc(var(--modal-frame-h) * 0.70), var(--modal-max-h));
}

.modal-content.modal-md,
.modal-scrollable .modal-content.modal-md {
    width: min(720px, var(--modal-max-w));
    max-height: min(calc(var(--modal-frame-h) * 0.85), var(--modal-max-h));
}

.modal-content.modal-lg,
.modal-scrollable .modal-content.modal-lg {
    width: min(920px, var(--modal-max-w));
    max-height: min(calc(var(--modal-frame-h) * 0.95), var(--modal-max-h));
}

/* 联盟账号 / 推广位（.modal-aff：账号弹窗 + 推广位弹窗）的字段排布：
   ① 标签列**固定宽度**（长标签也不折行）→ 所有输入框/下拉框的左边缘对齐，不会一行一个位置
   ② 输入框吃满剩余宽度；下拉框按内容自适应，不拉满整行（选项本来就没多长）
   ③ 字段下的小字提示对齐到输入框那一列的左边缘 */
.modal-aff .form-group > label:first-child {
    flex: 0 0 180px;
    width: 180px;
    max-width: none;
    white-space: normal;      /* 长标签允许折行（放一行太长，会把输入框挤短） */
    text-align: right;
    line-height: 1.5;
}

.modal-aff .form-group > input,
.modal-aff .form-group > textarea {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.modal-aff .form-group > select {
    flex: 0 0 auto;
    width: auto;
    min-width: 200px;
    max-width: 100%;
}

/* 字段下面的小字提示独占一行，左边缘与输入框对齐（180px 标签 + 12px 间距） */
.modal-aff .form-group > small {
    flex-basis: 100%;
    margin-top: 4px;
    padding-left: 192px;
}

/* 窄屏（弹窗已经只剩 92% 宽）：标签列收窄并允许折行，别把输入框挤没 */
@media (max-width: 820px) {
    .modal-aff .form-group > label:first-child {
        flex: 0 0 120px;
        width: 120px;
    }
    .modal-aff .form-group > small { padding-left: 132px; }
}

/* 采集配置弹窗（.modal-config，2026-09-28 用户："textarea 再大点、表单整体做大一点"）：
   ⚠️ 2026-10-12：**宽度改挂通用档位 `.modal-lg`**（页面 `modal-lg modal-config`），本类只留
   "控件比默认大一号"这类**样式**；高度仍是当初用户定的 680px 封顶（见下面那条）。
   这个弹窗的"商品"输入是**一整条商品/推广链接**（淘宝联盟后台的物料链接实测 657 字符），
   原来页面里还写死过 `style="max-width:560px"`，字段全挤在一起、链接看不全。做法：
   ① 弹窗比默认 720px 再宽一档，整体可用高度也放宽（默认 body 只有 50vh，六七个字段要滚来滚去）；
   ② 控件加高（padding/字号），提示文字行距放宽；
   ③ 商品输入给足高度并允许向下拖拽（`resize: vertical`）——链接再长也能一眼核对。
   作用域只在本类上，不影响其它弹窗（`.modal-aff` 那套照旧）。 */
/* 注意选择器要带上 .modal-content：`.modal-scrollable .modal-content`（文件后面那条）
   和它同权重，不加就得靠"谁在后面"决胜负，很容易被压回 70vh（改完实测踩到过）。 */
.modal-scrollable .modal-content.modal-config {
    /* 2026-09-28 用户："高度太高了，缩到 680px"——保留这个封顶（比当时默认的 90vh 矮），
       但**再跟遮罩框取小**（2026-10-12：所有弹窗都得装得进遮罩，矮视口下 680 会顶出去）。 */
    max-height: min(680px, var(--modal-max-h));
}

.modal-scrollable .modal-config .modal-body {
    /* 高度交给上面的封顶 + `.modal-scrollable .modal-body` 的 flex 模型
       （2026-10-12 去掉这里的 `max-height: 76vh`：它跟弹窗体自己的高度打架） */
    padding: 20px 24px;
}

.modal-config .modal-body .form-group {
    margin-bottom: 12px;
}

.modal-config .form-group > input,
.modal-config .form-group > select,
.modal-config .form-group > textarea {
    padding: 11px 14px;
    font-size: 14.5px;
}
/* 采集配置弹窗里的控件都比默认大一号，多选下拉的"壳"要跟着变大（与旁边 select 同高、同字号） */
.modal-config .form-group > .ms .ms-control {
    min-height: 46px;
    padding: 9px 36px 9px 14px;
    font-size: 14.5px;
}
.modal-config .form-group > .ms .ms-chip { font-size: 13px; }
.modal-config .form-group > .ms .ms-list { max-height: 260px; }   /* 能力多时多露几行 */

.modal-config .form-group > textarea {
    min-height: 240px;
    line-height: 1.65;
    resize: vertical;
    font-family: inherit;      /* 链接里可能混中文，等宽字体会挤 */
    word-break: break-all;     /* 长链接按字符换行，不撑破弹窗 */
}

.modal-config .form-group > small {
    font-size: 12.5px;
    line-height: 1.6;
}

/* 窄屏：回到单列，控件不再额外加高，给内容让位 */
@media (max-width: 820px) {
    .modal-config { width: 94%; }
    .modal-config .form-group > textarea { min-height: 140px; }
}

/* ============ 弹框表单样式 ============ */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 { margin: 0; font-size: 18px; color: #1a1a2e; font-weight: 600; }
.modal-close {
    font-size: 22px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    background: none;
    border: none;
}
.modal-close:hover { color: #ef4444; background: #fef2f2; }

.modal.align-items-start { align-items: center; }
.modal.align-items-start .modal-content { margin-bottom: 0; }

.modal-scrollable .modal-body {
    /* 2026-10-12：改成"填满弹窗体剩余高度"——弹窗体的高度已经由遮罩框算好了，body 再各写一个 vh
       数就会跟它打架（长内容被截、短内容留白）。`min-height:0` 是 flex 子项能收缩出滚动条的前提。 */
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 20px 24px;
}
.modal-scrollable .modal-content { max-height: 70vh; display: flex; flex-direction: column; }
.modal-scrollable .modal-header { position: sticky; top: 0; z-index: 1; background: #fff; }
.modal-scrollable .modal-footer { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #f0f0f0; }

.modal-body { padding: 24px 28px; }

.form-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* 字段行（2026-10-09 重做，用户："账号表单布局有点乱"）：
   左边一列是**定宽的 label 槽**（右对齐），右边是控件（自适应）；提示条**独占整行**、
   左缘与控件对齐、右缘与控件右缘对齐 —— 于是"从 label 到控件那么宽"是自动的，不靠魔法数字。

   为什么改：原来是 `grid-template-columns: 1fr 1fr` ——
     · 纯 `<label>` 被当成一个**半宽格子**（实测 260px），控件从第 276px 才开始，
       于是"启用"这种行看起来 checkbox 离得老远；
     · `.form-hint` 是同一个 grid 的第三个 item → 掉进**下一行的 label 格**（260px 宽的窄条、
       文字被挤成 4 行），既没对齐控件、也没占满整行。
   现在：hint 用 `grid-column: 2` 落进控件列（复用控件列的左右缘，天然对齐）；
   没有 label 的"纯说明行"用 `grid-column: 1 / -1` 占满整行。 */
.form-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 6px 12px;
    align-items: start;
    margin-bottom: 14px;
}
.form-row + .form-row { margin-top: 0; }
.form-row > label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-align: right;
    line-height: 1.4;
    padding-top: 9px;          /* 与 37px 高的控件在视觉上居中对齐 */
    word-break: break-word;
}
/* 提示条：**独占整行**（label 左缘 → 控件右缘），与 `.form-group` 里那条口径一致 ——
   用户 2026-10-09："提示单独搞一行，从左侧 label 一直到右侧的表单控件那么宽"。
   用 `grid-column: 1 / -1` 是自动的：不用猜 label 槽多宽。 */
.form-row > .form-hint,
.form-row > small.text-muted,
.form-row > .text-muted {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary, #6b7280);
    text-align: left;
}
/* 复选框行：`[x] 文案` 紧跟 label 槽（`.form-group` 里同样适用），不留半行的空档。
   2026-10-09：页面上原来各写各的 `style="display:flex;align-items:center;gap:6px;"`，
   统一成这个类。 */
.check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 37px;          /* 与普通控件同高，行距一致 */
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    /* 不收缩、不换行（2026-10-09：文字一换行，这一行看着就"乱了"）；
       文案太长时请把解释挪到下面的 .form-hint，而不是让它在这里折行。 */
    flex: 0 0 auto;
    width: auto;
    text-align: left;
    white-space: nowrap;
}
.check-inline input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex-shrink: 0; }

/* 选项行不是 label 槽：把"定宽 / 右对齐 / 可折行"这三条显式复位。
   带 `.form-group`/`.form-row` 与 `label.check-inline` 是为了压过各弹窗里的
   `.modal-aff .form-group > label` 之类变体（它们权重是 0,2,1）。
   2026-10-09：租户侧推广位弹窗（.modal-aff）里"设为默认"那句就是被那条规则压成 180px 折行的。 */
.form-group > label.check-inline,
.form-row > label.check-inline,
.modal .form-group > label.check-inline,
.modal .form-row > label.check-inline {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    text-align: left;
    white-space: nowrap;
    font-weight: 400;
    color: #374151;
}

.form-group.full { grid-column: 1 / -1; }

/* 表单字段之间的间距 */
.form-section > .form-group ~ .form-group,
.form-section > .form-row ~ .form-group,
.form-section > .form-group ~ .form-row,
.form-section > .form-row ~ .form-row {
    margin-top: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    flex-shrink: 0;
    width: 80px;
    text-align: right;
}
.form-label .required { color: #ef4444; margin-left: 2px; }

.form-value {
    font-size: 14px;
    color: #1a1a2e;
    line-height: 36px;
}

.rule-display .form-group {
    display: flex;
    align-items: center;
}

.rule-display .form-label {
    min-width: 70px;
}

.rule-display .form-value {
    margin-left: 8px;
}

.form-input,
.form-select,
.form-textarea {
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
    flex: 1;
    box-sizing: border-box;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12), 0 2px 8px rgba(102, 126, 234, 0.1);
}
.form-input::placeholder,
.form-textarea::placeholder { color: #adb5bd; }
.form-input:disabled,
.form-select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f3f4f6;
}

/* 输入框图标 */
.input-wrapper {
    position: relative;
}
.input-wrapper .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}
.input-wrapper .form-input {
    padding-left: 36px;
}
.input-wrapper.error .form-input,
.input-wrapper.error .form-select {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.input-wrapper .input-error-msg {
    font-size: 11px;
    color: #ef4444;
    margin-top: 4px;
}

.form-select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-hint { font-size: 11px; color: #9ca3af; }
.form-error-msg { font-size: 11px; color: #ef4444; margin-top: 2px; }

/* 表单分组标题（2026-10-09）：原来是 12px / 灰 / 大写间距 —— 中文用不上大写，看着像弱化的脚注。
   改成"左侧蓝色竖条 + 14px / 600 / 深灰"，各弹窗统一（monitor-rules 之前在自己页里覆盖过一份，
   已删掉那份、用它自己的提示样式即可）。 */
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--primary, #007bff);
    border-radius: 2px;
}

/* 角色卡片式选择器 */
.role-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.role-card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.role-card-item:hover { border-color: #667eea; background: #f8f7ff; }
.role-card-item.selected { border-color: #667eea; background: #f0effe; }
.role-card-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: #667eea; cursor: pointer; }
.role-card-item .role-card-info { flex: 1; min-width: 0; }
.role-card-item .role-card-name { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.role-card-item .role-card-desc { font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 角色复选框样式 */
.role-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.role-checkbox-label:hover { border-color: #667eea; background: #f8f7ff; }
.role-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #667eea; cursor: pointer; }
.role-checkbox-name { font-size: 13px; font-weight: 500; color: #1a1a2e; }
.role-badge.superuser {
    font-size: 10px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 28px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

/* 每个页面面板：**只留 padding**（2026-10-10 清掉上一代 tab 体系的旧布局样式）。
   隐藏/显示不在这里：非当前面板靠 layui 的 `.layui-tab-item{display:none}`，
   当前面板靠 `.layui-show{display:block!important}`（都在 layui.css）——真浏览器量过，隐藏面板确实是 display:none。
   同日删掉的（全站 0 引用，文本 + 真浏览器双查）：`.tab` / `.tab:hover` / `.tab.active` /
   `.tab .tab-close` / `.tab .tab-close:hover` / `.content-container` / `.content-panel.active` / `.wrap-container`。 */
.content-panel {
    padding: 20px;
}
/* ============ 卡片分组标题 ============ */
.card-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 10px 4px;
}

/* ============ 菜单卡片 ============ */
.menu-card {
    border: 1px solid var(--border, #e8ecef);
    border-radius: 12px;
    padding: 0;
    background: var(--bg-card, #fff);
    transition: all .25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.menu-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transform: translateY(-2px);
    border-color: var(--primary, #4a90d9);
}
.menu-card.disabled {
    opacity: .6;
}
.menu-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(99,102,241,0.02) 100%);
    border-bottom: 1px solid var(--border, #e8ecef);
}
.menu-card .card-header .icon {
    font-size: 1.8em;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #fff);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    flex-shrink: 0;
}
.menu-card .card-header .name {
    font-weight: 600;
    flex: 1;
    font-size: 1.05em;
    color: var(--text-primary, #1a1a2e);
}
.menu-card .card-badges {
    padding: 8px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border, #e8ecef);
    background: var(--bg-muted, #fafafa);
}
.menu-card .card-badges .badge {
    font-size: .7em;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--bg-muted, #e8e8e8);
    color: var(--text-secondary, #6c757d);
    font-weight: 500;
}
.menu-card .card-badges .badge.enabled {
    background: #d1fae5;
    color: #065f46;
}
.menu-card .card-badges .badge.disabled {
    background: #fef3c7;
    color: #92400e;
}
.menu-card .card-body {
    font-size: .88em;
    color: var(--text-secondary, #6c757d);
    padding: 12px 18px;
    flex: 1;
}
.menu-card .card-body .row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.menu-card .card-body .label {
    width: 80px;
    white-space: nowrap;
    color: var(--text-muted, #888);
    font-weight: 500;
}
.menu-card .card-body .value {
    flex: 1;
    word-break: break-all;
}
.menu-card .card-body .mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .95em;
}
.menu-card .card-actions {
    padding: 12px 18px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--bg-muted, #fafafa);
    border-top: 1px solid var(--border, #e8ecef);
}
.menu-card .card-actions .btn {
    font-size: .82em;
    padding: 5px 14px;
    border-radius: 6px;
}
/* ============ 菜单分类容器 ============ */
.menu-category {
    margin-bottom: 24px;
    padding: 4px 0;
}
/* 拖拽状态 */
.menu-card.dragging {
    opacity: 0.45;
    transform: scale(0.97);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    cursor: grabbing;
}
.menu-card.drag-over {
    border-color: #6366f1;
    border-style: dashed;
    background: #f0f1ff;
}
.menu-category.drag-target {
    background: #f8f9ff;
    border-radius: 12px;
    outline: 2px dashed #a5b4fc;
    outline-offset: 4px;
}

/* ============ 角色权限卡片 ============ */
.role-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e8ecef);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
    transition: all .25s ease;
}
.role-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transform: translateY(-2px);
    border-color: var(--primary, #4a90d9);
}
.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(74,144,217,0.08) 0%, rgba(74,144,217,0.02) 100%);
    border-bottom: 1px solid var(--border, #e8ecef);
}
.role-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}
.role-icon {
    font-size: 1.8em;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.role-name { font-size: 1.05em; font-weight: 600; color: var(--text-primary, #1a1a2e); }
.role-desc { font-size: .85em; color: var(--text-muted, #888); margin-top: 2px; }

/* 权限表格 */
.role-perm-area {
    overflow-x: auto;
    padding: 16px 18px;
    background: var(--bg-muted, #fafafa);
}
.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 500px; }
.perm-table thead th {
    text-align: center;
    padding: 8px 10px;
    color: #666;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #e8ecef;
}
.perm-table thead th:first-child { text-align: left; }
.perm-th { width: 64px; text-align: center !important; }
.perm-cell { text-align: center; }
.perm-label { display: flex; justify-content: center; cursor: pointer; }
.perm-page-name { padding: 8px 10px; color: #333; }
.perm-group td { padding: 0 !important; }
.perm-group-label {
    padding: 12px 10px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #adb5bd !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: #fafbfc !important;
    border: none !important;
}
.perm-group + tbody td { border-top: 1px solid #f0f2f5; }
.perm-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 角色卡片网格 */
.role-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(580px, 1fr));
    gap: 24px;
    margin-top: 12px;
}

/* ============ 用户管理表格 ============ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.user-avatar.disabled {
    background: #ccc;
    opacity: 0.6;
}
.user-name { font-weight: 600; color: #1a1a2e; font-size: 14px; }
.user-login { font-size: 12px; color: #aaa; }
.text-muted { color: #999; font-size: 13px; }

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* 「页面侧别」徽标（2026-09-28 用户反馈：分配权限弹窗里侧别和页面名同色同重，看不出来；
   而且他在菜单名里也写了「|租户侧」→ 渲染出来变成"租户侧租户侧"）。
   做法：三种侧别各一色 + 加粗 + 与页面名留出间距（名字里的重复后缀由 sys.js 去掉）。
   用在：分配权限弹窗（sys.js）、菜单管理页（sys-menus.html）。 */
.side-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.7;
    letter-spacing: .02em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.side-badge.internal { background: #e8eefc; color: #1e40af; border-color: #c7d7fb; }
.side-badge.tenant   { background: #e6f7ee; color: #047857; border-color: #b7e6cd; }
.side-badge.both     { background: #f3e8ff; color: #7c3aed; border-color: #e0ccfb; }
/* 平台配置的受众徽标（2026-11-07）：ops=运营（蓝）/ dev=开发（绿）/ both=两边（紫） */
.side-badge.ops      { background: #e8eefc; color: #1e40af; border-color: #c7d7fb; }
.side-badge.dev      { background: #e6f7ee; color: #047857; border-color: #b7e6cd; }

/* 分配权限弹窗：页面名 + 侧别徽标同一个 flex 行（gap 保证名字与徽标之间有间距） */
.perm-menu-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 采集配置链接 */
.config-link {
    color: var(--primary);
    text-decoration: none;
}
.config-link:hover {
    text-decoration: underline;
}
.col-configs {
    font-size: 13px;
    line-height: 1.5;
}

/* 高亮定位行 */
tr.highlight {
    background-color: #fff3cd !important;
    animation: highlight-fade 2s ease-out;
}
@keyframes highlight-fade {
    from { background-color: #ffc107; }
    to { background-color: transparent; }
}

.empty-cell { text-align: center; color: #aaa; padding: 32px !important; }
.role-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    background: #eef2ff;
    color: #667eea;
    margin: 0 2px;
}

/* 角色复选框 */
.role-checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.role-cb-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e8ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.role-cb-label:hover { background: #f8f9ff; }
.role-cb-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #667eea; }
.role-cb-name { font-weight: 600; color: #333; font-size: 14px; }
.role-cb-desc { font-size: 12px; color: #999; margin-left: auto; }

/* 平台卡片样式 */
.platform-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.platform-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0; /* 允许flex子元素收缩 */
    overflow: hidden;
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

.platform-card.disabled {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.platform-card.disabled:hover {
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.35);
}

.platform-card-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.platform-card-info {
    flex: 1;
    min-width: 0; /* 允许收缩 */
}

.platform-card-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-card-url {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-card-status {
    text-align: center;
    min-width: 70px;
}

.platform-card-status .cell-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 12px;
    padding: 3px 10px;
}

.platform-card-status .cell-badge.enabled {
    background: #d1fae5;
    color: #065f46;
}

.platform-card-status .cell-badge.disabled {
    background: #fef3c7;
    color: #92400e;
}

.platform-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.platform-card-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    font-size: 13px;
}

.platform-card-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============ 通知卡片样式 ============ */
.notif-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.notif-card {
    border-radius: 10px;
    padding: 18px 20px;
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.notif-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.notif-card.disabled {
    opacity: 0.6;
}

.notif-card.dingtalk { background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%); }
.notif-card.feishu    { background: linear-gradient(135deg, #1890ff 0%, #0050b3 100%); }
.notif-card.sms      { background: linear-gradient(135deg, #722ed1 0%, #531dab 100%); }
.notif-card.email    { background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); }
.notif-card.weixin  { background: linear-gradient(135deg, #fa8c16 0%, #d46b08 100%); }

.notif-card-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.notif-card-info {
    flex: 1;
    min-width: 0;
}

.notif-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-card-channel {
    font-size: 0.8rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-card-channel .channel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    display: inline-block;
}

.notif-card-status {
    flex-shrink: 0;
    text-align: center;
}

.notif-card-status .cell-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
}

.notif-card-status .cell-badge.enabled {
    background: rgba(40, 167, 69, 0.85);
}

.notif-card-status .cell-badge.disabled {
    background: rgba(220, 53, 69, 0.85);
}

.notif-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

/* 通知渠道卡片按钮使用统一样式 */

/* ============ 渠道配置表单 ============ */
.channel-cfg {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 4px;
    background: var(--bg-secondary);
}

.channel-cfg.hidden { display: none; }

.channel-cfg label {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.channel-cfg .form-group {
    margin-bottom: 10px;
}

.channel-cfg .form-group:last-child {
    margin-bottom: 0;
}

.required { color: #e53e3e; }

/* ============ 表格样式 ============ */
.table-wrapper {
    overflow-x: auto;
    margin-top: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: max-content;  /* 根据内容自动计算最小宽度 */
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background-color: #f8f9ff;
}

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

/* 分组头行（2026-09-30 阶段 C 尾巴③：推广位按 账号 → 应用 分组）：
   一行说清"哪个账号的哪个应用"，下面是它名下的推广位 */
.data-table tbody tr.group-row,
.data-table tbody tr.group-row:hover {
    background-color: #f1f5fd;
}
.data-table tbody tr.group-row td {
    padding: 8px 16px;
    font-size: 13px;
    color: #33415c;
    border-bottom: 1px solid var(--border);
}
.data-table tbody tr.group-row .cell-inline {
    gap: 8px;
    flex-wrap: wrap;
}

.data-table td {
    font-size: 14px;
    color: var(--text);
    vertical-align: middle;
}

/* 通用列宽控制 - 不换行，保持一行显示 */
.data-table td.col-key {
    white-space: nowrap;
    min-width: 120px;
}

/* 长文本列 - 最大宽度 + 省略号 */
.data-table td.col-content {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 长文本列：允许换行 + 按任意字符断行，避免把表格撑长（2026-11-07） */
.data-table td.cell-wrap {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

/* 短文本列（平台、店铺、指标、状态等）- 不换行 */
.data-table td.col-short {
    white-space: nowrap;
    min-width: 80px;
}

/* 列宽分配 */
.data-table .col-key {
    font-weight: 600;
    color: #212529;
    min-width: 120px;
}

.data-table .col-actions {
    width: 260px;
    text-align: right;
    white-space: nowrap;
}

/* 表格操作列按钮间距 */
.data-table .col-actions .btn,
.data-table .col-actions .btn-toggle {
    margin-left: 8px;
}
.data-table .col-actions .btn:first-child,
.data-table .col-actions .btn-toggle:first-child {
    margin-left: 0;
}

/* 表格操作列 .btn-action 按钮间距（td 未用 .col-actions 时的兜底，与 .card-actions gap 对齐） */
.data-table td .btn-action + .btn-action,
.data-table td .btn-action + .btn-toggle,
.data-table td .btn-toggle + .btn-action,
.data-table td .btn-toggle + .btn-toggle {
    margin-left: 6px;
}

.data-table .col-actions-right {
    text-align: right;
    padding-right: 20px;
}

/* 操作列样式 */
.data-table .action-cell {
    text-align: right;
    white-space: nowrap;
}

.data-table .action-cell .btn {
    margin-left: 6px;
}

.data-table .action-cell .btn:first-child {
    margin-left: 0;
}

.data-table .col-content {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #495057;
    font-size: 0.9em;
}

/* 单元格内标签 */
.data-table .cell-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

/* 「所属账号」「最近转链」这类"徽标 + 文字"混排的格子：用 flex 横向居中。
   别把 .plat-tag（inline-flex，基线取图标底边）或 .cell-badge（inline-block + 上下内边距）
   当普通行内元素和文字排在一起——实测混排时平台徽标会比文字**高 3.5px**、异常徽标低 1.5px，
   看起来就是"文字错位"（2026-09-28 用户反馈，chromium 实测值）。flex 子项由 align-items:center
   统一对齐，不靠基线猜。 */
.data-table td .cell-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}
.data-table td .cell-inline > .cell-badge { padding: 3px 10px; }

.data-table .cell-badge.enabled {
    background: #d4edda;
    color: #155724;
}

.data-table .cell-badge.disabled {
    background: #f8d7da;
    color: #721c24;
}

.data-table .cell-badge.limited {
    background: #fff3cd;
    color: #856404;
}

.data-table .cell-badge.pending {
    background: #cce5ff;
    color: #004085;
}

.data-table .cell-badge.info {
    background: #cce5ff;
    color: #004085;
}

/* 行内小标签 */
.data-table .cell-tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    font-size: 0.78em;
    padding: 1px 6px;
    border-radius: 3px;
    margin: 1px 2px;
    white-space: nowrap;
}

/* 链接样式 */
.data-table a {
    color: var(--primary);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* code样式 */
.data-table code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #e83e8c;
    font-family: "SF Mono", Monaco, Consolas, monospace;
}

/* 操作按钮 */
.data-table .btn {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0 2px;
}

/* 空状态 */
.data-table + .empty-state,
.empty-state:only-child {
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: #f8f9fa;
    border-radius: var(--radius);
    margin-top: 10px;
}

/* ============ 分页样式 ============ */
/* ===== 分页组件 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    padding: 12px 0;
    user-select: none;
}

.pg-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pg-btn:hover:not(:disabled):not(.pg-active) {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.pg-btn:disabled:not(.pg-active) {
    opacity: 0.4;
    cursor: not-allowed;
}

.pg-btn.pg-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
    cursor: default;
}

.pg-btn.pg-prev,
.pg-btn.pg-next {
    font-size: 16px;
    font-weight: 500;
    padding: 0 10px;
}

.pg-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    color: #94a3b8;
    font-size: 14px;
    letter-spacing: 1px;
}

.pg-info {
    color: #94a3b8;
    font-size: 13px;
    margin-left: 12px;
}

.pg-jump {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    font-size: 13px;
    margin-left: 8px;
}

.pg-jump-input {
    width: 44px;
    height: 28px;
    padding: 0 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    color: #475569;
    outline: none;
    transition: border-color 0.15s;
    -moz-appearance: textfield;
}

.pg-jump-input::-webkit-inner-spin-button,
.pg-jump-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pg-jump-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* ===== 内联编辑单元格（双击编辑） ===== */
.cell-editable {
    cursor: text;
    border-radius: 3px;
    transition: background 0.15s;
}
.cell-editable:hover {
    background: rgba(0, 123, 255, 0.08);
}
.data-table .cell-editable code {
    background: transparent;
    color: var(--primary);
    border-bottom: 1px dashed var(--primary);
    padding: 0 2px;
    border-radius: 0;
    transition: background 0.15s, border-bottom-style 0.15s;
}
.data-table .cell-editable:hover code {
    background: rgba(0, 123, 255, 0.12);
    border-bottom-style: solid;
}
.data-table .cell-editable .text-muted {
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 1px;
    transition: color 0.15s, border-bottom-color 0.15s;
}
.data-table .cell-editable:hover .text-muted {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.cell-editable.editing {
    padding: 2px 4px;
}
.inline-edit-input {
    width: 100%;
    box-sizing: border-box;
    padding: 2px 6px;
    font-size: 13px;
    font-family: 'Menlo', 'Consolas', monospace;
    color: #1f2937;
    background: #fff;
    border: 1px solid var(--primary);
    border-radius: 3px;
    outline: none;
}
.inline-edit-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* ===== 操作历史详情 ===== */
.cell-badge.warning,
.cell-badge.warn {
    background: #ffc107;
    color: #212529;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.detail-item {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.detail-item code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.detail-details {
    margin: 12px 0;
    padding: 10px;
    background: #fff3cd;
    border-radius: 4px;
}

.detail-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.diff-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.diff-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.diff-section ul {
    margin: 0;
    padding-left: 20px;
}

.diff-section ul li {
    margin: 4px 0;
    font-size: 13px;
}

.col-time {
    white-space: nowrap;
    color: #666;
    font-size: 13px;
}

.modal-body {
    padding: 16px;
}

.modal-body .detail-grid {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .detail-diff {
        grid-template-columns: 1fr;
    }
    .modal-body .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ 爬取源表单样式 ============ */
.source-form-section {
    margin-bottom: 20px;
}
.source-form-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}
.source-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.source-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.source-form-group-wide {
    grid-column: 1 / -1;
}
.source-form-switch {
    display: flex;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* ============ 爬取源卡片布局 ============ */
.source-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.source-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.source-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}
.source-card-disabled {
    opacity: 0.6;
    background: #fafafa;
}
.source-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.source-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.source-card-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.source-card-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.source-card-status .cell-badge {
    font-size: 12px;
    padding: 2px 8px;
}
.source-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.source-card-tag {
    font-size: 11px;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.source-card-platform {
    font-size: 13px;
    color: #6b7280;
}
.source-card-keyword {
    font-size: 12px;
    color: #f59e0b;
    background: #fef3c7;
    padding: 2px 8px;
    border-radius: 10px;
}
.source-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.source-card-tags .cell-badge {
    font-size: 11px;
    padding: 2px 7px;
}
.source-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.source-card-link {
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
}
.source-card-link:hover {
    text-decoration: underline;
}
.source-card-actions {
    display: flex;
    gap: 6px;
}
.source-card-actions .btn {
    font-size: 12px;
    padding: 4px 10px;
}

/* ============ 统一卡片操作区样式 ============ */
.card-actions, .tc-actions {
    padding: 12px 18px;
    display: flex; gap: 8px; justify-content: flex-end;
    background: var(--bg-muted, #fafafa);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.card-actions .btn, .tc-actions .btn {
    font-size: .82em; padding: 5px 14px; border-radius: 6px;
}
.card-actions .btn-toggle, .tc-actions .btn-toggle {
    font-size: .82em;
}

/* ============ 统一开关按钮样式 ============ */
.btn-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 60px;
    justify-content: center;
}

/* 启用按钮（当前是禁用，点击后启用） */
.btn-toggle.btn-enabled {
    background: #d1fae5;
    color: #065f46;
}

.btn-toggle.btn-enabled:hover {
    background: #a7f3d0;
    transform: translateY(-1px);
}

/* 禁用按钮（当前是启用，点击后禁用）- 橙色警告风格 */
.btn-toggle.btn-disabled {
    background: #fef3c7;
    color: #92400e;
}

.btn-toggle.btn-disabled:hover {
    background: #fde68a;
    transform: translateY(-1px);
}

/* ============ 统一卡片/表格操作按钮样式 ============ */
/* 操作按钮基础样式 - 用于卡片底部和表格行 */
.btn-action {
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-action.btn-edit {
    background: #f3f4f6;
    color: #374151;
}

.btn-action.btn-edit:hover {
    background: #e5e7eb;
}

.btn-action.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-action.btn-delete:hover {
    background: #fecaca;
}

.btn-action.btn-import {
    background: #dbeafe;
    color: #1e40af;
}

.btn-action.btn-import:hover {
    background: #bfdbfe;
}

.btn-action.btn-view {
    background: #f3f4f6;
    color: #374151;
}

.btn-action.btn-view:hover {
    background: #e5e7eb;
}

.btn-action.btn-success {
    background: #dcfce7;
    color: #166534;
}

.btn-action.btn-success:hover {
    background: #bbf7d0;
}

/* 立即执行类（立即采集/立即发现）：蓝色行动色，和编辑/删除区分开 */
.btn-action.btn-run-now {
    background: #e0f2fe;
    color: #075985;
}

.btn-action.btn-run-now:hover {
    background: #bae6fd;
}

/* ============ 表格操作列按钮组 ============ */
/* 容器：自动间隔，操作多时换行不溢出 */
.table-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
/* 组内按钮统一基础外观（圆角/高度/字号/字重一致，颜色由 modifier 区分） */
.table-btn-group .btn-action,
.table-btn-group .btn-toggle {
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 6px;
    white-space: nowrap;
    margin-left: 0;  /* 覆盖 .action-cell/.col-actions 的 margin-left，间隔统一由 gap 提供 */
}
/* 无 modifier 的默认中性色（如"解绑""复制""查看"等） */
.table-btn-group .btn-action:not(.btn-edit):not(.btn-delete):not(.btn-import):not(.btn-view):not(.btn-success):not(.btn-run-now) {
    background: #f3f4f6;
    color: #374151;
}
.table-btn-group .btn-action:not(.btn-edit):not(.btn-delete):not(.btn-import):not(.btn-view):not(.btn-success):not(.btn-run-now):hover {
    background: #e5e7eb;
}

/* 兼容旧样式 - btn btn-sm 在卡片操作区自动应用统一样式 */
.card-actions .btn.btn-sm,
.card-actions .btn:not(.btn-toggle),
.tc-actions .btn.btn-sm,
.tc-actions .btn:not(.btn-toggle),
.col-actions .btn.btn-sm,
.col-actions .btn:not(.btn-toggle),
.actions .btn.btn-sm,
.actions .btn:not(.btn-toggle) {
    padding: 6px 14px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    color: #374151;
}

.card-actions .btn.btn-sm:hover,
.card-actions .btn:not(.btn-toggle):hover,
.col-actions .btn.btn-sm:hover,
.col-actions .btn:not(.btn-toggle):hover,
.actions .btn.btn-sm:hover,
.actions .btn:not(.btn-toggle):hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* 删除按钮红色样式 */
.card-actions .btn.btn-sm.btn-danger,
.card-actions .btn.btn-danger:not(.btn-toggle),
.col-actions .btn.btn-sm.btn-danger,
.col-actions .btn.btn-danger:not(.btn-toggle),
.actions .btn.btn-sm.btn-danger,
.actions .btn.btn-danger:not(.btn-toggle) {
    background: #fee2e2;
    color: #991b1b;
}

.card-actions .btn.btn-sm.btn-danger:hover,
.card-actions .btn.btn-danger:not(.btn-toggle):hover,
.col-actions .btn.btn-sm.btn-danger:hover,
.col-actions .btn.btn-danger:not(.btn-toggle):hover,
.actions .btn.btn-sm.btn-danger:hover,
.actions .btn.btn-danger:not(.btn-toggle):hover {
    background: #fecaca;
}

/* 导入按钮蓝色样式 */
.card-actions .btn.btn-sm.btn-primary,
.card-actions .btn.btn-primary:not(.btn-toggle),
.col-actions .btn.btn-sm.btn-primary,
.col-actions .btn.btn-primary:not(.btn-toggle),
.actions .btn.btn-sm.btn-primary,
.actions .btn.btn-primary:not(.btn-toggle) {
    background: #dbeafe;
    color: #1e40af;
}

.card-actions .btn.btn-sm.btn-primary:hover,
.card-actions .btn.btn-primary:not(.btn-toggle):hover,
.col-actions .btn.btn-sm.btn-primary:hover,
.col-actions .btn.btn-primary:not(.btn-toggle):hover,
.actions .btn.btn-sm.btn-primary:hover,
.actions .btn.btn-primary:not(.btn-toggle):hover {
    background: #bfdbfe;
}

/* 占位符标签样式 */
.placeholder-hint {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.placeholder-tag {
    display: inline-block;
    margin: 2px;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.placeholder-tag:hover {
    background: #bbdefb;
}

/* ===== 从 main.css 合并的布局样式 ===== */

/*圆角*/
/*阴影*/
/*字体*/
/*动画属性*/
/*清楚浮动*/
/*2.1 栅格系统
    Name:           style_span
    Example:
    <div class="responsive">
    <div class="row cl" role="grid">
      <div class="col-1">……</div>
      ……
    </div>
    </div>
    Explain:        栅格系统
*/
/*2.1 响应式栅格系统*/
.container {
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
.container-fluid {
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: 992px) {
  .container {
    width: 960px;
  }
}
@media (min-width: 1200px) {
  .container {
    width: 1170px;
  }
}
@media (min-width: 1300px) {
  .container {
    width: 1270px;
  }
}
@media print {
  .container {
    width: auto;
  }
}
.row {
  box-sizing: border-box;
}
@media (max-width: 767px) {
  .visible-xs {
    display: block !important;
  }
  table.visible-xs {
    display: table;
  }
  tr.visible-xs {
    display: table-row !important;
  }
  th.visible-xs,
  td.visible-xs {
    display: table-cell !important;
  }
  .hidden-xs {
    display: none !important;
  }
  .visible-xs-block {
    display: block !important;
  }
  .visible-xs-inline {
    display: inline !important;
  }
  .visible-xs-inline-block {
    display: inline-block !important;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .visible-sm {
    display: block !important;
  }
  table.visible-sm {
    display: table;
  }
  tr.visible-sm {
    display: table-row !important;
  }
  th.visible-sm,
  td.visible-sm {
    display: table-cell !important;
  }
  .hidden-sm {
    display: none !important;
  }
  .visible-sm-block {
    display: block !important;
  }
  .visible-sm-inline {
    display: inline !important;
  }
  .visible-sm-inline-block {
    display: inline-block !important;
  }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .visible-md {
    display: block !important;
  }
  table.visible-md {
    display: table;
  }
  tr.visible-md {
    display: table-row !important;
  }
  th.visible-md,
  td.visible-md {
    display: table-cell !important;
  }
  .hidden-md {
    display: none !important;
  }
  .visible-md-block {
    display: block !important;
  }
  .visible-md-inline {
    display: inline !important;
  }
  .visible-md-inline-block {
    display: inline-block !important;
  }
}
@media (min-width: 1200px) {
  .visible-lg {
    display: block !important;
  }
  table.visible-lg {
    display: table;
  }
  tr.visible-lg {
    display: table-row !important;
  }
  th.visible-lg,
  td.visible-lg {
    display: table-cell !important;
  }
  .hidden-lg {
    display: none !important;
  }
  .visible-lg-block {
    display: block !important;
  }
  .visible-lg-inline {
    display: inline !important;
  }
  .visible-lg-inline-block {
    display: inline-block !important;
  }
}
@media print {
  .visible-print {
    display: block !important;
  }
  table.visible-print {
    display: table;
  }
  tr.visible-print {
    display: table-row !important;
  }
  th.visible-print,
  td.visible-print {
    display: table-cell !important;
  }
  .visible-print-block {
    display: block !important;
  }
  .visible-print-inline {
    display: inline !important;
  }
  .visible-print-inline-block {
    display: inline-block !important;
  }
  .hidden-print {
    display: none !important;
  }
}
.panel {
  background-color: #fff;
  border: solid 1px transparent;
}
.panel-header {
  border-bottom: solid 1px transparent;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 700;
}
/*面板标题*/
.panel-body {
  padding: 15px;
}
/*面板内容*/
.panel-footer {
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  padding: 5px 20px;
}
/*面板页脚*/
/*默认面板*/
.panel-default {
  border-color: #dddddd;
}
.panel-default > .panel-header {
  border-color: #ddd;
  background-color: #f5f5f5;
  color: #444444;
}
/*主要面板*/
.panel-primary {
  border-color: #5a98de;
}
.panel-primary > .panel-header {
  border-color: #5a98de;
  background-color: #5a98de;
  color: #ffffff;
}
/*次要面板*/
.panel-secondary {
  border-color: #3bb4f2;
}
.panel-secondary > .panel-header {
  border-color: #3bb4f2;
  background-color: #3bb4f2;
  color: #ffffff;
}
/*成功面板*/
.panel-success {
  border-color: #5eb95e;
}
.panel-success > .panel-header {
  border-color: #5eb95e;
  background-color: #5eb95e;
  color: #ffffff;
}
/*警告面板*/
.panel-warning {
  border-color: #f37b1d;
}
.panel-warning > .panel-header {
  border-color: #f37b1d;
  background-color: #f37b1d;
  color: #ffffff;
}
/*危险面板*/
.panel-danger {
  border-color: #dd514c;
}
.panel-danger > .panel-header {
  border-color: #dd514c;
  background-color: #dd514c;
  color: #ffffff;
}
@font-face {
  font-family: 'iconfont';
  src: url('../assets/fonts/iconfont.eot');
  src: url('../assets/fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('../assets/fonts/iconfont.woff') format('woff'), /* Modern Browsers */ url('../assets/fonts/iconfont.ttf') format('truetype'), /* Safari, Android, iOS */ url('../assets/fonts/iconfont.svg#svgFontName') format('svg');
  
  /* IE9 Compat Modes */
  /* Legacy iOS */
}
.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}
.panel-default {
  border-color: #ebeaea;
}
.panel-default .panel-header {
  border-color: transparent;
  background-color: #fff;
  color: #555555;
}
.panel-header {
  border-bottom: solid 1px transparent;
  padding: 8px 15px;
  font-size: 16px;
  font-weight: normal;
}
.layui-form-select dl dd.layui-this {
  background: #f2f2f2;
  color: #333;
}
.layui-nav-no-bg {
  background: transparent;
  width: auto;
}
.layui-nav-no-bg.layui-nav-tree .layui-nav-item a:hover {
  background-color: transparent;
  color: #00b5f9;
}
.layui-nav-no-bg.layui-nav .layui-nav-item a {
  color: #333;
}
.layui-nav-no-bg .layui-nav-itemed > a,
.layui-nav-no-bg .layui-nav-tree .layui-nav-title a,
.layui-nav-no-bg .layui-nav-tree .layui-nav-title a:hover {
  background: transparent!important;
  color: #333!important;
}
.layui-nav-no-bg.layui-nav-tree .layui-nav-child a {
  height: 40px;
  line-height: 40px;
  text-indent: 10px;
  color: #666;
}
.layui-nav-no-bg.layui-nav-tree .layui-nav-child dd.layui-this,
.layui-nav-no-bg.layui-nav-tree .layui-this,
.layui-nav-no-bg.layui-nav-tree .layui-this > a:hover {
  background-color: #fff;
  color: #00b5f9;
}
.layui-nav-no-bg.layui-nav-tree .layui-this > a {
  background-color: #fff;
  color: #00b5f9;
  border-left: 3px solid #00b5f9;
  margin-right: -20px;
}
.layui-nav-no-bg .layui-nav-bar {
  display: none;
}
.commentList .avatar {
  border: 1px solid transparent;
  float: left;
}
.comment-body {
  padding: 15px;
  overflow: hidden;
}
.commentList .comment-flip .avatar {
  float: right;
}
.comment-flip .comment-main {
  margin-left: 0;
  margin-right: 64px;
}
.comment-flip .comment-main:before {
  border-left-color: #dedede;
  border-right-color: transparent;
}
.comment-flip .comment-main:after,
.comment-flip .comment-main:before {
  left: 100%;
  position: absolute;
  right: -16px;
}
.comment-flip .comment-main:after {
  border-left-color: #f8f8f8;
  border-right-color: transparent;
  margin-left: auto;
  margin-right: 2px;
}
/*3.6.3 头像
    Name:           mod_avatar
    Example:        <i class="avatar avatar-L radius"><img src="static/h-ui/images/ucenter/avatar-default.jpg"></i>
*/
.avatar {
  display: inline-block;
  position: relative;
  overflow: hidden;
}
.avatar img {
  display: block;
}
.avatar.radius,
.avatar.radius img {
  border-radius: 50%;
}
.avatar,
.avatar img {
  width: 32px;
  height: 32px;
}
.avatar.size-MINI {
  width: 16px;
  height: 16px;
}
.avatar.size-S,
.avatar.size-S img {
  width: 24px;
  height: 24px;
}
.avatar.size-M,
.avatar.size-M img {
  width: 32px;
  height: 32px;
}
/*默认为中，可以不写，可以理解为：均码*/
.avatar.size-L,
.avatar.size-L img {
  width: 40px;
  height: 40px;
}
.avatar.size-XL,
.avatar.size-XL img {
  width: 64px;
  height: 64px;
}
.avatar.size-XXL,
.avatar.size-XXL img {
  width: 100px;
  height: 100px;
}
.avatar.size-XXXL,
.avatar.size-XXXL img {
  width: 128px;
  height: 128px;
}
.main-layout {
  width: 100%;
  height: 100%;
}
/* ===== 顶栏（全宽） ===== */
.main-layout-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 50px;
  border-bottom: none;
  background: linear-gradient(10deg, #596574 0%, #115ebd 100%);
  /* 必须高于 #contentContainer(z-index:200)：后者在 DOM 里更靠后，
     同层级会把顶栏下拉（用户菜单）盖住。 */
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  box-shadow: 0 2px 8px rgba(17,94,189,0.25);
}
.main-layout-header .header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 100%;
}
.main-layout-header .header-logo .logo-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.main-layout-header a {
  text-decoration: none;
}

/* ===== 顶栏用户区（通知 + 账户） ===== */
.main-layout-header .header-actions {
  margin-left: auto;
  padding-right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.header-message-btn {
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s;
}
.header-message-btn:hover { background: rgba(255,255,255,0.22); }
.header-alert-count {
  min-width: 0;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.header-user {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.header-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.header-user-info:hover { background: rgba(255,255,255,0.14); }
.header-user-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex: 0 0 auto;
}
.header-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-user-arrow {
  font-size: 11px;
  opacity: 0.7;
  transition: transform 0.2s;
}
.header-user.menu-open .header-user-arrow { transform: rotate(180deg); }
.header-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  width: 168px;
  padding: 6px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  z-index: 300;
}
.header-user-menu.open { display: block; }
.header-user-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #334155;
  font-size: 13px;
  text-decoration: none;
}
.header-user-menu a:hover { background: #f1f5f9; color: #0f172a; }
.header-user-menu a .layui-icon { font-size: 15px; }

/* ===== 个人中心页面 ===== */
.profile-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #333);
}
.profile-divider {
  height: 1px;
  background: var(--border, #e5e7eb);
  margin: 20px 0;
}

/* ===== 个人中心页面 ===== */
.profile-page .form-group {
  margin-bottom: 16px;
}
.profile-page .form-group:last-of-type {
  margin-bottom: 0;
}
.profile-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 4px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  margin-bottom: 20px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #115ebd, #596574);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}
.profile-meta h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #333);
}
.profile-meta p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #6c757d);
}
.profile-form-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  padding: 24px;
}
.profile-section-footer {
  margin-top: 20px;
  text-align: right;
}

/* ===== 侧边栏收起/展开按钮 ===== */
/* 右侧全高热区 */
.main-layout-side .side-toggle-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  cursor: pointer;
  z-index: 110;
}
/* 三角形（用 border 实现） — 展开态：朝左 ◀ 表示"可收起" */
/* border-right有色 → 三角形朝左 */
.main-layout-side .side-toggle-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 7px 7px 0;
  border-color: transparent rgba(255,255,255,0.35) transparent transparent;
  transition: all 0.2s ease;
}
/* 热区 hover 时三角形变亮变大 */
.main-layout-side .side-toggle-btn:hover::before {
  border-color: transparent rgba(255,255,255,0.8) transparent transparent;
  border-width: 9px 9px 9px 0;
  right: 2px;
}
/* 热区 hover 背景微亮 */
.main-layout-side .side-toggle-btn::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0);
  transition: background 0.2s ease;
}
.main-layout-side .side-toggle-btn:hover::after {
  background: rgba(255,255,255,0.15);
}
/* 隐藏 layui-icon */
.main-layout-side .side-toggle-btn .layui-icon {
  display: none;
}

/* ===== 收起状态：按钮固定在左侧 ===== */
.main-layout.hide-side .side-toggle-btn {
  position: fixed;
  left: 0;
  top: 50px;
  bottom: 0;
  width: 14px;
  z-index: 200;
  cursor: pointer;
  background: linear-gradient(180deg, #596574 0%, #115ebd 100%);
}
/* 收起时三角形朝右 ▶ — border-left有色 → 三角形朝右 */
.main-layout.hide-side .main-layout-side .side-toggle-btn::before {
  border-width: 7px 0 7px 7px !important;
  border-color: transparent transparent transparent #126bda !important;
  right: auto !important;
  left: 3px !important;
}
.main-layout.hide-side .main-layout-side .side-toggle-btn:hover::before {
  border-width: 9px 0 9px 7px !important;
  border-color: transparent transparent transparent #fff !important;
  left: 2px !important;
}
/* 收起时热区右侧竖线 */
.main-layout.hide-side .main-layout-side .side-toggle-btn::after {
  left: 0 !important;
  right: auto !important;
  width: 2px !important;
  background: #126bda !important;
}
.main-layout.hide-side .main-layout-side .side-toggle-btn:hover::after {
  background: #fff !important;
  width: 3px !important;
}

/* ===== 侧边栏（从顶栏下方开始） ===== */
.main-layout-side {
  width: 220px;
  position: fixed;
  left: 0;
  top: 50px;
  bottom: 0;
  background: linear-gradient(180deg, #596574 0%, #115ebd 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  -webkit-transition: left 0.3s;
  -moz-transition: left 0.3s;
  -ms-transition: left 0.3s;
  transition: left 0.3s;
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}
.main-layout.hide-side .main-layout-side {
  left: -220px;
}
.main-layout.hide-side .main-layout-container {
  left: 20px;
}
/* ===== 自实现侧边栏骨架（不依赖 layui 导航样式；元素视觉细节见下文 .side-nav-section / .side-nav-group / .nav-item 段） ===== */
.main-layout-side .side-nav {
  background: transparent;
  flex: 1 1 0;
  min-height: 0;          /* flex 子项默认 min-height:auto 会撑高导致 overflow 失效，必须置 0 才能收缩并出滚动条 */
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0;
  margin: 0;
  list-style: none;
}
.main-layout-side .side-nav,
.main-layout-side .side-nav ul { list-style: none; margin: 0; padding: 0; }

/* 所有链接基础：块级、超出省略；高度/颜色/字号由下方各元素规则细化。
   同时 reset 历史 .nav-item 全局规则（padding:14px 20px / display:flex / gap / border-left）的污染——
   那套规则无 .side-nav 前缀，会把叶子 <a> 撑成 flex 并冲掉 .nav-level-N 的 padding-left。
   此处 padding:0 清四方向，由下方 .nav-level-N 重新设 padding-left（同优先级、后写 → 生效）。 */
.main-layout-side .side-nav a {
  display: block;
  position: relative;
  padding: 0;
  gap: normal;
  border-left: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

/* 子区域：透明背景；默认折叠，.open 才展开 */
.main-layout-side .side-nav .side-nav-child {
  background: transparent !important;
  background-color: transparent !important;
  display: none;
}
.main-layout-side .side-nav .open > .side-nav-child { display: block; }

/* 层级缩进：同级分组标题与叶子用同一 nav-level-N → 天然对齐。
   每级 +20px：level-1=20（顶级 section）/ level-2=40 / level-3=60 / level-4=80 / level-5=100。
   原 64/80/96/112 跨度过大（level-1→2 达 44px），改统一 20px 递增更协调。 */
.main-layout-side .side-nav .nav-level-1 { padding-left: 20px; }
.main-layout-side .side-nav .nav-level-2 { padding-left: 40px; }
.main-layout-side .side-nav .nav-level-3 { padding-left: 60px; }
.main-layout-side .side-nav .nav-level-4 { padding-left: 80px; }
.main-layout-side .side-nav .nav-level-5 { padding-left: 100px; }
.main-layout-container {
  position: absolute;
  left: 220px;
  right: 0;
  top: 50px;
  bottom: 0;
  background: #f5f5f5;
  -webkit-transition: left 0.3s;
  -moz-transition: left 0.3s;
  -ms-transition: left 0.3s;
  transition: left 0.3s;
}
.main-layout-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-layout-tab {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.main-layout-tab .layui-tab-title {
  border-bottom: 1px solid #f0f0f0;
  z-index: 98;
  background: #fff;
  flex-shrink: 0;
}
.main-layout-tab .layui-tab-title li {
    border-left: 1px solid #f4f4f4;
}
.main-layout-tab.layui-tab-brief > .layui-tab-title .layui-this {
  color: #00b5f9;
}
.main-layout-tab.layui-tab-brief > .layui-tab-more li.layui-this:after,
.main-layout-tab.layui-tab-brief > .layui-tab-title .layui-this:after {
  border: none;
  border-radius: 0;
  border-bottom: 3px solid #00b5f9;
}
.main-layout-tab .welcome .layui-tab-close {
  display: none;
}
.main-layout-tab .layui-tab-content {
  flex: 1;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
  background: #f5f5f5;
  position: relative;
}
/* 2026-10-30：每个 tab 自己滚动（不再共用一个 scroll 容器）。
   这样切换 tab 会保留各自滚动位置，锁滚动也只锁当前面板。 */
.main-layout-tab .layui-tab-content .layui-tab-item {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* tab 内容容器 — flex 布局下由 flex:1 + overflow:auto 撑满 */

/* 每个页面面板 */
.layui-tab-item {
    position: relative;
    min-height: 100%;
}
/* 移动端响应式：侧边栏始终显示，内容区自适应 */
@media (max-width: 600px) {
  .main-layout-side {
    width: 60px;
    overflow: auto;
    overflow-x: hidden;
    z-index: 100;
  }
  .main-layout-header .header-logo .logo-text {
    display: none;
  }
  .main-layout-header .header-actions {
    padding-right: 8px;
    gap: 0;
  }
  .header-user-name {
    display: none;
  }
  .header-message-btn {
    padding: 5px 9px;
    font-size: 12px;
  }
  .header-user-info {
    gap: 4px;
    padding: 0 6px 0 4px;
  }
  .header-user-menu {
    right: -4px;
  }
  .main-layout-side .side-nav a {
    padding-left: 10px !important;
    padding-right: 10px;
  }
  .main-layout-container {
    left: 60px;
  }
  ::-webkit-scrollbar {
    width: 2px;
    height: 10px;
  }
}
.email-wrap {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  padding: 15px;
  background: #f5f5f5;
  overflow-x: hidden;
  overflow-y: auto;
}
.email-wrap .email-folder dd .iconfont,
.email-wrap .email-folder dd .layui-icon {
  float: left;
  padding-right: 10px;
  font-size: 16px;
}
.email-wrap .email-classify dd .iconfont,
.email-wrap .email-classify dd .layui-icon {
  float: left;
  padding-right: 10px;
  font-size: 14px;
}
.email-wrap .email-content {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  background: #fff;
  height: 100%;
  width: 100%;
  overflow: auto;
  padding: 15px;
  overflow: hidden;
}
.welcome-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 15px 0;
}
/***********welcome***********/
.welcome-left-container .data-show li {
  height: 95px;
  margin-bottom: 15px;
}
.welcome-left-container .data-show a {
  display: block;
  background: #fff;
  padding: 10px;
  border: 1px solid #ebeaea;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.welcome-left-container .data-show .icon-bg {
  width: 68px;
  height: 68px;
  text-align: center;
  -webkit-border-radius: 70px;
  -moz-border-radius: 70px;
  -ms-border-radius: 70px;
  border-radius: 70px;
}
.welcome-left-container .data-show .icon-bg .iconfont {
  color: #fff;
  font-size: 36px;
  position: relative;
  top: 15px;
}
.welcome-left-container .data-show .bg-org {
  background: #f8bb74;
}
.welcome-left-container .data-show .bg-blue {
  background: #86d2ee;
}
.welcome-left-container .data-show .bg-green {
  background: #94e0e1;
}
.welcome-left-container .data-show .right-text-con {
  padding-left: 78px;
}
.welcome-left-container .data-show p {
  margin: 0;
  color: #a0a8b4;
}
.welcome-left-container .data-show .color-org,
.welcome-left-container .data-show .color-blue,
.welcome-left-container .data-show .color-green {
  font-size: 28px;
  padding-right: 10px;
  font-family: "arial";
}
.welcome-left-container .data-show .color-org {
  color: #f8bb74;
}
.welcome-left-container .data-show .color-blue {
  color: #86d2ee;
}
.welcome-left-container .data-show .color-green {
  color: #94e0e1;
}
.welcome-left-container .data-show .name {
  margin-bottom: 10px;
  font-size: 16px;
  color: #555555;
}
.welcome-left-container .chart-panel {
  margin: 0px 15px 15px;
}
.welcome-left-container .server-panel {
  margin: 15px;
}
.welcome-left-container .server-panel .panel-header {
  padding-bottom: 0;
}
.welcome-left-container .server-panel .panel-body div {
  padding: 0;
}
.welcome-left-container .server-panel .title {
  background: #f2f2f2;
  height: 40px;
  line-height: 40px;
  padding-left: 15px;
  margin: 0;
}
.welcome-left-container .server-panel span {
  height: 30px;
  padding-top: 10px;
  padding-left: 15px;
  display: block;
  background: #fafafa;
}
.welcome-edge .comment-panel .panel-body {
  padding-top: 10px;
}
.welcome-edge .comment-panel .commentList .item {
  margin: 0 0 20px;
}
.welcome-edge .contact-panel {
  margin-top: 15px;
}
.welcome-edge .contact-panel .panel-header {
  padding-bottom: 0;
}
.column-wrap {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  padding: 0px;
  background: #f5f5f5;
  overflow-x: hidden;
  overflow-y: auto;
}
.column-content {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  padding: 15px;
  background: #f5f5f5;
  height: 100%;
  overflow-x: hidden;
  margin-left: 0px;
}
.page-content {
  padding: 0px;
}
.page-content-wrap {
  background: #fff;
  padding: 20px;
  margin: 0;
}
@media (max-width: 600px) {
  .layui-nav-no-bg {
    background: #fff;
  }
  .layui-nav-no-bg .layui-nav-item {
    border-bottom: 1px solid #f8f8f8;
  }
  .column-edge {
    float: none;
    width: 100%;
    height: auto;
    padding-bottom: 10px;
  }
  .column-content {
    background: #fff;
    height: auto;
    margin-left: 0px;
  }
  .layui-tab-content {
    padding: 15px 0;
  }
  .layui-form-label {
    padding: 9px 0px;
  }
  .layui-input-block {
    margin-left: 80px;
  }
}
.layui-nav .layui-nav-item a {
  display: block;
  padding: 0 20px;
  color: #c2c2c2;
  transition: all .3s;
  -webkit-transition: all .3s;
}
.main-layout-footer{
  height: 60px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.layer-panel-blue {
    border-color: #b6dfff;
}
.layer-panel-blue .layui-colla-title {
    background-color: #b6dfff;
}
.layer-panel-red {
    border-color: #ffc4cc;
}
.layer-panel-red .layui-colla-title {
    background-color: #ffc4cc;
}
.hidden{
  display: none !important;
}

/* ============ 骨架屏 ============ */
.skeleton-loader {
  padding: 16px;
}
.skeleton-card {
  background: var(--card-bg, #fff);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border, #e5e7eb);
}
.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  margin-bottom: 10px;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w30 { width: 30%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w100 { width: 100%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ 侧边栏美化覆盖 ============ */

/* 滚动条 */
.main-layout-side::-webkit-scrollbar {
  width: 4px;
}
.main-layout-side::-webkit-scrollbar-track {
  background: transparent;
}
.main-layout-side::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

/* 父级菜单项（section 标题） */
.main-layout-side .side-nav .side-nav-section > a {
  height: 42px;
  line-height: 42px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}
.main-layout-side .side-nav .side-nav-section > a:hover {
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.08);
}
/* 展开的父级 */
.main-layout-side .side-nav .side-nav-section.open > a {
  color: rgba(255,255,255,0.95) !important;
}

/* 子菜单容器 — 不加背景色，融入侧边栏 */
.main-layout-side .side-nav .side-nav-child {
  padding: 4px 0;
}
.main-layout-side .side-nav .side-nav-child > li {
  position: relative;
}

/* 子菜单项（叶子） */
.main-layout-side .side-nav .side-nav-child a {
  height: 36px;
  line-height: 36px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  transition: all 0.15s ease;
}
.main-layout-side .side-nav .side-nav-child a:hover {
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.08);
}

/* 选中态 — 子菜单 */
.main-layout-side .side-nav .side-nav-child li.active,
.main-layout-side .side-nav .active {
  background-color: transparent !important;
}
.main-layout-side .side-nav .side-nav-child li.active > a {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  font-weight: 500;
}

/* 选中态 — 父级 */
.main-layout-side .side-nav .active > a {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}

/* 左侧选中指示条 */
.main-layout-side .side-nav .side-nav-child li.active::after,
.main-layout-side .side-nav li.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: linear-gradient(180deg, #60a5fa, #a78bfa);
  border-radius: 0 3px 3px 0;
}

/* 二级分组 — 可展开子导航 */
.main-layout-side .side-nav .side-nav-group > a {
  height: 36px;
  line-height: 36px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  display: block;
  cursor: pointer;
  position: relative;
}
.main-layout-side .side-nav .side-nav-group > a:hover {
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.08);
}
/* 二级分组箭头（默认朝下，展开时上旋） */
.main-layout-side .side-nav .side-nav-group > a::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  border: 5px solid transparent;
  border-top: 6px solid rgba(255,255,255,0.4);
  transform: translateY(-25%);
  transition: transform 0.2s ease;
}
.main-layout-side .side-nav .side-nav-group.open > a::after {
  transform: translateY(-75%) rotate(180deg);
}
/* 顶级 section 也加箭头（与二级分组同款），展开时上旋 */
.main-layout-side .side-nav .side-nav-section > a::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  border: 5px solid transparent;
  border-top: 6px solid rgba(255,255,255,0.4);
  transform: translateY(-25%);
  transition: transform 0.2s ease;
}
.main-layout-side .side-nav .side-nav-section.open > a::after {
  transform: translateY(-75%) rotate(180deg);
}

/* ===== 侧边栏"分组 vs 页面"的视觉区分（2026-09-28 用户："菜单组能不能加粗/换个样式"）=====
   侧边栏是紫蓝渐变底，层级就用**权重 + 亮度**表达，别加底色（否则整条侧边栏变花）：
     一级分组（总览/商品库/采集监控…）  700 / 0.94 亮白 / 13.5px / 字距 .8  ← 最"重"
     二级分组（分组里再套分组，当前数据没用到，留着） 600 / 0.86 / 字距 .4
     叶子页面（真正的页面）            400 / 0.55 灰（选中态另有高亮）
   分组之间再加一条**极淡分隔线**，让"有几个分组"一眼可数（不占额外高度）。 */
.main-layout-side .side-nav .side-nav-section > a {
  color: rgba(255, 255, 255, 0.94);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
}
.main-layout-side .side-nav .side-nav-group > a {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  letter-spacing: 0.4px;
}
/* 分组之间的分隔线：只在"还有下一个分组"时出现（首尾不画） */
.main-layout-side .side-nav .side-nav-section + .side-nav-section {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 6px;
  padding-top: 2px;
}
/* 叶子页面的图标与文字之间留一点空隙，和加粗的分组标题拉开差别 */
.main-layout-side .side-nav .side-nav-child a {
  color: rgba(255, 255, 255, 0.6);
}

/* 分组内链接缩进由 .nav-level-N 按层级控制（支持多级分组） */

/* 侧边栏搜索框（type=search）：WebKit 的原生 ✕ 清空按钮在深色底上是一块灰疙瘩，关掉它
   —— 清空可以按 Esc / 选中删除；点了搜索结果也会自动清空（见 app.js globalSearchGo）。 */
.main-layout-side input[type="search"]::-webkit-search-cancel-button,
.main-layout-side input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* ===== 组头吸顶 + 当前组高亮（2026-10-13 用户拍板，配合 app.js 的"同级单开"） =====
   吸顶：滚动时**当前分组名一直贴在侧边栏顶部**，翻到哪一组永远看得见。
   ⚠️ 侧边栏底是渐变（#596574 → #115ebd），吸顶头**必须挡住滚过的内容**。
      首版用了块深蓝不透明底，用户反馈"太深了、跟页面很不搭" → 改成"毛玻璃"（见下）。 */
.main-layout-side .side-nav .side-nav-section > a,
.main-layout-side .side-nav .side-nav-group > a {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  /* 2026-10-13：吸顶头**不再画一块深色**（用户反馈"太深了，跟页面很不搭"）。
     侧边栏本身是渐变（#596574 → #115ebd），这里改用"毛玻璃"：几乎不加深底色，
     只把从下方滚过的内容糊掉 —— 观感与渐变融为一体，又不会透字。 */
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
/* 不支持 backdrop-filter 的浏览器：退回一层**与渐变中间调接近**的蓝（不是原来的深 navy），
   既不会"透字"，也不会在浅灰那段显得突兀。 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .main-layout-side .side-nav .side-nav-section > a,
  .main-layout-side .side-nav .side-nav-group > a {
    background: rgba(62, 100, 155, 0.96);
  }
}
/* 当前展开的组：左侧一条强调色，配合吸顶"一眼看出我在哪一组" */
.main-layout-side .side-nav .side-nav-section.open > a,
.main-layout-side .side-nav .side-nav-group.open > a {
  box-shadow: inset 3px 0 0 0 #4da3ff;
}

/* ============ 分组管理卡片 ============ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.card-grid .card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s;
}
.card-grid .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.card-grid .card.card-default {
    border: 2px solid #fbbf24;
}
.card-grid .card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(99,102,241,0.02) 100%);
    border-bottom: 1px solid var(--border, #e8ecef);
}
.card-grid .card .card-icon {
    font-size: 1.8em;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #fff);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    flex-shrink: 0;
}
.card-grid .card .card-title {
    font-weight: 600;
    font-size: 1.05em;
    color: var(--text-primary, #1a1a2e);
    flex: 1;
}
.card-grid .card .card-body {
    font-size: .88em;
    color: var(--text-secondary, #6c757d);
    padding: 12px 18px;
    flex: 1;
}
.card-grid .card .card-info-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 3px 0;
}
.card-grid .card .card-label {
    width: 56px;
    white-space: nowrap;
    color: var(--text-muted, #888);
    font-weight: 500;
}
.card-grid .card .card-value {
    flex: 1;
    word-break: break-all;
}

/* ============ 概览小胶囊（stat-chips/stat-chip） ============
   此前只有「采集明细」页在自己片段里定义过，别的页（账单与钱包等）用了类名却没样式，
   渲染成一串纯文字。这里做成全局默认，各页面仍可在自己的片段里覆盖。 */
.stat-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-chip {
    padding: 6px 12px; border-radius: 999px;
    background: var(--bg-muted, #f3f4f6);
    font-size: .85em; color: var(--text-muted, #6c757d);
}
.stat-chip b { color: var(--primary, #3b82f6); margin-left: 2px; }

/* ============ 平台图标（商品列表 / 店铺列表） ============
   图标文件：static/assets/images/platforms/<code>.svg（同名覆盖即可换官方 App 图标）；
   缺失时由 JS 回落到 .plat-ico-text（品牌色圆角块 + 简称）。 */
.plat-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.plat-ico {
    width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto;
    object-fit: cover; vertical-align: -4px;
}
.plat-ico-text {
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
    letter-spacing: -.2px;
}

/* ============ 可搜索的多选下拉（multi-select.js，采集配置/申请单共用）============
   两个坑（都是"被表单的 label 规则连带命中"，改这里时别再踩）：
     ① `.form-group label { width:100px }` → 选项行（也是 label）被压成 100px；
     ② `.form-group label { text-align:right }` → 选项行内容被推到右边。
   所以下面统一用 `.ms .ms-item`（类+类，权重高于"类+元素"）覆盖这两条，并显式左对齐。
   注：`float` 在这里没用——`.ms` 是 .form-group（flex 容器）的 flex 子项，CSS 规定
   flex 子项上的 float 会被忽略；"左对齐"要用 justify-content / text-align 表达。 */
/* 壳：与旁边 .form-select 同款（同高、同圆角、同边框），里面放 chip */
.ms { position: relative; flex: 1; min-width: 300px; text-align: left; }
.ms-control {
    position: relative;
    display: flex; align-items: center; gap: 6px;
    min-height: 42px; padding: 6px 36px 6px 12px;
    cursor: pointer; text-align: left;
    border: 1.5px solid #e5e7eb; border-radius: 8px; background: #fafafa;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.ms-control:hover { border-color: #c7d2fe; background: #fff; }
.ms.open .ms-control {
    border-color: #667eea; background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .12);   /* 展开时给个"聚焦"感 */
}
.ms-caret {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    color: #9aa0a6; font-size: 11px; transition: transform .15s;
}
.ms.open .ms-caret { transform: translateY(-50%) rotate(180deg); }
/* 已选能力：小胶囊（chip），左对齐、自动换行 */
.ms-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ms-placeholder { color: #9aa0a6; font-size: 13px; }
.ms-chip {
    display: inline-flex; align-items: center; gap: 2px;
    max-width: 100%; padding: 2px 4px 2px 9px;
    border-radius: 999px; background: #eef2ff; color: #3730a3;
    font-size: 12px; line-height: 1.7; white-space: nowrap;
}
.ms-chip-x {
    font-style: normal; cursor: pointer; color: #6366f1;
    width: 15px; height: 15px; line-height: 14px; text-align: center; border-radius: 50%;
}
.ms-chip-x:hover { background: #c7d2fe; color: #312e81; }
.ms-chip-more { background: #f1f5f9; color: #64748b; padding: 2px 9px; cursor: pointer; }
.ms-panel {
    position: absolute; z-index: 30; left: 0; right: 0; margin-top: 4px;
    background: #fff; border: 1px solid #e8eaf0; border-radius: 10px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, .14);
    overflow: hidden;
}
/* 下方放不下时向上弹（JS 按可视空间加 .ms-up） */
.ms.ms-up .ms-panel { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 4px; }
.ms-tools {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-bottom: 1px solid #f1f2f4; background: #fafbfc;
}
.ms-search {
    flex: 1; min-width: 0; padding: 6px 10px 6px 26px;
    border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E") no-repeat 8px center / 13px 13px;
}
.ms-search:focus { outline: none; border-color: #667eea; }
.ms-tools a { font-size: 12px; color: #4f6ef7; text-decoration: none; white-space: nowrap; }
.ms-tools a:hover { text-decoration: underline; }
/* 选项列表：像"菜单项"那样排——整行可点、悬停/选中都有反馈、状态靠右 */
.ms-list { width: 100%; box-sizing: border-box; max-height: 200px; overflow-y: auto; padding: 6px; }
.ms-list::-webkit-scrollbar { width: 8px; }
.ms-list::-webkit-scrollbar-thumb { background: #dcdfe6; border-radius: 4px; }
.ms-item {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 10px; padding: 9px 10px; border-radius: 6px;
    font-size: 13px; line-height: 1.4; cursor: pointer;
}
/* 覆盖 `.form-group label` 泄漏进来的 width:100px / text-align:right（详见上面的说明） */
.ms .ms-item {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 2px;
    text-align: left;
    justify-content: flex-start;
    color: #1f2937;
    font-weight: 400;
}
.ms .ms-item:last-child { margin-bottom: 0; }
.ms-item:hover { background: #f4f6fd; }
.ms .ms-item.ms-on { background: #eef2ff; color: #312e81; }
.ms .ms-item.ms-off { color: #9aa3af; }
.ms .ms-item.ms-off:hover { background: #fafbfc; }
/* 原生 checkbox 只做状态源（视觉隐藏），真正显示的是 .ms-tick 自绘方框 */
.ms .ms-item input {
    position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.ms-tick {
    flex: 0 0 auto; width: 16px; height: 16px; box-sizing: border-box;
    border: 1.5px solid #cbd5e1; border-radius: 4px; background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, border-color .12s;
}
.ms .ms-item.ms-on .ms-tick { background: #4f6ef7; border-color: #4f6ef7; }
.ms .ms-item.ms-on .ms-tick::after {
    content: ''; width: 4px; height: 8px; margin-top: -2px;
    border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg);
}
.ms .ms-item.ms-off .ms-tick { background: #f1f5f9; border-color: #e2e8f0; }
.ms-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 「暂不支持」= 右侧状态标签（贴右，不再挤在名称旁边） */
.ms-item-tag {
    flex: 0 0 auto; margin-left: auto; padding: 1px 7px; border-radius: 999px;
    background: #fef3c7; color: #92400e; font-size: 11px; white-space: nowrap;
}
.ms-empty { padding: 14px 10px; color: #9aa0a6; font-size: 13px; text-align: center; }

/* ============ 二次确认框（**唯一模板**，2026-10-09）=====================================
   用户："点『补齐全部接口』弹的确认框太丑了 —— 帮我重新写一个模板，所有二次确认框都用这一套。"
   所以：**别再写 window.confirm**（浏览器原生框不可样式化），一律用 `common.js::showConfirm()`；
   `tools/check_pages_syntax.py` 第四道门会拦住"裸用 confirm/prompt"的写法。
   结构（showConfirm 按这个模板生成，样式**全在这里**、不许在 JS 里写 inline 样式）：
     .confirm-mask > .confirm-box{ .confirm-head(icon+title) .confirm-body [.confirm-detail] .confirm-foot }
   语气由 `.confirm-tone-{danger|warn|normal}` 决定（图标底色 + 主按钮颜色）。
   **2026-10-10**：挂载点从 `<body>` 改为**当前 tab 的面板**（`#panel-<页>`），改成"面板内模态"——
   遮罩只盖本 tab、不盖 `.layui-tab-title`；切走随面板隐藏、切回原样（类名不动 → 不重播动画）。 */
/* ⚠️ 挂载点（2026-10-10 用户要求）：`showConfirm` 把这个节点塞进**当前 tab 的面板**
   （`.layui-tab-item`，它本身就是 `position: relative`，与 `.tab-mask`/`.modal` 依赖的是同一条）。
   这样遮罩**只盖本 tab 的内容区**、不盖 `.layui-tab-title` → 能自由切 tab；
   切到别的 tab 就是在给面板加 `display:none`，**确认框的类名一个字不动**，所以切回来"像一直都在"、
   不重播出现动画（用户："不像切回时'出现'的，好像就一直在那个 tab 里"）。
   没有 tab 的页面（登录页）由 JS 回落到 `<body>`，fixed 直接铺满视口。 */
.confirm-mask {
    /* 同 `.drawer-mask`：面板自己滚，遮罩必须 fixed + _fitOverlayMask() 量面板可见矩形，
       否则页面滚过后遮罩会整体上移。兜底铺满视口。 */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100000;
    /* 隐藏时既不可见也不挡点击：`visibility` 兜底 + `pointer-events: none`
       （2026-10-09 的教训：只写 `opacity: 0` 会用一层透明遮罩把整页点击全吃掉）。 */
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .16s ease, visibility .16s;
}
/* 压暗 + 轻微模糊画在 `::before` 上（观感对齐**表单遮罩** `.tab-mask` 的 rgba(0,0,0,.45)+blur(4px)）。
   ⚠️ 不能写在 `.confirm-mask` 本体上：`backdrop-filter` 会让**元素自己**变成 fixed 后代的包含块，
   而 `.confirm-box` 正是它的子元素、必须 `position: fixed`（面板比屏幕长时也要落在视口正中）。 */
.confirm-mask::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px);
}
.confirm-mask.show { opacity: 1; visibility: visible; pointer-events: auto; }
.confirm-box {
    /* 居中落在**视口**（不是面板）——同 `.modal-content`，面板再长、滚到哪都在屏幕正中 */
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.98);
    width: 100%; max-width: 460px; background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 18px 48px rgba(17, 24, 39, .24);
    z-index: 100001;
    transition: transform .16s ease;
}
.confirm-mask.show .confirm-box { transform: translate(-50%, -50%) scale(1); }
.confirm-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.confirm-icon {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; line-height: 1;
}
.confirm-title { padding-top: 7px; font-size: 16px; font-weight: 600; color: #111827; line-height: 1.5; }
.confirm-body {
    padding: 10px 24px 0 74px; color: #4b5563; font-size: 13.5px; line-height: 1.75;
    white-space: pre-line; max-height: 44vh; overflow-y: auto; word-break: break-word;
}
.confirm-body:empty { display: none; }
.confirm-detail {
    margin: 12px 24px 0 74px; padding: 10px 12px; border-radius: 8px;
    background: #f9fafb; border: 1px solid #eef0f3;
    color: #6b7280; font-size: 12.5px; line-height: 1.7; white-space: pre-line;
    max-height: 34vh; overflow-y: auto;
}
.confirm-detail:empty { display: none; }
.confirm-detail code { background: #eef2ff; color: #3730a3; padding: 0 4px; border-radius: 4px; }
.confirm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 24px 22px; }
.confirm-btn {
    min-width: 92px; padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.confirm-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.confirm-btn-cancel { background: #fff; border-color: #d7dbe0; color: #4b5563; }
.confirm-btn-cancel:hover { background: #f6f7f9; border-color: #c4c9d0; }
.confirm-btn-ok { color: #fff; }
/* 语气：danger=删除/停用（默认，最危险）；warn=有副作用的批量动作；normal=一般确认 */
.confirm-tone-danger .confirm-icon { background: #fef2f2; color: #dc2626; }
.confirm-tone-danger .confirm-btn-ok { background: #dc2626; }
.confirm-tone-danger .confirm-btn-ok:hover { background: #b91c1c; }
.confirm-tone-warn .confirm-icon { background: #fffbeb; color: #d97706; }
.confirm-tone-warn .confirm-btn-ok { background: #d97706; }
.confirm-tone-warn .confirm-btn-ok:hover { background: #b45309; }
.confirm-tone-normal .confirm-icon { background: #eff6ff; color: #2563eb; }
.confirm-tone-normal .confirm-btn-ok { background: #2563eb; }
.confirm-tone-normal .confirm-btn-ok:hover { background: #1d4ed8; }
@media (max-width: 600px) {
    /* 窄屏贴底（原来靠 flex-end，现在 box 是 fixed，直接钉在视口底部、拉满宽度） */
    .confirm-box {
        top: auto; right: 0; bottom: 0; left: 0; width: auto; max-width: none;
        transform: translateY(10px); border-radius: 14px 14px 0 0;
    }
    .confirm-mask.show .confirm-box { transform: none; }
    .confirm-body { padding-left: 24px; }
    .confirm-detail { margin-left: 24px; }
    .confirm-foot .confirm-btn { flex: 1; }
}

.confirm-input-wrap { padding: 14px 24px 0 74px; }
.confirm-input-wrap:empty, .confirm-input-wrap[style*="none"] { padding: 0; }
.confirm-input {
    width: 100%; box-sizing: border-box; padding: 9px 12px;
    border: 1px solid #d7dbe0; border-radius: 8px; font-size: 13.5px; color: #111827;
}
.confirm-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

/* ============ 抽屉（右侧滑出的**只读**面板，2026-10-12）=================================
   首例：平台侧「联盟接口」页的『调用历史』。生成入口 `common.js::showDrawer()`。
   与 `.confirm-*` **同族**：遮罩同样挂在**当前 tab 的面板**里（只盖内容区、不盖 `.layui-tab-title`），
   切走随面板隐藏、切回原样（类名不动 → 不重播动画），收尾也走同一个 `settleOverlaysIn()`。
   两处**有意不同**：
     ① 面板从右侧滑出、内部自己滚（`.drawer-body{overflow:auto}`），不是居中框；
     ② **点遮罩就关**（确认框有意不关：那是"必须做选择"的框，这个是只读浏览）。
   ⚠️ `.drawer-panel` 必须 `position: fixed`：面板（`.layui-tab-item`）比屏幕长的时候，
      absolute 的抽屉会被拖到屏幕外；`top` 由 JS 量 `.layui-tab-title` 的下缘写进 `style.top`
      （写死高度会在窄屏/收起侧边栏时错位 —— 与 2026-10-10 那次 `var(--sidebar-width)` 是同类坑）。
   ⚠️ `.drawer-mask` 也必须 `fixed`：2026-10-30 起每个 tab 面板自己滚，absolute 遮罩会
      跟着内容一起滚走（用户实测：总览页往上滚一点再点「采集健康明细」，遮罩整块上移）。
      打开时 JS 用 `_fitOverlayMask()` 把 left/top/width/height 写成宿主面板的可见矩形。 */
.drawer-mask {
    /* fixed（不是 absolute）：宿主面板自己滚（2026-10-30 起每个 tab 独立滚动），
       absolute 遮罩会跟着内容一起滚走 → 滚过再开抽屉，遮罩上移、底部露出页面。
       这里给的是兜底（铺满视口），打开时由 common.js::_fitOverlayMask() 收窄到面板可见矩形。 */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100000;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .16s ease, visibility .16s;
}
.drawer-mask::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .35);
}
.drawer-mask.show { opacity: 1; visibility: visible; pointer-events: auto; }
.drawer-panel {
    position: fixed; right: 0; bottom: 0; width: 480px; max-width: 100%;
    display: flex; flex-direction: column;
    background: #fff; border-left: 1px solid #e5e7eb;
    box-shadow: -12px 0 32px rgba(17, 24, 39, .16);
    /* top 由 JS 写（量 tab 标题栏下缘）；这里给个兜底值，免得 JS 没跑到时贴到屏幕顶 */
    top: 0;
    transform: translateX(100%); transition: transform .18s ease; z-index: 100001;
}
.drawer-mask.show .drawer-panel { transform: translateX(0); }
.drawer-head {
    flex: 0 0 auto; display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid #f0f2f5;
}
.drawer-title-wrap { flex: 1 1 auto; min-width: 0; }
.drawer-title { font-size: 15px; font-weight: 600; color: #111827; }
.drawer-sub { margin-top: 4px; font-size: 12px; color: #6b7280; word-break: break-all; }
.drawer-sub:empty { display: none; }
.drawer-close {
    flex: 0 0 auto; width: 28px; height: 28px; border: none; background: transparent;
    color: #9aa0a6; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.drawer-close:hover { background: #f3f4f6; color: #4b5563; }
.drawer-body { flex: 1 1 auto; overflow: auto; padding: 14px 18px 18px; }
/* 摘要条 + 筛选行（抽屉内的两个小件，页面只给类名、样式全在这里） */
.drawer-sum {
    display: flex; flex-wrap: wrap; gap: 6px 16px;
    padding: 10px 12px; margin-bottom: 12px;
    background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px;
    font-size: 12.5px; color: #4b5563;
}
.drawer-sum b { color: #111827; }
.drawer-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.drawer-table { font-size: 12.5px; }
.drawer-table th, .drawer-table td { padding: 7px 8px; }
@media (max-width: 600px) { .drawer-panel { width: 100%; } }

/* ===== 通知接收人卡片（2026-10-15 从 msg-receivers.html 搬来这里：
   接收人（平台侧/租户侧）与通知模板三页共用，别再各抄一遍。
   名字取中性的 entity-*：它描述的是"一张信息卡"的结构，不绑定某一种实体）===== */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.entity-card {
    border: 1px solid var(--border); border-radius: 12px; padding: 0;
    background: var(--bg-card); transition: all .25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.entity-card:hover { 
    box-shadow: 0 4px 12px rgba(0,0,0,.12); 
    transform: translateY(-2px);
    border-color: var(--primary, #4a90d9);
}
.entity-card .card-header { 
    display: flex; align-items: center; gap: 12px; 
    padding: 16px 18px; 
    background: linear-gradient(135deg, rgba(74,144,217,0.08) 0%, rgba(74,144,217,0.02) 100%);
    border-bottom: 1px solid var(--border);
}
.entity-card .card-header .icon { 
    font-size: 1.8em; 
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.entity-card .card-header .name { font-weight: 600; flex: 1; font-size: 1.05em; color: var(--text-primary); }
.entity-card .card-badges { padding: 8px 18px; display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); background: var(--bg-muted, #fafafa); }
.entity-card .card-badges .badge { font-size: .7em; padding: 3px 10px; border-radius: 12px; background: var(--bg-muted, #e8e8e8); color: var(--text-secondary); font-weight: 500; }
.entity-card .card-badges .badge.enabled { background: #d1fae5; color: #065f46; }
.entity-card .card-badges .badge.disabled { background: #fef3c7; color: #92400e; }
.entity-card .card-body { font-size: .88em; color: var(--text-secondary); padding: 16px 18px; flex: 1; }
.entity-card .card-body .row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.entity-card .card-body .row:last-child { margin-bottom: 0; }
.entity-card .card-body .label { width: 80px; white-space: nowrap; color: var(--text-muted, #888); font-weight: 500; }
.entity-card .card-body .value { flex: 1; word-break: break-all; }
.entity-card .card-actions { 
    padding: 12px 18px; 
    display: flex; gap: 8px; justify-content: flex-end; 
    background: var(--bg-muted, #fafafa);
    border-top: 1px solid var(--border);
}
.entity-card .card-actions .btn { font-size: .82em; padding: 5px 14px; border-radius: 6px; }
.entity-card.disabled { opacity: .6; }
.entity-card.disabled:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-color: var(--border); }

.empty-state { text-align: center; padding: 40px; color: var(--text-secondary); }

/* 功能权益勾选（2026-11-03） */
.feature-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feature-check {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}
.feature-check input[type="checkbox"] {
    margin-top: 2px;
}

/* 规则条件组合树（2026-11-03；2026-11-03 晚间强化视觉层级） */
.cond-tree { display: flex; flex-direction: column; gap: 10px; }
.cond-group {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 10px 12px 10px 14px;
    background: var(--bg-card, #fff);
}
/* 根分组：整块“触发条件”区域，蓝底 + 左粗边，和子分组明显区分 */
.cond-group.is-root {
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 60%);
    box-shadow: 0 1px 3px rgba(37, 99, 235, .08);
}
.cond-group.is-root > .cond-group-head {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #bfdbfe;
}
.cond-group.is-root > .cond-group-head .cond-group-title {
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
}
.cond-group.is-root.is-single {
    border-left-color: #0ea5e9;
}
/* 子分组：琥珀色虚线 + 缩进 + 连接线，一眼看出是嵌套组合 */
.cond-group.is-nested {
    position: relative;
    margin: 6px 0 6px 16px;
    border: 1px dashed #f59e0b;
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}
.cond-group.is-nested::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 18px;
    width: 13px;
    border-top: 1px dashed #f59e0b;
}
.cond-group.is-nested > .cond-group-head .cond-group-title {
    color: #b45309;
    font-weight: 700;
}
.cond-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cond-group-head .cond-op { width: auto; min-width: 150px; }
.cond-group-head .cond-op:disabled { opacity: .65; cursor: not-allowed; }
.cond-group-head .cond-group-title { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.cond-badge {
    display: inline-flex; align-items: center; padding: 1px 8px;
    border-radius: 999px; font-size: 11px; font-weight: 600;
    background: #dbeafe; color: #1d4ed8;
}
.cond-badge.is-nested { background: #fef3c7; color: #b45309; }
.cond-badge.is-single { background: #e0f2fe; color: #0369a1; }
.cond-children { display: flex; flex-direction: column; gap: 6px; }
/* 条件行：白色小卡片 + 指标胶囊 */
.cond-row {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    padding: 7px 9px; border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.cond-row.is-invalid { border-color: #dc2626; background: #fef2f2; }
.cond-row .cond-metric {
    font-size: 12px; font-weight: 700; min-width: 42px;
    padding: 2px 8px; border-radius: 999px;
    background: #eff6ff; color: #1d4ed8;
    text-align: center;
}
.cond-row .cond-trigger { flex: 1 1 220px; min-width: 180px; }
.cond-row .cond-threshold { flex: 0 0 120px; width: 120px; }
.cond-row .cond-unit { font-size: 12px; color: var(--text-secondary); min-width: 18px; }
.cond-row .cond-remove { flex: 0 0 auto; }
/* AND/OR 连接标签 */
.cond-join {
    align-self: flex-start;
    margin: -1px 0 -1px 18px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #64748b;
    background: var(--bg-muted, #f8fafc);
    border-left: 1px solid var(--border, #e5e7eb);
    line-height: 1.6;
}
.cond-empty { font-size: 12px; color: var(--text-muted); padding: 6px 2px; }
.cond-preview {
    margin-top: 8px; padding: 8px 11px; border-radius: 8px;
    background: #f8fafc; border: 1px dashed #cbd5e1;
    font-size: 12px; color: var(--text-secondary); line-height: 1.6;
}
.cond-preview b { color: #1d4ed8; }
.cond-error { color: #dc2626; font-size: 12px; margin-top: 4px; }

/* 条件树布局微调（2026-11-03 第二版）：子分组与同级条件左对齐，连接词做成居中胶囊 */
.cond-group.is-nested {
    margin-left: 0;
    padding-left: 10px;
    box-shadow: 0 1px 3px rgba(180, 83, 9, .08);
}
.cond-group.is-nested::before { display: none; }
.cond-group.is-nested > .cond-group-head {
    margin: -2px 0 8px 0;
    padding: 6px 9px;
    background: #fef3c7;
    border-radius: 6px;
}
.cond-group.is-nested > .cond-group-head .cond-group-title { color: #92400e; }
.cond-group-head .cond-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cond-summary { font-size: 11.5px; color: #64748b; margin-left: 2px; }
.cond-single-hint { font-size: 11.5px; color: #64748b; }
.cond-join {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    margin: 1px 0;
    padding: 1px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .10);
}
.cond-join.is-or {
    color: #b45309;
    background: #fffbeb;
    border-color: #fcd34d;
    box-shadow: 0 1px 2px rgba(180, 83, 9, .10);
}
.cond-row:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.cond-row .cond-trigger, .cond-row .cond-threshold { background: #fff; }

/* 条件树颜色编码（2026-11-03 第三版）：蓝=条件，绿=子分组，橙=或者 */
/* 根容器保持中性，让蓝色条件和绿色子分组成为视觉主体 */
.cond-group.is-root {
    border: 1px solid #cbd5e1;
    border-left: 4px solid #475569;
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.cond-group.is-root > .cond-group-head {
    border-bottom: 1px dashed #cbd5e1;
}
.cond-group.is-root > .cond-group-head .cond-group-title { color: #0f172a; }

/* 子分组：绿色系 */
.cond-group.is-nested {
    border: 1px solid #a7f3d0;
    border-left: 4px solid #059669;
    background: #ecfdf5;
    box-shadow: 0 1px 3px rgba(5, 150, 105, .08);
}
.cond-group.is-nested > .cond-group-head {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
}
.cond-group.is-nested > .cond-group-head .cond-group-title { color: #065f46; }
.cond-badge.is-nested { background: #a7f3d0; color: #065f46; }

/* 条件行：蓝色系 */
.cond-row {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 3px solid #60a5fa;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .06);
}
.cond-row .cond-metric { background: #dbeafe; color: #1e40af; }
.cond-row.is-invalid {
    background: #fef2f2;
    border-color: #dc2626;
    border-left-color: #dc2626;
}

/* 添加按钮：蓝色=条件，绿色=子分组 */
.cond-head-actions .btn.cond-add-btn {
    border-radius: 7px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .10);
}
.cond-head-actions .btn.cond-add-condition {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.cond-head-actions .btn.cond-add-condition:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.cond-head-actions .btn.cond-add-group {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
.cond-head-actions .btn.cond-add-group:hover {
    background: #047857;
    border-color: #047857;
    color: #fff;
}
.cond-head-actions .btn.cond-add-btn:disabled {
    opacity: .45;
    box-shadow: none;
}

/* 连接词：并且=中性灰；或者=橙色，避免和蓝/绿实体抢色 */
.cond-join {
    color: #475569;
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: none;
}
.cond-join.is-or {
    color: #b45309;
    background: #fffbeb;
    border-color: #fcd34d;
}

/* 颜色图例 */
.cond-legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 4px;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}
.cond-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.cond-dot + .cond-dot { margin-left: 8px; }
.cond-dot-condition { background: #3b82f6; }
.cond-dot-group { background: #10b981; }
.cond-dot-group { margin-left: 7px; }

/* 第四版配色（2026-11-03）：子分组回归琥珀/橙色，绿色不采用 */
.cond-group.is-nested {
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    background: #fffbeb;
    box-shadow: 0 1px 3px rgba(180, 83, 9, .10);
}
.cond-group.is-nested > .cond-group-head {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}
.cond-group.is-nested > .cond-group-head .cond-group-title { color: #92400e; }
.cond-badge.is-nested { background: #fde68a; color: #92400e; }

/* 添加分组按钮：深琥珀底 + 白字，和蓝色“添加条件”区分 */
.cond-head-actions .btn.cond-add-group {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
}
.cond-head-actions .btn.cond-add-group:hover {
    background: #92400e;
    border-color: #92400e;
    color: #fff;
}

/* 或者：紫罗兰，避免和橙色子分组混淆 */
.cond-join.is-or {
    color: #6d28d9;
    background: #f5f3ff;
    border-color: #ddd6fe;
    box-shadow: none;
}

/* 图例：条件=蓝，子分组=琥珀 */
.cond-dot-group { background: #f59e0b; }

/* 第五版：添加条件/添加分组改成浅色底 + 彩色字，避免白字像禁用按钮 */
.cond-head-actions .btn.cond-add-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.cond-head-actions .btn.cond-add-btn::after { display: none; }
.cond-head-actions .btn.cond-add-condition {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.cond-head-actions .btn.cond-add-condition:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .18);
    transform: translateY(-1px);
}
.cond-head-actions .btn.cond-add-group {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #b45309;
}
.cond-head-actions .btn.cond-add-group:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    box-shadow: 0 2px 6px rgba(180, 83, 9, .16);
    transform: translateY(-1px);
}
.cond-head-actions .btn.cond-add-btn:active {
    transform: scale(.97);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .10);
}
.cond-head-actions .btn.cond-add-btn:disabled {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #94a3b8;
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 触发类型用完后按钮仍可点击，用轻提示说明原因 */
.cond-no-more {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.internal-message-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
}
.internal-message-item.is-unread { color: #0f172a; }
.internal-message-item.is-unread:hover { background: #f8fafc; }
.internal-message-item.is-read { color: #94a3b8; background: #fafafa; cursor: default; }
.internal-message-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.internal-message-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
  display: inline-block; flex: 0 0 auto;
}
.internal-message-title { font-weight: 600; }
.internal-message-item.is-read .internal-message-title { font-weight: 400; }
.internal-message-time { color: #94a3b8; font-size: 12px; margin-left: auto; }
.internal-message-body { margin-top: 5px; font-size: 12.5px; line-height: 1.7; }
.internal-message-item.is-read .internal-message-body { color: #94a3b8; }

/* 我的通知：未送达告警条 + 摘要范围 */
.msg-alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
}
.msg-alert-icon { font-size: 18px; line-height: 1.4; flex: 0 0 auto; }
.msg-alert-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; }
.msg-alert-title { font-weight: 600; }
.msg-alert-sub { color: #92400e; font-size: 12px; margin-top: 2px; }
.msg-alert-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.msg-alert-banner .btn { white-space: nowrap; }
.msg-scope { display: flex; flex-direction: column; gap: 3px; }
.msg-scope-main { font-size: 13px; }
.msg-scope-sub { font-size: 11.5px; color: var(--text-muted, #6b7280); }
.msg-scope-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.msg-scope-detail { font-size: 12px; color: var(--text-secondary, #4b5563); margin-top: 2px; }
@media (max-width: 720px) {
  .msg-alert-banner { flex-wrap: wrap; }
  .msg-alert-actions { width: 100%; justify-content: flex-end; }
}
