/* ======= Emlog 管理后台增强样式 ======= */

/* 全局样式重置 */
* {
    box-sizing: border-box;
}

/* 基础body样式 */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fb;
    margin: 0;
    padding: 0;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 页面标题 */
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: #4299e1;
    font-size: 28px;
}

.page-title small {
    font-size: 14px;
    color: #718096;
    font-weight: 400;
    margin-left: 16px;
}

/* 卡片设计 */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    /* 改为 visible，避免裁剪卡片内的下拉框/弹层（否则部分浏览器下拉选项会被切掉） */
    overflow: visible;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
    font-weight: 600;
    font-size: 18px;
    color: #2d3748;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 因 .card 不再裁剪，这里手动圆角保持卡片顶部外观 */
    border-radius: 12px 12px 0 0;
}

.card-header i {
    margin-right: 8px;
    color: #4299e1;
}

.card-body {
    padding: 24px;
}

/* 统计卡片 - 保留为兼容性考虑 */
.stats-row {
    margin-bottom: 24px;
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
}

.stats-card.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stats-card.success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.stats-card.warning { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); color: #2d3748; }
.stats-card.info { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #2d3748; }
.stats-card.danger { background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%); }
.stats-card.secondary { background: linear-gradient(135deg, #a8a8a8 0%, #cfd8dc 100%); color: #2d3748; }

.stats-card .stats-icon {
    font-size: 36px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.stats-card .stats-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stats-card .stats-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stats-card .stats-trend {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.8;
}

/* 兼容旧版统计样式 */
.stats-col {
    margin-bottom: 16px;
}

.stat-card {
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.stat-card.warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #2d3748;
}

.stat-card.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: white;
}

.stat-card.info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2d3748;
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-right: 16px;
    opacity: 0.9;
}

.stat-card .stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.stat-card .stat-content p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

/* 表单控件 */
.form-group {
    margin-bottom: 20px;
}

.form-label, label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
    display: block;
}

.form-label .text-danger {
    color: #e53e3e;
}

.form-control {
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    /* 覆盖 Bootstrap 固定高度，避免 padding 过大导致选中文字被纵向裁切 */
    height: auto;
    line-height: 1.5;
}

.form-control:focus {
    border-color: #4299e1;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.form-control::placeholder {
    color: #a0aec0;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 自定义选择 */
.custom-select {
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 10px 40px 10px 16px;
    font-size: 14px;
    background-color: #ffffff;
    /* 覆盖 Bootstrap 固定高度，避免选中文字被纵向裁切 */
    height: auto;
    line-height: 1.5;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
    text-transform: none;
    padding: 10px 20px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.5;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: #4299e1;
    border-color: #4299e1;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #3182ce;
    border-color: #3182ce;
    color: #ffffff;
}

.btn-outline-primary {
    color: #4299e1;
    background-color: transparent;
    border-color: #4299e1;
}

.btn-outline-primary:hover {
    background-color: #4299e1;
    color: #ffffff;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-color: #48bb78;
    color: #ffffff;
}

.btn-outline-success {
    color: #48bb78;
    background-color: transparent;
    border-color: #48bb78;
}

.btn-outline-success:hover {
    background-color: #48bb78;
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border-color: #f56565;
    color: #ffffff;
}

.btn-outline-danger {
    color: #f56565;
    background-color: transparent;
    border-color: #f56565;
}

.btn-outline-danger:hover {
    background-color: #f56565;
    color: #ffffff;
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    border-color: #ed8936;
    color: #ffffff;
}

.btn-outline-warning {
    color: #ed8936;
    background-color: transparent;
    border-color: #ed8936;
}

.btn-outline-warning:hover {
    background-color: #ed8936;
    color: #ffffff;
}

.btn-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border-color: #4299e1;
    color: #ffffff;
}

.btn-outline-info {
    color: #4299e1;
    background-color: transparent;
    border-color: #4299e1;
}

.btn-outline-info:hover {
    background-color: #4299e1;
    color: #ffffff;
}

.btn-secondary {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    border-color: #718096;
    color: #ffffff;
}

