/**
 * merged_styles.css
 * 合并自 chain_styles.css 和 admin_content.css
 * 修复：Bootstrap modal 样式限定，避免影响自定义 modal
 * 保留所有原有样式，增强稳定性
 */

/* ==========================
   全局基础（变量 / 重置 / 通用类）
   ========================== */
:root {
    --brand-blue: #0d6efd;
    --brand-blue-dark: #0056b3;
    --muted: #6c757d;
    --surface: #f8f9fa;
    
    /* 医疗风格主色调 */
    --admin-primary: #007AFF;
    --admin-primary-light: rgba(0, 122, 255, 0.1);
    --admin-primary-dark: #0056b3;
    
    /* 辅助色 */
    --admin-success: #34C759;
    --admin-success-light: rgba(52, 199, 89, 0.1);
    --admin-warning: #FF9500;
    --admin-warning-light: rgba(255, 149, 0, 0.1);
    --admin-danger: #FF3B30;
    --admin-danger-light: rgba(255, 59, 48, 0.1);
    --admin-info: #5AC8FA;
    --admin-info-light: rgba(90, 200, 250, 0.1);
    
    /* 中性色 */
    --admin-white: #FFFFFF;
    --admin-gray-50: #F5F7FA;
    --admin-gray-100: #F0F2F5;
    --admin-gray-200: #E5E7EB;
    --admin-gray-300: #D1D5DB;
    --admin-gray-400: #9CA3AF;
    --admin-gray-500: #6B7280;
    --admin-gray-600: #4B5563;
    --admin-gray-700: #374151;
    --admin-gray-800: #1F2937;
    --admin-gray-900: #111827;
    
    /* 背景与阴影 */
    --admin-bg: #F5F7FA;
    --admin-bg-card: #FFFFFF;
    --admin-shadow-sm: 0 2px 8px rgba(0, 122, 255, 0.08);
    --admin-shadow-md: 0 4px 16px rgba(0, 122, 255, 0.12);
    --admin-shadow-lg: 0 8px 32px rgba(0, 122, 255, 0.16);
    
    /* 圆角 */
    --admin-radius-sm: 6px;
    --admin-radius-md: 10px;
    --admin-radius-lg: 16px;
    
    /* 过渡 */
    --admin-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 全局基础样式 */
body {
    font-family: "Segoe UI", "San Francisco", "Microsoft YaHei", sans-serif;
    color: #000;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

body.dashboard-body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    margin: 0;
    padding: 0;
}

/* 通用阴影与圆角 */
.card-radius { border-radius: 0.75rem; }
.soft-shadow { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ==========================
   页面结构与布局
   ========================== */
/* 主内容容器 */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 设置容器 */
.settings-container {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 91vh;
    padding: 25px;
    gap: 20px;
    box-sizing: border-box;
    align-items: stretch;
}

/* ==========================
   左侧设置菜单样式 - macOS 风格
   ========================== */

/* 菜单容器 */
.settings-sidebar {
    flex: 0 1 260px;
    min-width: 220px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(22px) saturate(120%);
    -webkit-backdrop-filter: blur(22px) saturate(120%);
    border-radius: 20px;
    border: 1px solid rgba(180, 190, 210, 0.5);
    box-shadow: 0 10px 32px rgba(100, 120, 160, 0.15);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: visible;
    height: auto;
}

/* 侧边栏头部 */
.sidebar-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(180, 190, 210, 0.3);
    margin-bottom: 20px;
}

.sidebar-logo {
    width: 64px;
    height: 64px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.75rem;
    color: var(--brand-blue);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
}

/* 菜单列表 */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 8px;
}

/* 菜单项 - macOS Finder 侧边栏风格 */
.sidebar-menu-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 122, 255, 0.1);
    border-radius: 10px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.sidebar-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: rgba(0, 122, 255, 0.8);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar-menu-item:hover::before {
    transform: scaleY(1);
}

