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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Microsoft YaHei', 'SimHei';
    background-color: #f5f7fa;
    color: #333;
}

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

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

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
}

/* Tab 样式 */
.tabs-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.tabs-list {
    display: flex;
    flex: 1;
    overflow-x: auto;
}

.tab-header {
    padding: 15px 20px;
    cursor: pointer;
    border-right: 1px solid #eee;
    position: relative;
    min-width: 120px;
    text-align: center;
}

.tab-header.active {
    background-color: white;
    font-weight: bold;
    border-bottom: 3px solid #3498db;
}

.tab-header:hover:not(.active) {
    background-color: #e9ecef;
}

.close-tab {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-tab:hover {
    color: #ff0000;
    background-color: #f8f9fa;
    border-radius: 50%;
}

.add-tab-btn {
    padding: 15px 20px;
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.add-tab-btn:hover {
    background: #2980b9;
}

.tabs-content {
    padding: 20px;
}

.tab-content {
    display: none;
}

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

/* 主内容样式 */
.main-content {
    display: flex;
    gap: 30px;
    height: calc(100vh - 250px);
}

.panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: auto;
}

.panel h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.upload-panel {
    flex: 1;
}

.control-panel {
    flex: 1;
}

.drop-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    margin-bottom: 20px;
}

.drop-area:hover, 
.drop-area.dragover {
    background-color: #e3f2fd;
    border-color: #2980b9;
}

.drop-area p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

#file-input {
    display: none;
}

.file-input {
    display: none;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.preview-item {
    position: relative;
    height: 120px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ecf0f1;
    outline: none;
}

#quantity-value {
    display: inline-block;
    width: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #3498db;
}

.prompts-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
}

.prompts-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#prompts-list {
    list-style-type: none;
}

.prompt-item {
    margin-bottom: 10px;
}

.prompt-text {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.prompt-text:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn.primary {
    background: #3498db;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn.secondary {
    background: #2ecc71;
    color: white;
}

.btn.secondary:hover:not(:disabled) {
    background: #27ae60;
}

.results-container {
    margin-top: 20px;
}

.results-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.result-item {
    position: relative;
    height: 120px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.result-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.download-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 10px;
    cursor: pointer;
}

/* Modal Styles */
.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;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

.close {
    position: absolute;
    top: 10px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

#preview-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 5px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .buttons {
        flex-direction: column;
    }
}