/* ========================================/*
   阿常悬浮积分箱 - 样式表
   包含6种精美配色方案
   ======================================== */

/* CSS 变量定义 - 默认梦幻紫主题 */
:root {
    /* 主色调 */
    --primary-color: #7B68EE;
    --primary-light: #9B89EE;
    --primary-dark: #6B5BDE;
    --primary-bg: #F0E6FF;
    
    /* 辅助色 */
    --secondary-color: #FF6B6B;
    --secondary-light: #FF8E8E;
    --success-color: #4CAF50;
    --warning-color: #FFD700;
    --info-color: #4A90D9;
    
    /* 背景色 */
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F5F5;
    
    /* 文字色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-light: #FFFFFF;
    
    /* 边框色 */
    --border-color: #E8E8E8;
    --border-light: #F0F0F0;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-primary: 0 8px 24px rgba(123,104,238,0.25);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

/* ========================================
   配色方案 - 天空蓝
   ======================================== */
[data-theme="blue"] {
    --primary-color: #4A90D9;
    --primary-light: #6BA5E7;
    --primary-dark: #3A7BC8;
    --primary-bg: #E3F2FD;
    --shadow-primary: 0 8px 24px rgba(74,144,217,0.25);
}

/* ========================================
   配色方案 - 清新绿
   ======================================== */
[data-theme="green"] {
    --primary-color: #4CAF50;
    --primary-light: #66BB6A;
    --primary-dark: #43A047;
    --primary-bg: #E8F5E9;
    --shadow-primary: 0 8px 24px rgba(76,175,80,0.25);
}

/* ========================================
   配色方案 - 甜美粉
   ======================================== */
[data-theme="pink"] {
    --primary-color: #FF6B9D;
    --primary-light: #FF8FB0;
    --primary-dark: #E91E63;
    --primary-bg: #FCE4EC;
    --shadow-primary: 0 8px 24px rgba(255,107,157,0.25);
}

/* ========================================
   配色方案 - 活力橙
   ======================================== */
[data-theme="orange"] {
    --primary-color: #FF8C42;
    --primary-light: #FFA726;
    --primary-dark: #F57C00;
    --primary-bg: #FFF3E0;
    --shadow-primary: 0 8px 24px rgba(255,140,66,0.25);
}

/* ========================================
   配色方案 - 暗夜黑
   ======================================== */
[data-theme="dark"] {
    --primary-color: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --primary-bg: #1E1E2E;
    
    --bg-primary: #0F0F1A;
    --bg-secondary: #1E1E2E;
    --bg-tertiary: #2D2D44;
    
    --text-primary: #E8E8F0;
    --text-secondary: #A0A0B0;
    --text-tertiary: #707080;
    
    --border-color: #2D2D44;
    --border-light: #3D3D5C;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-primary: 0 8px 24px rgba(99,102,241,0.35);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
    --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
}

/* ========================================
   基础样式重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f0f4f8 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    /* 360浏览器兼容性 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 360浏览器emoji兼容性 */
.emoji {
    font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    vertical-align: middle;
}

#app {
    min-height: 100vh;
    /* 视口定高：让左侧导航栏与主内容区各自独立滚动，而不是把整页撑高 */
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
}

.class-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.batch-badge {
    font-size: 14px;
    color: var(--primary-color);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.batch-badge:hover {
    transform: scale(1.1);
}

.nav-center {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background-color: var(--bg-tertiary);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.nav-btn.active {
    background-color: var(--primary-color);
    color: var(--text-light);
}

/* 批量按钮：高频操作（全班/部分学生加减分），用橙色渐变与普通导航按钮区分 */
.nav-btn.nav-btn-orange {
    background: linear-gradient(135deg, #FFB74D 0%, #FF8A65 100%);
    color: #fff;
    border-color: transparent;
}

.nav-btn.nav-btn-orange:hover {
    background: linear-gradient(135deg, #FFA726 0%, #FF7043 100%);
    color: #fff;
}

/* 批量模式开启（“退出批量”）时：加深橙色并显示白色底边，明确激活状态 */
.nav-btn.nav-btn-orange.active {
    background: linear-gradient(135deg, #F57C00 0%, #E64A19 100%);
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.45);
    color: #fff;
}

.nav-icon {
    font-size: 16px;
}

/* ========================================
   会员信息徽章（顶部导航栏）
   ======================================== */

/**
 * 会员信息徽章
 * 显示当前登录会员的名称，点击可跳转到个人中心页面
 * 未登录时隐藏，登录后自动显示
 */
.member-info-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-bg), #E8DAFF);
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-right: 4px;
    max-width: 180px;
}

/* 导航栏左侧的会员信息徽章：与班级选择器保持间距 */
.nav-left .member-info-badge {
    margin-left: 12px;
    margin-right: 8px;
}

.member-info-badge:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.member-info-icon {
    font-size: 16px;
    line-height: 1;
}

.member-info-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.member-info-badge:hover .member-info-name {
    color: #FFFFFF;
}

/* ========================================
   主内容区域
   ======================================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   导航栏班级选择器
   ======================================== */
.class-selector-nav {
    padding: 6px 12px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    background-color: transparent;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    min-width: 120px;
    max-width: 200px;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.class-selector-nav:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.class-selector-nav:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
}

.batch-badge {
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.batch-badge:hover {
    transform: scale(1.1);
}

/* 班级管理模态框 */
.class-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.class-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.class-list-item:hover {
    background-color: var(--border-light);
}

.class-list-item.current {
    border: 2px solid var(--primary-color);
    background-color: var(--primary-bg);
}

.class-info {
    flex: 1;
}

.class-name-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.class-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.class-actions {
    display: flex;
    gap: 8px;
}

.class-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.class-action-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.class-action-btn.delete:hover {
    color: var(--secondary-color);
}

.add-class-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   批量操作工具栏
   ======================================== */
.batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-primary);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.batch-count {
    font-size: 16px;
    color: var(--text-primary);
}

.batch-count strong {
    color: var(--primary-color);
    font-size: 20px;
}

.batch-select-all,
.batch-clear {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.batch-select-all:hover,
.batch-clear:hover {
    background: var(--primary-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.batch-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--success-color) 0%, #66BB6A 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.batch-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.batch-action-btn:active {
    transform: translateY(0);
}

/* 批量模式下的学生卡片 */
.student-card.batch-mode {
    position: relative;
}

.student-card.batch-mode .card-header {
    padding-left: 32px;
}

.batch-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.batch-checkbox:hover {
    border-color: var(--primary-color);
}

.batch-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.batch-checkbox .checkbox-icon {
    font-size: 14px;
    color: white;
    font-weight: bold;
}

.student-card.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-bg), var(--shadow-card-hover);
}

.student-card.selected .batch-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   学生卡片页面 - 全新设计
   ======================================== */
.students-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    width: 98%;
    max-width: none;
    margin: 0 auto;
    padding: 8px;
}

@media (max-width: 1600px) {
    .students-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .students-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .students-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 850px) {
    .students-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

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

.student-card {
    background: linear-gradient(145deg, #ffffff 0%, var(--primary-bg) 100%);
    border-radius: var(--radius-xl);
    border: none;
    padding: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(123, 104, 238, 0.15), 0 1px 3px rgba(0,0,0,0.05);
}

.student-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(123, 104, 238, 0.25), 0 4px 12px rgba(123, 104, 238, 0.15);
}

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

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

/* 卡片头部 - 等级徽章 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.level-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.level-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

.card-menu {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-menu:hover {
    background-color: var(--primary-bg);
    color: var(--primary-color);
}

/* 灰色头像效果 - 学生长时间未获得积分 */
.student-card.gray-avatar .card-avatar .pet-emoji,
.student-card.gray-avatar .card-avatar img {
    filter: grayscale(100%);
    opacity: 0.6;
}

.student-card.gray-avatar {
    opacity: 0.85;
    background: linear-gradient(145deg, #f5f5f5 0%, #e8e8e8 100%);
}

/* 饥饿/口渴提示文字 - 图片上方 */
.hunger-hint-top {
    font-size: 11px;
    color: #ff6b6b;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 3px 6px;
    background: rgba(255, 107, 107, 0.15);
    border-radius: 10px;
    display: block;
    text-align: center;
    animation: pulse 2s infinite;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 卡片头像区域 */
.card-avatar {
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    min-height: 160px;
    padding-top: 20px;
}

/* 背景图片样式 */
.card-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 12px 12px;
    overflow: hidden;
    opacity: 0.9;
}

.card-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl) var(--radius-xl) 12px 12px;
}