.sidebar-menu-item:hover {
    color: #1d1d1f;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 122, 255, 0.2);
    backdrop-filter: blur(10px);
}

.sidebar-menu-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.1);
}

/* 激活状态 - macOS 高亮 */
.sidebar-menu-item.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
    color: #007AFF;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.1);
    border-left-color: #007AFF;
    border-color: rgba(0, 122, 255, 0.15);
}

.sidebar-menu-item.active::before {
    transform: scaleY(1);
    background: #007AFF;
}

/* 菜单链接 */
.menu-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    border-radius: 10px;
}

.menu-link:hover {
    color: inherit;
    text-decoration: none;
}

.menu-link i {
    width: 18px;
    text-align: center;
    margin-right: 12px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.sidebar-menu-item .menu-link i {
    opacity: 1;
}

.sidebar-menu-item:hover .menu-link i {
    transform: scale(1.05);
    opacity: 1;
}

.sidebar-menu-item.active .menu-link i {
    opacity: 1;
}

.sidebar-menu-item.file-missing .menu-link {
    color: rgba(0, 0, 0, 0.4);
}

/* 分割线 */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(142, 142, 147, 0.3), transparent);
    margin: 12px 0;
    border: none;
    width: 100%;
    border-radius: 1px;
}

/* 滚动条样式 */
.settings-sidebar::-webkit-scrollbar {
    width: 8px;
}

.settings-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.settings-sidebar::-webkit-scrollbar-thumb {
    background: rgba(142, 142, 147, 0.3);
    border-radius: 4px;
}

.settings-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 142, 147, 0.5);
}

.settings-sidebar::-webkit-scrollbar-corner {
    background: transparent;
}

/* ==========================
   右侧内容区域 - 使用页面滚动条
   ========================== */
.settings-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px) saturate(120%);
    -webkit-backdrop-filter: blur(22px) saturate(120%);
    border-radius: 20px;
    border: 1px solid rgba(180, 190, 210, 0.5);
    box-shadow: 0 10px 32px rgba(100, 120, 160, 0.15);
    padding: 20px;
    display: flex;
    flex-direction: column;
    /* 使用页面滚动条，不限制高度 */
    overflow-y: visible;
    max-height: none;
}

.settings-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.settings-section {
    display: none;
    animation: adminFadeIn 0.4s ease-in-out;
}

.settings-section.active {
    display: block;
}

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

/* ==========================
   统计卡片区域
   ========================== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--admin-white);
    border-radius: var(--admin-radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--admin-shadow-sm), 0 0 0 1px var(--admin-gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--admin-shadow-md), 0 0 0 1px var(--admin-primary);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--admin-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.5rem;
}

.stat-card-icon.blue {
    background: var(--admin-primary-light);
    color: var(--admin-primary);
}

.stat-card-icon.green {
    background: var(--admin-success-light);
    color: var(--admin-success);
}

.stat-card-icon.orange {
    background: var(--admin-warning-light);
    color: var(--admin-warning);
}

.stat-card-icon.purple {
    background: rgba(111, 66, 193, 0.1);
    color: #6F42C1;
}

.stat-card-icon.red {
    background: var(--admin-danger-light);
    color: var(--admin-danger);
}

.stat-card-icon.yellow {
    background: rgba(255, 193, 7, 0.15);
    color: #E5AC09;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-gray-800);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--admin-gray-500);
    font-weight: 500;
}


/* ==========================
   内容卡片
   ========================== */
.content-card {
    background: var(--admin-white);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
    border: 1px solid var(--admin-gray-200);
    margin-bottom: 24px;
    overflow: hidden;
}

.content-card:last-child {
    margin-bottom: 0;
}

.content-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--admin-gray-50);
}

.content-card .card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-card .card-header h4 i {
    color: var(--admin-primary);
}

.content-card .card-body {
    padding: 20px;
}


