/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    background-color: var(--bg-color);
}

:root {
    --navbar-height: 70px;
    --safe-top: env(safe-area-inset-top, 0px);
    --primary-color: #6155f5;
    --purple-dark: #6b46c1;
    --purple-medium: #8A5CF5;
    --purple-light: #A78BFA;
    --purple-bg: #F3F4F6;
    --secondary-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --yellow-accent: #FCD34D;
    --pink-accent: #F9A8D4;
    --green-accent: #86EFAC;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #F5F7FA;
    --white: #FFFFFF;
    --border-color: #E1E8ED;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    /* 管理后台统一标题栏与 tab（按设计图） */
    --admin-header-bg: #F7F7F9;
    --admin-title-color: #5C32B8;
    --admin-title-bar: #A88EE4;
    --admin-pill-active-bg: #6F3DE9;
    --admin-pill-inactive-bg: #FFFFFF;
    --admin-pill-inactive-color: #5C32B8;
}

/* 管理后台 - 统一标题栏（左侧标题+竖条，右侧 pill tabs） */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0 1.25rem;
    margin-bottom: 0.5rem;
    background: unset;
    background-color: unset;
    border-radius: 0;
    min-height: 52px;
}
.admin-page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-page-title .title-bar {
    width: 4px;
    height: 1.5em;
    min-height: 24px;
    background: var(--admin-title-bar);
    border-radius: 2px;
    flex-shrink: 0;
}
.admin-page-title h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--admin-title-color);
    line-height: 1.3;
}
.admin-pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.admin-pill-tabs a,
.admin-pill-tabs .admin-pill-tab {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    background: var(--admin-pill-inactive-bg);
    color: var(--admin-pill-inactive-color);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.admin-pill-tabs a:hover,
.admin-pill-tabs .admin-pill-tab:hover {
    background: rgba(111, 61, 233, 0.08);
    color: var(--admin-pill-inactive-color);
}
.admin-pill-tabs a.active,
.admin-pill-tabs .admin-pill-tab.active {
    background: var(--admin-pill-active-bg);
    color: #FFFFFF;
    border-color: var(--admin-pill-active-bg);
    box-shadow: 0 1px 3px rgba(111, 61, 233, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

/* 导航栏（所有端已取消，仅保留样式定义便于恢复） */
.navbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    min-height: 70px;
    padding-top: env(safe-area-inset-top);
    box-sizing: content-box;
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    position: fixed;
    width: 100%;
    /*max-width: 1200px;*/
    height: 100%;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.login-info p {
    margin-bottom: 0.25rem;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

/* 提示框 */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #FEE;
    color: var(--danger-color);
    border: 1px solid #FCC;
}

/* 仪表板 */
.dashboard h1 {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

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

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.section {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.section h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.25rem;
}

.class-list,
.task-list {
    list-style: none;
}

.class-list li,
.task-list li {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-list li:last-child,
.task-list li:last-child {
    border-bottom: none;
}

.due-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 其他样式 */
.profile-section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.profile-card {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 3rem;
    color: var(--white);
}

.user-email {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.profile-info dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.profile-info dt {
    font-weight: 600;
    color: var(--text-color);
}

.profile-info dd {
    color: var(--text-light);
}

/* ============================================
   个人中心 - 优化美化
   ============================================ */
.main-content-area .profile-section {
    max-width: auto;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.profile-section .profile-card-modern {
    text-align: center;
    padding: 2.5rem 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(165deg, var(--white) 0%, #faf8ff 100%);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(107, 70, 193, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.12);
    position: relative;
    overflow: hidden;
}

.profile-section .profile-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--purple-medium), var(--purple-light));
    border-radius: 20px 20px 0 0;
}

.profile-avatar-modern {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--white);
    box-shadow: 0 8px 24px rgba(107, 70, 193, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--purple-medium) 100%);
}

.profile-avatar-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-modern {
    font-size: 2.5rem;
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.profile-card-modern h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.profile-section .user-email {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-top: 0;
}

.profile-card-modern p:last-of-type {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.stats-section-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-info-modern {
    flex: 1;
    min-width: 0;
}

.profile-info-modern {
    padding: 1.75rem 2rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

.profile-info-modern h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--purple-bg);
}

.profile-info-modern .info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: 1rem 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-info-modern .info-item {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--purple-bg);
}

.profile-info-modern .info-item:last-child,
.profile-info-modern .info-item:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}

.profile-info-modern .info-item dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.profile-info-modern .info-item dd {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

/* 个人中心 - 身份切换区块（校长账号） */
.profile-role-switch-section {
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}
.profile-role-switch-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 0.5rem;
}
.profile-role-switch-desc {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}
.btn-role-switch {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--purple-medium) 0%, var(--purple-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-role-switch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.35);
}

.profile-logout-wrap {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.profile-logout-wrap .btn-logout {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.profile-logout-wrap .btn-logout:hover {
    background: var(--purple-bg);
    border-color: var(--purple-light);
    color: var(--purple-dark);
}

.main-content-area .content-header {
    margin-bottom: 1.5rem;
}

.main-content-area .content-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--purple-dark);
    letter-spacing: -0.03em;
}

.profile-page-header {
    display: block;
}

.profile-page-subtitle {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin: 0.35rem 0 0;
    font-weight: 400;
}

.profile-role {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.profile-role-admin {
    color: var(--text-light);
}

.profile-role-super {
    color: var(--purple-dark);
    font-weight: 600;
}

.profile-role-badge {
    font-weight: 500;
}

.profile-role-badge.profile-role-super {
    color: var(--purple-dark);
}

@media (max-width: 768px) {
    .stats-section-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-info-modern .info-grid {
        grid-template-columns: 1fr;
    }
    .profile-section .profile-card-modern {
        padding: 1.75rem 1.25rem;
    }
    .profile-avatar-modern {
        width: 80px;
        height: 80px;
    }
    .avatar-placeholder-modern {
        font-size: 2rem;
    }
}

.schedule-list,
.materials-list {
    list-style: none;
}

.schedule-item,
.material-item {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1.5rem;
}

.schedule-time {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 80px;
}

.schedule-info h3 {
    margin-bottom: 0.5rem;
}

.task-item {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.status-pending {
    background: #FFF3CD;
    color: #856404;
}

.status-completed {
    background: #D4EDDA;
    color: #155724;
}

.classes-grid,
.courses-grid,
.readings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.class-card,
.course-card,
.reading-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.reading-level {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.reading-preview {
    color: var(--text-light);
    margin: 1rem 0;
}

.data-table {
    width: 100%;
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.data-table thead tr {
    border-radius: 0px;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.notifications-list {
    list-style: none;
}

.notification-item {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

/* 学员中心新设计 */
.student-dashboard {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    min-height: calc(100vh - 60px);
    background: var(--purple-bg);
    margin-top: 0;
}

body.student-app .student-dashboard {
    min-height: 100vh;
}

.main-content .student-dashboard {
    margin: 0;
    padding: 0;
    max-width: 100%;
}

/* 左侧边栏（所有端无 navbar，顶边贴顶） */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--safe-top);
    bottom: 0;
    z-index: 1;
    width: max(12vw, 200px);
    background: linear-gradient(180deg, #8B5CF6 0%, #6B46C1 100%);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: calc(100% - var(--safe-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    border-radius: 0 30px 30px 0;
}

/* 侧栏顶部用户信息：头像（圆形）、昵称、用户ID，中轴对称 */
.sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.sidebar-user-avatar-wrap {
    margin-bottom: 0.5rem;
}
.sidebar-user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.35);
}
.sidebar-user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
}
.sidebar-user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.3;
    word-break: break-all;
}
.sidebar-user-id {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.15rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

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

.nav-text {
    flex: 1;
}

/* 促销卡片 */
.promo-card {
    background: var(--purple-dark);
    border-radius: 16px;
    padding: 1.5rem;
    color: var(--white);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.promo-content {
    position: relative;
    z-index: 2;
}

.promo-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.promo-btn {
    background: var(--yellow-accent);
    color: var(--purple-dark);
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.promo-btn:hover {
    transform: scale(1.05);
}

.promo-illustration {
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0.3;
    font-size: 3rem;
}

.promo-char {
    font-size: 4rem;
    line-height: 1;
}

.promo-items {
    font-size: 1.5rem;
    margin-top: -1rem;
}

/* 主内容区（所有端无 navbar，顶边贴顶） */
.main-content-area {
    position: fixed;
    left: max(12vw, 200px);
    top: var(--safe-top);
    right: 0;
    bottom: 0;
    height: calc(100vh - var(--safe-top));
    z-index: 1;
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.content-header {
    display: flex;
}

.content-header h1 {
    font-size: 2rem;
    color: var(--purple-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* 课程筛选 */
.course-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: var(--white);
    color: var(--purple-dark);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.filter-btn.active {
    background: var(--purple-dark);
    color: var(--white);
}

.filter-btn {
    text-decoration: none;
    display: inline-block;
}

a.filter-btn {
    text-decoration: none;
}

/* =========================
   教材中心（管理员）- 首页UI
   ========================= */
.materials-page .content-header {
    margin-bottom: 1.25rem;
}

.materials-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.materials-page-title {
    font-size: 2rem;
    color: var(--purple-dark);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.materials-tabs {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.materials-tabs .filter-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
}

.materials-divider {
    height: 1px;
    background: rgba(17, 24, 39, 0.10);
    border-radius: 1px;
    margin: 0.75rem 0 1.25rem;
}

.materials-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.materials-toolbar-left,
.materials-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.materials-toolbar-left .filter-btn,
.materials-toolbar-right .filter-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    box-shadow: none;
}

.materials-btn-primary {
    background: var(--secondary-color);
    color: var(--white);
    border: 1px solid transparent;
}

.materials-btn-ghost {
    background: var(--white);
    color: var(--white);
    border: 1px solid rgba(17, 24, 39, 0.10);
}

.materials-search {
    position: relative;
    width: 320px;
    max-width: 100%;
}

.materials-search input[type="text"] {
    width: 100%;
    height: 40px;
    padding: 0 42px 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: var(--white);
    outline: none;
    font-size: 0.95rem;
}

.materials-search input[type="text"]::placeholder {
    color: rgba(107, 114, 128, 0.9);
}

.materials-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    color: rgba(107, 114, 128, 1);
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
}

@media (max-width: 1100px) {
    .materials-grid {
        grid-template-columns: 1fr;
    }
}

.materials-group-card {
    background: var(--white);
    border-radius: 22px;
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.08);
    padding: 1.25rem 1.25rem 1.1rem;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.25rem;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.materials-group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(17, 24, 39, 0.10);
}

.materials-group-cover {
    width: 240px;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.12);
    flex-shrink: 0;
}

.materials-group-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.materials-group-body {
    min-width: 0;
}

.materials-group-title {
    margin: 0 0 0.5rem 0;
    color: var(--purple-dark);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.materials-group-desc {
    margin: 0;
    color: rgba(107, 114, 128, 1);
    font-size: 0.95rem;
    line-height: 1.4;
    min-height: 1.4em;
}

.materials-group-footer {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.materials-group-count {
    color: rgba(17, 24, 39, 0.85);
    font-size: 0.95rem;
}

.materials-group-actions {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.materials-link {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.materials-link-edit {
    color: var(--purple-dark);
}

.materials-link-delete {
    color: rgba(107, 114, 128, 1);
}

/* 教材中心 - 右侧抽屉（编辑课本） */
html.scroll-locked,
body.scroll-locked {
    overflow: hidden !important;
    height: 100%;
    overscroll-behavior: none;
}

/* ========== 统一抽屉架构与遮罩样式 ========== */
.drawer-fully-hidden {
    display: none !important;
}

/* 统一遮罩：全屏半透明背景，打开时 .is-open */
.materials-drawer-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(17, 24, 39, 0.25);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.materials-drawer-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* 统一抽屉：右侧滑出，高度随浏览器视口适配（top/bottom 撑满），三块结构 header / body / footer */
.materials-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(720px, 92vw);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: #fff;
    border-top-left-radius: 22px;
    border-bottom-left-radius: 22px;
    box-shadow: -18px 0 40px rgba(17, 24, 39, 0.18);
    z-index: 2001;
    transform: translateX(110%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.materials-drawer.is-open {
    transform: translateX(0);
}

.materials-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(17, 24, 39, 0.9);
}

.materials-drawer-header > *:first-child:only-child {
    width: 100%;
    text-align: center;
}

.materials-drawer-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.materials-drawer-footer {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* 老师端：所有抽屉与遮罩置于页面最顶层 */
.teacher-app .materials-drawer-overlay { z-index: 2147483646 !important; }
.teacher-app .materials-drawer { z-index: 2147483647 !important; }

/* 老师端课节信息抽屉：课程表页与班级详情页统一结构与样式 */
.teacher-app #lessonDrawer { width: 400px; max-width: 100%; visibility: hidden; box-shadow: none; }
.teacher-app #lessonDrawer.is-open { visibility: visible; box-shadow: 0 0 24px rgba(0,0,0,.12); }
.teacher-app #lessonDrawer .materials-drawer-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.teacher-app .lesson-drawer-close { width: 36px; height: 36px; border: none; background: none; font-size: 1.5rem; cursor: pointer; color: #666; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.teacher-app .lesson-drawer-close:hover { background: rgba(17,24,39,.06); }
.teacher-app #lessonDrawer .materials-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.teacher-app #lessonDrawer .materials-drawer-footer { flex-shrink: 0; padding: 16px 20px; border-top: 1px solid rgba(17,24,39,.08); }
.teacher-app .lesson-drawer-section { margin-bottom: 20px; }
.teacher-app .lesson-drawer-section h3 { margin: 0 0 10px; font-size: 0.95rem; font-weight: 700; color: rgba(17,24,39,.85); }
.teacher-app .lesson-drawer-meta { font-size: 0.9rem; color: rgba(17,24,39,.75); line-height: 1.6; }
.teacher-app .lesson-drawer-meta p { margin: 0 0 6px; }
.teacher-app .lesson-drawer-materials { list-style: none; padding: 0; margin: 0; }
.teacher-app .lesson-drawer-materials li { padding: 8px 0; border-bottom: 1px solid rgba(17,24,39,.06); font-size: 0.9rem; }
.teacher-app .lesson-drawer-materials li:last-child { border-bottom: none; }
.teacher-app .lesson-drawer-progress { font-size: 0.9rem; color: var(--primary-color); font-weight: 600; }
.teacher-app .lesson-drawer-btn-live { display: block; width: 100%; padding: 14px 20px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--primary-color), var(--purple-dark)); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; }
.teacher-app .lesson-drawer-btn-live:hover { opacity: 0.95; color: #fff; }
.teacher-app #lessonDrawer .materials-drawer-footer .lesson-drawer-btn { display: block; width: 100%; padding: 12px 20px; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; border: 1px solid rgba(17,24,39,.15); background: #fff; color: rgba(17,24,39,.85); }
.teacher-app #lessonDrawer .materials-drawer-footer .lesson-drawer-btn:hover { background: rgba(17,24,39,.04); }
.teacher-app #lessonDrawer .materials-drawer-footer { display: flex; flex-direction: column; gap: 8px; }

#productDrawerOverlay {
    height: 100%;
    overflow-y: auto;
    overflow-x: visible;
}

#scheduleDrawerOverlay {
    position: absolute;
    left: unset;
    top: 0;
    height: 100%;
}

/* 教材组弹窗样式 */
.group-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.group-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.group-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.group-modal-content {
    position: relative;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    z-index: 2011;
    transform: scale(0.95);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.group-modal.is-open .group-modal-content {
    transform: scale(1);
}

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

.group-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple-dark);
}

.group-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    line-height: 1;
}

.group-modal-close:hover {
    background: var(--purple-bg);
    color: var(--text-color);
}

.group-modal-body {
    padding: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(90vh - 180px);
}

.group-form-row {
    margin-bottom: 1.5rem;
}

.group-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.group-form-input,
.group-form-textarea {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    outline: none;
    background: var(--white);
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.group-form-input:focus,
.group-form-textarea:focus {
    border-color: var(--primary-color);
}

.group-form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.group-modal-error {
    color: #c33;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.group-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.group-modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.group-modal-btn.cancel {
    background: var(--white);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.group-modal-btn.cancel:hover {
    background: var(--purple-bg);
    border-color: var(--text-light);
}

.group-modal-btn.save {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-dark));
    color: white;
}

.group-modal-btn.save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.materials-form-row {
    display: flex;
    flex-flow: row;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.1rem;
}

.materials-form-label {
    min-width: 120px;
    color: rgba(17, 24, 39, 0.9);
    font-weight: 700;
    padding-top: 0.55rem;
    text-align: left;
}

.materials-required {
    color: #c33;
    margin-right: 6px;
}

.materials-input,
.materials-textarea {
    width: 100%;
    border: 1px solid rgba(17, 24, 39, 0.10);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
}

.materials-textarea {
    resize: none;
    height: 120px;
}

/* 系统设置页 - 与其他管理页统一 */
.settings-page .content-header.profile-page-header {
    margin-bottom: 1.5rem;
}
.settings-page .profile-page-subtitle {
    margin-top: 0.35rem;
}
.settings-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.settings-message.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(231, 76, 60, 0.3);
}
.settings-message.success {
    background: rgba(80, 200, 120, 0.12);
    color: var(--secondary-color);
    border: 1px solid rgba(80, 200, 120, 0.35);
}
.settings-section-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}
.settings-section-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--purple-bg);
}
.settings-section-card .materials-form-row {
    margin-bottom: 1.1rem;
}
.settings-section-card .materials-form-row:last-of-type {
    margin-bottom: 0;
}
.settings-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1.4;
}
.pwa-icon-upload-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.pwa-icon-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}
.pwa-icon-preview-wrap {
    display: flex;
    align-items: center;
    min-height: 64px;
    width: 100%;
    gap: 32px;
}
.pwa-icon-preview {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: var(--purple-bg);
}
.pwa-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pwa-icon-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    color: var(--text-light);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.02);
}
.pwa-icon-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.08);
    color: var(--purple-dark);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
}
.pwa-icon-btn:hover {
    background: rgba(124, 58, 237, 0.15);
}
.pwa-icon-toast {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}
.pwa-icon-toast.success {
    background: rgba(80, 200, 120, 0.15);
    color: var(--secondary-color);
    border: 1px solid rgba(80, 200, 120, 0.35);
}
.pwa-icon-toast.error {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.25);
}
.settings-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}
.settings-checkbox-row:last-of-type {
    margin-bottom: 0;
}
.settings-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple-dark);
    cursor: pointer;
}
.settings-checkbox-row label {
    font-weight: 600;
    color: rgba(17, 24, 39, 0.9);
    cursor: pointer;
    margin: 0;
}
.settings-page .settings-submit-wrap {
    margin-top: 0.5rem;
}
.settings-page .materials-footer-btn.save {
    min-width: 140px;
}

