/* ============================================================
   天津津南津益医院 · 2026 后台视觉升级
   与前台统一的医疗蓝白体系；改善导航、表格、表单与移动端。
   ============================================================ */

:root {
    --admin-primary: #0b5a9e;
    --admin-primary-dark: #08436f;
    --admin-primary-light: #e8f2fa;
    --admin-primary-glow: rgba(11, 90, 158, 0.18);
    --admin-bg: #f4f8fb;
    --admin-sidebar-bg: #ffffff;
    --admin-sidebar-text: #4d6479;
    --admin-sidebar-hover: #f1f7fc;
    --admin-sidebar-active: #e8f2fa;
    --admin-card: #ffffff;
    --admin-border: #dce8f2;
    --admin-border-strong: #c3d6e6;
    --admin-text: #17324a;
    --admin-text-secondary: #5c7186;
    --admin-text-tertiary: #7b8ea0;
    --admin-bg-secondary: #f6f9fc;
    --admin-separator: #e8f0f7;
    --admin-danger: #b83a33;
    --admin-danger-light: #fbeceb;
    --apple-radius-sm: 8px;
    --apple-radius: 10px;
    --apple-radius-lg: 12px;
    --apple-radius-xl: 14px;
}

body {
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    color: var(--admin-text);
    background: var(--admin-bg);
}

/* ---------- 顶栏 ---------- */
.admin-header {
    background: #fff;
    color: var(--admin-text);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: 0 1px 0 rgba(10, 54, 86, 0.03);
    z-index: 1200;
}
.admin-header .container { height: 60px; padding: 0 22px; gap: 12px; }
.admin-header h2 {
    color: var(--admin-text);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-header h2::before {
    content: '✚';
    color: var(--admin-primary);
    font-size: 17px;
    line-height: 1;
}
.admin-actions { gap: 8px; flex-shrink: 0; }
.admin-actions .btn,
.admin-actions .btn-outline-dark {
    background: #fff;
    color: var(--admin-text-secondary);
    border: 1px solid var(--admin-border-strong);
    border-radius: 8px;
    font-size: 12.5px;
    padding: 6px 12px;
    box-shadow: none;
    white-space: nowrap;
}
.admin-actions .btn:hover,
.admin-actions .btn-outline-dark:hover {
    background: var(--admin-primary-light);
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

/* 移动端菜单按钮 */
.admin-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--admin-border-strong);
    background: #fff;
    color: var(--admin-primary);
    border-radius: 9px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.admin-nav-toggle:hover { background: var(--admin-primary-light); }

/* ---------- 布局 / 侧边栏 ---------- */
.admin-layout { min-height: calc(100vh - 60px); background: var(--admin-bg); }
.admin-sidebar {
    width: 224px;
    background: #fff;
    border-right: 1px solid var(--admin-border);
    padding: 10px 10px 24px;
    color: var(--admin-sidebar-text);
}
.admin-sidebar::before {
    content: '管理菜单';
    color: var(--admin-text-tertiary);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    padding: 10px 12px 12px;
}
.sidebar-group { margin-bottom: 2px; }
.sidebar-group-title {
    color: var(--admin-text-secondary);
    font-size: 11px;
    letter-spacing: 0.1em;
    padding: 14px 12px 6px;
}
.sidebar-item {
    color: var(--admin-text-secondary);
    border-left: 0;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13px;
    gap: 10px;
    margin-bottom: 1px;
}
.sidebar-item::after { display: none; }
.sidebar-item:hover {
    background: var(--admin-sidebar-hover);
    color: var(--admin-primary);
}
.sidebar-item.active {
    background: var(--admin-primary-light);
    color: var(--admin-primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--admin-primary);
}
.sidebar-item.active .sidebar-icon { color: var(--admin-primary); }
.sidebar-ext {
    color: var(--admin-primary);
    background: var(--admin-primary-light);
    border-radius: 999px;
}
.admin-backdrop {
    display: none;
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(9, 30, 48, 0.42);
    z-index: 1090;
    backdrop-filter: blur(2px);
}
.admin-backdrop.show { display: block; }

/* ---------- 主内容 ---------- */
.admin-main { padding: 24px 28px 40px; background: var(--admin-bg); }
.tab-panel { animation: none; }
.panel-header {
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.panel-header h3 {
    color: var(--admin-text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.panel-header h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--admin-primary);
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: -2px;
}
.panel-header > span { color: var(--admin-text-tertiary) !important; font-size: 12.5px !important; }
.panel-body {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(10, 54, 86, 0.03);
}
.panel-badge {
    background: var(--admin-primary-light);
    color: var(--admin-primary);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- 仪表盘 ---------- */
.dash-stats-grid { gap: 14px; margin-bottom: 16px; }
.dash-stat-card {
    border-radius: 14px;
    border: 1px solid var(--admin-border);
    padding: 18px 20px;
    box-shadow: none;
    gap: 14px;
}
.dash-stat-card::before { background: var(--admin-primary); height: 3px; }
.dash-stat-card:hover {
    border-color: var(--admin-border-strong);
    box-shadow: 0 10px 26px rgba(10, 54, 86, 0.08);
    transform: translateY(-2px);
}
.dash-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--admin-primary-light) !important;
    color: var(--admin-primary) !important;
    box-shadow: none !important;
}
.dash-stat-info .num { color: var(--admin-text); font-size: 26px; }
.dash-stat-info .lbl { color: var(--admin-text-secondary); }
.dash-stat-info .trend { color: var(--admin-primary); }
.dash-bottom-grid { gap: 14px; }
.dash-panel { border-radius: 14px; border: 1px solid var(--admin-border); }
.dash-panel-head { padding: 14px 18px; border-color: var(--admin-border); }
.dash-panel-head h4 { color: var(--admin-text); font-size: 15px; }
.dash-quick-actions { padding: 16px 18px; gap: 10px; }
.dash-qa-item {
    background: var(--admin-bg-secondary);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 16px 10px;
}
.dash-qa-item:hover {
    background: #fff;
    border-color: var(--admin-border);
    box-shadow: 0 6px 18px rgba(10, 54, 86, 0.06);
    transform: translateY(-2px);
}
.dash-qa-item .ic {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--admin-primary-light) !important;
    color: var(--admin-primary) !important;
}
.dash-qa-item .lbl { color: var(--admin-text-secondary); font-size: 12.5px; }
.dash-recent-item { border-radius: 9px; padding: 11px 10px; }
.dash-recent-item:hover { background: var(--admin-bg-secondary); }
.dash-recent-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--admin-primary-light);
    color: var(--admin-primary);
}
.dash-recent-item .info .name { color: var(--admin-text); font-size: 13.5px; }
.dash-recent-item .info .meta { color: var(--admin-text-secondary); }
.dash-recent-item .date { background: var(--admin-bg-secondary); color: var(--admin-text-secondary); }

