/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 沉浸式背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: floatBackground 20s ease-in-out infinite alternate;
}

@keyframes floatBackground {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(-20px) translateY(-20px);
    }
    100% {
        transform: translateX(20px) translateY(-10px);
    }
}

/* 浮动形状 */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    bottom: 10%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* 玻璃效果 */
.glass-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 修复卡片默认样式 */
.card {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.card-header {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* 淡入动画 */
.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

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

/* 脉冲图标 */
.pulse-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* 现代头像 */
.modern-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.avatar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.6;
    z-index: 1;
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        opacity: 0.4;
        transform: scale(1);
    }
    to {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* 现代徽章 */
.badge-grade {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #667eea;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #667eea }
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-radius: 10px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* 统计卡片 */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
}

.stat-card .stat-label {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* 表单样式 */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* 文件上传区域 */
.upload-area {
    border: 2px dashed rgba(0, 123, 255, 0.5);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    color: white !important;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.upload-area:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 123, 255, 0.8);
}

.upload-area.dragover {
    background: rgba(0, 123, 255, 0.2);
    border-color: rgba(0, 123, 255, 0.8);
    transform: scale(1.02);
}

/* 修复alert框背景 */
.alert {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    backdrop-filter: blur(10px);
}

.alert-light {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* 题目卡片 */
.exercise-card {
    border-left: 4px solid #007bff;
    margin-bottom: 1rem;
}

.exercise-card.difficulty-easy {
    border-left-color: #28a745;
}

.exercise-card.difficulty-medium {
    border-left-color: #ffc107;
}

.exercise-card.difficulty-hard {
    border-left-color: #dc3545;
}

/* 知识点标签 */
.knowledge-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* 徽章样式 */
.badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .stat-card .stat-number {
        font-size: 2rem;
    }

    .card {
        margin-bottom: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 特殊组件样式 */
.sidebar-menu {
    background-color: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar-menu .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.sidebar-menu .nav-link:hover,
.sidebar-menu .nav-link.active {
    background-color: #007bff;
    color: white;
}

/* 练习模式样式 */
.practice-mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-option {
    flex: 1;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-option:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.mode-option.selected {
    border-color: #007bff;
    background-color: #007bff;
    color: white;
}

/* 答题界面样式 */
.answer-area {
    min-height: 200px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    background-color: white;
}

/* 设置页面样式 */
.settings-section {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 主题色彩 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}