.materials-cover-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.materials-upload-btn {
    background: var(--purple-dark);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    height: 40px;
}

.materials-cover-hint {
    color: rgba(107, 114, 128, 1);
    font-size: 0.9rem;
    padding-top: 0.45rem;
    white-space: nowrap;
}

.materials-cover-gallery {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.75rem;
}

.materials-cover-thumb {
    width: 70px;
    height: 70px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.10);
    border: 2px solid transparent;
    flex-shrink: 0;
    cursor: pointer;
}

.materials-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.materials-cover-thumb.is-active {
    border-color: var(--purple-dark);
}

.materials-footer-btn {
    min-width: 96px;
    height: 40px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: var(--white);
}

.materials-footer-btn.save {
    background: #3CC07A;
    color: var(--white);
    border-color: transparent;
}

.materials-footer-btn.publish {
    background: #7C3AED;
    color: var(--white);
    border-color: transparent;
}

/* =========================
   排课抽屉 - 班级详情页
   ========================= */
.schedule-drawer {
    width: fit-content;
    min-width: 613px;
}

.schedule-drawer .materials-drawer-header {
    padding: 1.25rem 1.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.schedule-drawer .materials-drawer-body {
    padding: 1rem 1.5rem 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-drawer .materials-drawer-body form {
    margin: 0;
}

.schedule-drawer .materials-form-row {
    margin-bottom: 1rem;
    grid-template-columns: 130px 1fr;
    align-items: center;
}

/* 多行内容（日历、时间表）时标签顶对齐 */
.schedule-drawer .materials-form-row.schedule-form-row-block {
    align-items: start;
}

.schedule-drawer .materials-form-row.schedule-form-row-block .materials-form-label {
    padding-top: 0.6rem;
}

.schedule-drawer .materials-form-label {
    padding-top: 0;
    text-align: right;
}

/* 排课抽屉 - 课本名称旁的图标添加按钮 */
.schedule-drawer .schedule-add-textbook-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-dark));
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease, transform 0.1s ease;
}
.schedule-drawer .schedule-add-textbook-btn:hover {
    opacity: 0.92;
}
.schedule-drawer .schedule-add-textbook-btn:active {
    transform: scale(0.96);
}