.btn-outline-secondary {
    color: #718096;
    background-color: transparent;
    border-color: #718096;
}

.btn-outline-secondary:hover {
    background-color: #718096;
    color: #ffffff;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right-width: 1px;
}

.btn-group-vertical {
    flex-direction: column;
}

.btn-group-vertical .btn {
    border-radius: 0;
    border-bottom-width: 0;
    width: 100%;
}

.btn-group-vertical .btn:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.btn-group-vertical .btn:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom-width: 1px;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* 搜索表单 */
.search-form {
    position: relative;
}

.search-form .input-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-form .form-control {
    border-right: none;
    border-radius: 8px 0 0 8px !important;
}

.search-form .input-group-append .btn {
    border-left: none;
    border-radius: 0 8px 8px 0 !important;
}

/* 表格设计 */
.table {
    width: 100%;
    margin-bottom: 0;
    font-size: 14px;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-top: none;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 3px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 16px 12px;
}

.table td {
    vertical-align: middle;
    border-top: 1px solid #e2e8f0;
    padding: 12px;
    color: #4a5568;
}

.table-hover tbody tr:hover {
    background-color: rgba(66, 153, 225, 0.04);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-bordered {
    border: 1px solid #e2e8f0;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #e2e8f0;
}

.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.table-active {
    background-color: rgba(66, 153, 225, 0.08) !important;
}

/* 徽章标签 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 6px;
}

.badge-pill {
    padding-right: 8px;
    padding-left: 8px;
    border-radius: 50rem;
}

.badge-primary {
    color: #fff;
    background-color: #4299e1;
}

.badge-success {
    color: #fff;
    background-color: #48bb78;
}

.badge-warning {
    color: #2d3748;
    background-color: #ed8936;
}

.badge-danger {
    color: #fff;
    background-color: #f56565;
}

.badge-info {
    color: #fff;
    background-color: #4299e1;
}

.badge-secondary {
    color: #fff;
    background-color: #718096;
}

.badge-light {
    color: #2d3748;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
}

/* 渐变色徽章 */
.badge.bg-gradient-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e) !important;
    color: #fff;
}

.badge.bg-gradient-success {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    color: #fff;
}

.badge.bg-gradient-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20) !important;
    color: #fff;
}

.badge.bg-gradient-primary {
    background: linear-gradient(135deg, #4299e1, #3182ce) !important;
    color: #fff;
}

/* 选项卡 */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    border: none;
    padding: 12px 20px;
    color: #718096;
    font-weight: 600;
    position: relative;
    transition: all 0.2s ease;
    background: transparent !important;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: #4299e1;
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: #4299e1;
    background: transparent !important;
    border: none;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    border-radius: 3px 3px 0 0;
}

.nav-tabs .nav-link i {
    margin-right: 6px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: #ebf8ff;
    color: #3182ce;
    border-color: #bee3f8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination span.current {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: #fff;
    border-color: #4299e1;
    font-weight: 600;
}

