:root {
  --bg: #fdf8f4;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a5e;
  --line: #ecdcd2;
  --accent: #e8590c;
  --accent-dark: #c94a08;
  --accent-soft: #fff1e6;
  --green: #2f9e44;
  --green-soft: #ebfbee;
  --red: #c92a2a;
  --red-soft: #fff5f5;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(43, 33, 24, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.linklike { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Header */
.site-header {
  background: linear-gradient(135deg, #ff922b, #e8590c);
  color: #fff;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { color: #fff; font-size: 1.5rem; font-weight: 800; text-decoration: none; letter-spacing: 0.5px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.price-badge {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.lang-toggle { display: flex; background: rgba(0, 0, 0, 0.18); border-radius: 999px; padding: 3px; }
.lang-toggle button {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.75;
}
.lang-toggle button.active { background: #fff; color: var(--accent-dark); opacity: 1; }

/* Hero + steps */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: 1.35rem; margin: 0; }
.steps {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 20px 0;
  justify-content: space-between;
}
.steps li {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 3px solid var(--line);
  padding-top: 8px;
}
.steps li.active { color: var(--accent-dark); border-top-color: var(--accent); font-weight: 700; }
.steps li.done { color: var(--green); border-top-color: var(--green); }
.step-num {
  display: inline-block;
  width: 22px; height: 22px; line-height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 5px;
}
.steps li.active .step-num { background: var(--accent); color: #fff; }
.steps li.done .step-num { background: var(--green); color: #fff; }

/* Panels */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 28px;
}
.panel h2 { margin-top: 0; font-size: 1.25rem; }
.panel h3 { font-size: 1.05rem; margin: 22px 0 8px; }

/* Notice / error */
.notice {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}
.notice.error { background: var(--red-soft); color: var(--red); border: 1px solid #ffc9c9; }
.notice.info { background: var(--green-soft); color: #2b8a3e; border: 1px solid #b2f2bb; }

/* Upload */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: #fffaf7;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { font-size: 2.4rem; }
.photo-preview {
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

/* Forms */
.field-label { display: block; font-weight: 700; margin: 18px 0 8px; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { resize: vertical; }
.blessing-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; }

/* Style grid */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.style-card {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.style-card .emoji { font-size: 1.7rem; display: block; margin-bottom: 4px; }
.style-card:hover { border-color: var(--accent); }
.style-card.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }

/* Summary + price */
.summary { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.summary-photo { width: 90px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.summary dl { margin: 0; }
.summary dl div { margin-bottom: 10px; }
.summary dt { font-size: 0.8rem; color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; word-break: break-word; }
.price-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.price-row.total { font-size: 1.15rem; }

/* Buttons */
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { background: #e9c5ae; cursor: wait; }
.btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.secondary:hover { border-color: var(--accent); }
.btn.small { padding: 8px 16px; font-size: 0.88rem; }
.btn.whatsapp { background: #25d366; color: #fff; }
.btn.whatsapp:hover { background: #1da851; }

/* Generating */
.generating { text-align: center; padding: 24px 0 8px; }
.spinner {
  width: 46px; height: 46px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.result-card {
  border: 3px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  position: relative;
}
.result-card img { width: 100%; display: block; aspect-ratio: 2 / 3; object-fit: cover; }
.result-card.selected { border-color: var(--accent); }
.result-card.selected::after {
  content: "✓";
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px; line-height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  text-align: center;
}
.email-row { display: flex; gap: 10px; }
.email-row input { flex: 1; }

hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Footer */
.site-footer { text-align: center; padding: 10px 0 36px; }

@media (max-width: 560px) {
  .panel { padding: 18px; }
  .steps li { font-size: 0.72rem; }
  .step-num { margin-right: 0; display: block; margin: 0 auto 4px; }
  .email-row { flex-direction: column; }
  .summary { flex-direction: column; }
}
