@font-face {
  font-family: "Wandou Kaiti";
  src: url("/assets/fonts/KaitiSC-Regular.woff2?v=1") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

/* Keep legacy template declarations on the exact same embedded Kaiti face. */
@font-face {
  font-family: "Kaiti SC";
  src: url("/assets/fonts/KaitiSC-Regular.woff2?v=1") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  --green-950: #06281f;
  --green-900: #0b3d2e;
  --green-800: #145440;
  --green-100: #dfece4;
  --cream: #f8f3e8;
  --paper: #fffdf8;
  --gold: #d7a949;
  --gold-light: #f2d890;
  --ink: #183128;
  --muted: #6d7d75;
  --line: rgba(24, 49, 40, 0.13);
  --shadow: 0 24px 60px rgba(5, 42, 31, 0.12);
  --radius: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { width: 100%; max-width: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 8%, rgba(215, 169, 73, 0.18), transparent 28rem),
    linear-gradient(180deg, #f4eddf 0%, #fbf8f1 38%, #eef4ef 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

main { width: 100%; min-width: 0; }

button, input, textarea { max-width: 100%; font: inherit; }
button { cursor: pointer; }
img, canvas { max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(8, 122, 67, .34);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}
.ambient-one { width: 280px; height: 280px; background: rgba(40, 126, 92, 0.14); left: -120px; top: 35%; }
.ambient-two { width: 240px; height: 240px; background: rgba(218, 169, 73, 0.14); right: -100px; top: 65%; }

.topbar {
  width: 100%;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  min-width: 0;
  color: var(--green-950);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-logo {
  display: block;
  width: 112px;
  height: auto;
  flex: 0 0 auto;
}

.brand-event {
  padding-left: 11px;
  border-left: 1px solid rgba(24, 49, 40, .18);
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 46% 54%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green-900);
  box-shadow: inset -5px -4px 0 rgba(255, 255, 255, 0.12);
}

.engine-status {
  font-size: 12px;
  color: var(--green-800);
  border: 1px solid rgba(20, 84, 64, 0.2);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 7px 12px;
}
.top-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; }
.qr-entry { color: var(--green-800); font-size: 12px; font-weight: 700; text-decoration: none; padding: 7px 10px; }
.qr-entry:hover { text-decoration: underline; }

.section-shell { width: 100%; max-width: 1120px; min-width: 0; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 60px;
  padding-top: 48px;
  padding-bottom: 88px;
}
.hero > *, .hero-copy, .hero-visual { min-width: 0; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #a67623;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0;
  color: var(--green-950);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "STSong", serif;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 700;
  text-rendering: optimizeLegibility;
}

.hero h1 em { display: block; color: var(--green-800); font-style: normal; }
.no-wrap { display: inline-block; max-width: 100%; white-space: nowrap; }

.hero-lead {
  max-width: 590px;
  margin: 28px 0 30px;
  color: #53665e;
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions { display: flex; align-items: center; gap: 22px; }

.primary-button, .secondary-button, .generate-button {
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 26px;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button, .generate-button {
  color: #fff;
  background: var(--green-900);
  box-shadow: 0 12px 28px rgba(11, 61, 46, 0.22);
}
.primary-button:hover, .generate-button:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(11, 61, 46, 0.28); }
.primary-button:active, .generate-button:active { transform: translateY(0); }

.time-note { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.time-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(215, 169, 73, 0.15); }

.trust-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 28px; color: #78877f; font-size: 12px; }
.trust-row span::before { content: "✓"; color: var(--green-800); margin-right: 6px; font-weight: 800; }

.hero-visual { min-height: 480px; position: relative; display: grid; place-items: center; }
.hero-moon {
  position: relative;
  width: min(28vw, 350px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.72) 0 8%, transparent 9%),
    radial-gradient(circle at 62% 64%, rgba(174, 115, 37, 0.11) 0 13%, transparent 14%),
    radial-gradient(circle at 30% 70%, rgba(174, 115, 37, 0.08) 0 8%, transparent 9%),
    linear-gradient(145deg, #fff9d8, #edca70);
  box-shadow: 0 0 0 18px rgba(255, 249, 216, 0.16), 0 34px 90px rgba(170, 118, 32, 0.25);
}
.moon-word { font-family: "Songti SC", serif; color: rgba(90, 59, 20, 0.7); font-size: 76px; }
.moon-orbit { position: absolute; border: 1px solid rgba(11, 61, 46, 0.16); border-radius: 50%; transform: rotate(-18deg); }
.orbit-a { width: 440px; height: 270px; }
.orbit-b { width: 500px; height: 330px; transform: rotate(22deg); }
.floating-note { position: absolute; max-width: 56%; overflow-wrap: anywhere; color: var(--green-950); background: rgba(255, 253, 248, 0.88); backdrop-filter: blur(12px); padding: 12px 18px; border-radius: 14px; box-shadow: 0 12px 36px rgba(5, 42, 31, 0.13); font-size: 13px; }
.note-a { left: 0; top: 28%; }
.note-b { right: -2%; bottom: 25%; }
.stars { position: absolute; right: 2%; top: 16%; color: #b1802d; letter-spacing: 8px; }

.steps-strip {
  max-width: 1064px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--green-900);
  color: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.steps-strip div { min-width: 0; padding: 22px 26px; display: flex; align-items: baseline; gap: 12px; border-right: 1px solid rgba(255,255,255,.11); }
.steps-strip div:last-child { border-right: 0; }
.steps-strip strong { color: var(--gold-light); font-family: Georgia, serif; font-size: 22px; }
.steps-strip span { font-size: 14px; }

.maker { padding-top: 120px; padding-bottom: 110px; }
.section-heading { max-width: 680px; margin-bottom: 42px; }
.section-heading h2 { font-family: "Songti SC", serif; color: var(--green-950); font-size: clamp(34px, 5vw, 52px); margin: 0 0 14px; letter-spacing: -0.03em; }
.section-heading p { color: var(--muted); font-size: 17px; line-height: 1.7; margin: 0; }

fieldset { border: 0; padding: 0; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
.type-card { position: relative; min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.62); border-radius: 22px; padding: 24px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; cursor: pointer; transition: all 180ms ease; }
.type-card input, .theme-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.type-card:hover { transform: translateY(-2px); border-color: rgba(11,61,46,.35); }
.type-card.is-selected { color: #fff; background: var(--green-900); border-color: var(--green-900); box-shadow: 0 16px 32px rgba(11,61,46,.18); }
.type-icon { grid-row: 1 / span 2; width: 48px; height: 48px; border-radius: 50%; background: rgba(215,169,73,.16); color: var(--gold); display: grid; place-items: center; font-size: 22px; }
.type-card.is-selected .type-icon { background: rgba(255,255,255,.12); color: var(--gold-light); }
.type-card strong { font-size: 18px; align-self: end; }
.type-card small { opacity: .72; margin-top: 4px; }

.form-card { width: 100%; min-width: 0; margin-top: 20px; background: rgba(255,253,248,.84); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.86); border-radius: var(--radius); padding: 34px; box-shadow: 0 16px 45px rgba(26,57,45,.07); }
.form-card-title { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 26px; }
.form-card-title > span { font-family: Georgia, serif; color: #a67623; font-size: 15px; margin-top: 5px; }
.form-card-title h3 { margin: 0 0 6px; font-size: 21px; color: var(--green-950); }
.form-card-title p { margin: 0; color: #839088; font-size: 13px; }

.upload-zone { min-height: 250px; display: grid; place-items: center; position: relative; overflow: hidden; border: 1.5px dashed rgba(20,84,64,.28); border-radius: 20px; background: linear-gradient(135deg, rgba(223,236,228,.45), rgba(248,243,232,.72)); cursor: pointer; }
.upload-zone:hover { border-color: var(--green-800); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.upload-zone img { width: 100%; height: 360px; object-fit: contain; background: radial-gradient(circle at center, #edf3eb, #dfe9e2); }
.upload-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--green-900); }
.upload-empty b { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--green-900); color: white; font-size: 25px; font-weight: 400; }
.upload-empty small { color: var(--muted); }
.replace-photo { position: absolute; z-index: 3; right: 15px; bottom: 15px; border: 0; border-radius: 999px; padding: 9px 14px; color: white; background: rgba(6,40,31,.82); backdrop-filter: blur(8px); }
.privacy-notice { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; color: var(--green-900); background: rgba(8,122,67,.065); border: 1px solid rgba(8,122,67,.1); }
.privacy-notice > span { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; margin-top: 1px; border-radius: 50%; color: #fff; background: var(--green-800); font-size: 12px; font-weight: 800; }
.privacy-notice p { display: grid; gap: 3px; margin: 0; line-height: 1.5; }
.privacy-notice strong { font-size: 13px; }
.privacy-notice small { color: #74857d; font-size: 11px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dynamic-fields { display: grid; gap: 18px; margin-top: 18px; }
.field-rule { margin: 18px 0 0; padding: 11px 14px; display: flex; align-items: center; gap: 9px; border-radius: 12px; color: #6f7e76; background: rgba(8,122,67,.07); font-size: 12px; line-height: 1.5; }
.field-rule strong { flex: 0 0 auto; color: var(--green-800); }
.field { min-width: 0; display: grid; gap: 9px; }
.field > span { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; color: #345047; }
.field > span > span { min-width: 0; }
.field > span small { color: #96a29c; font-weight: 500; }
.field > span .char-count { flex: 0 0 auto; font-size: 11px; font-variant-numeric: tabular-nums; }
.field > span .char-count.is-near-limit { color: #a87316; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid rgba(24,49,40,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
  color: var(--ink);
  padding: 14px 15px;
  outline: none;
  resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus, .field textarea:focus { border-color: var(--green-800); box-shadow: 0 0 0 4px rgba(20,84,64,.09); background: #fff; }
.field input::placeholder, .field textarea::placeholder { color: #a8b1ac; }
.detail-hint { margin: 18px 0 0; color: #7e8c85; font-size: 12px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; }
.detail-hint strong { flex: 0 0 auto; color: #8a641d; background: rgba(242,216,144,.28); border-radius: 999px; padding: 2px 9px; }
.detail-hint strong.is-complete { color: var(--green-800); background: rgba(8,122,67,.10); }

.style-heading { margin-bottom: 14px; }
.orientation-status {
  margin: 0 0 20px;
  padding: 11px 14px;
  color: var(--green-800);
  background: rgba(8,122,67,.065);
  border: 1px solid rgba(8,122,67,.1);
  border-radius: 12px;
  font-size: 12px;
}
.theme-group { margin-top: 22px; opacity: .76; transition: opacity 180ms ease; }
.theme-group.is-recommended { opacity: 1; }
.theme-group-heading { min-width: 0; display: flex; align-items: baseline; gap: 10px; margin: 0 2px 12px; }
.theme-group-heading strong { color: var(--green-950); font-size: 16px; }
.theme-group-heading span { color: #839087; font-size: 12px; }
.theme-group-heading em { display: none; margin-left: auto; padding: 4px 9px; border-radius: 999px; color: #fff; background: var(--green-800); font-size: 10px; font-style: normal; }
.theme-group.is-recommended .theme-group-heading em { display: inline-block; }
.theme-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.theme-swatch {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 9px 9px 13px;
  cursor: pointer;
  background: #fff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.theme-swatch:hover { transform: translateY(-2px); border-color: rgba(20,84,64,.35); }
.theme-swatch.is-selected { border-color: var(--green-800); box-shadow: 0 0 0 3px rgba(20,84,64,.09), 0 12px 25px rgba(15,73,49,.10); }
.theme-swatch.is-selected::after { content: "✓"; position: absolute; top: 15px; right: 15px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green-900); font-size: 13px; font-weight: 900; box-shadow: 0 3px 10px rgba(6,40,31,.25); }
.theme-preview-wrap { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 12px; background: #f6f0e2; box-shadow: inset 0 0 0 1px rgba(24,49,40,.08); }
.theme-preview-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.theme-preview-wrap em { position: absolute; right: 7px; bottom: 7px; margin: 0; padding: 3px 7px; border-radius: 999px; color: rgba(255,255,255,.94); background: rgba(6,40,31,.72); backdrop-filter: blur(5px); font-size: 9px; font-style: normal; letter-spacing: .04em; }
.theme-name { min-width: 0; display: grid; gap: 3px; padding: 0 3px; }
.theme-name strong { color: var(--green-950); font-size: 14px; }
.theme-name small { color: #829088; font-size: 11px; }

.form-error { margin-top: 16px; padding: 12px 14px; border-radius: 12px; color: #842c22; background: #fff0ed; font-size: 13px; }
.generate-button { width: 100%; margin-top: 22px; min-height: 62px; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.generate-button b { font-size: 24px; font-weight: 400; }
.generate-button:disabled { opacity: .6; cursor: wait; transform: none; }

.result-section { padding-top: 105px; padding-bottom: 120px; }
.result-heading { margin-left: auto; margin-right: auto; text-align: center; }
.result-heading h2 span { display: block; white-space: nowrap; }
.result-layout { display: grid; grid-template-columns: minmax(310px, 500px) 1fr; align-items: start; gap: 48px; }
.card-stage { border-radius: 30px; padding: 18px; background: rgba(255,255,255,.55); box-shadow: var(--shadow); }
.card-stage img { width: 100%; display: block; border-radius: 20px; }
.result-panel { min-width: 0; background: rgba(255,253,248,.86); border-radius: 24px; padding: 28px; display: grid; gap: 18px; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.secondary-button { color: var(--green-900); border: 1px solid rgba(11,61,46,.2); background: white; }
.secondary-button:hover { background: var(--green-100); }
.text-button { border: 0; background: transparent; color: var(--green-800); padding: 10px; font-size: 13px; }
.text-button:hover { text-decoration: underline; }
.share-tip { color: #849089; font-size: 12px; line-height: 1.6; margin: 0; }
.share-link-box { border-radius: 14px; padding: 14px; background: rgba(223,236,228,.58); display: grid; gap: 8px; }
.share-link-box > span { color: #53665e; font-size: 12px; font-weight: 700; }
.share-link-box > .share-ready { color: var(--green-900); font-size: 14px; }
.share-url-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.share-link-box input { min-width: 0; border: 1px solid rgba(24,49,40,.13); border-radius: 10px; background: white; padding: 11px 12px; color: #53665e; font-size: 12px; }
.share-link-box button { border: 0; border-radius: 10px; color: white; background: var(--green-900); min-height: 44px; padding: 0 15px; font-weight: 700; }
.share-link-box small { color: #78877f; line-height: 1.55; }
.share-platform-tip { display: block; overflow-wrap: anywhere; }
.native-share-button { width: 100%; }
.share-divider { display: flex; align-items: center; gap: 9px; color: #93a099; font-size: 10px; }
.share-divider::before, .share-divider::after { content: ""; height: 1px; flex: 1; background: rgba(24,49,40,.10); }

.loading-layer { position: fixed; inset: 0; z-index: 20; min-height: 100dvh; display: grid; place-content: center; justify-items: center; background: rgba(6,40,31,.94); color: #fff; text-align: center; padding: 30px; }
.loading-layer[hidden] { display: none; }
.loading-layer strong { font-family: "Songti SC", serif; font-size: 24px; margin-top: 24px; }
.loading-layer span { color: rgba(255,255,255,.66); font-size: 13px; margin-top: 9px; }
.loader-moon { width: 88px; height: 88px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 50px rgba(242,216,144,.38); overflow: hidden; }
.loader-moon i { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--green-950); animation: moon-pass 1.55s ease-in-out infinite; }
@keyframes moon-pass { 0% { transform: translateX(-105%); } 50%, 100% { transform: translateX(105%); } }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); color: #fff; background: rgba(6,40,31,.92); border-radius: 999px; padding: 12px 18px; box-shadow: 0 14px 40px rgba(0,0,0,.18); font-size: 13px; }
.toast[hidden] { display: none; }
.save-image-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); background: rgba(3,27,20,.86); backdrop-filter: blur(8px); }
.save-image-modal[hidden] { display: none; }
.save-image-sheet { width: min(94vw, 480px); max-height: 96dvh; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-x: hidden; overflow-y: auto; border-radius: 24px; background: #fffdf7; box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.save-image-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--green-900); }
.save-image-head div { display: grid; gap: 3px; min-width: 0; }
.save-image-head strong { font-size: 17px; }
.save-image-head span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.save-image-head button { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 8px 12px; color: var(--green-900); background: #eaf3ec; font-weight: 700; }
.save-image-sheet img { display: block; flex: 0 0 auto; width: 100%; height: auto; max-height: none; object-fit: initial; border-radius: 15px; box-shadow: 0 8px 24px rgba(30,54,42,.14); -webkit-touch-callout: default; user-select: auto; }

footer { min-height: 190px; padding-bottom: env(safe-area-inset-bottom); background: var(--green-950); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
footer span { color: var(--gold-light); font-family: "Songti SC", serif; font-size: 21px; }
footer p { margin: 0; color: rgba(255,255,255,.58); font-size: 13px; }

@media (max-width: 820px) {
  .topbar { position: sticky; top: 0; z-index: 10; max-width: none; padding: calc(12px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); background: rgba(248,243,232,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(24,49,40,.07); }
  .brand { font-size: 12px; }
  .engine-status { padding: 6px 9px; }
  .section-shell { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 28px; padding-top: 54px; padding-bottom: 68px; }
  .hero-copy { width: 100%; text-align: center; }
  .hero h1 { font-size: clamp(34px, 6.4vw, 46px); }
  .hero-lead { font-size: 16px; margin: 22px auto 25px; }
  .hero-actions { justify-content: center; flex-direction: column; gap: 13px; }
  .trust-row { justify-content: center; gap: 8px 15px; }
  .hero-visual { width: 100%; min-height: 330px; overflow: hidden; }
  .hero-moon { width: 230px; }
  .moon-word { font-size: 56px; }
  .orbit-a { width: 305px; height: 190px; }
  .orbit-b { width: 300px; height: 190px; }
  .note-a { left: 1%; top: 20%; }
  .note-b { right: 1%; bottom: 18%; }
  .steps-strip { width: auto; margin-left: max(18px, env(safe-area-inset-left)); margin-right: max(18px, env(safe-area-inset-right)); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-strip div { padding: 17px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .steps-strip strong { font-size: 18px; }
  .maker { padding-top: 78px; padding-bottom: 80px; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2 { font-size: 36px; }
  .section-heading p { font-size: 15px; }
  .type-grid { gap: 10px; }
  .type-card { padding: 18px 14px; column-gap: 10px; }
  .type-icon { width: 40px; height: 40px; }
  .type-card strong { font-size: 16px; }
  .type-card small { font-size: 11px; }
  .form-card { border-radius: 22px; padding: 22px 18px; }
  .field input, .field textarea { font-size: 16px; }
  .field-grid { grid-template-columns: 1fr; gap: 16px; }
  .upload-zone { min-height: 210px; }
  .upload-zone img { height: 280px; }
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generate-button { position: sticky; z-index: 8; bottom: calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 15px 38px rgba(6,40,31,.28); }
  .result-section { padding-top: 76px; }
  .result-layout { grid-template-columns: 1fr; gap: 24px; }
  .card-stage { padding: 10px; border-radius: 23px; }
  .action-grid { grid-template-columns: 1fr; }
  .primary-button, .secondary-button, .generate-button, .text-button { min-height: 48px; }
  .share-url-row { grid-template-columns: 1fr; }
  .share-link-box input { min-height: 48px; font-size: 16px; }
}

@media (max-width: 600px) {
  .engine-status { display: none; }
  .brand-event { display: none; }
  .brand-logo { width: 102px; }
  .hero h1 { font-size: clamp(25px, 8.2vw, 37px); line-height: 1.14; letter-spacing: 0; }
  .hero h1 .no-wrap, .hero h1 em { display: block; max-width: 100%; white-space: nowrap; }
  .hero-lead { max-width: 34em; overflow-wrap: anywhere; }
  .theme-options { gap: 10px; }
}

@media (max-width: 420px) {
  .qr-entry { min-height: 44px; display: inline-flex; align-items: center; }
  .type-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(25px, 8.2vw, 34px); }
  .theme-group-heading { flex-wrap: wrap; gap: 4px 8px; }
  .theme-group-heading span { flex-basis: calc(100% - 62px); }
  .floating-note { font-size: 11px; padding: 10px 12px; }
  .steps-strip span { font-size: 12px; }
  .form-card-title h3 { font-size: 19px; }
  .detail-hint { flex-direction: column; gap: 6px; }
  .field-rule { align-items: flex-start; }
}

@media (max-width: 340px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 7px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-logo { width: 92px; }
  .qr-entry { padding-left: 6px; padding-right: 6px; }
  .section-shell { padding-left: 12px; padding-right: 12px; }
  .steps-strip { margin-left: 12px; margin-right: 12px; }
  .hero h1 { font-size: clamp(24px, 8.8vw, 30px); }
  .hero-moon { width: 205px; }
  .orbit-a { width: 250px; height: 155px; }
  .orbit-b { width: 245px; height: 150px; }
  .form-card { padding-left: 14px; padding-right: 14px; }
  .theme-options { grid-template-columns: 1fr; }
  .theme-preview-wrap { width: 104px; aspect-ratio: 3 / 4; }
  .theme-swatch { grid-template-columns: 104px minmax(0, 1fr); align-items: center; }
  .theme-name strong { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
