* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

/* 响应区域样式 */
.response-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    min-height: 200px;
}

/* 输入区域样式 */
.input-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.ai-avatar {
    font-size: 2rem;
    margin-right: 15px;
}

.ai-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ai-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.ai-status {
    font-size: 0.9rem;
    color: #666;
    margin-top: 2px;
}

.clear-response-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-response-btn:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

.response-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* 输入容器样式 */
.input-container {
    margin-bottom: 20px;
}

.textarea-wrapper {
    position: relative;
}

#textInput {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.send-btn:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
}

.send-btn.loading {
    background: #667eea;
    cursor: not-allowed;
}

.send-btn.loading svg {
    animation: spin 1s linear infinite;
}

.send-btn .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 图片预览样式 */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 控制按钮样式 */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.file-input-wrapper {
    position: relative;
    flex: 1;
}

#imageInput {
    display: none;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #48bb78;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
}

.file-input-label:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.camera-btn, .clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    flex: 1;
}

.camera-btn {
    background: #4299e1;
    color: white;
}

.camera-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.clear-btn {
    background: #f56565;
    color: white;
}

.clear-btn:hover {
    background: #e53e3e;
    transform: translateY(-2px);
}

/* 深度思考模式样式 */
.thinking-mode-section {
    padding: 15px;
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.thinking-mode-section.thinking-mode-active {
    background: transparent;
}

.thinking-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.thinking-checkbox {
    display: none;
}

.thinking-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #cbd5e0;
    border-radius: 12px;
    margin-right: 10px;
    transition: background 0.3s ease;
}

.thinking-checkbox:checked + .thinking-slider {
    background: #38b2ac;
}

.thinking-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.thinking-checkbox:checked + .thinking-slider::before {
    transform: translateX(26px);
}

.thinking-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #4a5568;
}

.thinking-description {
    margin-top: 8px;
    color: #718096;
    font-size: 0.9rem;
}

/* 相机模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.camera-container {
    text-align: center;
    margin-bottom: 20px;
}

#cameraVideo {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    background: #000;
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.capture-btn, .switch-camera-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.capture-btn {
    background: #48bb78;
    color: white;
}

.capture-btn:hover {
    background: #38a169;
}

.switch-camera-btn {
    background: #4299e1;
    color: white;
}

.switch-camera-btn:hover {
    background: #3182ce;
}

/* 响应内容样式 */
.user-input-section {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #2196f3;
}

.user-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1976d2;
}

.user-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.user-content {
    color: #333;
}

.user-text {
    margin-bottom: 10px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.user-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #2196f3;
}

/* AI响应样式 */
.thinking-section {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

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

.thinking-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.thinking-title {
    font-weight: 600;
    color: #4a5568;
}

.thinking-toggle {
    background: transparent;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.thinking-content {
    color: #4a5568;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
}

.answer-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.answer-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
}

.answer-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.answer-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #333;
}

/* 流式输出光标 */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #667eea;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 思考状态样式 */
.thinking-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thinking-dots {
    display: flex;
    gap: 2px;
}

.thinking-dots span {
    width: 4px;
    height: 4px;
    background: #667eea;
    border-radius: 50%;
    animation: thinking 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinking {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 错误消息样式 */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #feb2b2;
    margin: 10px 0;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        gap: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .input-section, .response-section {
        padding: 20px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .file-input-label, .camera-btn, .clear-btn {
        flex: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .camera-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .input-section, .response-section {
        padding: 15px;
    }
    
    #textInput {
        padding: 12px 40px 12px 12px;
    }
    
    .send-btn {
        padding: 6px 10px;
    }
}