/* 后台管理样式 */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* 侧边栏样式 */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
    transition: all 0.3s;
}

.sidebar.active {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.sidebar ul.components {
    padding: 20px 0;
    list-style: none;
}

.sidebar ul.components li {
    padding: 0;
}

.sidebar ul.components li a {
    padding: 15px 20px;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar ul.components li a:hover,
.sidebar ul.components li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar ul.components li a i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 主内容区域 */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

#content .navbar {
    padding: 15px 20px;
    background: #fff;
    border: none;
    border-radius: 0;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

.stat-card {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    color: #fff;
}

.stat-card.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.cyan {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card .icon {
    font-size: 3rem;
    opacity: 0.3;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* 表单样式 */
.form-label {
    font-weight: 600;
    color: #495057;
}

.form-control,
.form-select {
    border-radius: 5px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 分页样式 */
.pagination .page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 5px;
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: #fff;
}

/* 模态框样式 */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* 图片预览 */
.image-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s;
}

.image-preview:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 5px;
}

/* 操作按钮组 */
.action-btn {
    padding: 2px 8px;
    font-size: 0.875rem;
    margin: 0 2px;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }

    .sidebar.active {
        margin-left: 0;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card .icon {
        font-size: 2rem;
    }

    .stat-card .number {
        font-size: 1.8rem;
    }
}
