:root {
    --sidebar-width: 240px;
    --bg-primary: #f0f5ff;
    --bg-sidebar: #1e3a5f;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --border-dim: rgba(37,99,235,0.1);
    --neon-blue: #2563eb;
    --neon-purple: #3b82f6;
    --text-bright: #334155;
    --text-title: #0f172a;
    --text-muted: #94a3b8;
    --status-green: #10b981;
    --status-red: #ef4444;
    --status-yellow: #f59e0b;
    --status-blue: #2563eb;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --z-sidebar: 1000;
    --z-overlay: 999;
    --z-toast: 1080;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    overflow-x: hidden;
    color: var(--text-bright);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a5f 0%, #1e40af 100%);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform .3s var(--ease);
}

.sidebar-brand {
    padding: 20px;
    color: #ffffff;
    font-size: 18px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.15);
    font-weight: 600;
    letter-spacing: 1px;
}
.sidebar-brand .brand-mark {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-brand .brand-tag {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,.75);
    vertical-align: middle;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: all .3s;
    border-left: 3px solid transparent;
    gap: 10px;
    font-size: 14px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,.15);
    color: #ffffff;
    border-left-color: #ffffff;
}

/* 1.1.55 F④：侧边栏「系统更新」红点——检测到新版本且未被忽略时由 sidebar.js 注入 */
.sidebar-menu li a .update-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4f;
    box-shadow: 0 0 6px rgba(255,77,79,.9);
    flex-shrink: 0;
    margin-left: auto;
    animation: update-dot-pulse 2s ease-in-out infinite;
}

@keyframes update-dot-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255,77,79,.7); }
    50% { box-shadow: 0 0 10px rgba(255,77,79,1); }
}

/* 控制台「发现新版本」通栏横幅（dashboard.js 注入；点「忽略本次」或 × 不再显示） */
.update-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-lg, 14px);
    background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 48%, #3b82f6 100%);
    box-shadow: 0 10px 26px rgba(37,99,235,.28);
    color: #fff;
}

/* 右上角光晕装饰 */
.update-banner::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.22), rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.update-banner-ico {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    font-size: 20px;
}

.update-banner-main { flex: 1; min-width: 0; }

.update-banner-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.update-banner-title .ver {
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,.22);
    border-radius: 6px;
    padding: 1px 8px;
}

.update-banner-sub {
    font-size: 13px;
    opacity: .88;
    margin-top: 2px;
}

/* 更新说明：最多两行，超出省略 */
.update-banner-log {
    font-size: 12.5px;
    line-height: 1.65;
    opacity: .82;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.update-banner-ops {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    /* 右上角 × 忽略按钮（绝对定位）留出空间，避免窄屏重叠 */
    padding-right: 18px;
}

.update-banner-ops .btn {
    border-radius: 8px;
    font-size: 13.5px;
    padding: 7px 16px;
    white-space: nowrap;
}

.update-banner-ops .btn-banner-main {
    background: #fff;
    border: none;
    color: var(--neon-blue);
    font-weight: 600;
}

.update-banner-ops .btn-banner-main:hover {
    background: #eff4ff;
    color: var(--neon-blue);
}

.update-banner-ops .btn-banner-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,.45);
    color: rgba(255,255,255,.92);
}

.update-banner-ops .btn-banner-ghost:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.7);
    color: #fff;
}

.update-banner-close {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 1;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.6);
    font-size: 17px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
}

.update-banner-close:hover { color: #fff; }

@media (max-width: 768px) {
    .update-banner { flex-wrap: wrap; padding: 14px 16px 16px; }
    .update-banner-ops { width: 100%; }
    .update-banner-ops .btn { flex: 1; }
    /* 按钮组换行占满整行（已含「忽略本次」），× 悬浮右上会压住标题，隐藏 */
    .update-banner-close { display: none; }
}

.sidebar-menu li a.active::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255,255,255,.6);
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 999;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .3s;
}

