:root {
  --bg: #f0f4f1;
  --card: #ffffff;
  --ink: #1a2e1f;
  --muted: #5a6b5e;
  --accent: #07c160;
  --accent-dark: #06ad56;
  --border: #d8e0da;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(26, 46, 31, 0.06);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 10% -20%, #d4f0dd 0%, transparent 50%),
    radial-gradient(ellipse 90% 60% at 100% 0%, #e8f5ec 0%, transparent 45%),
    var(--bg);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  margin-bottom: 20px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.steps {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  flex-wrap: wrap;
}

.steps li {
  flex: 1;
  min-width: 4.5rem;
  text-align: center;
  padding: 8px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.input-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--muted);
}

.mode-btn.active {
  border-color: var(--accent);
  background: #f0faf4;
  color: var(--ink);
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.15);
}

.style-panel {
  margin: 0 0 16px;
  padding: 12px 12px 4px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fafcfb;
}

.style-panel legend {
  padding: 0 4px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.choice {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 6.5rem;
}

.choice.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
  background: #f0faf4;
}

.choice .title {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
}

.choice .hint {
  display: block;
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.choice-row.colors .choice {
  min-width: auto;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.field-label {
  margin: 4px 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.hint.tiny {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.choice-row.sizes .choice {
  min-width: 3rem;
  padding: 8px 12px;
  text-align: center;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.result-actions .btn-primary {
  flex: 1;
  min-width: 10rem;
}

.result-actions .btn-secondary {
  flex: 0 0 auto;
}

.preview figure[data-img-index]::before {
  content: "图" attr(data-img-index);
  display: inline-block;
  margin: 0 auto 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 20px;
  margin-bottom: 16px;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 200px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  line-height: 1.6;
  background: #fafcfb;
}

textarea:focus {
  outline: 2px solid rgba(7, 193, 96, 0.35);
  border-color: var(--accent);
}

.images-block {
  margin: 16px 0;
}

.images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.images-head .label {
  margin: 0;
}

.thumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thumb-list li {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f5f7f6;
}

.thumb-list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-list .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  font-size: 1.05rem;
  padding: 14px 22px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-secondary {
  background: #eef6f0;
  color: var(--ink);
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn-file {
  cursor: pointer;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.error {
  color: var(--danger);
}

.section-title {
  margin: 16px 0 10px;
  font-size: 1.05rem;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hint.success {
  color: var(--accent-dark);
  font-weight: 600;
}

.preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  overflow-x: auto;
}

.insert-guide {
  margin-top: 20px;
  padding: 14px;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #f0d9a0;
}

.insert-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insert-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  border: 1px solid var(--border);
}

.insert-list .num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.insert-list img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.insert-list .meta {
  flex: 1;
  font-size: 0.9rem;
  color: var(--muted);
}

.advanced {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.markdown-out {
  margin: 10px 0 0;
  padding: 12px;
  background: #f5f7f6;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  color: var(--ink);
}

@media (min-width: 640px) {
  .page {
    padding-top: 36px;
  }

  .card {
    padding: 22px 22px 24px;
  }
}
