/* 学生端样式文件 - 现代化美化版本 */

/* ==================== 全局样式 ==================== */
:root {
    /* 主色调 - 现代蓝紫渐变 */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #00d4aa;
    --warning-color: #ffc107;
    --danger-color: #ff6b6b;
    --info-color: #74b9ff;
    --light-color: #f8f9fa;
    --dark-color: #2d3748;
    
    /* 渐变色彩 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    --gradient-info: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    --gradient-warm: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --gradient-cool: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-aurora: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
    
    /* 几何形状渐变 */
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f0f2f5 100%);
    --gradient-hover: linear-gradient(145deg, #f0f2f5 0%, #e4e8ed 100%);
    
    /* 阴影系统 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 15px 35px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    /* 圆角系统 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 动画系统 */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

/* ==================== 登录页面样式 ==================== */
.student-login-page {
    background: var(--gradient-primary);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.student-login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(240, 147, 251, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(116, 185, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 30%);
    animation: backgroundFloat 15s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% { 
        transform: translateX(0) translateY(0) scale(1);
        opacity: 0.7;
    }
    33% { 
        transform: translateX(30px) translateY(-20px) scale(1.1);
        opacity: 0.9;
    }
    66% { 
        transform: translateX(-20px) translateY(30px) scale(0.9);
        opacity: 0.8;
    }
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="grad1" cx="50%" cy="50%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.15)"/><stop offset="100%" style="stop-color:rgba(255,255,255,0)"/></radialGradient><radialGradient id="grad2" cx="50%" cy="50%"><stop offset="0%" style="stop-color:rgba(240,147,251,0.2)"/><stop offset="100%" style="stop-color:rgba(240,147,251,0)"/></radialGradient></defs><circle cx="200" cy="300" r="150" fill="url(%23grad1)"/><circle cx="800" cy="200" r="100" fill="url(%23grad2)"/><circle cx="600" cy="700" r="120" fill="url(%23grad1)"/><circle cx="100" cy="600" r="80" fill="url(%23grad2)"/></svg>') no-repeat center center;
    background-size: cover;
    animation: float 25s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.login-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-glow), var(--shadow-xl);
    border-color: rgba(102, 126, 234, 0.2);
}

.logo-container {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoFloat 3s ease-in-out infinite, logoPulse 2s ease-in-out infinite alternate;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes logoPulse {
    0% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6)); }
}

.login-title {
    color: var(--dark-color);
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.8rem;
    position: relative;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.login-subtitle {
    color: #64748b;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.025em;
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.login-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.login-btn:hover::before {
    left: 100%;
}

/* ==================== 学习单元列表样式 ==================== */
.units-container {
    background: 
        linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%),
        radial-gradient(circle at 20% 80%, rgba(240, 147, 251, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(116, 185, 255, 0.05) 0%, transparent 50%);
    min-height: 100vh;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

.units-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(102,126,234,0.02)" stroke-width="0.5"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.user-header {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.user-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-info);
}

/* 移除波浪动画效果 */
.user-header::after {
    display: none;
}

/* 移除的动画关键帧 */
/* @keyframes headerFloat {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
} */

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.progress-overview {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.progress-item {
    text-align: center;
    position: relative;
}

.progress-item::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #e9ecef;
}

.progress-item:last-child::after {
    display: none;
}

.progress-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.progress-number.primary { color: var(--primary-color); }
.progress-number.success { color: var(--success-color); }
.progress-number.info { color: var(--info-color); }

.unit-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
    position: relative;
    backdrop-filter: blur(10px);
}

.unit-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-normal);
}

.unit-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.unit-card:hover::after {
    transform: scaleX(1);
}

/* ==================== 单元列表移动端适配 ==================== */