/* ==========================
   快捷操作按钮
   ========================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--admin-gray-50);
    border-radius: var(--admin-radius-md);
    text-decoration: none;
    color: var(--admin-gray-700);
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid var(--admin-gray-200);
    transition: var(--admin-transition);
}

.quick-action-btn:hover {
    background: var(--admin-primary-light);
    border-color: var(--admin-primary);
    color: var(--admin-primary);
    transform: translateX(6px);
}

.quick-action-btn i {
    font-size: 1.25rem;
    color: var(--admin-primary);
}


/* ==========================
   空状态显示
   ========================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--admin-gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
    color: var(--admin-gray-400);
}

.empty-state h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--admin-gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--admin-gray-400);
}


/* ==========================
   自定义表格
   ========================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--admin-radius-md);
    background: var(--admin-white);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.custom-table th,
.custom-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--admin-gray-200);
    vertical-align: middle;
    /* 移除强制不换行，让浏览器自然换行 */
    white-space: normal;
    word-break: break-word;
}

.custom-table thead th {
    background: var(--admin-gray-50);
    font-weight: 600;
    color: var(--admin-gray-700);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--admin-gray-300);
}

.custom-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.custom-table tbody tr:hover {
    background: rgba(0, 122, 255, 0.05) !important;
    border-color: #007AFF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
    position: relative;
    z-index: 1;
    cursor: pointer;
}

/* 确保单元格背景透明，不覆盖行的背景 */
.custom-table tbody tr:hover td {
    background: transparent !important;
}

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

.custom-table .text-center { text-align: center; }
.custom-table .text-right { text-align: right; }
.custom-table .text-left { text-align: left; }

/* ==========================
   表格内徽章 - 高对比度配色
   ========================== */
.custom-table .badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    /* 徽章自动换行所需样式 */
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
}

/* 成功 - 绿色背景 + 白字 */
.custom-table .badge.bg-success,
.badge.bg-success {
    background-color: #34C759 !important;
    color: #ffffff !important;
}

/* 警告 - 橙色背景 + 白字 */
.custom-table .badge.bg-warning,
.badge.bg-warning {
    background-color: #FF9500 !important;
    color: #ffffff !important;
}

/* 危险 - 红色背景 + 白字 */
.custom-table .badge.bg-danger,
.badge.bg-danger {
    background-color: #FF3B30 !important;
    color: #ffffff !important;
}

/* 信息 - 蓝色背景 + 白字 */
.custom-table .badge.bg-info,
.badge.bg-info {
    background-color: #007AFF !important;
    color: #ffffff !important;
}

/* 主要 - 蓝色背景 + 白字 */
.custom-table .badge.bg-primary,
.badge.bg-primary {
    background-color: #007AFF !important;
    color: #ffffff !important;
}

/* 次要 - 深灰背景 + 白字 */
.custom-table .badge.bg-secondary,
.badge.bg-secondary {
    background-color: #8E8E93 !important;
    color: #ffffff !important;
}

/* Alert 中的 badge 也使用白字 */
.alert .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}


/* ==========================
   警告状态文字
   ========================== */
.expiring-warning {
    color: var(--admin-danger);
    font-weight: 600;
}

.expiring-warning i {
    margin-right: 4px;
}

.expiring-soon {
    color: var(--admin-warning);
    font-weight: 600;
}

.expiring-soon i {
    margin-right: 4px;
}


/* ==========================
   表格内按钮组
   ========================== */
.action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btns .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: var(--admin-radius-sm);
}

.action-btns .btn i {
    margin-right: 3px;
}


/* ==========================
   分页样式
   ========================== */
.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--admin-gray-200);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    color: var(--admin-gray-500);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    gap: 6px;
    margin: 0;
}

.pagination .page-link {
    padding: 8px 14px;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-sm);
    color: var(--admin-gray-600);
    text-decoration: none;
    transition: var(--admin-transition);
    background: var(--admin-white);
    font-size: 0.9rem;
}

