/* 费曼学习法AI交互平台样式 */

:root {
    --primary-color: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.15);
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

/* 英雄区域样式 */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-radius: 20px;
    margin: 2rem 0;
}

.hero-section h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-section .lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: #6b7280;
}

/* 导航栏样式 */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(79, 70, 229, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* 卡片样式 */
.card {
    border-radius: 16px;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}
/*
.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}
*/

.card-header {
    background: var(--gradient-primary) !important;
    border: none;
    padding: 1.5rem;
}

.card-header h4 {
    margin: 0;
    font-weight: 600;
    color: white;
}

.card-body {
    padding: 2rem;
}

/* 特色卡片样式 */
.feature-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.9) 100%);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 对话区域样式 */
.chat-messages {
    max-height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(79, 70, 229, 0.3) 50%, transparent 100%);
}

.message {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

.message.ai-message {
    display: flex;
    align-items: flex-start;
}

.message.user-message {
    display: flex;
    align-items: flex-start;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 0.75rem;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.message-content {
    flex: 1;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.ai-message .message-content {
    border-top-left-radius: 4px;
}

.user-message .message-content {
    border-top-right-radius: 4px;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.ai-message .message-content::before {
    left: -16px;
    border-right-color: white;
}

.user-message .message-content::before {
    right: -16px;
    border-left-color: white;
}

.message-text {
    margin: 0;
    line-height: 1.6;
    color: #374151;
}

.message-meta {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 反馈样式 */
.feedback-section {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.feedback-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.evaluation-section {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.evaluation-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.score-item {
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.score-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

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

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), #6366f1);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* 按钮样式 */
.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    color: #64748b;
    backdrop-filter: blur(10px);
}

.btn-outline-secondary:hover {
    background: white;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-2px);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* 输入框样式 */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
    background: white;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.alert {
    border-radius: 12px;
    border: none;
    backdrop-filter: blur(10px);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.1) 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

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

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

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        margin: 1rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .message {
        flex-direction: column;
        align-items: center;
    }
    
    .message-avatar {
        margin: 0 0 0.5rem 0;
    }
    
    .message-content {
        width: 100%;
    }
    
    .message-content::before {
        display: none;
    }
    
    .evaluation-scores {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .chat-messages {
        padding: 1rem;
        max-height: 400px;
    }
    
    .progress {
        height: 6px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .evaluation-scores {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .chat-messages {
        max-height: 300px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #4338ca;
}

/* 特殊状态样式 */
.session-completed {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid var(--success-color);
}

.session-paused {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid var(--warning-color);
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 模态框样式 */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.02) 0%, rgba(99, 102, 241, 0.02) 100%);
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer h5 {
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 进度条增强 */
.progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: var(--gradient-primary);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

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

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

/* 加载动画增强 */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
}

.tooltip-inner {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选择文本样式 */
::selection {
    background: rgba(79, 70, 229, 0.2);
    color: #1f2937;
}

::-moz-selection {
    background: rgba(79, 70, 229, 0.2);
    color: #1f2937;
}

/* 暗色主题样式 */
.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    color: #e2e8f0;
}

.dark-theme .card {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(71, 85, 105, 0.3);
    color: #e2e8f0;
}

.dark-theme .card-header {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%) !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.dark-theme .form-control,
.dark-theme .form-select {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(71, 85, 105, 0.5);
    color: #e2e8f0;
}

.dark-theme .form-control:focus,
.dark-theme .form-select:focus {
    background: rgba(30, 41, 59, 1) !important;
    border-color: var(--primary-color);
    color: #e2e8f0;
}

.dark-theme .chat-messages {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
}

.dark-theme .message-content {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e2e8f0;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.dark-theme .navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.dark-theme .modal-content {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.dark-theme .modal-header {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.8) 0%, rgba(75, 85, 99, 0.8) 100%) !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.dark-theme .modal-footer {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.5) 0%, rgba(75, 85, 99, 0.5) 100%) !important;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.dark-theme .alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 197, 253, 0.2) 100%) !important;
    color: #93c5fd;
    border-left: 4px solid #3b82f6;
}

.dark-theme .progress {
    background: rgba(30, 41, 59, 0.5);
}

.dark-theme .text-muted {
    color: #9ca3af !important;
}

.dark-theme .text-primary {
    color: #60a5fa !important;
}

.dark-theme .text-success {
    color: #34d399 !important;
}

.dark-theme .text-warning {
    color: #fbbf24 !important;
}

.dark-theme .border-end {
    border-color: rgba(71, 85, 105, 0.3) !important;
}

.dark-theme .border-top {
    border-color: rgba(71, 85, 105, 0.3) !important;
}

.dark-theme .border-bottom {
    border-color: rgba(71, 85, 105, 0.3) !important;
}

/* Toast样式增强 */
.toast {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.toast-header {
    border-radius: 12px 12px 0 0;
    font-weight: 600;
}

.toast-body {
    border-radius: 0 0 12px 12px;
    font-size: 0.9rem;
}

/* 加载动画增强 */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* 脉冲动画 */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* 新增：用于强制移除指定卡片的悬浮效果 */
.card.no-hover:hover {
    transform: none !important;
    box-shadow: var(--shadow-soft) !important; /* 恢复成默认阴影或移除 */
}