.avatar-container {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 140px;
    z-index: 1;
}

.avatar-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 130px;
    height: 130px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gentleFloat 3s ease-in-out infinite;
}

.avatar-container .emoji {
    position: relative;
    z-index: 0;
}

/* 有背景图时，实体图片缩小到60%，并向下移动到背景图下方 */
.student-card.has-bg-image .avatar-container {
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translate(-50%, 0);
}

.student-card.has-bg-image .avatar-container img {
    width: 78px;
    height: 78px;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
}

.student-card.has-bg-image .avatar-container .emoji {
    font-size: 66px;
}

.pet-emoji {
    font-size: 110px;
    line-height: 1;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gentleFloat 3s ease-in-out infinite;
    display: inline-block;
}

.pet-image {
    width: 130px;
    height: 130px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gentleFloat 3s ease-in-out infinite;
}

/* 微微浮动的动画 */
@keyframes gentleFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-5px);
    }
}

@keyframes gentleFloatEmoji {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.pet-emoji {
    animation: gentleFloatEmoji 3s ease-in-out infinite;
}

.student-card:hover .avatar-container img {
    animation: none;
    transform: translate(-50%, -50%) scale(1.12);
}

.student-card:hover .pet-emoji {
    animation: none;
    transform: scale(1.12);
}

.student-card:hover .pet-image {
    animation: none;
    transform: scale(1.12);
}

/* 卡片信息区域 */
.card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.student-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.pet-type {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* 进度条区域 */
.card-progress {
    margin-bottom: 12px;
    padding: 0 4px;
}

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

.progress-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.progress-value {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-value::before {
    content: '还差';
    color: var(--text-tertiary);
    font-weight: 500;
}

.progress-value::after {
    content: '🎯';
    font-size: 12px;
}

.progress-bar {
    height: 10px;
    background-color: rgba(0,0,0,0.06);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 5px;
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 卡片底部统计 */
.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin: 0 4px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 14px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
}

.stat-item.points .stat-value {
    color: var(--secondary-color);
}

.stat-item.total-points .stat-value {
    color: var(--primary-color);
}

.stat-item.medals .stat-value {
    color: var(--warning-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-lg);
}

.empty-state:hover {
    background-color: var(--primary-bg);
    transform: translateY(-4px);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ========================================
   积分商店页面
   ======================================== */
.store-header {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* 返回主页按钮 */
.back-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--primary-bg);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-home-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.back-home-btn span {
    font-size: 16px;
}

.store-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.store-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.store-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    letter-spacing: 2px;
}

.store-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 24px;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.store-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 400px;
    width: 95%;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.product-stock {
    display: inline-block;
    background-color: var(--warning-color);
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

.product-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary-color);
}

.exchange-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.exchange-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.exchange-btn:disabled {
    background-color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

/* 添加按钮 */
.add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    background-color: var(--primary-bg);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-style: solid;
}

.add-btn span {
    font-size: 20px;
}

/* ========================================
   光荣榜页面
   ======================================== */
.ranking-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ranking-header .back-home-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.5);
}

.ranking-header .back-home-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.ranking-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ranking-icon {
    font-size: 48px;
}

.ranking-title h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ranking-title p {
    font-size: 14px;
    opacity: 0.9;
}

.ranking-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 95%;
    margin: 0 auto;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 排行榜标签切换 */
.ranking-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.ranking-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ranking-tab:hover {
    background-color: var(--primary-bg);
    color: var(--primary-color);
}

.ranking-tab.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-primary);
}

.ranking-tab .emoji {
    font-size: 18px;
}

/* 小组排行样式 */
.group-ranking-item {
    align-items: flex-start;
    padding: 20px;
}

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

