:root {
  --primary-gradient: linear-gradient(135deg, #9733EE, #DA22FF);
  --primary-color: #9733EE;
  --secondary-color: #DA22FF;
  --text-color: #333;
  --bg-color: #f9f9f9;
  --card-bg: #ffffff;
  --border-radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --heading-font: 'Nunito', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --body-font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--body-font);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

header {
  background: var(--primary-gradient);
  padding: 20px;
  text-align: center;
}

header h1 {
  color: white;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--heading-font);
}

main {
  padding: 20px;
}

/* 新增：内容包装器，用于左右布局 */
.content-wrapper {
  display: flex;
  gap: 20px;
}

/* 新增：左侧面板 */
.left-panel {
  flex: 1;
  max-width: 450px;
}

/* 新增：右侧面板 */
.right-panel {
  flex: 2;
}

.input-section {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-family: var(--heading-font);
}

textarea {
  width: 100%;
  height: 100px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: vertical;
  font-size: 16px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

select, input[type="range"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: white;
  font-size: 16px;
}

.steps-setting {
  display: flex;
  flex-direction: column;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-button {
  background: white;
  color: var(--text-color);
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-family: var(--body-font);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: auto;
  margin-bottom: 0;
}

.toggle-button:hover {
  background: var(--primary-gradient);
  color: white;
  border: 1px solid transparent;
}

.toggle-button.active {
  background: var(--primary-gradient);
  color: white;
  border: 1px solid transparent;
}

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

button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 18px;
  font-family: var(--heading-font);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(151, 51, 238, 0.3);
}

button:active {
  transform: translateY(0);
}

.result-section {
  height: 100%;
  min-height: 500px;
  border: 2px dashed #ddd;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#loading {
  text-align: center;
  color: #888;
}

/* 在文件末尾添加以下样式 */

/* 图片居中显示 */
#result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#result-image {
  max-width: 100%;
  max-height: 600px;
  border-radius: 8px;
  margin-bottom: 15px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* 修改瀑布流图片展示区域样式 */
.gallery-section {
  margin-top: 40px;
  width: 100%;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.gallery-section h2 {
  font-family: var(--heading-font);
  color: var(--text-color);
  margin-bottom: 20px;
  text-align: center;
}

.waterfall-gallery {
  column-count: 4; /* 修改为4列 */
  column-gap: 20px;
  width: 100%;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  display: block;
}

/* 修改图片信息样式，使其只在鼠标悬停时显示 */
.gallery-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  font-size: 14px;
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  white-space: pre-wrap;
  word-break: break-word;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 70%;
  overflow-y: auto;
}

.gallery-item:hover .gallery-item-info {
  transform: translateY(0);
}

/* 响应式布局调整 */
@media (max-width: 1200px) {
  .waterfall-gallery {
    column-count: 3; /* 大屏幕降为3列 */
  }
}

@media (max-width: 900px) {
  .waterfall-gallery {
    column-count: 2; /* 中等屏幕降为2列 */
  }
  
  .content-wrapper {
    flex-direction: column;
  }
  
  .left-panel {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .waterfall-gallery {
    column-count: 1;
  }
}

#prompt-info {
  width: 100%;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
  font-size: 14px;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

/* 响应式布局 */
@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column;
  }
  
  .left-panel {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .settings-section {
    grid-template-columns: 1fr;
  }
}