/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-primary: #0a0e27;
    --bg-secondary: #151d3b;
    --bg-tertiary: #1f2d4d;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #2d3e5f;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 60px;
    padding: 24px 8px;
}

.sidebar.collapsed .logo,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-name {
    display: none;
}

.sidebar.collapsed .nav-item {
    padding: 12px 8px;
    justify-content: center;
}

.sidebar.collapsed .nav-item-icon {
    width: 24px;
}

.toggle-sidebar-btn {
    position: absolute;
    top: 16px;
    right: -12px;
    width: 24px;
    height: 24px;
    background-color: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 10;
    transition: all 0.3s ease;
}

.toggle-sidebar-btn:hover {
    background-color: var(--primary-light);
    transform: scale(1.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding-left: 13px;
}

.nav-item-icon {
    width: 20px;
    text-align: center;
}

.user-info {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-name {
    font-size: 13px;
    color: var(--text-secondary);
}

#logout-btn {
    padding: 6px 12px;
    font-size: 12px;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

/* 主内容区 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* 通用按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

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

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

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

.btn-success:hover {
    background-color: #059669;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 输入框 */
.input {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--bg-secondary);
}

.input::placeholder {
    color: var(--text-muted);
}

/* 选择框 */
.select {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 卡片 */
.card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 35px rgba(59, 130, 246, 0.1);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.table thead {
    background-color: rgba(0, 0, 0, 0.3);
}

.table th {
    padding: 16px 14px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    line-height: 1.8;
}

.table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-icon.primary {
    background-color: rgba(59, 130, 246, 0.2);
}

.stat-icon.success {
    background-color: rgba(16, 185, 129, 0.2);
}

.stat-icon.warning {
    background-color: rgba(245, 158, 11, 0.2);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 通知 */
.notification {
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

.notification.success {
    background-color: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #86efac;
}

.notification.error {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        padding: 16px 12px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th, .table td {
        padding: 8px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 160px;
    }
    
    .nav-item {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .main-content {
        padding: 12px;
    }
}