.pagination .page-link:hover {
    background: var(--admin-primary-light);
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.pagination .page-item.active .page-link {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--admin-gray-400);
    pointer-events: none;
    background-color: var(--admin-gray-50);
    border-color: var(--admin-gray-200);
}


/* ==========================
   表单样式
   ========================== */
.form-group {
    margin-bottom: 20px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--admin-gray-700);
    font-size: 0.9rem;
}

.form-label .required {
    color: var(--admin-danger);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-md);
    font-size: 0.95rem;
    transition: var(--admin-transition);
    background: var(--admin-white);
    color: var(--admin-gray-800);
}

.form-control:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
    outline: none;
}

.form-control::placeholder {
    color: var(--admin-gray-400);
}

.form-control:disabled {
    background: var(--admin-gray-100);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-md);
    font-size: 0.95rem;
    background: var(--admin-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    cursor: pointer;
    transition: var(--admin-transition);
    appearance: none;
    -webkit-appearance: none;
}

.form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
    outline: none;
}

.form-text {
    font-size: 0.8rem;
    color: var(--admin-gray-500);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--admin-primary);
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--admin-gray-700);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}


/* ==========================
   按钮样式
   ========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--admin-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--admin-transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--admin-primary-dark);
    border-color: var(--admin-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background: var(--admin-gray-500);
    border-color: var(--admin-gray-500);
    color: white;
}

.btn-secondary:hover {
    background: var(--admin-gray-600);
    border-color: var(--admin-gray-600);
}

.btn-success {
    background: var(--admin-success);
    border-color: var(--admin-success);
    color: white;
}

.btn-success:hover {
    background: #2DB84D;
    border-color: #2DB84D;
}

.btn-danger {
    background: var(--admin-danger);
    border-color: var(--admin-danger);
    color: white;
}

.btn-danger:hover {
    background: #E03128;
    border-color: #E03128;
}

.btn-warning {
    background: var(--admin-warning);
    border-color: var(--admin-warning);
    color: white;
}

.btn-warning:hover {
    background: #E68600;
    border-color: #E68600;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.btn-outline-primary:hover {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border-color: var(--admin-gray-400);
    color: var(--admin-gray-600);
}

.btn-outline-secondary:hover {
    background: var(--admin-gray-500);
    border-color: var(--admin-gray-500);
    color: white;
}

.btn-outline-success {
    background: transparent;
    border-color: var(--admin-success);
    color: var(--admin-success);
}

.btn-outline-success:hover {
    background: var(--admin-success);
    border-color: var(--admin-success);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--admin-danger);
    color: var(--admin-danger);
}

.btn-outline-danger:hover {
    background: var(--admin-danger);
    border-color: var(--admin-danger);
    color: white;
}

.btn-outline-warning {
    background: transparent;
    border-color: var(--admin-warning);
    color: var(--admin-warning);
}

.btn-outline-warning:hover {
    background: var(--admin-warning);
    border-color: var(--admin-warning);
    color: white;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-group .btn {
    margin: 0;
}


/* ==========================
   提示框样式
   ========================== */
.alert {
    border-radius: var(--admin-radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--admin-success-light);
    border: 1px solid var(--admin-success);
    color: #1E7E34;
}

.alert-danger {
    background: var(--admin-danger-light);
    border: 1px solid var(--admin-danger);
    color: #C62828;
}

.alert-warning {
    background: var(--admin-warning-light);
    border: 1px solid var(--admin-warning);
    color: #B78600;
}

.alert-info {
    background: var(--admin-info-light);
    border: 1px solid var(--admin-info);
    color: #1B8AD6;
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}


/* ==========================
   产品信息展示
   ========================== */