/* 平板设备 */
@media (max-width: 768px) {
    .units-container {
        padding: 1rem 0;
    }
    
    .user-header {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .user-header::after {
        display: none; /* 移动端关闭动画背景 */
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .unit-card {
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
    }
    
    .unit-header {
        padding: 1rem;
    }
    
    .unit-title {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .unit-description {
        font-size: 0.85rem;
        opacity: 0.9;
    }
    
    .unit-content {
        padding: 1rem;
    }
    
    .unit-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-item {
        text-align: center;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.7);
        border-radius: var(--radius-sm);
    }
    
    .start-learning-btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: var(--radius-md);
        margin-top: 1rem;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .units-container {
        padding: 0.5rem 0;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .user-header {
        margin: 0.75rem;
        padding: 1rem;
        border-radius: var(--radius-sm);
    }
    
    .user-info h4 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .user-info p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .btn-outline-light {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .unit-card {
        margin-bottom: 0.75rem;
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-sm);
    }
    
    .unit-header {
        padding: 0.75rem;
    }
    
    .unit-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .unit-description {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .unit-content {
        padding: 0.75rem;
    }
    
    .unit-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .stat-item {
        padding: 0.5rem;
        font-size: 0.8rem;
        border-radius: var(--radius-sm);
    }
    
    .stat-number {
        font-size: 1.2rem;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 0.7rem;
        margin-top: 0.25rem;
    }
    
    .start-learning-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }
    
    .search-filters {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-sm);
    }
    
    .search-filters .form-control,
    .search-filters .form-select {
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem;
        border-radius: var(--radius-sm);
    }
}

.unit-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.unit-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.unit-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.unit-description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.unit-body {
    padding: 1.25rem;
}

.unit-progress {
    margin-bottom: 1rem;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

.unit-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.difficulty-1 { background: #d4edda; color: #155724; }
.difficulty-2 { background: #fff3cd; color: #856404; }
.difficulty-3 { background: #f8d7da; color: #721c24; }

.start-learning-btn {
    background: var(--gradient-success);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: white;
    transition: var(--transition);
    width: 100%;
}

.start-learning-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(40, 167, 69, 0.3);
    color: white;
}

/* ==================== 3D学习卡片样式 ==================== */
.learning-container {
    background: var(--gradient-primary);
    min-height: 100vh;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.learning-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon points="0,0 1000,300 1000,1000 0,1000" fill="rgba(255,255,255,0.05)"/></svg>') no-repeat;
    background-size: cover;
}

.progress-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 25px;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.2);
}

.progress-text {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    width: 200px;
    height: 6px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* TTS控制面板 */
.tts-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.tts-dropdown {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.tts-dropdown .dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* 3D翻转卡片 */
.flip-card {
    background-color: transparent;
    width: 400px;
    height: 500px;
    perspective: 1000px;
    margin: 0 auto;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    transition: var(--transition);
}

.flip-card-front {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    color: var(--dark-color);
    border: 3px solid rgba(102, 126, 234, 0.1);
}

.flip-card-back {
    background: var(--gradient-success);
    color: white;
    transform: rotateY(180deg);
}

.word-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    word-wrap: break-word;
    line-height: 1.2;
}

.phonetic-text {
    font-size: 1.1rem;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.meaning-text {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.example-text {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    line-height: 1.4;
}

.example-translation {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* 播放按钮 */
.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-primary);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn-back {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.play-btn-back:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* 控制按钮区域 */
.controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 1000;
}

.control-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 500;
    transition: var(--transition);
    margin: 0 0.5rem;
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    color: white;
}

.control-btn.secondary {
    background: #6c757d;
}

.control-btn.warning {
    background: var(--warning-color);
}

.control-btn.info {
    background: var(--info-color);
}

/* 单词列表导航 */
.word-list {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 1000;
    width: 200px;
}

.word-list h6 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.word-list-item {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.word-list-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.word-list-item.active {
    background: var(--gradient-primary);
    color: white;
}

/* 收藏按钮 */
.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #ffc107;
    transition: var(--transition);
    cursor: pointer;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.favorited {
    color: #ff6b6b;
}

/* ==================== 移动端适配 ==================== */

/* 大屏平板 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .flip-card {
        width: 350px;
        height: 450px;
    }
    
    .word-text {
        font-size: 2.5rem;
    }
    
    .meaning-text {
        font-size: 1.4rem;
    }
    
    .controls {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }
    
    .control-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-width: 120px;
    }
}

/* 平板设备 (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .learning-container {
        padding: 1rem;
    }
    
    .flip-card {
        width: 320px;
        height: 420px;
        margin: 1rem auto;
    }
    
    .flip-card-front, .flip-card-back {
        padding: 2rem 1.5rem;
    }
    
    .word-text {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .meaning-text {
        font-size: 1.3rem;
        line-height: 1.4;
    }
    
    .example-text {
        font-size: 1rem;
        margin-top: 1rem;
    }
    
    .word-list {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 30vh;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
        transition: var(--transition-normal);
    }
    
    .word-list.show {
        transform: translateY(0);
    }
    
    .tts-controls {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1002;
    }
    
    .controls {
        position: fixed;
        bottom: 20px;
        left: 15px;
        right: 15px;
        transform: none;
        padding: 1rem;
        border-radius: var(--radius-xl);
        backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: var(--shadow-lg);
    }
    
    .control-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        margin: 0.25rem;
        border-radius: var(--radius-md);
        min-width: 80px;
    }
    
    .progress-indicator {
        top: 15px;
        left: 15px;
        right: 80px;
        padding: 1rem 1.5rem;
        border-radius: var(--radius-lg);
        backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.9);
    }
    
    .progress-bar-container {
        width: 180px;
    }
    
    .progress-text {
        font-size: 1.1rem;
        font-weight: 600;
    }
}

/* 手机设备 (320px - 480px) */
@media (max-width: 480px) {
    .learning-container {
        padding: 0.5rem;
    }
    
    .flip-card {
        width: min(300px, calc(100vw - 2rem));
        height: min(380px, calc(100vh - 200px));
        margin: 0.5rem auto;
    }
    
    .flip-card-front, .flip-card-back {
        padding: 1.5rem 1rem;
    }
    
    .word-text {
        font-size: 1.8rem;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }
    
    .phonetic-text {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .meaning-text {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .example-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .play-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 0.75rem;
        border-radius: var(--radius-lg);
    }
    
    .control-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        margin: 0.2rem;
        border-radius: var(--radius-sm);
        min-width: 70px;
        flex: 1;
    }
    
    .progress-indicator {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
    }
    
    .progress-text {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .progress-bar-container {
        width: 120px;
        height: 8px;
    }
    
    .word-list {
        max-height: 25vh;
        padding: 1rem;
    }
    
    .word-list-item {
        padding: 0.75rem;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }
    
    .tts-controls {
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1002;
    }
    
    .tts-controls .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        border-radius: var(--radius-sm);
    }
    
    .tts-controls .dropdown-menu {
        min-width: 200px;
        right: 0;
        left: auto;
        border-radius: var(--radius-md);
        font-size: 0.85rem;
    }
    
    .tts-controls .dropdown-item {
        padding: 0.5rem 0.75rem;
    }
    
    .tts-controls .form-range {
        height: 4px;
    }
    
    .tts-controls .px-3 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* 小屏手机 (最小 320px) */
@media (max-width: 375px) {
    .flip-card {
        width: calc(100vw - 1.5rem);
        height: min(350px, calc(100vh - 180px));
    }
    
    .word-text {
        font-size: 1.6rem;
    }
    
    .meaning-text {
        font-size: 1rem;
    }
    
    .control-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
    .progress-indicator {
        padding: 0.5rem 0.75rem;
    }
    
    .progress-text {
        font-size: 0.9rem;
    }
    
    .progress-bar-container {
        width: 100px;
        height: 6px;
    }
}

/* 重复的媒体查询已整合到上面的移动端适配部分 */

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Toast通知样式 */
.toast {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--border-radius);
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ==================== 个人设置页面样式 ==================== */
.user-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.avatar-container {
    position: relative;
}

.avatar-colors {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.avatar-color {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition-normal);
    position: relative;
}

.avatar-color:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.avatar-color.selected {
    border-color: var(--primary-color);
    transform: scale(1.2);
    box-shadow: var(--shadow-lg);
}

.avatar-color.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.tab-content {
    transition: var(--transition-normal);
}

.list-group-item.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: white;
}

.form-range {
    accent-color: var(--primary-color);
}

/* ==================== 导航栏下拉菜单修复 ==================== */
.student-navbar {
    z-index: 9999 !important;
    position: relative;
}

.navbar .dropdown-menu {
    z-index: 99999 !important;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    position: absolute !important;
}

/* 强制所有可能遮挡的元素降低层级 */
.units-container,
.user-header,
.unit-card,
.card,
.modal,
.toast {
    z-index: 1 !important;
}

.navbar .dropdown-item {
    padding: 0.75rem 1rem;
    transition: var(--transition-normal);
}

.navbar .dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.navbar .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* 确保用户头像在下拉菜单中正确显示 */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid rgba(255,255,255,0.2);
}

/* 额外的下拉菜单修复 */
.navbar-nav .dropdown-menu {
    z-index: 99999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
}

.navbar-nav .dropdown-menu.show {
    z-index: 99999 !important;
    display: block !important;
    position: absolute !important;
}

/* 确保导航栏容器也有足够高的层级 */
.navbar-expand-lg {
    z-index: 9998 !important;
}

/* 精确控制导航栏元素层级 */
.navbar {
    z-index: 9999 !important;
}

.navbar .nav-link,
.navbar .dropdown-toggle {
    z-index: 9999 !important;
}

/* ==================== 练习快速入口 ==================== */
.practice-quick-access {
    margin: 1.5rem 0;
}

.practice-card {
    background: var(--gradient-card);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.practice-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.practice-card .card-body {
    padding: 1.5rem;
}

.practice-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.practice-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.practice-buttons .btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.practice-buttons .btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.practice-buttons .btn-primary:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.practice-buttons .btn-outline-danger {
    position: relative;
    overflow: visible;
}

#wrongWordsCountBadge {
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .practice-quick-access .col-md-8,
    .practice-quick-access .col-md-4 {
        text-align: center;
    }
    
    .practice-buttons {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .practice-buttons .btn {
        flex: 1;
        max-width: 120px;
    }
}

/* ==================== 移动端字体优化 ==================== */

/* 移动端字体缩放 - 768px以下设备 */
@media (max-width: 768px) {
    /* 主标题字体缩放 */
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    h4 {
        font-size: 1.2rem !important;
    }
    
    h5 {
        font-size: 1.1rem !important;
    }
    
    h6 {
        font-size: 1rem !important;
    }
    
    /* 正文字体缩放 */
    p, .card-text, .form-control, .btn {
        font-size: 0.9rem !important;
    }
    
    /* 小字体缩放 */
    small, .small {
        font-size: 0.8rem !important;
    }
    
    /* 导航和菜单字体 */
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    .nav-link {
        font-size: 0.9rem !important;
    }
    
    /* 按钮字体 */
    .btn-lg {
        font-size: 1rem !important;
    }
    
    .btn {
        font-size: 0.9rem !important;
    }
    
    .btn-sm {
        font-size: 0.8rem !important;
    }
    
    /* 表格字体 */
    .table {
        font-size: 0.9rem !important;
    }
    
    /* 模态框字体 */
    .modal-title {
        font-size: 1.2rem !important;
    }
    
    .modal-body {
        font-size: 0.9rem !important;
    }
}

/* 小屏幕字体缩放 - 480px以下设备 */
@media (max-width: 480px) {
    /* 主标题字体进一步缩放 */
    h1 {
        font-size: 1.6rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    h4 {
        font-size: 1.1rem !important;
    }
    
    h5 {
        font-size: 1rem !important;
    }
    
    h6 {
        font-size: 0.95rem !important;
    }
    
    /* 正文字体进一步缩放 */
    p, .card-text, .form-control, .btn {
        font-size: 0.85rem !important;
    }
    
    /* 小字体进一步缩放 */
    small, .small {
        font-size: 0.75rem !important;
    }
    
    /* 导航和菜单字体 */
    .navbar-brand {
        font-size: 1rem !important;
    }
    
    .nav-link {
        font-size: 0.85rem !important;
    }
    
    /* 按钮字体 */
    .btn-lg {
        font-size: 0.95rem !important;
    }
    
    .btn {
        font-size: 0.85rem !important;
    }
    
    .btn-sm {
        font-size: 0.75rem !important;
    }
    
    /* 表格字体 */
    .table {
        font-size: 0.8rem !important;
    }
    
    /* 模态框字体 */
    .modal-title {
        font-size: 1.1rem !important;
    }
    
    .modal-body {
        font-size: 0.85rem !important;
    }
}

/* 超小屏幕字体缩放 - 320px以下设备 */
@media (max-width: 320px) {
    /* 主标题字体最小缩放 */
    h1 {
        font-size: 1.4rem !important;
    }
    
    h2 {
        font-size: 1.2rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    h4 {
        font-size: 1rem !important;
    }
    
    h5, h6 {
        font-size: 0.9rem !important;
    }
    
    /* 正文字体最小缩放 */
    p, .card-text, .form-control, .btn {
        font-size: 0.8rem !important;
    }
    
    /* 小字体最小缩放 */
    small, .small {
        font-size: 0.7rem !important;
    }
}