.top-bar {
    background: var(--bg-card);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    margin: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px solid rgba(0,0,0,.06);
}

.top-bar h4 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-title);
}

#page-content {
    padding: 20px;
    flex: 1;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--neon-blue);
    cursor: pointer;
    padding: 0;
}

.stat-card {
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(37,99,235,0.06);
    height: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,.06);
    border-top: 3px solid transparent;
    border-image: linear-gradient(to right, var(--neon-blue), var(--neon-purple)) 1;
    border-image-slice: 1;
    transition: box-shadow .3s;
}

.stat-card:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-info) .fs-2,
.stat-card:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-info) .fs-1,
.stat-card:not(.bg-primary):not(.bg-success):not(.bg-warning):not(.bg-info) .fs-3 {
    color: var(--neon-blue) !important;
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: box-shadow .3s var(--ease), border-color .3s var(--ease);
}

.card:hover {
    box-shadow: 0 6px 20px rgba(37,99,235,0.1);
    border-color: rgba(37,99,235,0.15);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid rgba(0,0,0,.08);
    color: var(--text-title);
}

.card-footer {
    background: #f8fafc;
    border-top: 1px solid rgba(0,0,0,.08);
}

.card-body {
    color: var(--text-bright);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 表格列截断辅助：配合 table-layout:fixed 使用 */
/* 默认 td overflow visible 让 title tooltip 正常触发；截断在 .ce-cell-clip 上做 */
.table-wrap table[style*="table-layout:fixed"] tbody td {
    overflow: visible;
}
/* 内容管理文章列表：标题/行业/站点列超长省略号截断 */
td.ce-cell-clip {
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.text-truncate-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    width: 100%;
}

/* 表格列宽拖动（static/js/core/table-resize.js）：表头右边缘手势区。
   站点管理「网站标题」等长文本列被固定宽度截断，拖宽即可看全，双击自适应。 */
.table-wrap th.th-resizable {
    position: relative;
}

.table-wrap th.th-resizable > .col-resizer {
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 9px;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    z-index: 3;
}

/* 审计修复（1.1.65）：末列手柄不再溢出表格外缘 4px——配合 .table-wrap 的
   overflow-x:auto，-4px 会让页面出现 4px 横向滚动条闪现。 */
.table-wrap th.th-resizable:last-child > .col-resizer {
    right: 0;
}

.table-wrap th.th-resizable > .col-resizer::after {
    content: '';
    position: absolute;
    top: 22%;
    bottom: 22%;
    left: 4px;
    width: 1px;
    background: rgba(100, 116, 139, .28);
}

.table-wrap th.th-resizable:hover > .col-resizer::after {
    background: var(--primary, #3b82f6);
    width: 2px;
}

body.col-resizing {
    cursor: col-resize;
    user-select: none;
}

body.col-resizing * {
    cursor: col-resize !important;
}

.table-wrap table {
    margin-bottom: 0;
}

.table {
    color: #475569;
    border-color: #e2e8f0;
}

.table thead th {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table tbody td {
    color: #475569;
    border-color: #e2e8f0;
    vertical-align: middle;
    padding: 12px 16px;
}

.table tbody tr {
    background: #ffffff;
    transition: background .2s var(--ease);
}

.table-hover tbody tr:hover {
    background: #eff6ff;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #ffffff;
}

.table-striped tbody tr:nth-of-type(even) {
    background: #f8fafc;
}

.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid #e2e8f0;
    color: var(--text-bright);
    border-radius: 8px;
    transition: border-color .3s, box-shadow .3s;
}

.form-control:focus,
.form-select:focus {
    background: #ffffff;
    border-color: var(--neon-blue);
    color: var(--text-bright);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-control::placeholder {
    color: #64748b;
}

.form-label {
    color: #1e293b;
    font-weight: 500;
}

.form-text {
    color: var(--text-muted) !important;
}

.form-check-input {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

.form-check-input:checked {
    background-color: var(--neon-blue);
    border-color: var(--neon-blue);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    border-color: var(--neon-blue);
}

.form-check-label {
    color: var(--text-bright);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: all .3s;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(37,99,235,0.35);
    transform: translateY(-1px);
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: all .3s;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(239,68,68,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: all .3s;
}

.btn-success:hover {
    box-shadow: 0 4px 15px rgba(16,185,129,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: all .3s;
}

.btn-warning:hover {
    box-shadow: 0 4px 15px rgba(245,158,11,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-info {
    background: linear-gradient(135deg, #2563eb, #0891b2);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: all .3s;
}

.btn-info:hover {
    box-shadow: 0 4px 15px rgba(37,99,235,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 8px;
    transition: all .3s;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-outline-primary {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
    border-radius: 8px;
    transition: all .3s;
}

.btn-outline-primary:hover {
    background: rgba(37,99,235,0.1);
    color: var(--neon-blue);
    border-color: var(--neon-blue);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: #cbd5e1;
    border-radius: 8px;
}

.btn-outline-secondary:hover {
    background: rgba(203,213,225,0.2);
    color: var(--text-bright);
    border-color: #94a3b8;
}

.btn-outline-danger {
    color: var(--status-red);
    border-color: var(--status-red);
    border-radius: 8px;
}

.btn-outline-danger:hover {
    background: rgba(239,68,68,0.1);
    color: var(--status-red);
    border-color: var(--status-red);
}

.btn-outline-info {
    color: var(--neon-blue);
    border-color: rgba(37,99,235,0.4);
    border-radius: 8px;
}

.btn-outline-info:hover {
    background: rgba(37,99,235,0.08);
    color: var(--neon-blue);
    border-color: var(--neon-blue);
}

.btn-outline-success {
    color: var(--status-green);
    border-color: var(--status-green);
    border-radius: 8px;
}

.btn-outline-success:hover {
    background: rgba(16,185,129,0.1);
    color: var(--status-green);
    border-color: var(--status-green);
}

.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 5px 10px;
}

.badge.bg-success {
    background: rgba(16,185,129,0.12) !important;
    color: var(--status-green);
    border: 1px solid rgba(16,185,129,0.25);
}

.badge.bg-danger {
    background: rgba(239,68,68,0.12) !important;
    color: var(--status-red);
    border: 1px solid rgba(239,68,68,0.25);
}

.badge.bg-warning {
    background: rgba(245,158,11,0.12) !important;
    color: var(--status-yellow);
    border: 1px solid rgba(245,158,11,0.25);
}

.badge.bg-info {
    background: rgba(37,99,235,0.12) !important;
    color: var(--neon-blue);
    border: 1px solid rgba(37,99,235,0.25);
}

.badge.bg-primary {
    background: rgba(37,99,235,0.12) !important;
    color: var(--neon-blue);
    border: 1px solid rgba(37,99,235,0.25);
}

.badge.bg-secondary {
    background: rgba(100,116,139,0.12) !important;
    color: var(--text-muted);
    border: 1px solid rgba(100,116,139,0.25);
}

.badge.bg-light {
    background: rgba(226,232,240,0.5) !important;
    color: var(--text-bright);
    border: 1px solid rgba(226,232,240,0.6);
}

.pagination {
    gap: 4px;
}

.page-link {
    background: var(--bg-card);
    border: 1px solid #e2e8f0;
    color: var(--text-bright);
    border-radius: 6px !important;
    transition: all .2s;
}

.page-link:hover {
    background: rgba(37,99,235,0.08);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-color: transparent;
    color: #fff;
}

.page-item.disabled .page-link {
    background: var(--bg-card);
    border-color: #e2e8f0;
    color: var(--text-muted);
}

.alert-info {
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.3);
    color: var(--neon-blue);
    border-radius: 8px;
}

.alert-success {
    background: rgba(16,185,129,0.08);
    border: 1px solid var(--status-green);
    color: var(--status-green);
    border-radius: 8px;
}

.alert-danger {
    background: rgba(239,68,68,0.08);
    border: 1px solid var(--status-red);
    color: var(--status-red);
    border-radius: 8px;
}

.alert-warning {
    background: rgba(245,158,11,0.08);
    border: 1px solid var(--status-yellow);
    color: var(--status-yellow);
    border-radius: 8px;
}

.toast {
    background: #ffffff !important;
    border-left: 4px solid var(--neon-blue);
    border-radius: 8px;
    color: var(--text-bright);
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
}

.toast.bg-success {
    border-left-color: var(--status-green);
}

.toast.bg-danger {
    border-left-color: var(--status-red);
}

.toast.bg-warning {
    border-left-color: var(--status-yellow);
}

.toast.bg-info {
    border-left-color: var(--neon-blue);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 12px;
    color: var(--text-bright);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,.08);
}

.modal-title {
    color: var(--text-title);
}

.btn-close {
    filter: none;
}

.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,.1);
}

.dropdown-item {
    color: var(--text-bright);
}

.dropdown-item:hover {
    background: rgba(37,99,235,0.08);
    color: var(--neon-blue);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}

/* 表格/卡片局部加载遮罩（配合 utils.js showLoadingMask 使用） */
.loading-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.6);
    z-index: 10;
}

.loading-mask .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#app {
    display: none;
}

code {
    color: var(--neon-blue);
    background: rgba(37,99,235,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

pre {
    color: var(--text-bright);
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 8px;
}

a {
    color: var(--neon-blue);
}

a:hover {
    color: #1d4ed8;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--text-bright) !important;
}

.text-danger {
    color: var(--status-red) !important;
}

.text-primary {
    color: var(--neon-blue) !important;
}

.text-success {
    color: var(--status-green) !important;
}

.text-warning {
    color: var(--status-yellow) !important;
}

.text-info {
    color: var(--neon-blue) !important;
}

.text-white {
    color: #fff !important;
}

.bg-light {
    background: rgba(241,245,249,0.8) !important;
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.15;
}

.progress {
    background: #e2e8f0;
    border-radius: 6px;
}

.progress-bar {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
}

.input-group-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-bright);
}

hr {
    border-color: rgba(0,0,0,.08);
}

.spinner-border {
    border-color: #e2e8f0;
    border-top-color: var(--neon-blue);
}

.nav-tabs {
    border-bottom-color: #e2e8f0;
}

.nav-link {
    color: var(--text-muted);
}

.nav-link.active {
    color: var(--neon-blue);
    border-color: var(--neon-blue) var(--neon-blue) transparent;
}

.list-group-item {
    background: var(--bg-card);
    border-color: rgba(0,0,0,.08);
    color: var(--text-bright);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.stat-card.bg-primary,
.stat-card.bg-success,
.stat-card.bg-warning,
.stat-card.bg-info,
.stat-card.bg-danger,
.stat-card.bg-secondary,
.stat-card.bg-dark {
    border-top: 3px solid transparent;
    border-image: none;
    color: #ffffff;
}

.stat-card.bg-primary .fs-3,
.stat-card.bg-success .fs-3,
.stat-card.bg-warning .fs-3,
.stat-card.bg-info .fs-3,
.stat-card.bg-danger .fs-3,
.stat-card.bg-secondary .fs-3,
.stat-card.bg-dark .fs-3 {
    color: #ffffff !important;
}

.stat-card.bg-primary .small,
.stat-card.bg-success .small,
.stat-card.bg-warning .small,
.stat-card.bg-info .small,
.stat-card.bg-danger .small,
.stat-card.bg-secondary .small,
.stat-card.bg-dark .small {
    color: rgba(255,255,255,0.75) !important;
}

.stat-card.bg-primary [style*="opacity"],
.stat-card.bg-success [style*="opacity"],
.stat-card.bg-warning [style*="opacity"],
.stat-card.bg-info [style*="opacity"],
.stat-card.bg-danger [style*="opacity"],
.stat-card.bg-secondary [style*="opacity"],
.stat-card.bg-dark [style*="opacity"] {
    color: rgba(255,255,255,0.75) !important;
}

.stat-card.bg-primary .bi,
.stat-card.bg-success .bi,
.stat-card.bg-warning .bi,
.stat-card.bg-info .bi,
.stat-card.bg-danger .bi,
.stat-card.bg-secondary .bi,
.stat-card.bg-dark .bi {
    color: rgba(255,255,255,0.5) !important;
    opacity: 1 !important;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: inline-block;
    }
    .top-bar {
        margin: 10px;
    }
    #page-content {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}

.sidebar-menu li a:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: -2px;
}

a:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.page-link:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: -2px;
    box-shadow: none;
    z-index: 3;
}

.task-row-running {
    border-left: 3px solid var(--neon-blue);
}

.task-row-running td:first-child {
    padding-left: 13px;
}

.task-skeleton {
    animation: task-skeleton-pulse 1.5s ease-in-out infinite;
}

.task-skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: #e2e8f0;
}

@keyframes task-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.task-empty-state {
    padding: 48px 20px;
    text-align: center;
}

.task-empty-state .task-empty-icon {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.task-empty-state .task-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 4px;
}

.task-empty-state .task-empty-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.task-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    background: #f8fafc;
}