/* ---------- 表格 ---------- */
.data-table {
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.data-table thead th {
    background: #f2f7fb;
    color: var(--admin-text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--admin-border);
    padding: 11px 12px;
    white-space: nowrap;
}
.data-table thead th:first-child { border-top-left-radius: 9px; }
.data-table thead th:last-child { border-top-right-radius: 9px; }
.data-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--admin-border-light, #eef4f9);
    color: var(--admin-text);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #f7fbfe; }
.data-table .td-desc { color: var(--admin-text-secondary); }
.data-table .actions { gap: 5px; }
.data-table .actions .btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ---------- 筛选 / 表单 ---------- */
.filter-bar {
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    flex-wrap: wrap;
}
.filter-input {
    height: 36px;
    border: 1px solid var(--admin-border-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--admin-text);
    font-size: 13px;
    padding: 0 10px;
}
.filter-input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(11, 90, 158, 0.1);
}
.filter-divider { background: var(--admin-border); }

.admin-main input[type="text"],
.admin-main input[type="number"],
.admin-main input[type="date"],
.admin-main input[type="time"],
.admin-main input[type="password"],
.admin-main input[type="email"],
.admin-main select,
.admin-main textarea {
    border: 1px solid var(--admin-border-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--admin-text);
    font-size: 13.5px;
    padding: 9px 11px;
    transition: border-color .18s, box-shadow .18s;
}
.admin-main input:focus,
.admin-main select:focus,
.admin-main textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(11, 90, 158, 0.1);
}
.admin-main label { color: var(--admin-text-secondary); font-size: 12.5px; font-weight: 600; }
.form-row-2, .form-row-3 { gap: 14px; }