/* 警告提示 */
.alert {
    position: relative;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

.alert-info i {
    color: #31708f;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #a0aec0;
    text-align: center;
}

.empty-state i {
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-state p {
    margin-bottom: 0;
    opacity: 0.8;
}

/* 模态框 */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
    color: #2d3748;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    padding: 20px 24px;
}

/* 输入组 */
.input-group {
    display: flex;
    position: relative;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-append .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-text {
    background-color: #f7fafc;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 10px 16px;
    color: #4a5568;
    font-weight: 500;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 280px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.bg-success {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    color: #ffffff;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e) !important;
    color: #ffffff;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20) !important;
    color: #ffffff;
}

.toast.bg-info {
    background: linear-gradient(135deg, #4299e1, #3182ce) !important;
    color: #ffffff;
}

/* 响应式图片 */
.img-thumbnail {
    padding: 4px;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.img-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 辅助工具类 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-weight-bold { font-weight: 700 !important; }
.font-weight-600 { font-weight: 600 !important; }
.font-weight-500 { font-weight: 500 !important; }
.font-weight-normal { font-weight: 400 !important; }

.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }

.small, small { font-size: 0.875em; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }

.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }

/* 间距类 */
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 20px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 48px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 48px !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 16px !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 16px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 4px !important; }
.pt-2 { padding-top: 8px !important; }
.pt-3 { padding-top: 16px !important; }
.pt-4 { padding-top: 24px !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 4px !important; }
.pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 16px !important; }
.pb-4 { padding-bottom: 24px !important; }

.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.px-5 { padding-left: 20px !important; padding-right: 20px !important; }

.py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-5 { padding-top: 20px !important; padding-bottom: 20px !important; }

.border-top { border-top: 1px solid #e2e8f0 !important; }
.border-bottom { border-bottom: 1px solid #e2e8f0 !important; }

/* 浮动 */
.float-right { float: right !important; }
.float-left { float: left !important; }
.float-none { float: none !important; }

/* 圆角 */
.rounded { border-radius: 8px !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-lg { border-radius: 12px !important; }

/* Editor.md 编辑器调整 */
.editormd {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
    margin-bottom: 24px !important;
    overflow: hidden;
}

.editormd-toolbar {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 12px 12px 0 0 !important;
}

.editormd .editormd-preview {
    background-color: #ffffff !important;
    padding: 24px !important;
}

.editormd-fullscreen .editormd-preview {
    background-color: #ffffff !important;
}

/* 让 Editor.md 工具栏图标使用其自带的 FontAwesome 4 字体，
   避免与后台全局加载的 FontAwesome 5 冲突（同名 .fa 类导致部分图标渲染成小方块） */
.editormd .fa,
.editormd .fa:before,
.editormd [class^="fa-"]:before,
.editormd [class*=" fa-"]:before {
    font-family: 'FontAwesome' !important;
}

/* 工具栏图标尺寸统一、点击区域更舒适 */
.editormd-toolbar > .editormd-toolbar-container > ul > li > a {
    font-size: 16px !important;
    min-width: 28px;
    padding: 4px 6px;
    color: #4a5568;
}

.editormd-toolbar > .editormd-toolbar-container > ul > li > a:hover {
    color: #2d3748;
    background: #e2e8f0;
    border-radius: 6px;
}

/* 自定义开关样式 */
.custom-switch {
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-switch .custom-control-label {
    cursor: pointer;
    font-weight: 500;
    padding-left: 0;
    margin-bottom: 0;
}

.custom-switch .custom-control-input {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    position: relative;
    -webkit-appearance: none;
    background-color: #cbd5e0;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-switch .custom-control-input:checked {
    background-color: #4299e1;
}

.custom-switch .custom-control-input::before {
    content: '';
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #ffffff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-switch .custom-control-input:checked::before {
    left: 24px;
}

/* 图片模态 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* 行高 */
.line-height-1 { line-height: 1; }
.line-height-1_2 { line-height: 1.2; }
.line-height-1_5 { line-height: 1.5; }

/* 侧边栏导航子菜单样式 - 重新设计 */
.sidebar .collapse-inner {
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar .collapse-item {
    display: block !important;
    padding: 10px 20px 10px 48px !important;
    font-size: 13px !important;
    color: #4a5568 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border-radius: 0 !important;
    border-left: 3px solid transparent !important;
    position: relative !important;
    line-height: 1.4 !important;
}

.sidebar .collapse-item:hover {
    background-color: rgba(66, 153, 225, 0.08) !important;
    color: #4299e1 !important;
    border-left-color: #4299e1 !important;
}

.sidebar .collapse-item.active {
    background-color: #4299e1 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-left-color: #2b6cb0 !important;
}

/* 子菜单分隔线 */
.sidebar .collapse-item + .collapse-item {
    border-top: 1px solid #e2e8f0 !important;
}

/* 修复折叠容器的边框 */
.sidebar .collapse {
    background: transparent !important;
}

.sidebar .collapse-inner {
    background: #ffffff !important;
    border-radius: 8px !important;
    margin: 4px 8px !important;
    overflow: hidden !important;
    box-shadow: inset 0 0 0 1px #e2e8f0 !important;
}

/* 下拉选择框优化 */
select.form-control option {
    padding: 8px 12px !important;
}

select.form-control optgroup {
    font-weight: 600 !important;
    color: #4a5568 !important;
    padding: 4px 8px !important;
}

/* 解决显示不全问题 */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.table th, .table td {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 卡片内表格优化 */
.card .table th:first-child,
.card .table td:first-child {
    padding-left: 20px !important;
}

.card .table th:last-child,
.card .table td:last-child {
    padding-right: 20px !important;
}

/* 按钮组改进 */
.btn-group .btn {
    margin-right: -1px !important;
}

.btn-group .btn:focus {
    z-index: 1 !important;
}

/* 选择框悬浮效果 */
select.form-control:hover {
    border-color: #a0aec0 !important;
}

select.form-control:focus {
    border-color: #4299e1 !important;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2) !important;
}

/* 响应式设计 */
@media (max-width: 767.98px) {
    .page-title {
        font-size: 24px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-body {
        padding: 20px;
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .btn-group-vertical > .btn,
    .btn-group > .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .search-form {
        width: 100% !important;
        margin-top: 12px;
    }
    
    .stats-row .col-md-3,
    .stats-row .col-md-4 {
        margin-bottom: 16px;
    }
    
    .stats-card {
        padding: 16px;
    }
    
    .stats-card .stats-value {
        font-size: 24px;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state h5 {
        font-size: 16px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
    
    /* 修复表格显示问题 */
    .table-responsive table {
        min-width: 600px !important;
    }
    
    /* 修复下拉菜单 */
    .dropdown-menu {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
    }
    
    .dropdown-item {
        padding: 8px 16px !important;
        font-size: 14px !important;
        color: #4a5568 !important;
    }
    
    .dropdown-item:hover {
        background-color: #f7fafc !important;
        color: #4299e1 !important;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 20px;
    }
    
    .page-title small {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .stats-card {
        text-align: center;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .badge {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control,
    .input-group .btn {
        width: 100%;
        border-radius: 8px !important;
    }
}

/* 打印优化 */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .btn,
    .nav-tabs,
    .pagination,
    .search-form {
        display: none !important;
    }
    
    .table {
        border: 1px solid #ccc !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #ccc !important;
    }
}

/* ============================================================
   统一美化增强 (UI Polish)
   设计变量 / 字体 / 颜色 / 标题 / 小标题 / 参数说明 / 筛选面板
   ============================================================ */
:root {
    --zc-primary: #4299e1;
    --zc-primary-dark: #3182ce;
    --zc-primary-soft: #ebf4ff;
    --zc-accent: #667eea;
    --zc-success: #48bb78;
    --zc-danger: #f56565;
    --zc-warning: #ed8936;
    --zc-text: #2d3748;
    --zc-text-2: #4a5568;
    --zc-muted: #a0aec0;
    --zc-border: #e2e8f0;
    --zc-bg: #f5f7fb;
    --zc-radius: 12px;
    --zc-radius-sm: 8px;
    --zc-shadow: 0 6px 20px rgba(45, 55, 72, 0.06);
    --zc-font: 'Segoe UI', 'Roboto', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
}

/* 全局字体与排版 */
body {
    font-family: var(--zc-font);
    font-size: 14px;
    color: var(--zc-text);
    line-height: 1.65;
    letter-spacing: .2px;
}

.container-fluid {
    padding-top: 24px;
}

/* 页面标题：左侧渐变强调色条 + 图标徽标 */
.page-title {
    border-bottom: none;
    position: relative;
    padding: 4px 0 16px 20px;
    margin-bottom: 24px;
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 14px;
    width: 5px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--zc-primary), var(--zc-accent));
}

.page-title i {
    background: var(--zc-primary-soft);
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 20px;
    color: var(--zc-primary);
}

.page-title small {
    font-size: 13px;
    color: var(--zc-muted);
    font-weight: 400;
    margin-left: 14px;
}

/* 小标题 / 区块标题 */
.sub-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--zc-text);
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--zc-border);
    position: relative;
}

.sub-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 48px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--zc-primary), var(--zc-accent));
}

/* ============ AI 开放平台 - 模型卡片（参考 emlog 风格） ============ */
.model-card {
    border: 1px solid var(--zc-border);
    border-radius: 12px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.model-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
    transform: translateY(-2px);
}

.model-card .model-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--zc-text);
    word-break: break-word;
}

.model-card .model-actions {
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.model-card .model-actions a {
    position: relative;
    text-decoration: none;
}

.model-card .model-actions a:hover {
    text-decoration: underline;
}

.model-card .model-actions a + a:not(.set-front-btn)::before,
.model-card .model-actions .text-success + .text-primary::before,
.model-card .model-actions .text-info + .text-primary::before,
.model-card .model-actions .text-primary + .text-danger::before {
    content: '';
}

/* 文字链接之间的分隔竖线（除最后一项外） */
.model-card .model-actions > *:not(:last-child)::after {
    content: '|';
    color: var(--zc-border);
    margin-left: 10px;
    font-weight: 400;
}

/* 设置区块标题（基础设置分组） */
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--zc-text);
    padding-bottom: 10px;
    margin: 28px 0 16px;
    border-bottom: 2px solid var(--zc-border);
    position: relative;
    display: flex;
    align-items: center;
}

.section-title:first-of-type {
    margin-top: 0;
}

.section-title i {
    color: var(--zc-primary);
    margin-right: 8px;
    font-size: 16px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 48px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--zc-primary), var(--zc-accent));
}