.task-detail-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.task-detail-info-cell {
    padding: 14px 16px;
    border-right: 1px solid #e2e8f0;
}

.task-detail-info-cell:last-child {
    border-right: none;
}

.task-detail-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.task-detail-info-value {
    font-size: 0.875rem;
    color: var(--text-title);
}

.task-result-table td,
.task-result-table th {
    font-size: 0.8125rem;
    padding: 8px 12px;
    vertical-align: top;
    word-break: break-all;
}

.task-result-table td:last-child,
.task-result-table th:last-child {
    word-break: break-word;
}

@media (max-width: 768px) {
    .task-detail-info {
        grid-template-columns: repeat(2, 1fr);
    }
    .task-detail-info-cell:nth-child(2) {
        border-right: none;
    }
    .task-detail-info-cell:nth-child(1),
    .task-detail-info-cell:nth-child(2) {
        border-bottom: 1px solid #e2e8f0;
    }
}

/* ===== 死链处理策略卡片（config-deadlink） ===== */
.strategy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.strategy-card {
    display: block;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.strategy-card:hover {
    border-color: #93c5fd;
}
.strategy-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb inset;
}
.strategy-card-body {
    user-select: none;
}
.strategy-radio {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    vertical-align: middle;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
}
.strategy-radio.checked {
    border-color: #2563eb;
    background: radial-gradient(circle, #2563eb 40%, #fff 45%);
}

/* ===== UX 优化：导航折叠组 / 页面说明 / 空状态 / 工具类 ===== */

/* 可折叠菜单组头 */
.sidebar-menu li.menu-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding-right: 16px;
}
.sidebar-menu li.menu-header:hover {
    color: rgba(255,255,255,.9);
}
.sidebar-menu li.menu-header .group-arrow {
    font-size: 10px;
    transition: transform .2s var(--ease);
    opacity: .7;
}
.sidebar-menu li.menu-header.collapsed .group-arrow {
    transform: rotate(-90deg);
}
.sidebar-menu li.group-hidden {
    display: none;
}

