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

:root {
    --primary: #1890ff;
    --primary-dark: #096dd9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #f5222d;
    --text: #333;
    --text-secondary: #666;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --border: #e8e8e8;
    --sidebar-width: 220px;
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

/* 布局 */
.app {
    display: flex;
    min-height: 100vh;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.btn-logout {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 99;
    transition: transform 0.3s;
}

.sidebar.closed {
    transform: translateX(-100%);
}

.nav {
    padding: 20px 0;
}

.menu-group {
    margin-bottom: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(24, 144, 255, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main, .main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    transition: margin-left 0.3s;
}

.sidebar.closed + .main,
.sidebar.closed ~ .main-content {
    margin-left: 0;
}

/* 页面 */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page h1 {
    margin-bottom: 20px;
    font-size: 24px;
}

/* 卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-icon {
    font-size: 40px;
}

.card-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary);
}

.card-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #f0f0f0;
    color: var(--text);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-4px);
}

.video-thumbnail {
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-weight: 600;
    margin-bottom: 5px;
}

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

/* 任务列表 */
.task-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.task-item {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item:last-child {
    border-bottom: none;
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.task-status.pending {
    background: #fff7e6;
    color: #fa8c16;
}

.task-status.completed {
    background: #f6ffed;
    color: #52c41a;
}

.task-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.task-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.task-meta {
    font-size: 13px;
    color: #999;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
}

.video-modal-content {
    max-width: 900px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

#video-player {
    width: 100%;
    max-height: 500px;
}

/* 积分 */
.points-display {
    text-align: center;
    margin-bottom: 30px;
}

.points-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    display: inline-block;
    min-width: 200px;
}

.points-value {
    font-size: 48px;
    font-weight: 700;
}

.points-label {
    font-size: 16px;
    opacity: 0.9;
}

/* 奖品 */
.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.prize-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.prize-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.prize-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.prize-points {
    color: var(--primary);
    font-weight: 600;
}

.prize-stock {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* 响应式 */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
        width: 220px;
    }
    
    .main {
        margin-left: 0;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.section h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

/* 测评 */
.assessment-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
}

.subject-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.subject-buttons .btn {
    padding: 15px 30px;
    font-size: 16px;
}

.question-item {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.question-item:last-child {
    border-bottom: none;
}

.question-title {
    font-weight: 600;
    margin-bottom: 15px;
}

.question-knowledge {
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 10px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.option-label:hover {
    background: #f5f5f5;
}

/* 数据列表 */
.data-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.data-item {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-item:last-child {
    border-bottom: none;
}

/* 历史记录 */
.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .positive {
    color: var(--success);
    font-weight: 600;
}

.history-item .negative {
    color: var(--danger);
    font-weight: 600;
}

/* 进度查看 */
.progress-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header strong {
    font-size: 18px;
}

.points-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.progress-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.progress-actions {
    display: flex;
    gap: 10px;
}

/* 空状态 */
.empty-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* 弱项显示 */
.weak-point-item {
    background: #fff7e6;
    border-left: 4px solid var(--warning);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
}

.plan-item {
    background: #f6ffed;
    border-left: 4px solid var(--success);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
}