.product-name-cell {
    font-weight: 600;
    color: var(--admin-gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-description-cell {
    font-size: 0.85rem;
    color: var(--admin-gray-500);
    margin-top: 4px;
}

.price-cell {
    font-size: 1rem;
    font-weight: 700;
    color: var(--admin-danger);
}

.original-price-cell {
    font-size: 0.85rem;
    color: var(--admin-gray-400);
    text-decoration: line-through;
    margin-left: 8px;
}

.recommended-badge {
    color: #FFB800;
    font-size: 0.9rem;
}


/* ==========================
   产品详情信息
   ========================== */
.product-info {
    background: var(--admin-gray-50);
    border-radius: var(--admin-radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.product-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--admin-gray-200);
}

.product-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.product-info-row:first-child {
    padding-top: 0;
}

.product-info-label {
    color: var(--admin-gray-500);
    font-size: 0.9rem;
}

.product-info-value {
    font-weight: 600;
    color: var(--admin-gray-800);
    font-size: 0.9rem;
}

.price-hint {
    background: var(--admin-gray-50);
    border-radius: var(--admin-radius-sm);
    padding: 12px 14px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--admin-gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-hint i {
    color: var(--admin-primary);
}


/* ==========================
   订单详情信息
   ========================== */
.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.order-detail-item {
    background: var(--admin-gray-50);
    border-radius: var(--admin-radius-sm);
    padding: 14px 16px;
}

.order-detail-item .label {
    font-size: 0.8rem;
    color: var(--admin-gray-500);
    margin-bottom: 6px;
}

.order-detail-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-gray-800);
}


/* ==========================
   机构详情信息
   ========================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.detail-item {
    background: var(--admin-gray-50);
    border-radius: var(--admin-radius-md);
    padding: 16px;
}

.detail-item .label {
    font-size: 0.8rem;
    color: var(--admin-gray-500);
    margin-bottom: 6px;
}

.detail-item .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--admin-gray-800);
    word-break: break-all;
}


/* ==========================
   筛选标签页
   ========================== */
.filter-tabs {
    margin-bottom: 20px;
}

.filter-tabs .nav-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tabs .nav-pills .nav-link {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--admin-gray-600);
    background: var(--admin-gray-100);
    text-decoration: none;
    transition: var(--admin-transition);
    font-weight: 500;
}

.filter-tabs .nav-pills .nav-link:hover {
    background: var(--admin-gray-200);
    color: var(--admin-gray-800);
}

.filter-tabs .nav-pills .nav-link.active {
    background: var(--admin-primary);
    color: white;
}


/* ==========================
   搜索栏
   ========================== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--admin-gray-50);
    border-radius: var(--admin-radius-md);
    flex-wrap: wrap;
}

.search-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 180px;
}

.search-bar .form-control,
.search-bar .form-select {
    width: 100%;
}

.search-bar .btn {
    align-self: flex-end;
    white-space: nowrap;
    height: 40px;
}


/* ==========================
   订单状态徽章
   ========================== */
.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-status.pending {
    background: rgba(255, 193, 7, 0.15);
    color: #B78600;
}

.order-status.paid {
    background: var(--admin-success-light);
    color: var(--admin-success);
}

.order-status.cancelled {
    background: var(--admin-danger-light);
    color: var(--admin-danger);
}

.order-status.refunded {
    background: var(--admin-info-light);
    color: #1B8AD6;
}


/* ==========================
   时间线样式
   ========================== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--admin-gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--admin-primary);
    border: 2px solid var(--admin-white);
    box-shadow: 0 0 0 2px var(--admin-primary);
}

.timeline-item .time {
    font-size: 0.8rem;
    color: var(--admin-gray-500);
    margin-bottom: 6px;
}

.timeline-item .content {
    background: var(--admin-gray-50);
    padding: 12px 16px;
    border-radius: var(--admin-radius-sm);
    font-size: 0.9rem;
    color: var(--admin-gray-700);
}


/* ==========================
   统计摘要
   ========================== */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--admin-white);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-shadow-sm);
    border: 1px solid var(--admin-gray-200);
}

.stat-item .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--admin-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-item .stat-content {
    flex: 1;
}