/* 固定底栏（1.1.18）：个人资料/退出登录不随菜单滚动——sidebar 是 flex 列、
   sidebar-menu 为 flex:1 自滚动容器，footer 作为兄弟节点天然固定在底部 */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 6px 0 10px;
    flex-shrink: 0;
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: all .3s;
    border-left: 3px solid transparent;
    gap: 10px;
    font-size: 14px;
}
.sidebar-footer a:hover,
.sidebar-footer a.active {
    color: #fff;
    background: rgba(255,255,255,.08);
    border-left-color: var(--primary, #3b82f6);
}

/* 顶栏页面说明（标题下一行小字，说明当前页是干什么的） */
.top-bar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.page-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 统一空状态（表格行内/区块通用） */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 2.2rem;
    opacity: .5;
    display: block;
    margin-bottom: 10px;
}
.empty-state-text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
}
.empty-state-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.empty-state .btn {
    margin-top: 4px;
}

/* 高频内联样式收敛 */
.cursor-pointer {
    cursor: pointer;
}
.fs-xs {
    font-size: .7rem;
}

/* 窄屏细节：顶栏标题与说明不挤压 */
@media (max-width: 576px) {
    .top-bar {
        padding: 12px 14px;
    }
    .top-bar h4 {
        font-size: 1rem;
    }
    .page-desc {
        font-size: 11px;
    }
    .empty-state {
        padding: 28px 12px;
    }
}
/* ===== 站点远程选择器（1.1.68）=====
   已选中具体站点 = 绿框 + 右侧勾；仅手输域名（模糊筛选）保持普通/红框，
   让"精确选中"和"手输文本"在视觉上能区分开 */
