/* 统一的后台管理样式 - 渐变配色方案 - 紧凑版 */

/* 基础颜色变量 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warm-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --cool-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #e9ecef;
    --text-color: #333333;
    --text-muted: #6c757d;
}

/* 侧边栏样式 */
.sidebar {
    min-height: 100vh;
    background: var(--primary-gradient);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 6px;
    margin: 1px 0;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.sidebar h4 {
    font-size: 1.1rem;
}

.sidebar small {
    font-size: 0.75rem;
}

/* 主内容区 */
.main-content {
    background: var(--background-color);
    min-height: 100vh;
    padding: 1.5rem !important;
}

/* 页面标题 */
.page-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(15deg);
}

/* 卡片样式 */
.stats-card, .content-card, .page-card {
    background: var(--card-background);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.stats-card:hover, .content-card:hover, .page-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 统计卡片特殊样式 */
.stats-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 12px 12px 0 0;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 统计卡片图标 */
.stats-icon {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.stats-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* 表格样式 */
.table {
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9rem;
}

.table thead th {
    background: #f8f9fa;
    color: var(--text-color);
    border: none;
    font-weight: 600;
    padding: 0.8rem;
    font-size: 0.85rem;
    position: relative;
}

.table thead th::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 8px 8px 0 0;
}

.table thead th::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-gradient) 50%, transparent 100%);
    transform: translateY(-50%);
}

.table tbody td {
    padding: 0.8rem;
    border-color: #f0f0f0;
    vertical-align: middle;
    font-size: 0.85rem;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

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

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-gradient);
    filter: brightness(1.1);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* 徽章样式 */
.badge {
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    font-size: 0.75rem;
}

/* 配置页面特殊样式 */
.page-card {
    cursor: pointer;
    height: 160px;
    display: flex;
    align-items: center;
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.page-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 12px 12px 0 0;
}

.page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 1.2rem;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    text-align: left;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.card-count {
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
}

.card-arrow {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    opacity: 0.6;
}

.page-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* 网格布局 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1400px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .page-card {
        height: auto;
        padding: 1.2rem;
    }
    .card-icon {
        font-size: 2.5rem;
        margin-right: 1rem;
    }
}

/* 配置项样式 */
.config-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.config-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.config-key {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.config-value {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.config-input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem;
    font-size: 0.8rem;
    width: 100%;
}

.config-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* 搜索卡片 */
.search-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary-gradient);
    border-radius: 12px 12px 0 0;
}

.search-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 返回按钮 */
.back-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.back-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* 统计卡片渐变变体 */
.stats-card:nth-child(1)::before {
    background: var(--primary-gradient);
}

.stats-card:nth-child(2)::before {
    background: var(--secondary-gradient);
}

.stats-card:nth-child(3)::before {
    background: var(--accent-gradient);
}

.stats-card:nth-child(4)::before {
    background: var(--warm-gradient);
}

/* 模态框样式 */
.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-size: 1.1rem;
}

.modal-content {
    border-radius: 10px;
    overflow: hidden;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
}

/* 警告框样式 */
.alert {
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* 紧凑布局 */
.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-8, .col-lg-10 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* 小标题 */
h5 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

h6 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* 小文本 */
small {
    font-size: 0.75rem;
}

/* 紧凑间距 */
.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 2rem !important;
}

.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}
