:root {
  --primary: #0e7c6b;
  --primary-dark: #0a5f52;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f6f8f7;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}
.container { max-width: 880px; margin: 0 auto; padding: 20px; }

/* 顶栏 */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 12px 20px; display: flex; justify-content: space-between; align-items: center;
}
.topbar .brand { font-weight: 800; color: var(--primary); text-decoration: none; font-size: 18px; }
.topbar .user-area { font-size: 14px; color: var(--text-light); display: flex; gap: 12px; align-items: center; }
.topbar .user-area a { color: var(--primary); text-decoration: none; font-weight: 600; }
.credits-badge { background: #ecfdf5; color: var(--primary-dark); padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }

h1 { font-size: 28px; margin: 24px 0 8px; }
.subtitle { color: var(--text-light); margin-bottom: 24px; }
.step-label { font-weight: 700; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.step-num {
  background: var(--primary); color: #fff; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.optional { color: var(--text-light); font-weight: 400; font-size: 14px; }

/* 上传区 */
.dropzone {
  border: 2px dashed #b6cfc9; border-radius: var(--radius); background: #fff;
  padding: 36px 20px; text-align: center; cursor: pointer; transition: border-color .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #f0faf7; }
.dropzone .dz-title { font-weight: 700; font-size: 16px; }
.dropzone .dz-hint { color: var(--text-light); font-size: 13px; margin-top: 6px; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview-item { position: relative; width: 90px; height: 90px; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.preview-item .rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: #ef4444; color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
}

/* 风格卡片 */
.style-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.style-option {
  border: 2px solid var(--border); border-radius: var(--radius); padding: 10px;
  text-align: center; cursor: pointer; background: #fff; transition: border-color .15s;
}
.style-option:hover { border-color: #9fc5bd; }
.style-option.selected { border-color: var(--primary); background: #eff7f5; }
.style-option .style-thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 8px; }
.style-option .style-name { font-weight: 700; font-size: 14px; }
.style-option .style-desc { font-size: 12.5px; color: var(--text-light); margin-top: 4px; }

textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--primary); }

.btn-generate {
  display: block; width: 100%; margin-top: 16px; padding: 14px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
}
.btn-generate:disabled { opacity: .6; cursor: not-allowed; }

.status { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.status.ok { background: #ecfdf5; color: #065f46; }
.status.error { background: #fef2f2; color: #991b1b; }
.result-area { margin-top: 20px; text-align: center; }
.result-area img { max-width: 100%; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.result-actions { margin-top: 12px; display: flex; gap: 10px; justify-content: center; }
.btn-secondary {
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text);
}

/* 登录/注册页 */
.auth-card { max-width: 380px; margin: 60px auto; background: #fff; padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); }
.auth-card h1 { font-size: 22px; margin: 0 0 20px; }
.auth-card input {
  width: 100%; padding: 11px 12px; margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
.auth-card .btn-generate { margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-light); }
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-note { font-size: 12.5px; color: var(--text-light); margin-top: 14px; }

footer { text-align: center; color: var(--text-light); font-size: 13px; padding: 30px 20px; }
footer a { color: var(--text-light); }