/* 参数说明（form-text）统一样式：信息图标 + 柔和提示色 */
.form-text.text-muted {
    font-size: 12.5px;
    color: var(--zc-muted);
    margin-top: 6px;
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
}

.form-text.text-muted::before {
    content: '\f05a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 11px;
    color: var(--zc-primary);
}

/* 筛选面板 */
.filter-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--zc-border);
    border-radius: var(--zc-radius);
    box-shadow: var(--zc-shadow);
    padding: 20px 22px;
    margin-bottom: 24px;
}

.filter-bar .filter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--zc-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar .filter-title i {
    color: var(--zc-primary);
}

.filter-bar label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--zc-text-2);
    margin-bottom: 6px;
}

.filter-bar .form-control,
.filter-bar .custom-select {
    border-radius: var(--zc-radius-sm);
}

/* 搜索框：圆角胶囊 + 聚焦高亮 */
.search-form .form-control {
    border-radius: 999px 0 0 999px !important;
}

.search-form .input-group-append .btn {
    border-radius: 0 999px 999px 0 !important;
}

.search-form .input-group {
    box-shadow: var(--zc-shadow);
    border-radius: 999px;
    overflow: hidden;
}

/* 卡片标题内的小标题 */
.card-header h5 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.card-header h5 i {
    color: var(--zc-primary);
}

