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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a1628;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ===== 布局 ===== */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

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

.header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.header .subtitle {
  color: #888;
  margin-top: 6px;
  font-size: 14px;
}

/* ===== 模式切换 ===== */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.mode-tab {
  padding: 8px 24px;
  border: 1px solid #1e3355;
  border-radius: 8px;
  background: transparent;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.mode-tab:hover:not(.active) {
  border-color: #555;
  color: #ddd;
}

/* ===== 主内容：左右两栏 ===== */
.main {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.input-panel {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-panel {
  flex: 1;
  min-height: 400px;
  background: #111f38;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ===== 表单 ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  color: #aaa;
  font-weight: 500;
}

textarea {
  width: 100%;
  height: 100px;
  background: #111f38;
  border: 1px solid #1e3355;
  border-radius: 8px;
  padding: 12px;
  color: #e0e0e0;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus {
  border-color: #2563eb;
}

/* ===== 上传区 ===== */
.upload-area {
  background: #111f38;
  border: 2px dashed #1e3355;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 80px;
}

.upload-area:hover {
  border-color: #3b82f6;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #666;
  font-size: 13px;
}

.upload-icon {
  font-size: 28px;
}

.preview-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
}

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

.preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 比例选择 ===== */
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ratio-btn {
  padding: 10px 0;
  background: #111f38;
  border: 1px solid #1e3355;
  border-radius: 6px;
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ratio-btn.active {
  background: #1e3a6e;
  border-color: #2563eb;
  color: #fff;
}

.ratio-btn.active {
  background: #1e3a6e;
  border-color: #2563eb;
  color: #60a5fa;
}

.ratio-btn:hover:not(.active) {
  border-color: #3b82f6;
}

/* ===== 生成数量 ===== */
.count-selector {
  display: flex;
  gap: 6px;
}

.count-btn {
  flex: 1;
  padding: 8px;
  background: #111f38;
  border: 1px solid #1e3355;
  border-radius: 6px;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.count-btn.active {
  background: #1e3a6e;
  border-color: #2563eb;
  color: #fff;
}

/* ===== 生成按钮 ===== */
.generate-btn {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.generate-btn:hover {
  background: #1d4ed8;
}

.generate-btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* ===== 状态提示 ===== */
.status {
  font-size: 13px;
  min-height: 20px;
  text-align: center;
}

.status.loading {
  color: #60a5fa;
}

.status.error {
  color: #f87171;
}

.status.success {
  color: #4ade80;
}

/* ===== 结果展示 ===== */
.result-placeholder {
  color: #555;
  font-size: 14px;
}

.result-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
  width: 100%;
}

.result-grid.show {
  display: grid;
}

.result-card {
  background: #1a2d4f;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.result-card img {
  width: 100%;
  display: block;
}

.result-card .download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.result-card .download-btn:hover {
  background: rgba(37,99,235,0.8);
}

/* ===== 响应式 ===== */
@media (max-width: 800px) {
  .main {
    flex-direction: column;
  }
  .input-panel {
    width: 100%;
  }
}