.stat-item .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--admin-gray-800);
    line-height: 1.2;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: var(--admin-gray-500);
    margin-top: 2px;
}


/* ==========================
   响应式设计
   ========================== */
@media (max-width: 992px) {
    .settings-content {
        padding: 20px;
        max-height: none;
    }
    
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card-value {
        font-size: 1.6rem;
    }
    
    .stat-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .settings-content {
        padding: 16px;
        border-radius: var(--admin-radius-md);
    }
    
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-card-value {
        font-size: 1.4rem;
    }
    
    .stat-card-label {
        font-size: 0.8rem;
    }
    
    .content-card .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .content-card .card-header h4 {
        font-size: 0.95rem;
    }
    
    .custom-table th,
    .custom-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .pagination-wrap {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .order-detail-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================
   动画效果
   ========================== */
@keyframes adminSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes adminPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.stat-card:hover .stat-card-icon {
    animation: adminPulse 0.3s ease-in-out;
}


/* ==========================
   打印样式
   ========================== */
@media print {
    .settings-content {
        box-shadow: none;
        border: 1px solid var(--admin-gray-300);
    }
    
    .btn,
    .action-btns,
    .pagination-wrap {
        display: none !important;
    }
    
    .stat-card,
    .content-card {
        box-shadow: none;
        border: 1px solid var(--admin-gray-300);
        break-inside: avoid;
    }
}


/* ==========================
   Bootstrap Modal 样式（限定在 .modal 内，避免影响自定义 modal）
   ========================== */
.modal-backdrop {
    z-index: 1040 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1051 !important;
    max-width: 1200px;
    margin: 1.75rem auto;
}

.modal .modal-content {
    isolation: isolate;
    border: none;
    border-radius: 12px;
    background: #ffffff !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 0;
    border: 2px solid #3b82f6;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1052 !important;
    backdrop-filter: none !important;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal .modal-header {
    border-bottom: 1px solid #3b82f6;
    border-radius: 10px 10px 0 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    position: relative;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.modal .modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.modal .btn-close {
    opacity: 0.9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
    padding: 0;
    margin: 0;
}

.modal .btn-close::before {
    content: '×';
    font-size: 18px;
    font-weight: 400;
    color: #FF0000;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal .btn-close:hover,
.modal .btn-close:focus {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.1);
    outline: none;
    color: #FF0000;
}

.modal .modal-body {
    padding: 24px;
    background: #ffffff;
    position: relative;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    font-size: 0.9rem;
    animation: fadeInUp 0.5s ease-out 0.1s both;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.modal .modal-footer {
    border-top: 1px solid var(--admin-gray-200);
    padding: 16px 20px;
    flex-shrink: 0;
}

/* ==========================
   医疗专业单选按钮样式
   ========================== */
.app-status-radio {
    display: flex;
    gap: 12px;
}

.app-status-radio .form-check {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.app-status-radio .form-check:hover {
    border-color: #3b82f6;
    background-color: #f0f7ff;
}

.app-status-radio .form-check.active {
    border-color: #3b82f6;
    background-color: #e7f3ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.app-status-radio .form-check-input {
    display: none;
}

.app-status-radio .form-check-label {
    font-weight: 600;
    cursor: pointer;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================
   机构编辑弹窗专用样式
   ========================== */
#customerEditModal .modal-dialog,
#customerDetailModal .modal-dialog {
    max-width: 95vw;
    width: 960px;
}

#customerEditModal .modal-content {
    max-height: 95vh;
    overflow-y: visible;
}

#customerEditModal .modal-body {
    max-height: none;
    overflow-y: visible;
    padding: 16px;
}

#customerEditModal .row {
    margin-bottom: 8px;
}

#customerEditModal .mb-3 {
    margin-bottom: 12px !important;
}

#customerEditModal .mb-4 {
    margin-bottom: 16px !important;
}

/* 编辑弹窗内表单优化 */
#customerEditModal .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

#customerEditModal .form-label.small {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

#customerEditModal .form-control,
#customerEditModal .form-select {
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    padding: 6px 10px;
    font-size: 0.85rem;
}

