/* style.css */
:root {
    --primary-color: #1a73e8;
    --accent-color: #1a73e8;
    --error-color: #d93025;
    --success-color: #2e7d32;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 2rem auto;
    padding: 0 20px;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.main-container {
    max-width: 90vw;
    margin: 2rem auto;
    padding: 0 20px;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    text-align: center;
}

.content-wrapper {
    display: flex;
    gap: 2rem;
    width: 100%;
    min-height: calc(100vh - 10rem);
}

.upload-container {
    flex: 0 0 400px;
}

.report-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container-inner {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 2rem;
    height: 100%;
}

.api-key-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.api-key-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.api-key-section input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.upload-section {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.upload-section:hover {
    background: #eef7ff;
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin: 1.5rem 0;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 14px 28px;
    background: var(--accent-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.file-input-label:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

button {
    padding: 14px 28px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: bold;
    margin: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

button:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#file-list {
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f0f7ff;
    border-radius: 8px;
    margin-bottom: 8px;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s;
}

.file-item:hover {
    background: #e1eeff;
    transform: translateX(5px);
}

.file-item span {
    flex: 1;
    font-size: 0.95em;
    text-align: left;
    word-break: break-all;
    padding-right: 10px;
}

.file-item .remove-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    transition: all 0.2s;
}

.file-item .remove-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.loading {
    display: none;
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 25px;
    margin: 20px 0;
    background: #f9f9f9;
    border-radius: 10px;
}

.error {
    color: var(--error-color);
    margin: 1rem 0;
    text-align: center;
    padding: 15px;
    background: #ffebee;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.success {
    color: var(--success-color);
    margin: 1rem 0;
    text-align: center;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.loader {
    margin: 25px auto;
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#result-area {
    display: none;
    margin-top: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

#report-viewer {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    height: 100%;
    border: 1px solid #eaeaea;
    box-sizing: border-box;
}

#report-viewer iframe {
    width: 100%;
    height: 100%;
    min-height: 600px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

#download-btn {
    background: #4caf50;
    min-width: 200px;
}

#view-btn {
    background: #2196f3;
    min-width: 200px;
}

.footer-note {
    margin-top: 30px;
    color: #777;
    font-size: 0.9rem;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .upload-container {
        flex: none;
        width: 100%;
        max-width: none;
    }
    
    #report-viewer {
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .container-inner {
        padding: 1.5rem;
    }
    
    .upload-section {
        padding: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    button {
        width: 100%;
        margin: 5px 0;
    }
    
    .file-input-label {
        padding: 12px 20px;
    }
}
    