.group-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.group-member {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.ranking-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.ranking-item.top-1 {
    background: linear-gradient(90deg, #FFF8E1, #FFECB3);
    border: 2px solid #FFD700;
}

.ranking-item.top-2 {
    background: linear-gradient(90deg, #F5F5F5, #E0E0E0);
    border: 2px solid #C0C0C0;
}

.ranking-item.top-3 {
    background: linear-gradient(90deg, #FFF3E0, #FFE0B2);
    border: 2px solid #CD7F32;
}

.ranking-number {
    width: 40px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.ranking-item.top-1 .ranking-number {
    font-size: 32px;
}

.ranking-avatar {
    font-size: 36px;
    margin: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-avatar-image {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
}

.ranking-avatar .avatar-container {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-avatar .avatar-container img,
.ranking-avatar .pet-image {
    width: 36px;
    height: 36px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ranking-detail {
    font-size: 12px;
    color: var(--text-tertiary);
}

.ranking-points {
    text-align: right;
    margin-right: 20px;
}

.ranking-points-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.ranking-points-label {
    font-size: 11px;
    color: var(--text-tertiary);
}

.ranking-medals {
    text-align: center;
    min-width: 50px;
}

.ranking-medals-icon {
    font-size: 20px;
}

.ranking-medals-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--warning-color);
}

/* ========================================
   设置页面
   ======================================== */
.settings-header {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 95%;
    max-width: none;
    margin: 0 auto;
}

.settings-section {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    margin: 0 auto;
}

/* 系统管理网格布局 */
.system-management {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.system-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.system-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.system-list-item:hover {
    background-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.system-info {
    flex: 1;
    width: 100%;
}

.system-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-end;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 老师卡片 */
.teacher-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.teacher-avatar {
    font-size: 40px;
}

.teacher-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.teacher-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.teacher-status {
    font-size: 12px;
    color: var(--success-color);
}

/* 设置按钮 */
.settings-btns {
    display: flex;
    gap: 12px;
}

.settings-btn {
    padding: 10px 20px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-btn:hover {
    background-color: var(--border-color);
}

.settings-btn.danger {
    color: var(--secondary-color);
    border-color: var(--secondary-light);
}

.settings-btn.danger:hover {
    background-color: var(--secondary-light);
    color: var(--text-light);
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* 配色方案选择 */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.theme-card {
    text-align: center;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.theme-card:hover {
    background-color: var(--bg-primary);
}

.theme-card.active {
    border-color: var(--primary-color);
    background-color: var(--primary-bg);
}

.theme-preview {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    margin: 0 auto 8px;
    box-shadow: var(--shadow-sm);
}

.purple-theme {
    background: linear-gradient(135deg, #7B68EE, #9B89EE);
}

.blue-theme {
    background: linear-gradient(135deg, #4A90D9, #6BA5E7);
}

.green-theme {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
}

.pink-theme {
    background: linear-gradient(135deg, #FF6B9D, #FF8FB0);
}

.orange-theme {
    background: linear-gradient(135deg, #FF8C42, #FFA726);
}

.dark-theme {
    background: linear-gradient(135deg, #1E1E2E, #2D2D44);
}

.theme-card span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 等级配置 */
.level-config {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.level-item {
    text-align: center;
}

.level-item label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.level-item input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
}

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

/* 学生列表 */
.student-management-btns {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.add-student-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.add-student-btn span {
    font-size: 20px;
}

#batchImportStudentBtn {
    background-color: var(--secondary-color);
}

#batchImportStudentBtn:hover {
    background-color: #E55A5A;
}

.student-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.student-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.student-list-item:hover {
    background-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.student-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.student-list-avatar {
    font-size: 32px;
}

.student-list-avatar-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

.student-list-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.student-list-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.student-list-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-end;
}

.list-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.list-action-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.list-action-btn.delete:hover {
    color: var(--secondary-color);
}

/* 系统管理 */
.add-system-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background-color: var(--primary-bg);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-system-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-style: solid;
}

.add-system-btn span {
    font-size: 20px;
}

.system-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.system-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.system-list-item:hover {
    background-color: var(--border-light);
}

.system-info {
    flex: 1;
}

.system-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.system-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.system-type {
    font-size: 11px;
    color: var(--text-tertiary);
}

.system-actions {
    display: flex;
    gap: 8px;
}

/* 实体管理 */
.entity-management {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.add-entity-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background-color: var(--primary-bg);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-entity-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-style: solid;
}

.add-entity-btn span {
    font-size: 20px;
}

.entity-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.entity-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.entity-list-item:hover {
    background-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.entity-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.entity-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    align-self: flex-end;
}

/* 保存按钮 */
.save-settings-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--text-primary);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.save-settings-btn:hover {
    background-color: var(--text-secondary);
}

/* ========================================
   模态框
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

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

.modal-form label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-form input,
.modal-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn.primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

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

.modal-btn.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background-color: var(--border-color);
}

/* ========================================
   Toast 提示
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--text-primary);
    color: var(--text-light);
    padding: 14px 24px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background-color: var(--success-color);
}

.toast.error {
    background-color: var(--secondary-color);
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1200px) {
    .students-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .navbar {
        padding: 0 16px;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    
    .nav-center {
        order: 3;
        width: 100%;
        margin: 0;
        max-width: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .students-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .store-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .level-config {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 576px) {
    .students-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .student-card {
        padding: 10px;
    }
    
    .avatar-container {
        width: 110px;
        height: 110px;
    }
    
    .pet-emoji {
        font-size: 85px;
    }
    
    .pet-image {
        width: 100px;
        height: 100px;
    }
    
    .student-name {
        font-size: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .theme-options {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .level-config {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .ranking-item {
        padding: 12px;
    }
    
    .ranking-avatar {
        font-size: 28px;
        margin: 0 10px;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer-bg {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading {
    background: linear-gradient(90deg, var(--bg-primary) 25%, var(--border-light) 50%, var(--bg-primary) 75%);
    background-size: 200% 100%;
    animation: shimmer-bg 1.5s infinite;
}

/* 升级动画 */
.level-up {
    animation: pulse 0.5s ease 3;
}

/* 积分增加动画 */
.points-added {
    animation: bounce 0.5s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* 选中文本样式 */
::selection {
    background-color: var(--primary-bg);
    color: var(--primary-color);
}

/* ========================================
   升级全屏特效
   ======================================== */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.level-up-overlay.active {
    opacity: 1;
    visibility: visible;
}

.level-up-content {
    text-align: center;
    animation: levelUpPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes levelUpPop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.level-up-image {
    width: 280px;
    height: 280px;
    object-fit: contain;
    margin-bottom: 30px;
    filter: drop-shadow(0 20px 60px rgba(255, 215, 0, 0.5));
    animation: levelUpImageGlow 2s ease-in-out infinite;
}

@keyframes levelUpImageGlow {
    0%, 100% {
        filter: drop-shadow(0 20px 60px rgba(255, 215, 0, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 30px 80px rgba(255, 215, 0, 0.8));
        transform: scale(1.05);
    }
}

.level-up-emoji {
    font-size: 200px;
    line-height: 1;
    margin-bottom: 30px;
    filter: drop-shadow(0 20px 60px rgba(255, 215, 0, 0.5));
    animation: levelUpImageGlow 2s ease-in-out infinite;
}

.level-up-title {
    font-size: 48px;
    font-weight: 800;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    animation: levelUpTextShine 2s ease-in-out infinite;
}

@keyframes levelUpTextShine {
    0%, 100% {
        text-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 0 4px 40px rgba(255, 215, 0, 0.9), 0 0 60px rgba(255, 215, 0, 0.6);
    }
}

.level-up-student {
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: 10px;
}

.level-up-level {
    font-size: 64px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.6);
}

.level-up-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.level-up-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FFD700;
    border-radius: 50%;
    animation: particleFloat 3s ease-in infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* 彩带效果 */
.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   积分操作弹窗样式
   ======================================== */
.points-modal {
    padding: 0;
}

.points-modal .point-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.points-modal .product-exchange-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: var(--primary-color) !important;
}

/* 弹窗内容区域滚动条美化 */
.points-modal ::-webkit-scrollbar {
    width: 6px;
}

.points-modal ::-webkit-scrollbar-track {
    background: transparent;
}

.points-modal ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.points-modal ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ========================================
   左侧小图标固定栏
   ======================================== */
.sidebar-icon-bar {
    position: fixed;
    top: 70px;            /* 与 navbar 底部对齐 */
    left: 0;
    width: 56px;
    height: calc(100vh - 70px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0;
    gap: 6px;
    z-index: 90;
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.sidebar-icon-btn:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
    transform: scale(1.06);
    box-shadow: var(--shadow-sm);
}

.sidebar-icon-btn:active {
    transform: scale(0.97);
}

/* 左侧小图标栏在抽屉展开时的高亮提示 */
.sidebar-icon-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--shadow-primary);
}

/* ========================================
   常用功能面板（左侧抽屉）
   ======================================== */
.quick-actions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
}

.quick-actions-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(1px);
}

.quick-actions-panel {
    position: relative;
    margin-left: 56px;         /* 与侧边小图标栏对齐，避免被遮挡 */
    width: 320px;
    max-width: calc(85vw - 56px);
    height: 100vh;
    background: var(--bg-secondary);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    animation: slideInLeft 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    z-index: 1;
    border-radius: 0 16px 16px 0;
}

/* 左侧滑入动画 */
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0.4; }
    to   { transform: translateX(0); opacity: 1; }
}

.quick-actions-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 24px;
}

/* 左侧抽屉：垂直列表布局 */
.quick-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-action-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 4px;
    opacity: 0.7;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    position: relative;
}

.quick-action-item:hover {
    background: var(--primary-bg);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.quick-action-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    color: var(--primary-color);
    background: var(--primary-bg);
    border-radius: 10px;
}

.quick-action-item:hover .quick-action-icon {
    background: var(--primary-color);
    color: var(--text-light);
}

.quick-action-info {
    flex: 1;
    min-width: 0;
}

.quick-action-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.quick-action-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: left;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 权限徽章（左侧抽屉版本） */
.quick-action-permission-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
}

/* 桌面端：主内容区布局由 .app-body flex 布局控制（见下方"左侧可折叠导航栏"），
   不再需要为小图标栏预留 margin-left（旧 icon-bar 方案已废弃） */

/* 移动端响应式调整 */
@media (max-width: 992px) {
    .sidebar-icon-bar {
        top: 0;
        height: 100vh;
    }

    .quick-actions-panel {
        margin-left: 0;
        width: 85vw;
        max-width: 85vw;
        border-radius: 0;
    }

    .quick-action-item {
        padding: 12px 14px;
    }

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

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .sidebar-icon-bar {
        width: 52px;
    }

    .sidebar-icon-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
}

/* ========================================
   作业检查器弹窗
   ======================================== */
.homework-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.homework-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.homework-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 95%;
    height: 95vh;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.homework-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.homework-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.homework-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.homework-modal-home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.homework-modal-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.3);
}

.homework-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.homework-modal-close:hover {
    background: var(--bg-primary);
    color: var(--secondary-color);
}

/* 最大化按钮 */
.homework-modal-maximize {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.homework-modal-maximize:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* 最大化状态 */
.homework-modal-content.maximized {
    width: 100% !important;
    height: 100vh !important;
    border-radius: 0 !important;
}

.homework-modal-body {
    flex: 1;
    overflow: hidden;
}

.homework-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .homework-modal-content {
        width: 80%;
    }
}

@media (max-width: 576px) {
    .homework-modal-content {
        width: 95%;
        max-height: 85vh;
    }
}

/* ========================================
   视图切换按钮样式
   ======================================== */
.view-mode-switcher {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.view-mode-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.view-mode-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-primary);
}

.view-mode-btn .view-icon {
    font-size: 16px;
}

/* ========================================
   小组卡片样式
   ======================================== */
.group-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-light);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.group-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.group-card-menu {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.group-card-menu:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

.group-members-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.group-member-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.group-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid var(--border-color);
}

.group-member-preview-name {
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.group-member-more {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.group-points-progress {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px;
    transition: width var(--transition-slow);
}

.group-card-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.group-stat {
    text-align: center;
}

.group-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.group-stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.group-evaluate-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.group-evaluate-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-primary);
}

.group-members-list {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    max-height: 300px;
    overflow-y: auto;
}

.group-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.group-member-item:hover {
    background: var(--bg-tertiary);
}

.group-member-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.group-member-info {
    flex: 1;
}

.group-member-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.group-member-detail {
    font-size: 12px;
    color: var(--text-tertiary);
}

.group-member-points {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   小组评价弹窗样式
   ======================================== */
.group-evaluate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.group-evaluate-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.group-evaluate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.group-evaluate-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-evaluate-title .title-icon {
    font-size: 28px;
}

.group-evaluate-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.group-evaluate-title .subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

.group-evaluate-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.group-evaluate-close:hover {
    background: var(--secondary-color);
    color: white;
}

.group-evaluate-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.evaluate-left-panel {
    width: 280px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.selected-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border-light);
}

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

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

.member-select-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.member-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.member-select-item:hover {
    background: var(--bg-tertiary);
}

.member-select-item.selected {
    background: var(--primary-bg);
}

.select-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.member-select-item.selected .select-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.check-icon {
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.member-select-item .member-avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

.member-select-item .member-info {
    flex: 1;
}

.member-select-item .member-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.member-select-item .member-detail {
    font-size: 11px;
    color: var(--text-tertiary);
}

.select-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin: 8px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-all-btn:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

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

.evaluate-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.evaluate-tabs {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.evaluate-tab {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.evaluate-tab:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

.evaluate-tab.active {
    background: var(--primary-color);
    color: white;
}

.evaluate-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.evaluate-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 8px;
}

.evaluate-item:hover {
    transform: translateX(4px);
    background: var(--bg-primary);
}

.evaluate-item.add {
    border-left: 3px solid var(--success-color);
}

.evaluate-item.deduct {
    border-left: 3px solid var(--secondary-color);
}

.evaluate-item-icon {
    font-size: 24px;
}

.evaluate-item-info {
    flex: 1;
}

.evaluate-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.evaluate-item-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.evaluate-item-points {
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
}

.evaluate-item-points.negative {
    color: var(--secondary-color);
}

.empty-evaluate-items {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.group-evaluate-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.group-evaluate-footer .cancel-btn {
    padding: 10px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.group-evaluate-footer .cancel-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.group-evaluate-footer .confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.group-evaluate-footer .confirm-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-primary);
}

/* 无分组提示样式 */
#noGroupsState {
    text-align: center;
    padding: 60px 20px;
}

#noGroupsState .empty-action-btn {
    margin-top: 20px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

#noGroupsState .empty-action-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-primary);
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 768px) {
    .group-evaluate-content {
        width: 95%;
        max-height: 90vh;
    }

    .group-evaluate-body {
        flex-direction: column;
    }

    .evaluate-left-panel {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .group-members-preview {
        justify-content: center;
    }

    .group-card-stats {
        gap: 8px;
    }

    .group-stat-value {
        font-size: 16px;
    }
}

/* ========================================
   会员功能提示弹窗样式
   ======================================== */

.member-required-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.member-required-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.member-required-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: memberModalSlideIn 0.3s ease;
}

@keyframes memberModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.member-required-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 24px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.member-required-icon {
    font-size: 28px;
}

.member-required-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.member-required-body {
    padding: 24px;
    text-align: center;
}

.member-required-message {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.member-required-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    border: 2px dashed var(--primary-light);
}

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

.contact-wechat {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.member-required-footer {
    padding: 16px 24px 24px;
    text-align: center;
}

.member-required-btn {
    padding: 12px 32px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.member-required-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-primary);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .member-required-content {
        width: 85%;
        max-width: 320px;
    }

    .member-required-header {
        padding: 20px 20px 12px;
    }

    .member-required-icon {
        font-size: 24px;
    }

    .member-required-header h3 {
        font-size: 18px;
    }

    .member-required-body {
        padding: 20px;
    }

    .member-required-message {
        font-size: 14px;
    }

    .contact-wechat {
        font-size: 16px;
    }
}

/* ========================================
   响应式卡片布局 - 全面适配各种设备
   ======================================== */

/* 
 * 设备断点定义：
 * - 移动设备: < 576px (手机)
 * - 平板设备: 576px - 768px (大手机/小平板)
 * - 大屏设备: 768px - 992px (平板/小笔记本)
 * - 桌面设备: 992px - 1200px (标准桌面)
 * - 大屏桌面: 1200px - 1600px (大桌面)
 * - 超大屏幕: > 1600px (超大桌面/4K)
 */

/* ----------------------------------------
   1. 超大屏幕 (> 1600px) - 6列网格
   ---------------------------------------- */
@media screen and (min-width: 1601px) {
    .students-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
        padding: 16px;
    }
    
    .student-card {
        padding: 20px;
        border-radius: var(--radius-xl);
    }
    
    .card-avatar {
        min-height: 180px;
        padding-top: 24px;
    }
    
    .avatar-container {
        width: 160px;
        height: 160px;
    }
    
    .avatar-container img {
        width: 150px;
        height: 150px;
    }
    
    .pet-emoji {
        font-size: 130px;
    }
    
    .student-name {
        font-size: 20px;
    }
    
    .pet-type {
        font-size: 13px;
    }
    
    .progress-label {
        font-size: 13px;
    }
    
    .progress-value {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

/* ----------------------------------------
   2. 大屏桌面 (1200px - 1600px) - 5列网格
   ---------------------------------------- */
@media screen and (max-width: 1600px) and (min-width: 1200px) {
    .students-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
        padding: 14px;
    }
    
    .student-card {
        padding: 18px;
        border-radius: var(--radius-lg);
    }
    
    .card-avatar {
        min-height: 160px;
        padding-top: 20px;
    }
    
    .avatar-container {
        width: 140px;
        height: 140px;
    }
    
    .avatar-container img {
        width: 130px;
        height: 130px;
    }
    
    .pet-emoji {
        font-size: 115px;
    }
    
    .student-name {
        font-size: 18px;
    }
    
    .pet-type {
        font-size: 12px;
    }
}

/* ----------------------------------------
   3. 桌面设备 (992px - 1200px) - 4列网格
   ---------------------------------------- */
@media screen and (max-width: 1199px) and (min-width: 992px) {
    .students-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 12px;
    }
    
    .student-card {
        padding: 16px;
        border-radius: var(--radius-lg);
    }
    
    .card-avatar {
        min-height: 140px;
        padding-top: 16px;
    }
    
    .avatar-container {
        width: 120px;
        height: 120px;
    }
    
    .avatar-container img {
        width: 110px;
        height: 110px;
    }
    
    .pet-emoji {
        font-size: 100px;
    }
    
    .student-name {
        font-size: 17px;
    }
    
    .pet-type {
        font-size: 11px;
    }
    
    .progress-label {
        font-size: 11px;
    }
    
    .progress-value {
        font-size: 12px;
    }
}

/* ----------------------------------------
   4. 大屏设备/平板横屏 (768px - 992px) - 3列网格
   ---------------------------------------- */
@media screen and (max-width: 991px) and (min-width: 768px) {
    .students-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
        padding: 10px;
    }
    
    .student-card {
        padding: 14px;
        border-radius: var(--radius-md);
    }
    
    .card-avatar {
        min-height: 120px;
        padding-top: 12px;
        margin-bottom: 10px;
    }
    
    .avatar-container {
        width: 100px;
        height: 100px;
    }
    
    .avatar-container img {
        width: 90px;
        height: 90px;
    }
    
    .pet-emoji {
        font-size: 85px;
    }
    
    .student-name {
        font-size: 16px;
    }
    
    .pet-type {
        font-size: 11px;
    }
    
    .card-info {
        margin-bottom: 10px;
    }
    
    .card-progress {
        margin-bottom: 10px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .card-stats {
        padding-top: 10px;
    }
    
    .stat-value {
        font-size: 15px;
    }
    
    .stat-label {
        font-size: 10px;
    }
}

/* ----------------------------------------
   5. 平板设备/大手机 (576px - 768px) - 2列网格
   ---------------------------------------- */
@media screen and (max-width: 767px) and (min-width: 576px) {
    .students-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 8px;
    }
    
    .student-card {
        padding: 12px;
        border-radius: var(--radius-md);
    }
    
    .card-header {
        margin-bottom: 8px;
    }
    
    .level-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .card-menu {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .card-avatar {
        min-height: 100px;
        padding-top: 8px;
        margin-bottom: 8px;
    }
    
    .avatar-container {
        width: 85px;
        height: 85px;
    }
    
    .avatar-container img {
        width: 75px;
        height: 75px;
    }
    
    .pet-emoji {
        font-size: 70px;
    }
    
    .student-name {
        font-size: 15px;
    }
    
    .pet-type {
        font-size: 10px;
    }
    
    .card-info {
        margin-bottom: 8px;
        padding: 0 2px;
    }
    
    .card-progress {
        margin-bottom: 8px;
        padding: 0 2px;
    }
    
    .progress-header {
        margin-bottom: 6px;
    }
    
    .progress-label {
        font-size: 10px;
    }
    
    .progress-value {
        font-size: 11px;
    }
    
    .progress-bar {
        height: 7px;
    }
    
    .card-stats {
        padding-top: 8px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 9px;
    }
}

/* ----------------------------------------
   6. 移动设备 (< 576px) - 单列网格
   ---------------------------------------- */
@media screen and (max-width: 575px) {
    .students-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 8px;
    }
    
    .student-card {
        padding: 16px;
        border-radius: var(--radius-lg);
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .card-header {
        position: absolute;
        top: 8px;
        right: 8px;
        margin-bottom: 0;
    }
    
    .level-badge {
        display: none;
    }
    
    .card-menu {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .card-avatar {
        min-height: auto;
        padding-top: 0;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .avatar-container {
        width: 70px;
        height: 70px;
    }
    
    .avatar-container img {
        width: 65px;
        height: 65px;
    }
    
    .pet-emoji {
        font-size: 55px;
    }
    
    .card-content {
        flex: 1;
        min-width: 0;
    }
    
    .card-info {
        margin-bottom: 6px;
        padding: 0;
    }
    
    .student-name {
        font-size: 16px;
        font-weight: 600;
    }
    
    .pet-type {
        font-size: 11px;
    }
    
    .card-progress {
        margin-bottom: 6px;
        padding: 0;
    }
    
    .progress-header {
        margin-bottom: 4px;
    }
    
    .progress-label {
        font-size: 10px;
    }
    
    .progress-value {
        font-size: 11px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .card-stats {
        padding-top: 6px;
        border-top: 1px solid var(--border-light);
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    /* 有背景图时的适配 */
    .student-card.has-bg-image .card-avatar {
        min-height: auto;
    }
    
    .student-card.has-bg-image .avatar-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }
    
    .student-card.has-bg-image .avatar-container img {
        width: 65px;
        height: 65px;
    }
    
    .student-card.has-bg-image .avatar-container .emoji {
        font-size: 55px;
    }
    
    .card-bg-image {
        display: none;
    }
}

/* ----------------------------------------
   7. 超小屏幕 (< 360px) - 紧凑模式
   ---------------------------------------- */
@media screen and (max-width: 359px) {
    .students-grid {
        gap: 8px;
        padding: 6px;
    }
    
    .student-card {
        padding: 12px;
        gap: 10px;
    }
    
    .avatar-container {
        width: 60px;
        height: 60px;
    }
    
    .avatar-container img {
        width: 55px;
        height: 55px;
    }
    
    .pet-emoji {
        font-size: 48px;
    }
    
    .student-name {
        font-size: 14px;
    }
    
    .pet-type {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .stat-label {
        font-size: 8px;
    }
}

/* ========================================
   产品卡片响应式布局
   ======================================== */

/* 产品网格基础样式 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

/* 大屏幕产品卡片 */
@media screen and (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

/* 桌面设备 */
@media screen and (max-width: 1199px) and (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* 平板设备 */
@media screen and (max-width: 991px) and (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* 大手机 */
@media screen and (max-width: 767px) and (min-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* 手机设备 */
@media screen and (max-width: 575px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
}

/* 超小屏幕 */
@media screen and (max-width: 359px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ========================================
   响应式字体大小变量
   ======================================== */

:root {
    /* 基础字体大小 */
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
}

/* 大屏幕字体 */
@media screen and (min-width: 1600px) {
    :root {
        --font-size-xs: 11px;
        --font-size-sm: 13px;
        --font-size-base: 15px;
        --font-size-md: 17px;
        --font-size-lg: 20px;
        --font-size-xl: 22px;
        --font-size-2xl: 26px;
    }
}

/* 平板字体 */
@media screen and (max-width: 991px) and (min-width: 768px) {
    :root {
        --font-size-xs: 9px;
        --font-size-sm: 11px;
        --font-size-base: 13px;
        --font-size-md: 15px;
        --font-size-lg: 17px;
        --font-size-xl: 19px;
        --font-size-2xl: 22px;
    }
}

/* 手机字体 */
@media screen and (max-width: 767px) {
    :root {
        --font-size-xs: 8px;
        --font-size-sm: 10px;
        --font-size-base: 12px;
        --font-size-md: 14px;
        --font-size-lg: 16px;
        --font-size-xl: 18px;
        --font-size-2xl: 20px;
    }
}

/* ========================================
   左侧可折叠导航栏
   ======================================== */

/* 侧边栏 CSS 变量 */
:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --sidebar-bg: var(--bg-secondary);
    --sidebar-border: var(--border-color);
    --sidebar-hover-bg: var(--primary-bg);
    --sidebar-active-bg: var(--primary-bg);
    --sidebar-active-color: var(--primary-color);
    --sidebar-transition: 0.3s ease;
    /* 侧边栏独立滚动条配色 */
    --sidebar-scrollbar-width: 6px;
    --sidebar-scrollbar-thumb: rgba(0, 0, 0, 0.18);
    --sidebar-scrollbar-thumb-hover: rgba(0, 0, 0, 0.38);
}

/* 暗夜主题下的滚动条配色 */
[data-theme="dark"] {
    --sidebar-scrollbar-thumb: rgba(255, 255, 255, 0.20);
    --sidebar-scrollbar-thumb-hover: rgba(255, 255, 255, 0.40);
}

/**
 * 应用主体布局容器
 * 左侧导航栏 + 右侧内容区，flex 横向排列
 */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/**
 * 左侧可折叠导航栏
 * 默认折叠状态 60px，展开后 240px
 */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    /* 侧边栏自身不滚动：顶部工具栏固定，滚动条只出现在下方导航菜单区 */
    overflow: hidden;
    transition: width var(--sidebar-transition), min-width var(--sidebar-transition);
    position: relative;
    z-index: 50;
}

/* 折叠状态：仅显示图标 */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .category-title,
.sidebar.collapsed .category-arrow,
.sidebar.collapsed .sidebar-submenu,
.sidebar.collapsed .submenu-title,
.sidebar.collapsed .sidebar-edit-toolbar {
    display: none;
}

/* 折叠时编辑按钮仅显示图标，不显示文字 */
.sidebar.collapsed .edit-text {
    display: none;
}

.sidebar.collapsed .sidebar-edit-btn {
    padding: 8px 0;
}

.sidebar.collapsed .category-icon {
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-category-header {
    justify-content: center;
    padding: 12px 8px;
}

/**
 * 侧边栏顶部工具栏（折叠切换 + 编辑按钮）
 */
.sidebar-top-toolbar {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-bottom: 1px solid var(--sidebar-border);
}

/**
 * 折叠/展开切换按钮
 */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary-color);
}

.sidebar-toggle .toggle-icon {
    font-size: 18px;
    transition: transform var(--transition-fast);
}

/**
 * 导航菜单容器 —— 独立滚动区
 * min-height: 0 是关键：允许它在 flex 列容器中被压缩，
 * 否则内容会撑破高度、变成整页滚动而非侧边栏内部滚动
 */
.sidebar-nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* 滚到底时不要把滚动传递给外层页面 */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    /* Firefox 细滚动条 */
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-scrollbar-thumb) transparent;
}

/* ---- 侧边栏专属滚动条（独立于主内容区） ---- */
.sidebar-nav::-webkit-scrollbar {
    width: var(--sidebar-scrollbar-width);
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-scrollbar-thumb);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-scrollbar-thumb-hover);
    background-clip: padding-box;
}

/* 鼠标移入侧边栏时滚动条更醒目 */
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-scrollbar-thumb-hover);
    background-clip: padding-box;
}

/* 折叠态（60px）用更窄的滚动条，避免遮挡图标 */
.sidebar.collapsed .sidebar-nav {
    scrollbar-width: thin;
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

/**
 * 一级菜单分类容器
 */
.sidebar-category {
    border-bottom: 1px solid var(--border-light, #F0F0F0);
}

/**
 * 一级菜单头部（可点击折叠/展开）
 */
.sidebar-category-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    gap: 10px;
    user-select: none;
}

.sidebar-category-header:hover {
    background: var(--sidebar-hover-bg);
}

.category-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.category-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-arrow {
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

/* 展开状态：箭头旋转 */
.sidebar-category.expanded .category-arrow {
    transform: rotate(180deg);
}

/* 展开状态：一级标题/箭头高亮，提示当前所在的一级分类（2026-09-06 用户反馈） */
.sidebar-category.expanded .category-title {
    color: var(--primary-color);
}

.sidebar-category.expanded .category-arrow {
    color: var(--primary-color);
}

/**
 * 二级菜单列表
 * 默认折叠，父级 .expanded 时展开
 */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--sidebar-transition);
    background: rgba(0, 0, 0, 0.02);
}

.sidebar-category.expanded .sidebar-submenu {
    max-height: 800px;
}

/**
 * 二级菜单项
 */
.sidebar-submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 40px;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 8px;
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-submenu-item:hover {
    background: var(--sidebar-hover-bg);
    border-left-color: var(--primary-color);
}

.sidebar-submenu-item.active {
    background: var(--sidebar-active-bg);
    border-left-color: var(--primary-color);
    color: var(--sidebar-active-color);
}

.submenu-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.submenu-title {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-submenu-item:hover .submenu-title,
.sidebar-submenu-item.active .submenu-title {
    color: var(--text-primary);
}

/* 权限锁标识 */
.submenu-lock {
    display: flex;
    align-items: center;
    font-size: 18px;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity var(--transition-fast);
}

/* 锁图标为内联 SVG，颜色跟随 .submenu-lock 的 color（currentColor） */
.submenu-lock .lock-icon-svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 悬停/选中时锁图标完全清晰 */
.sidebar-submenu-item:hover .submenu-lock,
.sidebar-submenu-item.active .submenu-lock {
    opacity: 1;
}

.submenu-lock.has-permission {
    opacity: 1;
    color: #4CAF50;   /* 有权限：绿色开锁 */
}

.submenu-lock.no-permission {
    opacity: 1;
    color: #ff9800;   /* 无权限：橙色上锁 */
}

/**
 * 编辑模式工具栏（保存/取消，位于顶部工具栏内）
 */
.sidebar-edit-toolbar {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    flex-shrink: 0;
}

.sidebar-edit-toolbar .edit-btn {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-edit-toolbar .edit-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sidebar-edit-toolbar .edit-btn.cancel:hover {
    background: var(--text-tertiary);
    border-color: var(--text-tertiary);
}

/* 编辑按钮（顶部工具栏内，与折叠按钮相邻） */
.sidebar-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-edit-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary-color);
}

/* 折叠时编辑按钮不再需要 special justify-content */
.sidebar.collapsed .sidebar-edit-btn {
    justify-content: center;
}

/**
 * 编辑模式下的二级菜单项
 */
.sidebar-submenu-item.editing {
    background: rgba(123, 104, 238, 0.05);
}

.sidebar-submenu-item.editing .submenu-title {
    border-bottom: 1px dashed var(--primary-color);
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
    min-width: 60px;
}

.sidebar-submenu-item.editing .drag-handle {
    display: inline-flex;
    cursor: grab;
    color: var(--text-tertiary);
    font-size: 14px;
    margin-right: 4px;
    flex-shrink: 0;
}

.sidebar-submenu-item .drag-handle {
    display: none;
}

/**
 * 编辑模式下的"移动到"下拉菜单（跨一级菜单移动）
 */
.sidebar-submenu-item .move-to-select {
    display: none;
    margin-left: auto;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 80px;
}

.sidebar-submenu-item.editing .move-to-select {
    display: inline-block;
}

.sidebar-submenu-item.editing .move-to-select:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tool-frame-container {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.tool-frame-container.active {
    display: flex;
}

.tool-frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.tool-frame-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tool-frame-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-frame-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-frame-back-btn:hover {
    background: var(--primary-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tool-frame-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tool-frame-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* 响应式：小屏幕下工具框架填充更多空间 */
@media (max-width: 768px) {
    .tool-frame-header {
        padding: 10px 14px;
    }
    .tool-frame-title {
        font-size: 14px;
    }
    .tool-frame-back-btn {
        padding: 4px 12px;
        font-size: 13px;
    }
}

/* ========================================
   常用功能面板 - 权限锁样式
   ======================================== */
.quick-action-permission-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 11px;
    z-index: 2;
    line-height: 1;
}

.quick-action-item {
    position: relative;
}

/* ========================================
   移动端UI组件 - 桌面端默认隐藏
   （移动端 < 768px 显示逻辑在 mobile.css 的 @media 查询中控制）
   ======================================== */

/**
 * 移动端底部导航栏（主页/光荣榜/商店/常用/撤回五个按钮）
 * 桌面端默认不显示，由 mobile.css 在小屏幕时覆盖为 display:flex
 */
.mobile-navbar {
    display: none;
}

/**
 * 移动端右上角菜单按钮（☰ 汉堡按钮，打开侧边抽屉）
 * 桌面端默认不显示，由 mobile.css 在小屏幕时覆盖为 display:flex
 */
.mobile-menu-btn {
    display: none;
}

/**
 * 移动端侧边抽屉菜单容器（会员信息、批量模式、常用功能、喊话、后台管理）
 * 桌面端默认不显示，由 mobile.css 在小屏幕时覆盖为 display:block
 */
.mobile-drawer {
    display: none;
}

/**
 * 移动端侧边抽屉遮罩层（打开菜单时的半透明黑色背景）
 * 桌面端默认不显示，由 mobile.css 在小屏幕时覆盖为 display:none/block
 */
.mobile-drawer-overlay {
    display: none;
}

/**
 * 移动端搜索栏（位于页面顶部的独立搜索输入框）
 * 桌面端默认不显示，由 mobile.css 在小屏幕时覆盖显示
 */
.mobile-search-bar {
    display: none;
}

/* ========================================
   导航栏位置切换（底部 / 左侧）
   .app-body.sidebar-position-bottom = 底部横向导航条（默认）
   .app-body.sidebar-position-left   = 传统左侧竖向导航栏
   ======================================== */

/**
 * 位置切换按钮（位于侧边栏顶部工具栏，与编辑按钮相邻）
 */
.sidebar-position-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-position-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary-color);
}

.sidebar-position-btn .position-icon {
    font-size: 15px;
    line-height: 1;
}

/* 折叠时仅显示图标 */
.sidebar.collapsed .position-text {
    display: none;
}

.sidebar.collapsed .sidebar-position-btn {
    justify-content: center;
    padding: 8px 0;
}

/* ---- 底部布局：主体容器改为纵向排列，导航条通过 order 沉底 ---- */
.app-body.sidebar-position-bottom {
    flex-direction: column;
    /* 分层定位容器：today-schedule 与 sidebar 均为 absolute 钉在底部 */
    position: relative;
}

/* DOM 中侧边栏在前，底部布局时排到内容区之后（沉底） */
.app-body.sidebar-position-bottom .main-content {
    order: 1;
    /* 去掉 24px 底部内边距：否则工具页 iframe 下方会漏出一条灰色背景带，
       看起来像导航条还遮着内容（2026-09-04 用户反馈） */
    padding-bottom: 0;
    /* 分层后：底部 64px 留给 today-schedule（56px）+ sidebar 上沿缓冲（8px），
       避免内容被浮在上层的 sidebar 覆盖。today-schedule 自带 absolute bottom:0，
       不参与 flex 高度计算，所以 main-content 需要为它预留空间。 */
    padding-bottom: 64px;
}

.app-body.sidebar-position-bottom .sidebar {
    order: 2;
    width: 100%;
    min-width: 0;
    height: var(--sidebar-bottom-height, 64px);
    min-height: var(--sidebar-bottom-height, 64px);
    /* 镜像布局：工具栏靠右、导航图标从右下角排布（2026-09-04 用户要求） */
    flex-direction: row-reverse;
    align-items: stretch;
    border-right: none;
    border-top: 1px solid var(--sidebar-border);
    /* 弹出面板需要溢出显示，不再裁剪 */
    overflow: visible;
    transition: height var(--sidebar-transition), min-height var(--sidebar-transition),
                width var(--sidebar-transition), min-width var(--sidebar-transition),
                right var(--sidebar-transition),
                background var(--sidebar-transition),
                border-color var(--sidebar-transition);
    /* 分层：sidebar 浮在 today-schedule 上层，展开时整条覆盖课程显示 */
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    /* 展开态：sidebar 自带背景与 border-top，覆盖在下层课程显示上 */
    background: var(--sidebar-bg);
    border-top: 1px solid var(--sidebar-border);
}

/* 折叠态：矮一点的胶囊条，靠右浮在课程显示上方，不遮挡课程信息 */
.app-body.sidebar-position-bottom .sidebar.collapsed {
    height: 56px;
    min-height: 56px;
    /* 关键：折叠时让 sidebar 只占工具栏胶囊宽度，浮在右下角，课程显示完整可见 */
    width: auto;
    min-width: auto;
    right: 10px;            /* 与右边缘留 10px 空隙，形成"漂浮"感 */
    background: transparent; /* 自身透明，让下层课程显示透出 */
    /* 折叠时隐藏上边框（用 transparent 保留宽度，背景过渡才能平滑） */
    border-top-color: transparent;
}

/* 顶部工具栏：镜像后横向排在导航条最右侧，分隔线改到左侧 */
.app-body.sidebar-position-bottom .sidebar-top-toolbar {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    border-bottom: none;
    border-right: none;
    border-left: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.app-body.sidebar-position-bottom .sidebar-toggle {
    width: auto;
    height: 100%;
    padding: 0 12px;
}

.app-body.sidebar-position-bottom .sidebar-edit-btn,
.app-body.sidebar-position-bottom .sidebar-position-btn {
    width: auto;
    height: 100%;
    padding: 0 12px;
}

.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-edit-btn,
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-position-btn {
    padding: 0 10px;
}

/* 编辑模式工具栏（保存/取消）在底部条内保持横向 */
.app-body.sidebar-position-bottom .sidebar-edit-toolbar {
    flex-direction: row;
    gap: 6px;
}

/* 导航菜单：五个分类横向铺开，弹出面板以上方整条显示
   注意：overflow 必须保持 visible——若设 auto/scroll（任一轴），
   另一轴的 visible 会按规范计算为 auto，向上弹出的二级面板会被裁掉；
   row-reverse = 镜像排列：分类从右下角开始排，积分广场紧邻右侧工具栏 */
.app-body.sidebar-position-bottom .sidebar-nav {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    overflow: visible;
    padding-bottom: 0;
}

.app-body.sidebar-position-bottom .sidebar-category {
    display: flex;
    flex-direction: column;
    border-bottom: none;
    border-right: 1px solid var(--border-light, #F0F0F0);
    flex-shrink: 1;
    min-width: 0;
}

/* 一级分类头部：撑满整条高度，加大点击区（触屏友好） */
.app-body.sidebar-position-bottom .sidebar-category-header {
    flex: 1;
    padding: 8px 18px;
    gap: 8px;
}

.app-body.sidebar-position-bottom .category-title {
    font-size: 15px;
}

/* 展开时箭头指向上方（面板在上方弹出） */
.app-body.sidebar-position-bottom .sidebar-category.expanded .category-arrow {
    transform: rotate(180deg);
}

/* 底部模式：展开的分类头部加底色 + 圆角，与弹出的面板视觉衔接，
   一眼看出当前面板属于哪个一级分类（2026-09-06 用户反馈） */
.app-body.sidebar-position-bottom .sidebar-category.expanded .sidebar-category-header {
    background: var(--sidebar-hover-bg);
    border-radius: 10px 10px 0 0;
}

/**
 * 二级菜单弹出面板：锚定在整个导航条上方，整条宽度铺开（mega-menu 风格）
 * 注意：面板挂在各自 .sidebar-category 内，但 left/right 均拉满导航条宽度，
 * 因为 .sidebar-nav 设了 position:relative，各分类保持 static
 */
.app-body.sidebar-position-bottom .sidebar-submenu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    /* row-reverse = 二级菜单项镜像：从面板右上角开始往左排（2026-09-04 用户要求） */
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    max-height: 0;
    padding: 0 12px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.10);
    z-index: 200;
}

.app-body.sidebar-position-bottom .sidebar-category.expanded .sidebar-submenu {
    max-height: 220px;
    padding: 10px 12px;
    overflow-y: auto;
}

/* 折叠态必须彻底隐藏弹出面板：
   上方 bottom 模式规则（含 display:flex）与基础折叠隐藏规则同为 3 级特异性且在文件更后，
   会压过 .collapsed 的 display:none，导致折叠后残留面板（实测踩坑），这里用更高特异性补一刀 */
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-category .sidebar-submenu {
    display: none;
}

/* 二级菜单项：横向大按钮（触屏点击区 ≥44px） */
.app-body.sidebar-position-bottom .sidebar-submenu-item {
    padding: 10px 16px;
    min-height: 44px;
    border-left: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.03);
    gap: 8px;
}

