/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 60px 0 40px;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: #888888;
    margin-bottom: 20px;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* 上传区域 */
.upload-section {
    display: flex;
    justify-content: center;
}

.upload-area {
    width: 100%;
    max-width: 500px;
    height: 300px;
    border: 2px dashed #333333;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

.upload-area.dragover {
    border-color: #ffffff;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
}

.upload-icon {
    color: #666666;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: #ffffff;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #ffffff;
}

.upload-hint {
    font-size: 0.9rem;
    color: #666666;
    text-align: center;
}

/* 预览区域 */
.preview-section {
    margin-top: 40px;
}

.image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.original-image,
.transformed-image {
    text-align: center;
}

.original-image h3,
.transformed-image h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: #cccccc;
}

.original-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

.result-placeholder {
    width: 100%;
    height: 400px;
    border: 2px dashed #333333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    color: #666666;
    font-size: 1rem;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333333;
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 聊天区域 */
.chat-section {
    margin-top: 40px;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.05);
}

.chat-messages {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

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

.user-message {
    align-items: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-message .message-content {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    color: #ffffff;
    border: 1px solid #333333;
}

.user-message .message-content {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #000000;
}

.message-content ul {
    margin-top: 10px;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 5px;
}

/* 输入区域 */
.chat-input-container {
    padding: 20px 30px 30px;
    border-top: 1px solid #333333;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid #333333;
    border-radius: 20px;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: all 0.3s ease;
}

#chatInput:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

#chatInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-button {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

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

/* 下载按钮 */
.download-button {
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #000000;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-left: auto;
    margin-right: auto;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 40px 0 20px;
    color: #666666;
    font-size: 0.9rem;
    position: relative;
}

/* API设置按钮 */
.api-settings {
    position: absolute;
    right: 0;
    bottom: 20px;
}

.settings-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 1px solid #333333;
    border-radius: 20px;
    color: #cccccc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-button:hover {
    background: linear-gradient(145deg, #2a2a2a, #3a3a3a);
    border-color: #ffffff;
    color: #ffffff;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    margin: 10% auto;
    padding: 0;
    border: 1px solid #333333;
    border-radius: 16px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

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

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

.modal-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 500;
}

.close {
    color: #888888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cccccc;
    font-size: 0.95rem;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.api-section {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border-radius: 12px;
}

.api-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
}

.api-info {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border-radius: 12px;
    color: #aaaaaa;
    font-size: 0.9rem;
}

.api-info p {
    margin: 0 0 15px;
}

.api-info ul {
    margin: 15px 0;
    padding-left: 20px;
}

.api-info a {
    color: #80c0ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.api-info a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #333333;
    text-align: right;
}

.save-button {
    padding: 12px 24px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #000000;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.save-success {
    position: absolute;
    left: 30px;
    color: #44ff44;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .image-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chat-messages {
        padding: 20px;
    }
    
    .chat-input-container {
        padding: 20px;
    }
    
    .message-content {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .upload-area {
        height: 250px;
    }
    
    .result-placeholder {
        height: 300px;
    }
} 