/* 排课方式单选 */
.schedule-drawer .schedule-mode-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.schedule-drawer .schedule-mode-options label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 500;
    color: rgba(17, 24, 39, 0.85);
}

.schedule-drawer .schedule-mode-options input[type="radio"] {
    accent-color: var(--primary-color);
}

/* 日期汇总与日历外框 */
.schedule-date-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: rgba(17, 24, 39, 0.7);
    min-height: 1.5rem;
}

.schedule-calendar-wrap {
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
    background: rgba(17, 24, 39, 0.02);
}

.schedule-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.schedule-cal-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(17, 24, 39, 0.06);
    border-radius: 8px;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(17, 24, 39, 0.8);
    transition: background 0.15s ease, color 0.15s ease;
}

.schedule-cal-btn:hover {
    background: rgba(17, 24, 39, 0.1);
    color: var(--purple-dark);
}

.schedule-cal-btn:active {
    transform: scale(0.96);
}

#scheduleCalTitle {
    font-size: 0.9375rem;
    font-weight: 700;
    color: rgba(17, 24, 39, 0.9);
}

/* 日历格子 */
.schedule-drawer .schedule-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.schedule-drawer .schedule-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.schedule-drawer .schedule-cal-day.rest {
    color: #16a34a;
    cursor: default;
}

