* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    padding: 20px;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex: 1;
    overflow: hidden;
}

.panel-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.parameters-panel {
    flex: 0 0 33.333%;
    min-width: 300px;
}

.generations-panel {
    flex: 1;
    min-width: 600px;
}

.panel-title {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border-radius: 4px 4px 0 0;
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid #3498db;
    border-bottom: none;
}

.module {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 0 4px 4px 4px;
    background-color: #f9f9f9;
    border-top: none;
}

.parameters-module {
    flex: 1;
    min-width: 300px;
    background-color: #f0f8ff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

.generations-module {
    flex: 1;
    min-width: 600px;
    background-color: #f9f9f9;
    overflow-y: auto;
}

.module h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    color: #34495e;
    font-size: 16px;
}

.generation-item {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.generation-item h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 16px;
}

.generation-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.generation-image-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.generation-image-item img {
    max-width: 150px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.generation-image-item button {
    padding: 8px 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generation-image-item button:hover {
    background-color: #219a52;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    margin-top: 30px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

input[type="checkbox"] {
    margin-right: 8px;
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #2980b9;
}

#loading {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.progress-container {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #3498db;
    border-radius: 10px;
    transition: width 0.3s ease;
}

#result {
    margin-top: 30px;
}

#image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

#image-container img {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.image-item {
    flex: 1 1 200px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.image-item button {
    padding: 8px 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.image-item button:hover {
    background-color: #219a52;
}

#download-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#download-btn:hover {
    background-color: #219a52;
}

/* 图片预览模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    background-color: transparent;
    margin: 5% auto;
    padding: 40px 20px;
    width: 80%;
    max-width: 1000px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.05);
}

.prev-button {
    left: -80px;
}

.next-button {
    right: -80px;
}

.modal-image {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    margin: 20px 0;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #f1f1f1;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 30px 10px;
    }
    
    .prev-button {
        left: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .next-button {
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .modal-image {
        max-width: 95%;
        max-height: 60vh;
    }
    
    .close {
        top: -30px;
        font-size: 28px;
    }
}

/* 点击图片时的指针样式和悬停效果 */
#image-container img,
.generation-images img {
    cursor: pointer;
    transition: all 0.3s ease;
}

#image-container img:hover,
.generation-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(52, 152, 219, 0.8);
    border-radius: 8px;
    cursor: zoom-in;
}

/* 为图片容器添加提示文字 */
.image-item,
.generation-image-item {
    position: relative;
    margin: 10px;
}

.image-item:hover::before,
.generation-image-item:hover::before {
    content: '点击放大预览';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
