:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --sidebar-width: 250px;
    --header-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.user-info i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* 导航菜单样式 */
.student-menu,
.teacher-menu {
    margin-bottom: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    margin: 0 0.5rem;
    font-size: 1.2rem;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

#content-area {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    min-height: calc(100vh - 4rem);
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    cursor: pointer;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 1rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* 卡片样式 */
.course-card,
.student-card,
.subject-card,
.log-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
    transition: transform 0.3s ease;
}

.course-card:hover,
.student-card:hover,
.subject-card:hover,
.log-card:hover {
    transform: translateY(-5px);
}

/* 按钮样式 */
.btn-primary,
.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover,
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 进度条样式 */
.progress-section {
    margin-top: 2rem;
}

.progress-bar {
    background: var(--glass-bg);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
    border: 1px solid var(--glass-border);
}

.progress {
    background: var(--primary-color);
    height: 100%;
    transition: width 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100vw;
        height: 60px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0 0.5rem;
        z-index: 1000;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        overflow-x: auto;
        overflow-y: visible;
    }
    .sidebar span {
        display: none;
    }
    .sidebar-header {
        display: none;
    }
    .user-info {
        display: none;
    }
    .student-menu, .teacher-menu {
        display: flex !important;
        flex-direction: row;
        margin: 0;
        gap: 0.5rem;
    }
    .nav-link {
        margin: 0 0.25rem;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        font-size: 1rem;
        min-width: 60px;
        justify-content: center;
    }
    .main-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 1rem;
    }
    #content-area {
        padding: 1rem;
        min-height: calc(100vh - 60px);
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .weekday,
    .calendar-day {
        text-align: center;
        max-width: 130px;
        max-height: 130px;
    }
    .progress-chart {
        max-width: 500px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-color);
    font-size: 1.2rem;
}

/* 错误提示 */
.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    color: #ff4444;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    color: var(--text-color);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 仪表盘样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #ceffbb;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.progress-container {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: #6c5ce7;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 最近课程列表 */
.recent-logs {
    margin-top: 2rem;
}

.recent-logs h3 {
    color: #ffffff;
    margin-bottom: 1rem;
}

#userName {
    overflow: hidden;
}

.logs-list {
    display: grid;
    gap: 1rem;
}

.recent-log {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-between;
}
.recent-log i {
    font-size: 1.5rem;
    color: #fff;
}

.log-info h4 {
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.log-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 日历样式 */
.calendar-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-header button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.calendar-header button:hover {
    color: #6c5ce7;
}

.calendar-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-weekday {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.calendar-day:hover {
    background: rgba(108, 92, 231, 0.2);
}

.calendar-day.current-month {
    color: #ffffff;
}

.calendar-day.prev-month,
.calendar-day.next-month {
    color: rgba(255, 255, 255, 0.3);
}

.calendar-day.selected {
    background: #6c5ce7;
    color: #ffffff;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: #6c5ce7;
    border-radius: 50%;
}

.calendar-legend {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.has-event {
    background: #6c5ce7;
}

.day-events {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.day-events h4 {
    color: #ffffff;
    margin-bottom: 1rem;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-item i {
    font-size: 1.25rem;
    color: #6c5ce7;
}

.event-info h5 {
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.event-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 进度图表样式 */
.progress-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-container h3 {
    color: #ffffff;
    margin-bottom: 1rem;
}

.chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.recent-log,
.calendar-container,
.chart-container {
    animation: fadeIn 0.3s ease-out;
}

.student .onlyTeacher {
    display: none;
}

/* 个人信息页面样式 */
#admin-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--box-shadow);
    animation: fadeIn 0.3s ease-out;
}

.user-details {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
}

.user-details p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.action-bar {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 学习进度图表响应式布局 */
.progress-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.progress-chart {
    flex: 1;
    min-width: 100px;
    max-width: 83vw;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    animation: fadeIn 0.3s ease-out;
}


@media (min-width: 769px) {
    .progress-container {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .progress-container {
        flex-direction: column;
    }
}

#now_wifi_time_out .ri-wifi-off-line {
    color: rgb(255, 0, 0);
}

#now_wifi_time_out .ri-wifi-line {
    color: #ceffbb;
}

.log-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}