.btn {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    box-shadow: none;
}
.btn-primary {
    background: var(--admin-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(11, 90, 158, 0.18);
}
.btn-primary:hover { background: var(--admin-primary-dark); box-shadow: 0 4px 12px rgba(11, 90, 158, 0.24); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-cancel { background: var(--admin-bg-secondary); color: var(--admin-text-secondary); border: 1px solid var(--admin-border); }
.btn-cancel:hover { background: #eef4f9; }
.btn-outline { background: #fff; color: var(--admin-primary); border: 1px solid var(--admin-primary); }
.btn-outline:hover { background: var(--admin-primary-light); }
.btn-danger { background: var(--admin-danger); }
.btn-danger:hover { background: #9c2f29; }
.btn-warning { background: #b8791b; }
.btn-success { background: #1b8a5a; }
.btn-export { background: var(--admin-primary); }
.btn-filter { background: #fff; border: 1px solid var(--admin-border-strong); color: var(--admin-text-secondary); }
.btn-filter:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.btn-filter-danger { background: #fff; border: 1px solid #eccbc8; color: var(--admin-danger); }
.btn-filter-danger:hover { background: var(--admin-danger-light); }
.btn-filter-outline { background: #fff; border: 1px solid var(--admin-border-strong); color: var(--admin-text-secondary); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
    background: rgba(9, 30, 48, 0.46);
    backdrop-filter: blur(3px);
}
.admin-modal {
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(10, 54, 86, 0.2);
    border: 1px solid var(--admin-border);
    padding: 24px;
}
.admin-modal h3 {
    color: var(--admin-text);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border);
}
.modal-actions {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--admin-border);
    gap: 10px;
}
.modal-actions .btn-preview { border: 1px solid var(--admin-border-strong); background: #fff; color: var(--admin-text-secondary); }
.modal-actions .btn-preview.on { background: var(--admin-primary); border-color: var(--admin-primary); color: #fff; }
.form-section-title { color: var(--admin-primary); }

/* ---------- 卡片式管理列表 ---------- */
.dept-admin-card, .doctor-admin-card, .news-admin-card, .health-admin-card {
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: none;
}
.dept-admin-card:hover, .doctor-admin-card:hover, .news-admin-card:hover, .health-admin-card:hover {
    border-color: var(--admin-border-strong);
    box-shadow: 0 10px 26px rgba(10, 54, 86, 0.07);
}
.empty-state { color: var(--admin-text-tertiary); }

/* ---------- 移动端 ---------- */
@media (max-width: 1024px) {
    .admin-nav-toggle { display: inline-flex; }
    .admin-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 250px;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: 12px 0 40px rgba(10, 54, 86, 0.14);
        overflow-y: auto;
    }
    .admin-sidebar.open { transform: translateX(0); }
    body.admin-nav-open { overflow: hidden; }
    .admin-main { padding: 18px 16px 32px; }
}

@media (max-width: 768px) {
    .admin-header .container { padding: 0 10px; height: 56px; gap: 8px; }
    .admin-header h2 { font-size: 12.5px; letter-spacing: 0; }
    .admin-sidebar { top: 56px; }
    .admin-backdrop { inset: 56px 0 0 0; }
    .admin-actions .btn,
    .admin-actions .btn-outline-dark { padding: 5px 9px; font-size: 11.5px; }
    .admin-actions .btn[data-hide-mobile] { display: none; }
    .panel-header h3 { font-size: 18px; }
    .panel-body { padding: 14px; border-radius: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 640px; }
    .filter-bar { padding: 10px; }
    .filter-input { flex: 1 1 130px; min-width: 0; }
    .dash-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .dash-bottom-grid { grid-template-columns: 1fr; }
    .admin-modal { width: calc(100vw - 24px); max-width: none !important; padding: 18px; max-height: 88vh; overflow-y: auto; }
    .modal-actions { position: sticky; bottom: 0; background: #fff; }
    .chk-edit-modal-wide {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        max-height: 100vh !important;
        border-radius: 0;
    }
    /* 移动端预览改为全屏查看，关闭预览后回到编辑 */
    #editModalBody.chk-preview-on { flex-direction: column; }
    #editModalBody.chk-preview-on .chk-edit-layout { display: none; }
    #editModalBody.chk-preview-on .chk-preview-pane {
        width: 100%;
        min-width: 0;
        height: 100%;
        border-left: none;
    }
    #editModalBody.chk-preview-on .chk-preview-frame { width: 100% !important; }
    .chk-preview-devices { display: none !important; }
}

/* ===== 体检内容编辑器增强 ===== */
.chk-preview-head { display: flex; align-items: center; gap: 10px; }
#editModalBody.chk-preview-on .chk-preview-pane { width: 55%; min-width: 440px; }
.chk-preview-devices { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.chk-device-btn {
    border: 1px solid var(--admin-border);
    background: #fff;
    color: var(--admin-text-secondary);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.chk-device-btn:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.chk-device-btn.active {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: #fff;
}
.chk-preview-frame {
    display: block;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    transition: width 0.2s ease;
}
.chk-preview-frame.device-tablet { width: 768px; max-width: 100%; }
.chk-preview-frame.device-mobile { width: 390px; max-width: 100%; }

.chk-drag-handle {
    flex: 0 0 20px;
    width: 20px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: #fff;
    color: #8aa0b3;
    font-size: 14px;
    line-height: 1;
    cursor: grab;
}
.chk-drag-handle:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.chk-drag-handle:active { cursor: grabbing; }
.chk-list-row.chk-dragging,
.pkg-edit-card.chk-dragging {
    opacity: 0.45;
    outline: 2px dashed var(--admin-primary);
    outline-offset: 2px;
}
.chk-dup-btn { flex: 0 0 auto; white-space: nowrap; }

.chk-dirty-hint {
    margin-right: auto;
    color: #b8791b;
    font-size: 12px;
    font-weight: 600;
}
.chk-edit-nav-item.dirty::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c9852b;
    margin-left: auto;
    flex: 0 0 auto;
}
.chk-edit-nav-item.active {
    background: var(--admin-primary-light) !important;
    color: var(--admin-primary) !important;
}
.chk-edit-nav-item.active .nav-icon { color: var(--admin-primary) !important; }
.chk-edit-section input:focus,
.chk-edit-section textarea:focus,
.chk-edit-section select:focus {
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 3px rgba(11, 90, 158, 0.1) !important;
}
.chk-edit-save-bar .btn-primary { background: var(--admin-primary) !important; }
.chk-edit-save-bar .btn-primary:hover { background: var(--admin-primary-dark) !important; }
.chk-edit-save-bar .btn-preview.on {
    background: var(--admin-primary) !important;
    border-color: var(--admin-primary) !important;
}

@media (max-width: 480px) {
    .dash-stats-grid { grid-template-columns: 1fr !important; }
    .admin-actions .btn[data-hide-mobile] { display: none; }
    .panel-header { align-items: flex-start; }
}

/* ============================================================
   2026-10-19 体检内容编辑器界面优化
   目标：加宽工作区、表单卡片化、预览真实缩放、移动端可用
   ============================================================ */

/* ---- 弹窗外壳 ---- */
.chk-edit-modal-wide {
    width: min(1360px, calc(100vw - 32px));
    max-width: 1360px !important;
    height: min(880px, 90vh);
    max-height: 90vh;
    position: relative;
}
.chk-edit-modal-wide h3 {
    padding: 24px 28px 2px !important;
    font-size: 19px !important;
    font-weight: 650 !important;
    letter-spacing: -0.02em;
}
.chk-edit-subtitle {
    margin: 0;
    padding: 0 28px 14px;
    font-size: 12.5px;
    color: #7a8699;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}
.chk-edit-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #8b95a5;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    z-index: 30;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chk-edit-close:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

/* ---- 左侧分区导航 ---- */
.chk-edit-sidebar {
    width: 216px;
    padding: 10px 0 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e6ebf2;
    scrollbar-width: thin;
    box-shadow: inset 0 -18px 18px -18px rgba(15, 23, 42, 0.14);
}
.chk-nav-search {
    position: sticky;
    top: 0;
    z-index: 2;
    display: block;
    width: calc(100% - 20px);
    margin: 0 10px 8px;
    padding: 7px 10px;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}
.chk-nav-search::placeholder { color: #a0aab8; }
.chk-nav-search:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-glow, rgba(11, 90, 158, .1));
}
.chk-nav-group-title {
    padding: 13px 16px 5px;
    font-size: 10.5px;
    font-weight: 700;
    color: #8a96a8;
    letter-spacing: 0.06em;
    text-transform: none;
}
.chk-edit-nav-item {
    width: calc(100% - 16px);
    min-height: 34px;
    padding: 7px 10px !important;
    margin: 1px 8px;
    gap: 8px;
    border-radius: 8px;
    font-size: 13px;
    color: #566274;
    transition: background .15s ease, color .15s ease;
}
.chk-edit-nav-item:hover {
    background: rgba(15, 23, 42, 0.045);
    color: #1e293b;
    transform: none;
}
.chk-edit-nav-item.active {
    padding-left: 10px !important;
    background: var(--admin-primary-light, #e8f1fb) !important;
    color: var(--admin-primary, #0b5a9e) !important;
    font-weight: 650;
    box-shadow: inset 3px 0 0 var(--admin-primary, #0b5a9e);
}
.chk-edit-nav-item .nav-icon {
    width: 20px;
    height: 20px;
    font-size: 13px;
}
.chk-edit-nav-item.dirty::after {
    width: 6px;
    height: 6px;
    background: #d58a24;
}

/* ---- 中间表单区 ---- */
.chk-edit-content {
    padding: 22px 26px 30px;
    background: #fff;
}
.chk-edit-section {
    max-width: 780px;
}
.chk-section-title {
    margin-bottom: 4px;
    font-size: 19px;
    letter-spacing: -0.02em;
}
.chk-section-desc {
    margin-bottom: 20px;
    color: #7a8699;
    font-size: 12.5px;
}
.chk-edit-section .form-group { margin-bottom: 16px; }
.chk-edit-section .form-group label {
    margin-bottom: 6px;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0;
}
.chk-edit-section .form-row-2,
.chk-edit-section .form-row-3 {
    display: grid;
    gap: 14px;
}
.chk-edit-section .form-row-2 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.chk-edit-section .form-row-3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.chk-edit-section input[type="text"],
.chk-edit-section input[type="number"],
.chk-edit-section input:not([type]),
.chk-edit-section textarea,
.chk-edit-section select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #dbe2ec;
    border-radius: 9px;
    background: #fff;
    color: #1e293b;
    font-size: 13.5px;
    box-sizing: border-box;
}
.chk-edit-section textarea {
    min-height: 72px;
    line-height: 1.6;
}
.chk-edit-section input:hover,
.chk-edit-section textarea:hover,
.chk-edit-section select:hover {
    border-color: #c4ceda;
}
.chk-edit-section input:focus,
.chk-edit-section textarea:focus,
.chk-edit-section select:focus {
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 3px var(--admin-primary-glow, rgba(11, 90, 158, .1)) !important;
}
.chk-list-row {
    padding: 8px 10px;
    border-color: #e6ebf2;
    background: #fbfcfe;
    border-radius: 9px;
}
.chk-list-row input {
    padding: 7px 9px;
    border-color: #dbe2ec;
    border-radius: 7px;
    font-size: 13px;
}
.chk-edit-divider { margin: 16px 0; }

/* ---- 底部保存栏 ---- */
.chk-edit-save-bar {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff;
    border-top: 1px solid #e8edf4;
}
.chk-edit-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chk-dirty-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff7e8;
    color: #a56712;
    font-size: 12px;
    font-weight: 600;
}
.chk-dirty-hint::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d58a24;
}
.chk-edit-save-bar .btn-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 0;
    padding: 9px 16px;
    border: 1px solid #dbe2ec;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}
.chk-edit-save-bar .btn-preview svg { width: 15px; height: 15px; }
.chk-edit-save-bar .btn-preview:hover {
    background: #f8fafc;
    border-color: #c4ceda;
}
.chk-edit-save-bar .btn-preview.on {
    background: var(--admin-primary-light, #e8f1fb) !important;
    border-color: var(--admin-primary, #0b5a9e) !important;
    color: var(--admin-primary, #0b5a9e) !important;
}
.chk-edit-save-bar .btn-cancel {
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #64748b;
    font-size: 13px;
}
.chk-edit-save-bar .btn-cancel:hover {
    background: #f1f5f9;
    border-color: transparent;
}
.chk-edit-save-bar .btn-primary {
    min-width: 92px;
    padding: 9px 22px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 650;
}
.chk-edit-save-bar .btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---- 实时预览 ---- */
#editModalBody { position: relative; }
.chk-preview-pane {
    position: relative;
    background: #eef2f7;
}
#editModalBody.chk-preview-on .chk-preview-pane {
    width: 46%;
    min-width: 420px;
    max-width: 640px;
}
.chk-preview-head {
    height: 44px;
    padding: 0 12px;
    gap: 8px;
    background: #fff;
    border-bottom: 1px solid #e8edf4;
    font-size: 12.5px;
}
.chk-preview-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-weight: 650;
    white-space: nowrap;
}
.chk-preview-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 3px rgba(34, 160, 107, .14);
    flex: 0 0 auto;
}
.chk-preview-devices {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    padding: 2px;
    border-radius: 8px;
    background: #f1f5f9;
}
.chk-device-btn {
    padding: 4px 9px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #7a8699;
    font-size: 11.5px;
    font-weight: 600;
}
.chk-device-btn:hover {
    color: var(--admin-primary);
    background: #fff;
}
.chk-device-btn.active {
    background: #fff;
    color: var(--admin-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.chk-preview-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    color: #8b95a5;
    font-size: 20px;
}
.chk-preview-close:hover {
    background: #f1f5f9;
    color: #334155;
}
.chk-preview-close-label { display: none; }
.chk-preview-frame {
    display: block;
    flex: 0 0 auto;
    max-width: none;
    margin: 0 auto;
    border: none;
    background: #fff;
    transform-origin: top left;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.chk-preview-pane {
    overflow: hidden;
}

/* ---- 中等屏幕 ---- */
@media (max-width: 1180px) and (min-width: 769px) {
    .chk-edit-sidebar { width: 198px; }
    #editModalBody.chk-preview-on .chk-preview-pane {
        width: 43%;
        min-width: 360px;
        max-width: 520px;
    }
    .chk-edit-content { min-width: 0; padding: 20px 20px 26px; }
    .chk-edit-save-bar { padding: 11px 20px; }
}

/* ---- 移动端 ---- */
@media (max-width: 768px) {
    .chk-edit-modal-wide {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        max-height: 100vh !important;
        border-radius: 0;
    }
    .chk-edit-modal-wide h3 {
        padding: 18px 48px 2px 16px !important;
        font-size: 17px !important;
    }
    .chk-edit-subtitle {
        padding: 0 16px 10px;
        font-size: 11.5px;
    }
    .chk-edit-close { top: 12px; right: 12px; }
    .chk-edit-sidebar {
        width: 100%;
        flex-shrink: 0;
        display: flex;
        gap: 4px;
        padding: 8px 10px;
        border-right: none;
        border-bottom: 1px solid #e6ebf2;
        overflow-x: auto;
        overflow-y: hidden;
        box-shadow: none;
    }
    .chk-nav-search,
    .chk-nav-group-title,
    .chk-nav-sep { display: none !important; }
    .chk-edit-nav-item {
        flex: 0 0 auto;
        width: auto;
        min-height: 32px;
        padding: 6px 10px !important;
        margin: 0;
        font-size: 12px;
        white-space: nowrap;
    }
    .chk-edit-nav-item.active { box-shadow: none; }
    .chk-edit-content {
        min-width: 0;
        padding: 18px 14px 24px;
    }
    .chk-edit-section { max-width: none; }
    .chk-edit-section .form-row-2,
    .chk-edit-section .form-row-3 { grid-template-columns: 1fr; }
    .chk-edit-save-bar { padding: 10px 12px; gap: 8px; }
    .chk-dirty-hint { display: none; }
    .chk-edit-save-bar .btn-cancel { display: none; }
    .chk-edit-actions { flex: 1; justify-content: flex-end; }
    .chk-edit-save-bar .btn-primary { flex: 0 0 auto; }
    .chk-preview-devices { display: none !important; }
    #editModalBody.chk-preview-on .chk-preview-pane {
        position: absolute;
        inset: 0;
        z-index: 20;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border-left: none;
    }
    .chk-preview-head {
        height: 48px;
        padding: 0 10px;
    }
    .chk-preview-close {
        width: auto;
        padding: 0 10px;
        gap: 5px;
        font-size: 13px;
        font-weight: 600;
    }
    .chk-preview-close-label { display: inline; }
    .chk-preview-close-x { font-size: 18px; line-height: 1; }
}
