:root {
  --red: #7a0c1e;
  --gold: #d4af37;
  --gold-soft: #ffe9a8;
  --bg: #1a0608;
  --card: #2a0d12;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #3a0a14, var(--bg));
  color: #fff3d0;
  min-height: 100vh;
}

.site-header {
  padding: 22px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.brand { display: inline-flex; align-items: center; gap: 14px; }
.emblem {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #fff; font-size: 26px; font-weight: bold;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}
.site-header h1 { font-size: 22px; letter-spacing: 2px; }
.site-header p { font-size: 13px; opacity: 0.8; margin-top: 2px; }

.container { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }

.step { margin-bottom: 28px; }
.step h2 {
  font-size: 17px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.step-no {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: var(--red);
  display: grid; place-items: center; font-size: 14px; font-weight: bold;
}

/* 模板卡片 */
.template-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.template-card {
  border: 2px solid transparent; border-radius: 14px; overflow: hidden;
  background: var(--card); cursor: pointer; transition: 0.2s;
}
.template-card:hover { transform: translateY(-3px); }
.template-card.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.25); }
.template-card img { width: 100%; height: auto; display: block; background: var(--card); }
.template-card .meta { padding: 10px 12px; }
.template-card .meta b { font-size: 14px; }
.template-card .meta p { font-size: 12px; opacity: 0.75; margin-top: 3px; }

/* 上传区 */
.drop-zone {
  display: block; border: 2px dashed rgba(212,175,55,0.5);
  border-radius: 16px; padding: 30px; text-align: center;
  cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.02);
}
.drop-zone.drag { border-color: var(--gold); background: rgba(212,175,55,0.08); }
.upload-hint .plus { font-size: 40px; color: var(--gold); }
.upload-hint p { margin-top: 8px; font-size: 14px; }
.upload-hint .sub { font-size: 12px; opacity: 0.65; margin-top: 4px; }
.preview-img { max-width: 100%; max-height: 320px; border-radius: 12px; margin: 0 auto; display: block; }

/* 按钮 */
.btn-primary, .btn-secondary {
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 15px; padding: 13px 28px; font-weight: bold; transition: 0.2s;
}
.btn-primary { background: linear-gradient(135deg, var(--gold), #b8860b); color: #2a0d12; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { background: transparent; border: 1.5px solid var(--gold); color: var(--gold-soft); }
.btn-primary:hover:not(:disabled), .btn-secondary:hover { transform: translateY(-2px); }

/* 进度 */
.progress-wrap { margin-top: 16px; }
.progress-bar {
  height: 8px; border-radius: 999px; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width 0.3s;
}
.progress-text { display: block; margin-top: 8px; font-size: 13px; opacity: 0.8; }

/* 结果 */
.result-card { text-align: center; }
#resultCanvas {
  max-width: 100%; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.site-footer { text-align: center; padding: 18px; font-size: 12px; opacity: 0.6; }