#customerEditModal .form-control:focus,
#customerEditModal .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

#customerEditModal .form-control::placeholder {
    font-size: 0.8rem;
    color: #adb5bd;
}

#customerEditModal .card {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
}

#customerEditModal .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 8px 12px;
    font-size: 0.9rem;
}

#customerEditModal .card-body {
    padding: 12px;
}

/* 紧凑型行 */
#customerEditModal .compact-row {
    margin-bottom: 0;
}

#customerEditModal .compact-row > .col-md-3,
#customerEditModal .compact-row > .col-md-4,
#customerEditModal .compact-row > .col-md-6 {
    padding: 4px 8px;
}

/* 滚动条美化 */
#customerEditModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#customerEditModal .modal-body::-webkit-scrollbar-track {
    background: #f0f9ff;
    border-radius: 3px;
}

#customerEditModal .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 3px;
}

#customerEditModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ==========================
   机构详情弹窗样式
   ========================== */
#customerDetailModal .modal-dialog {
    max-width: 95vw;
    width: 960px;
}

#customerDetailModal .modal-body {
    padding: 16px;
}

#customerDetailModal .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

#customerDetailModal .form-label.small {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

#customerDetailModal .form-control {
    border-radius: 4px;
    border: 1px solid #dee2e6;
    padding: 6px 10px;
    font-size: 0.85rem;
    background-color: #f8f9fa;
}

#customerDetailModal .form-control:not(.bg-light):not(.border-success):not(.border-warning) {
    background-color: #fff;
}

#customerDetailModal .form-control.border-success {
    border-color: #198754;
    background-color: #d1e7dd;
}

#customerDetailModal .form-control.border-warning {
    border-color: #ffc107;
    background-color: #fff3cd;
}

#customerDetailModal .card {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
}

#customerDetailModal .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 8px 12px;
    font-size: 0.9rem;
}

#customerDetailModal .card-body {
    padding: 12px;
}

#customerDetailModal .compact-row {
    margin-bottom: 0;
}

#customerDetailModal .compact-row > .col-md-3,
#customerDetailModal .compact-row > .col-md-6 {
    padding: 4px 8px;
}

#customerDetailModal .table-responsive {
    margin: 0;
}

#customerDetailModal .custom-table {
    font-size: 0.85rem;
}


/* ==========================
   图表容器
   ========================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container canvas {
    max-height: 100%;
}

/* ==========================
   用户列表表格 - 自适应宽度（已修复重叠问题）
   ========================== */
.table-responsive .custom-table th,
.table-responsive .custom-table td {
    white-space: normal;
    word-break: break-word;
}

/* 角色列：自适应宽度，无需特别设置宽度，让浏览器自动分配 */
.table-responsive .custom-table th:nth-child(5),
.table-responsive .custom-table td:nth-child(5) {
    white-space: normal;
    width: auto;
    min-width: 140px;
    max-width: none;
    text-align: left;
}