.form-control.is-picked {
  border-color: #198754;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23198754'%3E%3Cpath d='M13.485 1.929a1 1 0 0 1 .086 1.41l-7.5 8.5a1 1 0 0 1-1.45.06l-4-4a1 1 0 1 1 1.414-1.414l3.26 3.26 6.78-7.68a1 1 0 0 1 1.41-.136z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 1rem 1rem;
  padding-right: 2.1rem;
}

/* 下拉 ↑↓ 键盘高亮（bootstrap .list-group-item.active 的显式兜底，保证对比度） */
.list-group-item.active[role="option"] {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

/* 图库卡片失败提示与小屏操作栏保持在卡片宽度内。 */
.si-image-retry { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: .68rem; }
@media (max-width: 576px) {
    .si-hover-actions { flex-wrap: wrap; }
    #si-detail-title { font-size: 1rem; }
}

@media (max-width: 575.98px) {
    #si-images-container .si-hover-actions button { min-width: 28px; min-height: 28px; }
    #si-images-container .si-chk { width: 20px; height: 20px; }
}

/* ===== 默认图设置面板（全局 / 单站）===== */
.di-panel{font-size:14px}
.di-panel .di-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.di-panel .di-src{color:#6b7280;font-size:13px}
.di-panel .di-err{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;border-radius:6px;padding:8px 10px;margin-bottom:10px}
.di-panel .di-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.di-panel .di-url{flex:1 1 320px;min-width:200px;padding:6px 10px;border:1px solid #d1d5db;border-radius:6px}
.di-panel .di-btn{padding:6px 12px;border:1px solid #d1d5db;background:#fff;border-radius:6px;cursor:pointer}
.di-panel .di-btn.di-primary{background:#2563eb;border-color:#2563eb;color:#fff}
.di-panel .di-btn[disabled]{opacity:.6;cursor:not-allowed}
.di-panel .di-meta{color:#6b7280;font-size:12px;margin:6px 0 10px}
.di-panel .di-prev{display:flex;gap:12px;align-items:flex-start;border:1px solid #e5e7eb;border-radius:8px;padding:10px;background:#fafafa}
.di-panel .di-prev img{max-width:180px;max-height:140px;object-fit:contain;background:#fff;border:1px solid #eee;border-radius:4px}
.di-panel .di-prev-info{font-size:12px;color:#4b5563;overflow-wrap:anywhere}
.di-panel .di-actions{display:flex;gap:8px;align-items:center;margin-top:12px;flex-wrap:wrap}
.di-panel .di-state{color:#6b7280;font-size:12px}
.di-panel .di-hint{color:#9ca3af;font-size:12px;margin:10px 0 0}

/* 产品图与装饰图标分区：真实产品图用大图区，避免被塞进小图标框裁断 */
.product-main-image{margin:0 0 20px;text-align:center}
.product-main-image img{max-width:100%;height:auto;object-fit:contain;border-radius:8px}
.product-thumb{width:100%;height:180px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.product-thumb img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
