/* 后台管理样式 */
:root {
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-sidebar-bg: #1e293b;
    --admin-sidebar-text: #f1f5f9;
    --admin-sidebar-active: rgba(255, 255, 255, 0.1);
    --admin-bg: #f3f4f6;
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #334155;
    --admin-text-muted: #94a3b8;
    --admin-header-bg: rgba(255, 255, 255, 0.9);
    --admin-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
}

/* 管理后台布局 */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: var(--admin-sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 18px;
    color: white;
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    opacity: 0.8;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--admin-sidebar-active);
    color: white;
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2) 0%, transparent 100%);
    border-left-color: var(--admin-primary);
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-divider {
    padding: 15px 20px 8px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
}

.nav-sub {
    padding-left: 30px;
    font-size: 13px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--admin-bg);
}

.main-header {
    background-color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 500;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--admin-text);
}

.content-wrapper {
    padding: 20px;
}

/* 侧边栏折叠 */
.sidebar-collapsed .sidebar {
    width: 60px;
}

.sidebar-collapsed .sidebar-header h1,
.sidebar-collapsed .nav-item span {
    display: none;
}

.sidebar-collapsed .main-content {
    margin-left: 60px;
}

/* 卡片 */
.card {
    background-color: var(--admin-card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--admin-border);
}

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: var(--admin-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 24px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--admin-primary);
    margin-bottom: 0;
}

.stat-info {
    text-align: right;
    z-index: 1;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--admin-text);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-info p {
    color: var(--admin-text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* 装饰性背景圆 - 可选 */
.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), transparent);
    border-radius: 50%;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.data-table th {
    background-color: var(--admin-bg);
    font-weight: 500;
}

.data-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #e0e0e0;
    color: var(--admin-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #bdbdbd;
}

.btn-primary {
    background-color: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #1565c0;
    color: white;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
}

textarea.form-control {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .col-3 {
    flex: 0 0 25%;
}

.form-row .col-6 {
    flex: 0 0 50%;
}

.form-actions {
    padding-top: 20px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    gap: 10px;
}

/* 警告提示 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
    margin-left: 5px;
}

.badge-primary {
    background-color: var(--admin-primary);
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.page-info {
    color: var(--admin-text-muted);
}

/* 内容头部 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 快捷操作 */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 文本对齐 */
.text-center {
    text-align: center;
}

.empty-msg {
    color: var(--admin-text-muted);
    text-align: center;
    padding: 20px;
}

/* 登录页面 */
.login-page {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: var(--admin-primary);
    margin-bottom: 15px;
    display: block;
}

.login-header h1 {
    font-size: 24px;
    color: var(--admin-text);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--admin-border);
}

.login-footer a {
    color: var(--admin-text-muted);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--admin-primary);
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h1,
    .nav-item span {
        display: none;
    }

    .main-content {
        margin-left: 60px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .col-3,
    .form-row .col-6 {
        flex: 1;
    }
}