.schedule-drawer .schedule-cal-day.selected {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    font-weight: 700;
}

.schedule-drawer .schedule-cal-day:hover:not(.rest) {
    background: rgba(17, 24, 39, 0.06);
}

/* 上课时间表格 */
.schedule-time-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.schedule-time-table thead th {
    text-align: left;
    padding: 0.5rem 0.5rem 0.5rem 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    font-weight: 600;
    color: rgba(17, 24, 39, 0.8);
}

.schedule-time-table tbody td {
    padding: 0.5rem 0.5rem 0.5rem 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    vertical-align: middle;
}

.schedule-time-table tbody tr:last-child td {
    border-bottom: none;
}

.schedule-time-table .time-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.schedule-drawer .schedule-time-start,
.schedule-drawer .schedule-time-end {
    min-width: 100px;
    width: 100px;
    height: 43px;
    padding: 0 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    font-size: 0.8125rem;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.schedule-drawer .schedule-time-start:focus,
.schedule-drawer .schedule-time-end:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.schedule-drawer .schedule-time-end {
    min-width: 100px;
    width: 100px;
}

.schedule-drawer .schedule-time-preset,
.schedule-drawer .schedule-time-del {
    height: 43px;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(17, 24, 39, 0.15);
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    color: rgba(17, 24, 39, 0.85);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.schedule-drawer .schedule-time-preset:hover,
.schedule-drawer .schedule-time-del:hover {
    background: rgba(17, 24, 39, 0.04);
    border-color: rgba(17, 24, 39, 0.2);
}

.schedule-drawer .schedule-time-del:hover {
    border-color: rgba(220, 38, 38, 0.3);
    color: #b91c1c;
}

.schedule-add-time {
    display: block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
    transition: opacity 0.15s ease;
}

.schedule-add-time:hover {
    opacity: 0.85;
    text-decoration: underline;
}

.schedule-drawer .materials-drawer-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    justify-content: center;
}

.schedule-drawer .materials-drawer-footer .materials-footer-btn {
    min-width: 88px;
}

/* =========================
   教材中心 - 课本详情（组内教材）
   ========================= */
.group-materials-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.group-materials-back {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: var(--white);
    color: var(--purple-dark);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.group-materials-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--purple-dark);
    letter-spacing: 0.3px;
}

.group-materials-toolbar {
    background: var(--white);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.group-materials-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.group-materials-search {
    position: relative;
    width: 240px;
    max-width: 100%;
}

.group-materials-search input {
    width: 100%;
    height: 38px;
    padding: 0 40px 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(17, 24, 39, 0.10);
    outline: none;
    background: var(--white);
}

.group-materials-search .icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(107, 114, 128, 1);
}

.group-materials-hint {
    color: rgba(107, 114, 128, 1);
    font-size: 0.95rem;
    font-weight: 600;
}

.group-materials-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gm-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: var(--white);
    color: rgba(17, 24, 39, 0.85);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.gm-btn.primary {
    background: #7C3AED;
    color: var(--white);
    border-color: transparent;
}

.gm-btn.dropdown::after {
    content: "▼";
    font-size: 0.75rem;
    margin-left: 6px;
    opacity: 0.7;
}

.group-materials-table-head {
    display: grid;
    grid-template-columns: 80px 90px 1fr 160px;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    color: rgba(17, 24, 39, 0.75);
    font-weight: 800;
    font-size: 0.95rem;
}

.group-materials-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.gm-row {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(17, 24, 39, 0.06);
    padding: 1.05rem 1.25rem;
    display: grid;
    grid-template-columns: 80px 90px 1fr 160px;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s;
    cursor: default;
}

.gm-row[draggable="true"] {
    cursor: move;
}

.gm-row.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 16px 32px rgba(17, 24, 39, 0.12);
}

.gm-row.drag-over {
    border-top: 3px solid rgba(124, 58, 237, 0.8);
    padding-top: calc(1.05rem - 3px);
}

.gm-sort {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(17, 24, 39, 0.9);
    font-weight: 700;
}

.gm-drag {
    color: rgba(124, 58, 237, 0.8);
    font-weight: 900;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    width: 18px;
    text-align: center;
    transition: color 0.3s;
}

.gm-drag:active {
    cursor: grabbing;
    color: rgba(124, 58, 237, 1);
}

.gm-row:hover .gm-drag {
    color: rgba(124, 58, 237, 1);
}

.gm-sort-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(17, 24, 39, 0.9);
}

.gm-cover {
    width: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.12);
    border: 2px solid rgba(124, 58, 237, 0.35);
}