/* ==========================
   连锁管理模块特有样式（卡片网格、工具栏、链式表格等）
   ========================== */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: var(--card, #f8f9fa); border: 1px solid var(--chain-border, #cbd5e1); padding: 12px 16px; border-radius: 8px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type="text"] { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 4px; }
.toolbar select { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 4px; }
.chain-table { width: 100%; border-collapse: collapse; border: 1px solid #cbd5e1; }
.chain-table thead { background: #f1f5f9; }
.chain-table th, .chain-table td { padding: 8px 10px; border-bottom: 1px solid #cbd5e1; text-align: left; font-size: 13px; }
.chain-table tbody tr:hover { background: #f8fafc; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; font-size: 14px; }
.pagination button { padding: 4px 10px; border: 1px solid #cbd5e1; background: #fff; border-radius: 4px; cursor: pointer; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination button.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.btn-sm { padding: 4px 8px; font-size: 12px; }

/* ==========================
   自定义模态框（用于连锁管理）- 最高层级
   ========================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999 !important;
    /* 不使用 backdrop-filter，避免性能问题和闪烁 */
}

.modal-overlay.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Modal 动画 */
.modal-overlay.show .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-overlay .modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 95%;
    width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000000 !important;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.5);
    border: 3px solid #3b82f6;
    /* 确保不受 Bootstrap 样式影响 */
}
.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 12px;
}
.modal-overlay .modal-header h3 { margin: 0; font-size: 18px; }
.modal-overlay .modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #6c757d; }
.modal-overlay .modal-body-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
.modal-overlay .modal-section { padding: 16px; background: #f8f9fa; border-radius: 8px; }
.modal-overlay .modal-section-title { font-weight: 600; margin-bottom: 12px; color: #0d6efd; font-size: 14px; }
.modal-overlay .source-org-box { background: #e7f1ff; padding: 12px; border-radius: 6px; border-left: 4px solid #0d6efd; font-weight: 500; }
.modal-overlay .target-list-improved { max-height: 300px; overflow-y: auto; border: 1px solid #dee2e6; padding: 12px; border-radius: 6px; background: #fff; }
.modal-overlay .target-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid #f0f0f0; }
.modal-overlay .target-item:last-child { border-bottom: none; }
.modal-overlay .target-item:hover { background: #f8f9fa; }

/* ==========================
   其他辅助类
   ========================== */
.text-muted { color: #6c757d !important; }
.text-center { text-align: center !important; }
.text-nowrap { white-space: nowrap !important; }
.fs-4 { font-size: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.gap-2 { gap: 0.5rem !important; }
.row { display: flex; flex-wrap: wrap; margin-right: -8px; margin-left: -8px; }
.row > * { padding-right: 8px; padding-left: 8px; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.small { font-size: 0.8rem !important; }
small, .small { font-size: 0.8rem !important; }
.g-1 { gap: 0.25rem !important; }
code { padding: 2px 6px; font-size: 0.85em; color: #007AFF; background-color: rgba(0, 122, 255, 0.1); border-radius: 4px; }
.bg-light { background-color: var(--admin-gray-100) !important; }
.text-dark { color: var(--admin-gray-800) !important; }
.text-primary { color: var(--admin-primary) !important; }
.text-success { color: var(--admin-success) !important; }
.text-warning { color: var(--admin-warning) !important; }
.text-danger { color: var(--admin-danger) !important; }
.fw-bold { font-weight: 700 !important; }
.ms-2 { margin-left: 0.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.p-0 { padding: 0 !important; }
.d-none { display: none !important; }
.hidden { display: none !important; }
.spinner-border { display: inline-block; width: 2rem; height: 2rem; vertical-align: text-bottom; border: 0.25em solid currentColor; border-right-color: transparent; border-radius: 50%; -webkit-animation: spinner-border .75s linear infinite; animation: spinner-border .75s linear infinite; color: var(--admin-primary); }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.2em; }
@keyframes spinner-border { to { transform: rotate(360deg); } }

/* 复选框与单选框 */
.form-check { display: flex; align-items: center; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.form-check-input { width: 1rem; height: 1rem; margin-left: -1.5rem; margin-right: 0.5rem; accent-color: var(--admin-primary); cursor: pointer; }
.form-check-label { margin-bottom: 0; cursor: pointer; font-size: 0.9rem; }
.form-check-input:checked { background-color: var(--admin-primary); border-color: var(--admin-primary); }
.form-check-input[type="radio"] { border-radius: 50%; }

/* 响应式微调 */
@media (max-width: 768px) {
    .settings-container { flex-direction: column; }
    .settings-sidebar { flex: none; max-width: 100%; }
    .col-md-3 { flex: 0 0 50%; max-width: 50%; margin-bottom: 10px; }
}