.app-body.sidebar-position-bottom .sidebar-submenu-item:hover {
    border-left-color: transparent;
    background: var(--sidebar-hover-bg);
}

.app-body.sidebar-position-bottom .sidebar-submenu-item.active {
    border-left-color: transparent;
    box-shadow: inset 0 -3px 0 var(--primary-color);
}

.app-body.sidebar-position-bottom .submenu-title {
    font-size: 14px;
}

/* 折叠态：底部条内隐藏所有文字，仅图标 */
.app-body.sidebar-position-bottom .sidebar.collapsed .category-title,
.app-body.sidebar-position-bottom .sidebar.collapsed .category-arrow {
    display: none;
}

/* 底部条内分类图标居中放大，方便学生点按 */
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-category-header {
    justify-content: center;
    padding: 8px 22px;
}

.app-body.sidebar-position-bottom .sidebar.collapsed .category-icon {
    font-size: 22px;
    margin: 0;
}

/* ========================================
   今日课程横幅（2026-09-07 分层改造）
   原方案：放在 .sidebar 内，随 .sidebar.collapsed 被压缩成"只显示时钟"。
   新方案：作为 .app-body 的独立子元素，与底部导航栏分层：
     - 课程显示 = 下层（z-index: 1），始终展开（完整时间+课程+状态）
     - 底部导航栏 = 上层（z-index: 2），折叠时只占右侧胶囊宽度不遮挡，展开时覆盖课程显示
   DOM 顺序：.sidebar 之后追加 #todayScheduleBar，底部布局通过 order 让其在最底；
   视觉位置通过 position: absolute 钉在底部，独立于 flex 流。
   左侧竖向导航模式下隐藏。
   ======================================== */