.gm-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gm-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.gm-name-text {
    font-weight: 800;
    color: rgba(17, 24, 39, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gm-tag {
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
    color: rgba(124, 58, 237, 1);
    font-weight: 800;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

.gm-info {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(124, 58, 237, 0.55);
    color: rgba(124, 58, 237, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.gm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.9rem;
    font-weight: 800;
}

.gm-action {
    color: rgba(124, 58, 237, 1);
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.gm-action.more::after {
    content: "▼";
    font-size: 0.75rem;
    margin-left: 6px;
    opacity: 0.7;
}

.gm-action.danger {
    color: #dc2626;
}

.gm-action.danger:hover {
    color: #b91c1c;
}

@media (max-width: 980px) {
    .group-materials-table-head { display: none; }
    .gm-row {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        align-items: start;
    }
    .gm-actions { justify-content: flex-start; }
}

/* 教材组课程列表 - iPad/平板 样式修复 */
@media (max-width: 1024px) {
    .group-materials-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .group-materials-header .lesson-editor-header-title {
        font-size: 1.35rem;
        line-height: 1.4;
        min-width: 0;
        word-break: break-word;
    }
    .group-materials-header .lesson-editor-header-title::after {
        display: block;
        margin-left: 0;
        margin-top: 0.2rem;
    }
    .group-materials-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }
    .group-materials-toolbar-left {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .group-materials-toolbar-right {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .gm-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }
    .group-materials-list {
        min-width: 0;
        overflow-x: hidden;
    }
    .gm-row {
        padding: 1rem;
        min-width: 0;
    }
    .gm-name {
        flex-wrap: wrap;
    }
    .gm-name-text {
        white-space: normal;
        word-break: break-word;
    }
    .gm-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .gm-action {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .group-materials-header .lesson-editor-header-title {
        font-size: 1.2rem;
    }
    .group-materials-search {
        width: 100%;
    }
    .group-materials-hint {
        width: 100%;
        font-size: 0.875rem;
    }
    .gm-sort {
        flex-direction: row;
    }
    .gm-cover {
        width: 72px;
        min-width: 72px;
    }
}

/* 课本详情 - 编辑课文信息抽屉（编辑封面） */
.lesson-drawer .materials-drawer-header {
    padding-top: 2rem;
    font-size: 2.1rem;
}

.lesson-cover-preview {
    margin-top: 0.9rem;
    width: 260px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.10);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.lesson-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lesson-drawer-footer {
    justify-content: flex-end;
}

.materials-footer-btn.go {
    min-width: 170px;
}

/* 课程卡片网格 */
.course-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.course-card {
    background: var(--purple-dark);
    border-radius: 20px;
    padding: 2rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-card-purple {
    background: linear-gradient(135deg, #c392ff 0%, #7b8dff 100%);
    /*background: linear-gradient(135deg, #6B46C1 0%, #8B5CF6 100%);*/
}

.course-card-yellow {
    background: linear-gradient(135deg, #FCD34D 0%, #FBBF24 100%);
    color: var(--purple-dark);
}

.course-card-empty {
    background: linear-gradient(90deg, rgba(249, 168, 212, 1) 0%, rgba(182, 143, 255, 1) 100%);
    border-style: none;
    border-width: 0;
    border-color: rgba(0, 0, 0, 0);
    border-image: none;
    color: rgba(17, 24, 39, 0.7);
}

.course-empty-msg {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

.course-empty-hint {
    font-size: 0.9rem;
}

.course-empty-hint a {
    color: var(--primary-color);
    text-decoration: none;
}

.course-card-cover {
    width: 100%;
    max-height: 100px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.course-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-hot-type {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}
.course-price {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.course-hours {
    font-size: 0.9rem;
    opacity: 0.9;
}
.course-footer .course-link {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.95;
}
.course-footer .course-link:hover {
    text-decoration: underline;
}

/* 热门课程：广告 Banner 形式 */
.hot-banner-section {
    margin-bottom: 0;
}
.hot-banner-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 -0.5rem;
    padding: 0 0.5rem 40px;
}
.hot-banner-wrap::-webkit-scrollbar {
    display: none;
}
.hot-banner-track {
    display: flex;
    gap: 1rem;
    min-width: min-content;
}
.hot-banner-item {
    flex: 0 0 auto;
    width: min(92vw, 520px);
    min-height: 160px;
    aspect-ratio: 2 / 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    color: var(--white);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background-size: cover;
    background-position: center;
    background-color: #4c1d95;
    background-repeat: no-repeat;
    box-shadow: 0 4px 20px rgba(17, 24, 39, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hot-banner-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.2);
}
.hot-banner-item:not([style*="background-image"]) {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #a78bfa 100%);
}
.hot-banner-placeholder-icon {
    position: absolute;
    top: 50%;
    right: 15%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    opacity: 0.35;
    pointer-events: none;
}
.hot-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.2) 45%, transparent 100%);
    pointer-events: none;
}
.hot-banner-badge {
    position: absolute;
    top: 12px;
    left: 14px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    z-index: 1;
}
.hot-banner-badge.hot-banner-badge-course {
    background: rgba(124, 58, 237, 0.9);
}
.hot-banner-badge.hot-banner-badge-hour_card {
    background: rgba(14, 165, 233, 0.9);
}
.hot-banner-badge.hot-banner-badge-product {
    background: rgba(244, 63, 94, 0.9);
}
.hot-banner-content {
    position: relative;
    z-index: 1;
    padding: 1rem 1.25rem 1.1rem;
    width: 100%;
}
.hot-banner-title {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hot-banner-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.hot-banner-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.hot-banner-price small {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
}
.hot-banner-hours {
    font-size: 0.85rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    font-weight: 600;
}
.hot-banner-cta {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    transition: opacity 0.2s ease;
}
.hot-banner-item:hover .hot-banner-cta {
    opacity: 0.95;
}

.course-card-empty-hot {
    max-width: 520px;
    margin: 0 auto 2rem;
    width: 100%;
}

.course-lock {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.course-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.course-instructor {
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.course-textbooks {
    font-size: 0.85rem;
    opacity: 0.95;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.course-textbooks-label {
    color: rgba(255, 255, 255, 0.85);
    margin-right: 0.25rem;
}

.course-illustration {
    font-size: 4rem;
    text-align: center;
    margin: 1rem 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.course-duration,
.course-level {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 学习资源 */
.resources-section {
    margin-bottom: 3rem;
}

.resources-section h2 {
    font-size: 1.5rem;
    color: var(--purple-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.resource-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

a.resource-link.resource-card {
    text-decoration: none;
    color: inherit;
}

.resource-pink {
    background: linear-gradient(135deg, #F9A8D4 0%, #F472B6 100%);
    color: var(--white);
}

.resource-purple {
    background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
    color: var(--white);
}

.resource-green {
    background: linear-gradient(135deg, #86EFAC 0%, #4ADE80 100%);
    color: var(--purple-dark);
}

.resource-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.resource-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.resource-content p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 统计卡片 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 24px;
    margin-bottom: 24px;
}

.stat-card-modern {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stat-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon-modern {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
    border-radius: 12px;
}

.stat-value-modern {
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple-dark);
}

.stat-label-modern {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .student-dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 200px;
        height: auto;
        position: relative;
        top: 0;
        bottom: 0;
        flex-direction: row;
        padding: 1rem;
    }
    
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
    }
    
    .nav-item {
        flex: 1;
        min-width: 120px;
    }
    
    .promo-card {
        display: none;
    }
    
    /* 平板/iPad：主内容区不再固定 left，随 flex 布局流动，避免错位与溢出 */
    .main-content-area {
        position: relative;
        left: 0;
        top: 0;
        right: auto;
        bottom: auto;
        min-width: 0;
        overflow-x: hidden;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .main-content-area {
        padding: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .course-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .profile-info dl {
        grid-template-columns: 1fr;
    }
    
    .schedule-item {
        flex-direction: column;
    }
    
    .classes-grid,
    .courses-grid,
    .readings-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        flex-direction: column;
        position: fixed;
        top: 0;
        bottom: 0;
    }
    
    .sidebar-nav {
        flex-direction: column;
    }
    
    .nav-item {
        width: 100%;
    }
}

/* ============================================
   老师中心优化样式
   ============================================ */

/* 老师中心仪表板 */
.teacher-dashboard {
    padding-top: 1rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.welcome-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 统计卡片优化 */
.teacher-stats {
    margin-bottom: 2.5rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--purple-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-primary {
    border-left: 4px solid var(--primary-color);
}

.stat-card-success {
    border-left: 4px solid var(--secondary-color);
}

.stat-card-warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card-info {
    border-left: 4px solid var(--purple-dark);
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(167, 139, 250, 0.1));
}

.stat-card-primary .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15), rgba(74, 144, 226, 0.05));
    color: var(--primary-color);
}

.stat-card-success .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(80, 200, 120, 0.15), rgba(80, 200, 120, 0.05));
    color: var(--secondary-color);
}

.stat-card-warning .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.15), rgba(243, 156, 18, 0.05));
    color: var(--warning-color);
}

.stat-card-info .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.15), rgba(107, 70, 193, 0.05));
    color: var(--purple-dark);
}

.stat-icon {
    width: 28px;
    height: 28px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.trend-up {
    color: var(--secondary-color);
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.page-title-section {
    flex: 1;
}

.page-title-section h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.page-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

.page-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* 按钮优化 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-light);
    transition: all 0.3s;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--purple-bg);
    color: var(--primary-color);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* 空状态优化 */
.empty-state-modern {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: var(--text-light);
    margin: 0 auto 1.5rem;
    opacity: 0.5;
}

.empty-state-modern p {
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.empty-hint {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: normal;
}

/* 章节头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.section-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.section-link:hover {
    color: var(--purple-dark);
}

/* 今日课程列表 */
.class-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
}

.class-item-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--purple-bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.class-item-modern:hover {
    background: #E5E7EB;
    transform: translateX(4px);
}

.class-time-badge {
    min-width: 80px;
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-dark));
    color: white;
    border-radius: 10px;
    font-weight: 600;
}

.time-hour {
    font-size: 1rem;
    display: block;
}

.class-details {
    flex: 1;
}

.class-details h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.class-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 快速操作 */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-color);
}

.quick-action-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(167, 139, 250, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.quick-action-icon svg {
    width: 32px;
    height: 32px;
}

.quick-action-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quick-action-card p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 学员卡片 */
.students-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.student-card-modern {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.student-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.student-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.student-info {
    flex: 1;
}

.student-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.student-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.student-email svg {
    width: 16px;
    height: 16px;
}

.student-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--purple-bg);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-color);
}

.meta-badge svg {
    width: 14px;
    height: 14px;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

/* 班级卡片 */
.classes-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.class-card-modern {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.class-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.class-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.class-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(167, 139, 250, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.class-icon svg {
    width: 24px;
    height: 24px;
}

.class-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.class-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.class-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--purple-bg);
    border-radius: 10px;
}

.class-stat-item svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-text {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.class-actions {
    display: flex;
    gap: 0.75rem;
}

/* 课表 */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.schedule-day {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.schedule-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.day-date {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.day-name {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
}

.day-number {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.day-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.schedule-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
}

.schedule-item-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--purple-bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.schedule-item-modern:hover {
    background: #E5E7EB;
}

.schedule-time-modern {
    min-width: 80px;
    text-align: center;
}

.time-hour {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.schedule-info-modern {
    flex: 1;
}

.schedule-info-modern h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.schedule-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 任务列表 */
.tasks-container {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.task-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item-modern {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
}

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

.task-item-modern:hover {
    background: var(--purple-bg);
    border-radius: 12px;
}

.task-checkbox {
    margin-top: 0.25rem;
}

.task-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-content {
    flex: 1;
}

.task-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.task-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.task-student,
.task-due {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.task-student svg,
.task-due svg {
    width: 16px;
    height: 16px;
}

.task-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

/* 教材卡片 */
.materials-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.material-card-modern {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.material-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.material-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(167, 139, 250, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.material-icon svg {
    width: 28px;
    height: 28px;
}

.material-info {
    flex: 1;
}

.material-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.material-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.material-type,
.material-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.material-type svg,
.material-date svg {
    width: 16px;
    height: 16px;
}

.material-actions {
    display: flex;
    gap: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    
    .students-grid-modern,
    .classes-grid-modern,
    .materials-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .class-stats {
        grid-template-columns: 1fr;
    }
    
    .task-item-modern {
        flex-wrap: wrap;
    }
}

/* 身份切换弹窗样式 */
.role-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.role-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.role-modal-content {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1001;
}

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

.role-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.role-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.role-modal-close:hover {
    background: var(--purple-bg);
    color: var(--text-color);
}

.role-modal-body {
    padding: 1.5rem;
}

.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: left;
    width: 100%;
}

.role-btn:hover {
    border-color: var(--primary-color);
    background: var(--purple-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.role-btn-icon {
    font-size: 1.5rem;
}

.role-btn-text {
    font-weight: 500;
}

.role-btn-student:hover {
    border-color: #4A90E2;
    background: #E8F4FD;
}

.role-btn-teacher:hover {
    border-color: #50C878;
    background: #E8F9F0;
}

.role-btn-admin:hover {
    border-color: #6B46C1;
    background: #F3F4F6;
}

.role-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.role-btn-cancel {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.role-btn-cancel:hover {
    background: var(--purple-bg);
    border-color: var(--text-light);
}

/* 制作课文页面样式 */
body:has(.lesson-editor-page) {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body:has(.lesson-editor-page) .navbar {
    display: none !important;
}

body:has(.lesson-editor-page) .main-content {
    margin: 0;
    padding: 0;
    max-width: 100%;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.lesson-editor-page {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #F3F4F6;
    overflow: hidden;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 课程编辑页面包屑：教材中心 > 教材组 > 课程详情 */
.lesson-breadcrumb {
    flex-shrink: 0;
    padding: 10px 30px 0;
    font-size: 13px;
    color: #6B7280;
    background: transparent;
}
.lesson-breadcrumb a {
    color: #6B46C1;
    text-decoration: none;
}
.lesson-breadcrumb a:hover {
    text-decoration: underline;
}
.lesson-breadcrumb-sep {
    margin: 0 6px;
    color: #9CA3AF;
}
.lesson-breadcrumb-current {
    color: #111827;
    font-weight: 500;
}

.lesson-editor-header {
    height: 89px;
    background: transparent;
    display: flex;
    align-items: center;
    padding: 0 30px;
    flex-shrink: 0;
}

.lesson-back-btn {
    width: 62px;
    height: 40px;
    border: none;
    background: #FFFFFF;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6B46C1;
    transition: all 0.3s;
    margin-right: 0;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 22px;
}

.lesson-back-btn:hover {
    background: #F5F5F5;
}

.lesson-back-btn svg {
    display: none;
}

.lesson-back-btn::before {
    content: '返回';
}

.lesson-editor-header-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 45px;
    color: #6B46C1;
    margin: 0 0 0 18px;
    flex: 1;
}

.lesson-editor-header-title::after {
    content: attr(data-subtitle);
    color: #3a76ff;
    margin-left: 8px;
}

.lesson-editor-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-editor-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    background: #F3F4F6;
    padding: 0 30px 30px;
}

.lesson-editor-container {
    display: flex;
    flex: 1;
    height: 100%;
    background: #F3F4F6;
    overflow: hidden;
    gap: 0;
}

/* 左侧：课程顺序 */
.lesson-steps-sidebar {
    width: 252px;
    background: transparent;
    padding: 39px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    min-height: auto;
}

.lesson-steps-title {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 45px;
    letter-spacing: 0em;
    text-align: left;
    color: #6B46C1;
    padding-left: 83px;
    margin-bottom: 0;
    height: 45px;
}

.lesson-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-top: 0;
}

.lesson-step-item {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.3s;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex-shrink: 0;
    position: absolute;
    width: 252px;
}

.lesson-step-item[data-step="1"] {
    top: 30px;
}

.lesson-step-item[data-step="2"] {
    top: 210px;
}

.lesson-step-item[data-step="3"] {
    top: 390px;
    left: auto;
}

.lesson-step-item[data-step="4"] {
    top: 570px;
    left: auto;
}

.lesson-step-item[data-step="5"] {
    top: 750px;
}

.lesson-step-item:hover {
    box-shadow: none;
}

.lesson-step-header {
    position: absolute;
    left: 0px;
    top: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.lesson-step-checkbox {
    position: absolute;
    left: 30px;
    top: calc(50% - 14px/2);
    width: 14px;
    height: 14px;
    cursor: pointer;
    background: #FFFFFF;
    border: 1px solid #B7B5FF;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.lesson-step-checkbox:checked {
    background: #B7B5FF;
    border-color: #B7B5FF;
}

.lesson-step-checkbox:checked::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: bold;
}

.lesson-step-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    color: #000000;
    cursor: pointer;
    text-align: center;
}

.lesson-step-chevron {
    position: absolute;
    left: 0px;
    top: 87px;
    width: 100%;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B7B5FF;
    transition: transform 0.3s;
}

.lesson-step-item:hover .lesson-step-chevron {
    color: #8A5CF5;
}

/* 内容模块卡片 */
.lesson-module-card {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 160px;
    background: #FFFFFF;
    border: 1px solid #E7E0EC;
    box-shadow: 0px 8px 9px rgba(107, 70, 193, 0.05);
    border-radius: 30px;
    padding: 0;
    padding-right: 0px;
    margin-right: 0px;
    transition: all 0.3s;
    cursor: move;
    flex-shrink: 0;
}

.lesson-module-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.lesson-module-card.drag-over {
    border-top: 3px solid #7C3AED;
    padding-top: calc(20px - 3px);
}

.lesson-module-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lesson-module-drag-handle {
    position: absolute;
    left: 6px;
    top: 152px;
    width: 24px;
    height: 24px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.lesson-module-drag-handle:hover {
    opacity: 1;
}

.lesson-module-drag-handle img {
    width: 24px;
    height: 24px;
}

.lesson-module-checkbox {
    position: absolute;
    left: 30px;
    top: calc(50% - 14px/2);
    width: 14px;
    height: 14px;
}

.lesson-module-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    background: #FFFFFF;
    border: 1px solid #B7B5FF;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.lesson-module-checkbox input[type="checkbox"]:checked {
    background: #B7B5FF;
    border-color: #B7B5FF;
}

.lesson-module-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: bold;
}

.lesson-module-icon {
    position: absolute;
    left: 78px;
    top: calc(50% - 50px/2);
    width: 64px;
    height: 64px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: visible;
    background: unset;
    background-color: unset;
    background-image: none;
}

.lesson-module-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 第三步和第五步的图标位置略有不同 */
.lesson-module-card[data-step="3"] .lesson-module-icon,
.lesson-module-card[data-step="5"] .lesson-module-icon {
    left: 83px;
}

.video-icon {
    background: unset;
    background-color: unset;
    background-image: none;
}

.interaction-icon {
    background: unset;
    background-color: unset;
    background-image: none;
}

.pdf-icon {
    background: unset;
    background-color: unset;
    background-image: none;
}

.game-icon {
    background: unset;
    background-color: unset;
    background-image: none;
}

.lesson-module-preview {
    flex-shrink: 0;
}

/* 视频预览 */
.video-preview {
    position: absolute;
    left: 192px;
    top: calc(50% - 124px/2);
    width: 220px;
    height: 124px;
}

.video-thumbnail {
    position: absolute;
    width: 220px;
    height: 123px;
    left: 0px;
    top: calc(50% - 123px/2 - 0.5px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 124px;
    left: 0px;
    top: 0px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}



.video-play-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.video-text {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 24px;
    font-weight: bold;
    color: #FFFFFF;
    z-index: 3;
}

/* 互动预览 - 图片集横向滚动 */
.interaction-preview {
    position: absolute;
    height: 139px;
    left: 192px;
    right: 92px;
    top: calc(50% - 139px/2 + 0.5px);
    overflow-x: scroll;
    overflow-y: hidden;
}

.interaction-thumbnails {
    display: flex;
    gap: 20px;
    height: 124px;
    align-items: center;
    width: max-content;
    padding-top: calc(139px/2 - 124px/2 + 0.5px);
}

.interaction-thumb {
    width: 220px;
    height: 124px;
    border-radius: 20px;
    overflow: hidden;
    background: #F5F5F5;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.interaction-thumb-content {
    display: none;
}

.interaction-char {
    display: none;
}

.interaction-text {
    display: none;
}

/* PDF预览 */
.pdf-preview {
    position: absolute;
    left: 192px;
    top: calc(50% - 124px/2);
    width: 218px;
    height: 124px;
}

.pdf-thumbnail {
    position: absolute;
    width: 218px;
    height: 124px;
    left: 0px;
    top: 0px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    overflow: hidden;
    border: none;
}

.pdf-preview-content {
    width: 100%;
    height: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-preview-scene {
    text-align: center;
    color: #333333;
}

.pdf-preview-text {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.pdf-preview-word {
    font-size: 12px;
    margin-bottom: 2px;
}

.pdf-preview-translation {
    font-size: 10px;
    color: #666666;
    margin-top: 4px;
}

/* 游戏预览 */
.game-preview {
    position: absolute;
    left: 192px;
    top: 45px;
    width: 868px;
    height: 70px;
}

.game-buttons {
    display: flex;
    gap: 12px;
    height: 100%;
}

.game-btn {
    width: fit-content;
    height: 100%;
    min-width: unset;
    padding-left: 20px;
    padding-right: 20px;
    border: none;
    border-radius: 20px;
    font-size: 24px;
    font-weight: 600;
    line-height: 34px;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-btn.red {
    background: #FF5257;
}

.game-btn.green {
    background: #00C8B3;
}

.game-btn.purple {
    background: #6155F5;
    color: #FFFFFF;
}

.game-btn.blue {
    background: #0088FF;
}

/*右侧模块信息和操作 */
.lesson-module-info {
    position: absolute;
    left: 442px;
    top: 0;
    width: auto;
    height: 160px;
}



.module-duration {
    position: absolute;
    width: 42px;
    height: 34px;
    left: 35px;
    top: calc(50% - 34px/2 + 30px);
    font-size: 24px;
    font-weight: 600;
    line-height: 34px;
    color: #000000;
    display: flex;
    align-items: center;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 视频时长图标 */
.module-duration-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    left: 0px;
    top: calc(50% - 24px/2 + 30px);
    color: #8A5CF5;
}

.module-actions-inline {
    position: absolute;
    left: 442px;
    top: calc(50% - 22px/2 + 36px);
    display: flex;
    gap: 42px;
    margin-top: 0;
    align-items: center;
    height: 22px;
}

.module-actions-inline .module-link-btn:first-child {
    position: relative;
}

.module-actions-inline .module-link-btn.download-btn {
    position: relative;
    margin-left: 0;
}

.module-link-btn {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 16px;
    line-height: 22px;
    color: #8A5CF5;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-weight: 400;
    width: 100%;
    vertical-align: middle;
}

.module-link-btn:hover {
    color: #7C3AED;
}

.module-link-btn.download-btn {
    padding: 0;
    width: 24px;
    height: 24px;
    position: absolute;
    left: 82px;
    top: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-link-btn.download-btn svg {
    width: 24px;
    height: 24px;
}

.lesson-module-actions {
    position: static;
    right: 30px;
    width: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}



.module-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #666666;
    position: relative;
}

.module-action-btn:hover {
    opacity: 0.8;
}

.module-action-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.module-action-btn.add-btn {
    background: transparent;
    border: none;
    position: absolute;
    top: 44px;
}

.module-action-btn.add-btn:hover {
    opacity: 0.8;
    transform: none;
}

.module-action-btn[title="编辑"] {
    top: calc(50% - 24px/2 - 44px);
}

.module-action-btn[title="删除"] {
    top: calc(50% - 24px/2);
}

.module-action-btn.add-btn {
    top: calc(50% - 24px/2 + 44px);
}

/* 底部操作栏 */
.lesson-editor-footer {
    position: absolute;
    left: 751px;
    top: 1037px;
    padding: 0;
    border: none;
    display: flex;
    justify-content: flex-start;
    gap: 0;
    background: transparent;
    z-index: 100;
    height: 40px;
}

.lesson-footer-btn {
    width: 62px;
    height: 40px;
    margin-left: 15px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--pink-accent);
    color: var(--white);
}

.lesson-footer-btn.cancel {
    width: 62px;
    height: 40px;
    background: #FFFFFF;
    color: #000000;
    border: 1px solid #E2E8ED;
    border-radius: 6px;
}

.lesson-footer-btn.cancel:hover {
    background: #F5F5F5;
}

.lesson-footer-btn.draft {
    width: 62px;
    height: 40px;
    margin-left: 20px;
    background: #8A5CF5;
    color: #FFFFFF;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.lesson-footer-btn.draft:hover {
    background: #7C3AED;
}

.lesson-footer-btn.publish {
    width: 62px;
    height: 40px;
    margin-left: 20px;
    background: #8A5CF5;
    color: #FFFFFF;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.lesson-footer-btn.publish:hover {
    background: #7C3AED;
}

/* ============================================
   iOS Safari 兼容适配
   ============================================ */

/* 防止 iOS 输入框聚焦时自动放大（小于 16px 会触发缩放） */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea,
select {
    font-size: max(16px, 1rem);
}

/* aspect-ratio 在旧版 iOS Safari 的兼容（Safari 15+ 已支持，此处增强） */
@supports not (aspect-ratio: 1 / 1) {
    .gm-cover,
    .profile-avatar-modern,
    .lesson-cover-preview {
        height: 0;
        padding-bottom: 100%;
        position: relative;
    }
    .gm-cover img,
    .profile-avatar-modern img,
    .profile-avatar-modern .avatar-placeholder-modern,
    .lesson-cover-preview img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Flex 子项滚动：iOS Safari 需要 min-height: 0 才能正确滚动 */
.main-content-area,
.sidebar,
.materials-drawer,
.materials-drawer-body,
.group-modal-body {
    min-height: 0;
}

/* 固定定位在 iOS 上的稳定性 */
.navbar,
.sidebar,
.main-content-area,
.materials-drawer-overlay,
.materials-drawer,
.role-modal-overlay {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* ============================================
   全局移动端侧滑导航（左抽屉）
   ============================================ */
.mobile-sidebar-toggle {
    display: none;
}

.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .mobile-sidebar-toggle {
        position: fixed;
        left: 12px;
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        z-index: 1202;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: rgba(17, 24, 39, 0.85);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 8px 20px rgba(17, 24, 39, 0.22);
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1200;
        background: rgba(0, 0, 0, 0.42);
    }

    .has-mobile-sidebar.sidebar-open .mobile-sidebar-backdrop {
        display: block;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        z-index: 1201 !important;
        width: min(80vw, 320px) !important;
        height: 100vh !important;
        padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
        border-radius: 0 18px 18px 0 !important;
        flex-direction: column !important;
        gap: 1rem !important;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        will-change: transform;
    }

    .has-mobile-sidebar.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }

    .main-content-area {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        min-height: 100vh;
        height: auto !important;
        padding: calc(env(safe-area-inset-top, 0px) + 68px) 14px calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
    }

    .has-mobile-sidebar.sidebar-open {
        overflow: hidden;
    }
}
