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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
}

.container {
  width: 100%;
  max-width: 640px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* 顶部主角区 */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 36px 24px 32px;
  text-align: center;
  color: #fff;
}

.hero-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* 中间图像展示区 */
.canvas-area {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f9f9fc;
  position: relative;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 280px;
  border: 2px dashed #d0d0e0;
  border-radius: 14px;
  background: #fff;
  color: #aaa;
}

.placeholder-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.placeholder-text {
  font-size: 16px;
  color: #888;
  margin-bottom: 6px;
}

.placeholder-hint {
  font-size: 13px;
  color: #b0b0b0;
}

.result-image {
  max-width: 100%;
  max-height: 480px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.result-video {
  max-width: 100%;
  max-height: 480px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  background: #000;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #888;
  font-size: 14px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

/* 文本描述区 */
.input-area {
  padding: 20px 24px 12px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 10px;
}

.textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e8;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.6;
}

.textarea:focus {
  outline: none;
  border-color: #667eea;
}

.textarea::placeholder {
  color: #c0c0c8;
}

/* 参考图上传区 */
.upload-area {
  padding: 4px 24px 8px;
}

.upload-zone {
  border: 2px dashed #d0d0d8;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-zone:hover {
  border-color: #667eea;
  background: #f8f8ff;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.upload-placeholder p {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.upload-placeholder span {
  font-size: 12px;
  color: #aaa;
}

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

.image-preview {
  position: relative;
  display: inline-block;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  display: block;
}

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

.remove-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* 生成参数区 */
.options-area {
  padding: 4px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.option-title {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.option-title.ml {
  margin-left: 12px;
}

.select-control {
  padding: 8px 12px;
  border: 2px solid #e0e0e8;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-control:focus {
  outline: none;
  border-color: #667eea;
}

/* 底部操作区 */
.action-bar {
  padding: 12px 24px 28px;
  text-align: center;
}

.btn-group {
  display: flex;
  gap: 12px;
}

.btn-generate {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-image {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-video {
  background: linear-gradient(135deg, #f093fb 0%, #d55a8e 100%);
  color: #fff;
}

.btn-imgvideo {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #fff;
}

.btn-generate:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-generate:active:not(:disabled) {
  transform: scale(0.98);
}

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

.error-msg {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}
