/* 全局样式重置和变量定义 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-color: #333;
    --light-color: #f5f5f5;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* 页面切换 */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 登录/注册页面样式 */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.app-title i {
    margin-right: 10px;
}

.auth-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--dark-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

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

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #45a049;
}

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

.btn-secondary:hover {
    background-color: #1976D2;
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch-form {
    text-align: center;
    margin-top: 1rem;
}

.switch-form a {
    color: var(--primary-color);
    text-decoration: none;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* 导航栏样式 */
.navbar {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

/* 标签页样式 */
.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-button i {
    margin-right: 0.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 上传区域 */
.upload-section {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 3rem;
    background-color: white;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-area.dragover {
    background-color: #e8f5e9;
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.upload-hint {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* 上传进度 */
.upload-progress {
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* 结果显示区域 */
.result-section {
    margin-top: 2rem;
}

.result-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    align-items: stretch; /* 确保两列高度相等 */
    min-height: 500px; /* 设置最小高度 */
}

/* 视频播放器容器 - 智能适配横屏/竖屏视频 */
.video-player {
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px; /* 为小视频设置最小高度 */
}

.video-player video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 70vh; /* 限制最大高度为视口的70% */
    object-fit: contain; /* 保持视频比例，完整显示 */
    display: block;
}

/* 让视频播放器在移动端能够自适应视频尺寸 */
.video-player.landscape {
    aspect-ratio: 16/9; /* 横屏视频的默认比例 */
}

.video-player.portrait {
    aspect-ratio: 9/16; /* 竖屏视频的默认比例 */
    max-width: 60%; /* 竖屏视频在桌面端限制宽度 */
    margin: 0 auto;
}

.video-player.square {
    aspect-ratio: 1/1; /* 正方形视频 */
    max-width: 70%;
    margin: 0 auto;
}

.analysis-result {
    padding: 0 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容溢出 */
}

.analysis-result h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.analysis-content {
    height: calc(100% - 3rem); /* 减去标题高度 */
    min-height: 500px;
    max-height: 70vh; /* 视口高度的70% */
    overflow-y: auto;
    padding-right: 0; /* 统一左右边距，移除右侧额外内边距 */
}

/* 删除exercise-info相关布局样式 - 不再使用 */

/* 分析内容的容器布局 */
.analysis-content {
    display: flex;
    flex-direction: column;
}

.analysis-content::-webkit-scrollbar {
    width: 6px; /* 减小滚动条宽度，避免占用过多空间 */
}

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

.analysis-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.analysis-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Markdown内容样式 - 与streaming-content保持一致 */
.analysis-content h1, .analysis-content h2, .analysis-content h3 {
    margin: 1rem 0 0.5rem 0;
    color: var(--dark-color);
    line-height: 1.3;
}

.analysis-content > :first-child {
    margin-top: 0;
}

.analysis-content p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.analysis-content p:empty {
    display: none;
}

.analysis-content p + p {
    margin-top: 0.5rem;
}

.analysis-content ul, .analysis-content ol {
    margin: 0.5rem 0 0.8rem 0;
    padding-left: 1.5rem;
}

.analysis-content li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.analysis-content li > ul,
.analysis-content li > ol {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

/* 流式分析样式 */
.streaming-analysis {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid #e0e0e0;
    height: 100%; /* 占满可用高度 */
    display: flex;
    flex-direction: column;
    flex: 1; /* 确保占据剩余空间 */
}

.streaming-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    color: var(--dark-color);
}

.streaming-header i.spinning {
    animation: spin 2s linear infinite;
    color: var(--primary-color);
}

.streaming-header i.fa-check-circle {
    color: #28a745;
}

.streaming-content {
    height: calc(100% - 5rem); /* 减去头部高度 */
    min-height: 400px; /* 减少最小高度 */
    max-height: 70vh; /* 视口高度的70% */
    overflow-y: auto;
    overflow-x: hidden; /* 防止水平滚动 */
    line-height: 1.6; /* 统一行高，避免过大 */
    font-size: 1rem;
    word-wrap: break-word; /* 防止长文本溢出 */
    padding-right: 0; /* 统一左右边距，移除右侧额外内边距 */
}

.streaming-content::-webkit-scrollbar {
    width: 6px; /* 减小滚动条宽度，避免占用过多空间 */
}

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

.streaming-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.streaming-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.streaming-content h1, 
.streaming-content h2, 
.streaming-content h3 {
    color: var(--dark-color);
    margin: 1rem 0 0.5rem 0; /* 减少标题间距 */
    line-height: 1.3;
}

/* 第一个标题不需要顶部边距 */
.streaming-content > :first-child {
    margin-top: 0;
}

.streaming-content h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.streaming-content h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.streaming-content h3 {
    font-size: 1.3rem;
    color: #666;
}

.streaming-content p {
    margin-bottom: 0.8rem; /* 减少段落间距 */
    text-align: justify;
    line-height: 1.6; /* 确保行高一致 */
}

/* 防止空段落占用空间 */
.streaming-content p:empty {
    display: none;
}

/* 连续段落的间距处理 */
.streaming-content p + p {
    margin-top: 0.5rem;
}

.streaming-content ul, 
.streaming-content ol {
    margin: 0.5rem 0 0.8rem 0; /* 减少列表间距 */
    padding-left: 1.5rem; /* 减少缩进 */
}

.streaming-content li {
    margin-bottom: 0.4rem; /* 减少列表项间距 */
    line-height: 1.6;
}

/* 嵌套列表的处理 */
.streaming-content li > ul,
.streaming-content li > ol {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

.streaming-content strong {
    color: var(--dark-color);
    font-weight: 600;
}

.streaming-content em {
    color: var(--secondary-color);
    font-style: italic;
}

.streaming-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
}

/* 流式打字指示器样式 */
.streaming-content .typing-indicator {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.streaming-content .typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: typingPulse 1.4s infinite ease-in-out;
}

.streaming-content .typing-indicator span:nth-child(2) {
    animation-delay: -1.2s;
}

.streaming-content .typing-indicator span:nth-child(3) {
    animation-delay: -1.0s;
}

@keyframes typingPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 流式分析响应式设计 */
@media (max-width: 768px) {
    .streaming-analysis {
        padding: 0.75rem; /* 进一步减少内边距 */
        margin-top: 0.25rem; /* 减少顶部间距 */
    }
    
    .streaming-header {
        gap: 0.6rem;
        margin-bottom: 0.75rem; /* 减少底部间距 */
        padding-bottom: 0.75rem;
        font-size: 0.9rem;
    }
    
    .streaming-content {
        height: auto;
        min-height: 250px; /* 减少最小高度 */
        max-height: 65vh; /* 增加最大高度 */
        font-size: 1.1rem; /* 增大字体到正常网页大小，便于阅读 */
        line-height: 1.6; /* 优化行高 */
        padding-right: 0; /* 统一左右边距 */
    }
    
    .streaming-content h1 {
        font-size: 1.4rem; /* 稍微减小标题 */
        margin: 0.75rem 0 0.4rem 0; /* 减少标题间距 */
    }
    
    .streaming-content h2 {
        font-size: 1.25rem;
        margin: 0.6rem 0 0.3rem 0;
    }
    
    .streaming-content h3 {
        font-size: 1.1rem;
        margin: 0.5rem 0 0.25rem 0;
    }
    
    .streaming-content p {
        margin-bottom: 0.6rem; /* 减少段落间距 */
    }
    
    .streaming-content ul,
    .streaming-content ol {
        margin: 0.4rem 0 0.6rem 0; /* 优化列表间距 */
        padding-left: 1.25rem; /* 减少缩进 */
    }
    
    .streaming-content li {
        margin-bottom: 0.3rem; /* 减少列表项间距 */
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

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

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

/* 历史记录样式 */
.history-section {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

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

.history-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.video-history {
    max-height: 600px;
    overflow-y: auto;
}

.video-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.video-item:hover {
    box-shadow: var(--shadow);
}

.video-info {
    flex: 1;
    margin-right: 1rem;
}

.video-filename {
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.video-meta {
    color: #666;
    font-size: 0.9rem;
}

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

.video-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.video-analysis {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.video-analysis h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.video-analysis-content {
    max-height: 300px;
    overflow-y: auto;
}

.no-videos {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-videos i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 0.75rem; /* 减少外边距，节省空间 */
    }
    
    .result-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem; /* 减少内边距，增加内容宽度 */
    }
    
    .video-player {
        margin-bottom: 1rem;
        min-height: 250px; /* 移动端适当减小最小高度 */
    }
    
    /* 移动端视频播放器 - 取消横屏视频的宽度限制 */
    .video-player.portrait {
        max-width: 100%;
        aspect-ratio: 9/16;
    }
    
    .video-player.landscape {
        aspect-ratio: 16/9;
    }
    
    .video-player.square {
        max-width: 100%;
        aspect-ratio: 1/1;
    }
    
    /* 分析结果区域在移动端的优化 */
    .analysis-result {
        padding: 0 0.5rem; /* 进一步减少内边距 */
    }
    
    .streaming-analysis {
        padding: 1rem; /* 减少流式分析的内边距 */
    }
    
    .streaming-content {
        font-size: 1.1rem; /* 增大字体到正常网页大小，便于阅读 */
        line-height: 1.6; /* 优化行高 */
        padding-right: 0; /* 统一左右边距 */
    }
    
    .message-bubble {
        padding: 0.75rem 1rem; /* 减少聊天气泡的内边距 */
        font-size: 1rem; /* 保持正常字体大小 */
        line-height: 1.6;
    }
    
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .upload-area {
        padding: 2rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    /* 标签页移动端样式 */
    .tabs {
        justify-content: center;
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* 历史记录移动端样式 */
    .history-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .video-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .video-info {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .video-actions {
        justify-content: center;
    }
    
    .video-analysis-content {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .auth-form {
        padding: 1.5rem;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* 小屏幕设备的进一步优化 */
    .main-content {
        padding: 0.5rem; /* 进一步减少外边距 */
    }
    
    .result-container {
        padding: 0.75rem; /* 进一步减少内边距 */
    }
    
    .analysis-result {
        padding: 0 0.25rem; /* 进一步减少内边距 */
    }
    
    .streaming-analysis {
        padding: 0.5rem; /* 小屏幕设备进一步减少内边距 */
    }
    
    .streaming-content {
        font-size: 1rem; /* 保持正常字体大小，便于阅读 */
        padding-right: 0; /* 统一左右边距 */
    }
    
    .message-bubble {
        max-width: 95%; /* 小屏幕设备进一步增加宽度 */
        padding: 0.6rem 0.8rem; /* 减少内边距 */
        font-size: 1rem; /* 保持正常字体大小 */
    }
    
    .chat-messages {
        padding: 0.5rem; /* 进一步减少聊天消息的内边距 */
    }
}

/* 加载进度信息样式 */
.progress-info {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.progress-info p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.progress-info p:first-child {
    margin-top: 0;
}

.progress-info p:last-child {
    margin-bottom: 0;
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 2rem;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: var(--border-radius);
    color: var(--danger-color);
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
}

.error-message p {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.error-message .btn {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* 加载状态增强 */
.loading {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.loading p {
    margin: 0.5rem 0;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.loading #loadingText {
    font-weight: bold;
    color: var(--primary-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .progress-info {
        padding: 0.75rem;
    }
    
    .progress-info p {
        font-size: 0.8rem;
    }
    
    .error-message {
        padding: 1.5rem;
    }
    
    .error-message i {
        font-size: 1.5rem;
    }
    
    .error-message p {
        font-size: 1rem;
    }
    
    .loading {
        padding: 1.5rem;
    }
    
    .loading i {
        font-size: 1.5rem;
    }
    
    .loading p {
        font-size: 1rem;
    }
}

/* 上传指引样式 */
.upload-guidelines {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f0f7ff;
    border-radius: var(--border-radius);
    border: 1px solid #e0f0ff;
}

.guideline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: #555;
    font-size: 0.9rem;
}

.guideline-item:not(:last-child) {
    border-bottom: 1px solid #e8f2ff;
}

.guideline-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.guideline-item .fas.fa-clock {
    color: #ff9800;
}

.guideline-item .fas.fa-file-video {
    color: #2196f3;
}

.guideline-item .fas.fa-check-circle {
    color: #4caf50;
}

.guideline-item strong {
    color: var(--dark-color);
    font-weight: 600;
}

/* 视频选择后的样式改进 */
.file-selected {
    background-color: #f8fbff;
    border-color: var(--primary-color);
}

.file-selected .upload-icon {
    color: var(--primary-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .upload-guidelines {
        padding: 0.75rem;
        margin-top: 1rem;
    }
    
    .guideline-item {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
    
    .guideline-item i {
        font-size: 1rem;
    }
}

/* 删除动作信息样式 - 不再使用 */

/* 删除响应式调整 - 不再使用 */

/* 动作名称输入框样式 */
.exercise-input-section {
    margin: 1.5rem 0;
    padding: 0 1rem;
}

.exercise-input-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.exercise-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.exercise-input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.exercise-input-label i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.exercise-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.exercise-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
    color: var(--dark-color);
}

.btn-recognize {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-recognize:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.exercise-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.exercise-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.exercise-input-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

.exercise-input-hint i {
    color: #ffc107;
    font-size: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .exercise-input-section {
        padding: 0 0.5rem;
        margin: 1rem 0;
    }
    
    .exercise-input-container {
        padding: 1rem;
    }
    
    .exercise-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .exercise-input {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .btn-recognize {
        width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .exercise-input-hint {
        font-size: 0.8rem;
    }
}

/* 模型选择切换开关样式 */
.model-toggle-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    min-width: 100px;
}

.toggle-label i {
    color: var(--secondary-color);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 15px;
    transition: var(--transition);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--secondary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-status {
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.toggle-status.off {
    color: #6c757d;
}

.toggle-status.on {
    color: var(--secondary-color);
}

.toggle-desc {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

@media (max-width: 768px) {
    .model-toggle-section {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    .toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .toggle-label {
        min-width: auto;
    }
    
    .toggle-switch {
        align-self: center;
    }
    
    .toggle-info {
        align-self: center;
        text-align: center;
    }
}

.btn.fast-analysis {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: white;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.btn.fast-analysis:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
    border-color: #1e7e34;
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(-1px);
}

.btn.fast-analysis:active {
    transform: translateY(0);
}

.btn.fast-analysis::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.fast-analysis:hover::before {
    left: 100%;
}

/* 动画效果 */
@keyframes fastAnalysisGlow {
    0%, 100% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.5), 0 0 20px rgba(40, 167, 69, 0.3);
    }
}

.btn.fast-analysis {
    animation: fastAnalysisGlow 2s ease-in-out infinite;
}

/* 需要指定动作名称的按钮样式 */
.btn.need-exercise-name {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    border-color: #ffc107;
    color: #212529;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
    position: relative;
    cursor: not-allowed;
}

.btn.need-exercise-name:hover {
    background: linear-gradient(135deg, #e0a800 0%, #e85d04 100%);
    border-color: #e0a800;
    box-shadow: 0 6px 12px rgba(255, 193, 7, 0.4);
    transform: none; /* 禁用悬停效果 */
}

.btn.need-exercise-name:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* 警告动画效果 */
@keyframes needExerciseNamePulse {
    0%, 100% {
        box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 0 4px 8px rgba(255, 193, 7, 0.5), 0 0 15px rgba(255, 193, 7, 0.4);
    }
}

.btn.need-exercise-name {
    animation: needExerciseNamePulse 2s ease-in-out infinite;
}

/* 聊天区域样式 */
.chat-section {
    margin-top: 2rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.chat-header:hover {
    background-color: #e9ecef;
}

/* 对话头部操作按钮容器 */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 对话操作按钮样式 */
.chat-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.chat-action-btn:hover {
    background-color: rgba(108, 117, 125, 0.2);
    color: #495057;
    transform: scale(1.05);
}

.chat-action-btn:active {
    transform: scale(0.95);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .chat-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .chat-header-actions {
        gap: 0.75rem;
    }
}

.chat-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header h3 i {
    color: var(--primary-color);
}

.chat-container {
    max-height: 500px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.chat-container.collapsed {
    max-height: 0;
    overflow: hidden;
}

/* 切换指示器样式 */
.chat-toggle-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.chat-toggle-indicator:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.chat-toggle-indicator i {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

/* 图标旋转由JavaScript控制 */

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: #fafbfc;
    scroll-behavior: smooth;
}

.chat-message {
    margin-bottom: 1rem;
    animation: fadeInMessage 0.3s ease;
}

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

.chat-message.user {
    text-align: right;
}

.chat-message.assistant {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
}

.user .message-bubble {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant .message-bubble {
    background-color: #e9ecef;
    color: var(--dark-color);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #e9ecef;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    margin: 0 2px;
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #e9ecef;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-height: 44px;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-button:hover {
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* Markdown内容样式 */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.message-bubble p {
    margin: 0.5rem 0;
}

.message-bubble ul,
.message-bubble ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-bubble pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.message-bubble code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.assistant .message-bubble pre {
    background-color: #f8f9fa;
}

.assistant .message-bubble code {
    background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-section {
        margin-top: 0.75rem; /* 减少顶部间距 */
        border-radius: 0;
    }
    
    .chat-container {
        max-height: calc(100vh - 280px); /* 稍微增加高度 */
    }
    
    .chat-messages {
        height: calc(100vh - 380px); /* 稍微增加高度 */
        padding: 0.75rem; /* 减少内边距 */
    }
    
    .message-bubble {
        max-width: 90%; /* 增加最大宽度 */
        padding: 0.75rem 1rem; /* 调整内边距 */
        font-size: 1rem; /* 保持正常字体大小 */
        line-height: 1.6;
    }
    
    .message-bubble h1,
    .message-bubble h2,
    .message-bubble h3 {
        margin: 0.5rem 0 0.25rem 0; /* 减少标题间距 */
    }
    
    .message-bubble p {
        margin-bottom: 0.6rem; /* 减少段落间距 */
    }
    
    .message-bubble ul,
    .message-bubble ol {
        margin: 0.4rem 0 0.6rem 0; /* 优化列表间距 */
        padding-left: 1.25rem; /* 减少缩进 */
    }
}

/* 访客按钮样式 */
.guest-buttons {
    display: flex;
    gap: 0.75rem; /* 稍微增加间距 */
    align-items: center;
}

/* 统一导航栏按钮尺寸 */
.guest-buttons .btn {
    min-width: 90px;
    text-align: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* 边框按钮样式 */
.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #f8f9fa;
    color: var(--dark-color);
}

.modal-body {
    padding: 1.5rem;
}

.btn-block {
    width: 100%;
}

.switch-form {
    text-align: center;
    margin-top: 1rem;
    color: #6c757d;
}

.switch-form a {
    color: var(--primary-color);
    text-decoration: none;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* 登录提醒模态框样式 */
.login-reminder-modal {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

.login-reminder-content {
    padding: 2rem;
}

.login-reminder-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-reminder-content h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.login-reminder-content p {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 统一弹窗按钮尺寸 */
.modal-buttons .btn {
    flex: 1; /* 让按钮平分空间 */
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px; /* 更圆润的边角 */
}

/* 调整次要按钮（取消）的样式 */
.btn-secondary {
    background-color: #e9ecef; /* 浅灰色背景 */
    color: #495057; /* 深灰色文字 */
    border-color: #e9ecef;
}

.btn-secondary:hover {
    background-color: #dee2e6; /* 悬停时加深 */
    border-color: #dee2e6;
}

/* 响应式模态框 */
@media (max-width: 576px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .btn {
        margin-bottom: 0.5rem;
    }
}

/* 确保分析内容区域的加载状态有合适的高度 */
.analysis-content .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

/* 当分析内容只有少量文字时，确保占满容器高度 */
.analysis-content > * {
    min-height: 100%;
}

/* 让视频播放器和分析结果区域高度匹配 */
.video-player {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 400px;
}

/* 确保流式分析容器填满整个分析结果区域 */
#analysisContent {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 当流式分析完成后，确保内容占满空间 */
#analysisContent > .streaming-analysis {
    flex: 1;
    min-height: 0; /* 允许收缩 */
}

/* 删除exercise-info相关样式 - 不再使用 */

