/* 基础样式 - 基于您提供的index.html样式进行扩展 */
:root {
    --sidebar-width: 260px;
    --primary: #2C5AA0;
    --primary-light: #eff6ff;
    --primary-dark: #1e3a8a;
    --accent: #4F46E5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
}

/* 链接重置 */
a {
    text-decoration: none;
    color: inherit;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-main);
    border-color: var(--border);
}

.btn:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
}

.btn-outline:hover {
    background: #f8fafc;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

.badge-homework { background: #f0f9ff; color: #0c4a6e; }
.badge-quiz { background: #fef3c7; color: #92400e; }
.badge-test { background: #f0fdf4; color: #166534; }
.badge-exam { background: #fef2f2; color: #991b1b; }
.badge-hsk { background: #f5f3ff; color: #5b21b6; }

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.brand i {
    font-size: 1.5rem;
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-group {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 24px;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 0;
    margin-bottom: 2px;
    font-size: 0.95rem;
    transition: 0.2s;
    border-left: 4px solid transparent;
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
    color: var(--text-muted);
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item.active i {
    color: var(--primary);
}

/* 顶部栏样式 */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin 0.3s ease;
}

.top-bar {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.menu-toggle {
    display: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-main);
    margin-right: 15px;
}

.search-container {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    width: 300px;
}

.search-container input {
    border: none;
    background: transparent;
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.user-menu:hover {
    background: #f8fafc;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    object-fit: cover;
}

/* 主要内容区域 */
.content-area {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.page-header h2 i {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.card-header h3 i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

/* 表格样式 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    padding: 14px 24px;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.large .modal-content {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 欢迎横幅 */
.welcome-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(44,90,160,0.2);
}

.welcome-hero h1 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.hero-icon {
    position: absolute;
    right: 30px;
    bottom: -10px;
    font-size: 8rem;
    opacity: 0.1;
}

/* 统计行 */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-box {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
}

.stat-box h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* 页脚 */
.main-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        width: 200px;
    }
}

@media (max-width: 640px) {
    .search-container {
        display: none;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .welcome-hero {
        padding: 20px;
    }
    
    .hero-icon {
        display: none;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 工具类 */
.hide-mobile {
    display: inline;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
}

/* 状态指示器 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.status-badge.active {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.status-badge.graduated {
    background: #e0f2fe;
    color: #0369a1;
}

.status-badge.warning {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.success {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.info {
    background: #e0f2fe;
    color: #0369a1;
}

.status-badge.primary {
    background: var(--primary-light);
    color: var(--primary);
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}