.today-schedule {
    display: none;
}

.app-body.sidebar-position-bottom .today-schedule {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;          /* 不参与 flex 拉伸/收缩，固定高度 */
    min-width: 0;
    height: 56px;            /* 与折叠态导航栏同高，视觉对齐 */
    padding: 6px 10px 6px 16px;
    overflow: hidden;
    flex-direction: row;
    /* 关键：脱离 flex 流，绝对定位钉在底部（z-index 低于导航栏） */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    background: var(--sidebar-bg, var(--bg-secondary, #fff));
    border-top: 1px solid var(--sidebar-border, var(--border-color, #E0E0E0));
    /* 折叠态时 padding-right 会从 10px 变到 210px，平滑过渡 */
    transition: padding-right var(--sidebar-transition);
}

/* 左侧时钟 */
.today-schedule .ts-clock {
    flex: 0 0 auto;
    text-align: center;
    padding-right: 12px;
    border-right: 1px solid var(--sidebar-border, var(--border-color, #E0E0E0));
}

.today-schedule .ts-time {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-primary, #2D3436);
    font-variant-numeric: tabular-nums;
}

.today-schedule .ts-date {
    font-size: 11px;
    color: var(--text-tertiary, #9aa0a6);
    margin-top: 2px;
    white-space: nowrap;
}

/* 竖分隔线 */
.today-schedule .ts-divider {
    flex: 0 0 auto;
    width: 1px;
    height: 60%;
    background: var(--sidebar-border, var(--border-color, #E0E0E0));
}

/* 中部：今日课程胶囊条 */
.today-schedule .ts-courses {
    /* 2026-09-07：原 flex: 1 1 auto 会把状态区一路推到容器最右，
       中间留下大段空白。改为 0 1 auto，让课程条按内容自然收缩，
       空白随之转移到状态区右侧，状态区可紧贴课程表末尾显示。 */
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.today-schedule .ts-hint {
    font-size: 12px;
    color: var(--text-tertiary, #9aa0a6);
    white-space: nowrap;
}

.today-schedule .ts-course {
    flex: 0 0 auto;
    max-width: 170px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.25;
    color: var(--text-secondary, #636E72);
    background: var(--sidebar-hover-bg, rgba(123, 104, 238, 0.06));
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.25s ease;
}

.today-schedule .ts-course-time {
    display: block;
    font-size: 10px;
    color: var(--text-tertiary, #9aa0a6);
    font-variant-numeric: tabular-nums;
}

/* 已结束的课：淡化 */
.today-schedule .ts-course.done {
    opacity: 0.45;
}

/* 正在上的课：主题色高亮 */
.today-schedule .ts-course.current {
    color: #fff;
    background: var(--primary-color, #7B68EE);
    border-color: var(--primary-color, #7B68EE);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(123, 104, 238, 0.35);
    max-width: 220px;
}

.today-schedule .ts-course.current .ts-course-time {
    color: rgba(255, 255, 255, 0.85);
}

/* 状态区（还剩 X 分钟下课 / 下节预告）— 2026-09-07 改造：
   紧贴课程列表末尾显示，与最后一节课之间不再有竖线分隔。
   border-left 已移除（多余的竖线），用 padding-left 与胶囊保持 10px 视觉间距。
   2026-09-07：再调整位置——配合 .ts-courses 改为 flex: 0 1 auto，
   这里加 margin-left: 12px（与课程表的小间距）+ margin-right: 20px（不贴右边缘），
   让"还剩 X 分钟下课"贴在课程表末尾显示，从原来的最右移到中部偏左。 */
.today-schedule .ts-status {
    flex: 0 0 auto;
    text-align: center;
    min-width: 96px;
    max-width: 180px;
    margin-left: 12px;
    margin-right: 20px;
    padding-left: 10px;
    overflow: hidden;
}

.today-schedule .ts-status-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color, #7B68EE);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-schedule .ts-status-sub {
    font-size: 11px;
    color: var(--text-tertiary, #9aa0a6);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

/* 左侧竖向导航模式：横幅随底部条隐藏 */
.app-body.sidebar-position-left .today-schedule {
    display: none;
}

/* ============================================================
   底部导航条 - 折叠态"最小化胶囊"模式 + 分层覆盖
   改：2026-09-07 分层改造：#todayScheduleBar 已移出 .sidebar 成为 .app-body 独立子元素（z-index: 1），
   .sidebar 浮在其上方（z-index: 2），展开时整条覆盖课程显示，折叠时只占右侧胶囊宽度，
   让课程显示完整可见（不被压缩）。
   - 折叠态仅显示：右侧 sidebar-top-toolbar（☰ 折叠 + ⇆ 移位 + ✏️ 编辑）胶囊
   - 展开时 sidebar-nav 用 flex-basis + transform 从右向左滑入，覆盖整个底部区域
   - JS 侧完全复用 isCollapsed 标志，无需新增状态
   ============================================================ */

/* 折叠态：今日课程横幅右侧让出 ~200px 给浮在右上的胶囊，避免状态文字被遮挡 */
.app-body.sidebar-position-bottom .sidebar.collapsed ~ .today-schedule {
    padding-right: 210px; /* 胶囊宽度（约 140-180px）+ 间隙 + 状态区最小宽 96px 缓冲 */
}

/* 折叠态（最小化）：整体让 toolbar 靠右浮在课程显示上方
   关键：sidebar 自身已 width:auto + right:10px + 透明背景（见前面 .sidebar.collapsed），
   这里再确保内部 toolbar 容器靠右对齐、保持胶囊形态 */
.app-body.sidebar-position-bottom .sidebar.collapsed {
    height: 56px;
    min-height: 56px;
    /* 让内容（toolbar 胶囊）靠右对齐 */
    justify-content: flex-end;
}

/* 折叠态：sidebar-nav 完全折叠为 0 宽度 + 透明
   用 flex-basis 0 配合 transform translateX 做出"从右向左滑入"动画 */
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-nav {
    flex: 0 0 0;
    flex-basis: 0;
    min-width: 0;
    width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* 展开态：sidebar-nav 平滑滑入
   在原有属性基础上追加：flex-basis 变化 + transform 位移 + opacity 渐显 */
.app-body.sidebar-position-bottom .sidebar-nav {
    /* flex-basis / width / transform / opacity 联合过渡 */
    transition: flex-basis 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.24s ease;
    transform: translateX(0);
    opacity: 1;
    will-change: flex-basis, transform, opacity;
}

/* 折叠态：顶部工具栏变"椭圆胶囊"
   圆角 + 内边距收紧 + 阴影，让 ☰⇆ 区域在底部条里像悬浮的椭圆；
   分层后 sidebar 自身透明，胶囊需要自带背景与阴影形成"漂浮"感 */
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-top-toolbar {
    border-radius: 999px;
    padding: 0 4px;
    margin: 6px 0;          /* 折叠态靠右浮，外边距由 .sidebar.collapsed 的 right:10px 统一控制 */
    height: calc(100% - 12px);
    background: var(--sidebar-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    /* 分层后：胶囊浮在下层课程显示上方，不需 border-left（旧的竖线用于与压缩态今日课程条分隔） */
    border-left: none;
}

/* 折叠态：胶囊内的按钮去掉左右内边距（保留高度撑满），更紧凑 */
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-toggle,
.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-position-btn {
    padding: 0 10px;
    height: 100%;
}

.app-body.sidebar-position-bottom .sidebar.collapsed .sidebar-edit-btn {
    padding: 0 10px;
    height: 100%;
}