/* 表格标题行美化 */
.table thead th {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%) !important;
    color: var(--zc-text) !important;
    font-size: 12.5px !important;
}

.table thead.thead-dark th {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    color: #fff !important;
    border-bottom: none !important;
}

/* 告警提示：左侧强调边 */
.alert {
    border-left: 4px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert i {
    margin-top: 2px;
    font-size: 16px;
}

/* 说明文字容器：作为单个 flex item，内部文本整体流动，避免被 flex 拆成多块 */
.alert-body {
    flex: 1;
    min-width: 0;
    line-height: 1.7;
}

.alert-info {
    border-left-color: var(--zc-primary);
}

.alert-success {
    border-left-color: var(--zc-success);
}

.alert-warning {
    border-left-color: var(--zc-warning);
}

.alert-danger {
    border-left-color: var(--zc-danger);
}

/* 侧边栏品牌区 */
.sidebar .sidebar-brand {
    font-weight: 700;
    letter-spacing: .5px;
    padding: 18px 16px;
}

/* 自定义开关色彩统一 */
.custom-switch .custom-control-input:checked {
    background-color: var(--zc-primary);
}

.custom-switch .custom-control-input:checked::before {
    left: 24px;
}

/* 统计数值字体 */
.h3, .h2, .stats-value, .stat-content h3 {
    font-variant-numeric: tabular-nums;
}

/* 表单标签统一样式 */
.form-group > label,
.col-form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--zc-text-2);
}