
/* ===== 页面样式 ===== */

/* 页面容器 */
.page {
    min-height: 100vh;
    padding-top: 70px; /* 为固定导航栏留出空间 */
}

/* 首页样式 */
.home-page {
    /* 首页特定样式 */
}

/* 考公专区样式 */
.civil-page {
    /* 考公专区特定样式 */
}

/* 计算机专区样式 */
.computer-page {
    /* 计算机专区特定样式 */
}

/* 语言学习专区样式 */
.language-page {
    /* 语言学习专区特定样式 */
}

/* 资源中心样式 */
.resources-page {
    /* 资源中心特定样式 */
}

/* 学习社区样式 */
.community-page {
    /* 学习社区特定样式 */
}

/* 课程详情弹窗 */
.course-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.course-detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

.course-detail-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.course-detail-overlay.active .course-detail-content {
    transform: scale(1);
}

.detail-header {
    padding: 24px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-icon {
    font-size: 2.5rem;
    margin-right: 16px;
}

.detail-info h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.detail-info p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.detail-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.detail-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.detail-body {
    padding: 24px;
}

.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.detail-stat i {
    color: var(--primary);
}

.detail-progress {
    margin-bottom: 24px;
}

.detail-progress h3 {
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.detail-tag {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
}

.detail-chapters {
    margin-bottom: 24px;
}

.detail-chapters h3 {
    margin-bottom: 16px;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.chapter-item:hover {
    background: var(--bg-card-hover);
}

.chapter-item.completed {
    background: rgba(67, 233, 123, 0.1);
}

.chapter-item.current {
    background: rgba(102, 126, 234, 0.1);
}

.chapter-item.locked {
    opacity: 0.6;
}

.chapter-status {
    margin-right: 12px;
    color: var(--primary);
}

.chapter-title {
    flex: 1;
    margin-right: 12px;
}

.chapter-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-actions {
    display: flex;
    gap: 12px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: rgba(67, 233, 123, 0.1);
    color: #2eb863;
}

.toast-error {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
}

.toast-info {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

/* 管理员页面样式 */
.admin-page {
    padding-top: 70px;
}

.admin-header {
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.admin-header p {
    color: var(--text-secondary);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-content h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.admin-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    margin-bottom: 16px;
}

.admin-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-controls input,
.admin-controls select {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.admin-controls input:focus,
.admin-controls select:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-table tr:hover {
    background: var(--bg-secondary);
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
}

.role-badge.user {
    background: rgba(67, 233, 123, 0.1);
    color: #2eb863;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
}

.stats-card h3 {
    margin-bottom: 16px;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.stats-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.stats-info {
    flex: 1;
}

.stats-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.stats-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-value {
    font-weight: 600;
    color: var(--primary);
}

.chart-container {
    height: 200px;
    margin-top: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
}

.settings-card h3 {
    margin-bottom: 16px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
