:root {
  --ink: #292526;
  --muted: #897f7c;
  --rose: #c9847a;
  --rose-dark: #a7655d;
  --blush: #f3dfda;
  --paper: #fffdfa;
  --line: #e9ded9;
  --green: #56876c;
  --shadow: 0 24px 70px rgba(111, 75, 67, 0.13);
}
* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 14% 9%, #fff 0, transparent 25%),
    linear-gradient(135deg, #fffdfa 0%, #faf1ed 48%, #f3e1dd 100%);
}
.mobile-progress,
.download-notice {
  display: none;
}
button,
input,
select {
  font: inherit;
}
button,
.button,
label.button,
select,
input[type="range"],
input[type="color"] {
  touch-action: manipulation;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
.button:focus-within {
  outline: 3px solid rgba(201, 132, 122, 0.42);
  outline-offset: 3px;
}
.topbar {
  min-height: calc(70px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(24px, 6vw) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(153, 109, 99, 0.13);
  background: rgba(255, 253, 250, 0.76);
  backdrop-filter: blur(18px);
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.16em;
}
.brand span {
  font-size: 22px;
  color: var(--rose);
  margin-right: 9px;
}
.service-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.service-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d29a64;
  box-shadow: 0 0 0 4px rgba(210, 154, 100, 0.12);
}
.service-state i.ready {
  background: #6f9b7b;
  box-shadow: 0 0 0 4px rgba(111, 155, 123, 0.12);
}
.service-state i.mock {
  background: #cc9360;
}
.account-button {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
}
.auth-card input {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 16px;
}
.auth-switch {
  border: 0;
  background: transparent;
  color: var(--rose-dark);
  cursor: pointer;
  margin-top: 12px;
}
.account-assets { margin-top: 18px; text-align: left; border-top: 1px solid var(--line); padding-top: 14px; }
.account-assets h4 { margin: 0 0 8px; }
.account-work { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.redeem-row { display: flex; gap: 8px; margin-top: 14px; }
.redeem-row input { flex: 1; min-width: 0; margin: 0; }
.redeem-row .button { padding: 10px 12px; }
.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 50px 0 30px;
}
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}
.eyebrow,
.kicker {
  margin: 0 0 9px;
  color: var(--rose);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.intro h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 43px;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.intro h1 em {
  color: var(--rose);
  font-weight: 400;
}
.intro-copy {
  margin: 14px 0 0;
  color: var(--muted);
}
.privacy {
  border: 1px solid #ecd9d4;
  background: rgba(255, 250, 247, 0.8);
  border-radius: 30px;
  padding: 10px 15px;
  color: #947975;
  font-size: 11px;
}
.progress {
  list-style: none;
  margin: 0 0 20px;
  padding: 0 30px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.progress li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aea39f;
  position: relative;
  padding: 10px 0;
}
.progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 32%;
  height: 1px;
  background: #ddd1cc;
}
.progress b {
  font-size: 11px;
  font-weight: 600;
}
.progress span {
  font-size: 12px;
  font-weight: 600;
}
.progress small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 400;
}
.progress li.active,
.progress li.done {
  color: var(--ink);
}
.progress li.active b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rose);
  color: white;
}
.progress li.done b {
  color: var(--green);
}
.workspace {
  position: relative;
  min-height: 570px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.view {
  display: none;
  min-height: 570px;
  padding: 42px 50px;
}
.view.active {
  display: block;
  animation: appear 0.35s ease;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.upload-view {
  text-align: center;
}
.trial-card { display:flex; align-items:center; gap:12px; margin:22px 0 18px; padding:14px 16px; border-radius:16px; background:#f4e8db; color:#332c27; }
.trial-card .trial-mark { color:#c9847a; font-size:24px; }
.trial-card strong { display:block; font-size:15px; }
.trial-card em { color:#ad6259; font-style:normal; }
.trial-card small { display:block; margin-top:5px; color:#756e67; font-size:12px; line-height:1.4; }

.upload-visual {
  width: 205px;
  height: 205px;
  margin: 2px auto 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, #faece8, #efd2cc);
  position: relative;
  overflow: hidden;
}
.spark {
  position: absolute;
  color: #c77f74;
}
.spark.one {
  right: 37px;
  top: 35px;
  font-size: 25px;
}
.spark.two {
  left: 35px;
  top: 78px;
  font-size: 13px;
}
.avatar-art {
  position: absolute;
  left: 52px;
  bottom: -20px;
  width: 104px;
  height: 151px;
  border-radius: 54px 54px 28px 28px;
  background: #d79e95;
}
.avatar-art::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 22px;
  width: 67px;
  height: 78px;
  border-radius: 48% 48% 46% 46%;
  background: #f4d0c7;
}
.avatar-art::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 100px;
  height: 71px;
  border-radius: 55px 55px 16px 16px;
  background: #7c5e59;
  clip-path: polygon(0 0, 100% 0, 93% 100%, 77% 53%, 54% 35%, 28% 55%, 8% 100%);
}
.upload-view h2,
.view h2 {
  margin: 5px 0 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.upload-actions,
.inline-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 15px;
}
.upload-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin: 0 auto 8px;
  color: #8c6d67;
  font-size: 12px;
}
.upload-status[hidden] {
  display: none;
}
.upload-status-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #ead8d3;
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: upload-spin 0.8s linear infinite;
}
@keyframes upload-spin {
  to { transform: rotate(360deg); }
}
.upload-view.is-uploading .upload-choice,
.upload-view.is-uploading #demoButton {
  opacity: 0.55;
  pointer-events: none;
}
.button {
  border: 0;
  border-radius: 9px;
  padding: 12px 25px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}
.button:hover {
  transform: translateY(-1px);
}
.button.primary {
  color: white;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(41, 37, 38, 0.13);
}
.button.primary:hover {
  background: #151314;
}
.button.secondary {
  color: #5e5553;
  background: #fff;
  border: 1px solid #ded4cf;
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.wide {
  width: 100%;
  margin-top: 10px;
}
.photo-rules {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 20px;
  color: #7f9284;
  font-size: 11px;
}
.consent {
  width: min(570px, 90%);
  margin: 24px auto 0;
  color: #aaa09d;
  font-size: 10px;
  line-height: 1.7;
}
.split,
.result-layout,
.export-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  align-items: center;
  height: 100%;
}
.source-photo {
  width: min(350px, 100%);
  height: 455px;
  margin: auto;
  border-radius: 15px;
  background: #eee9e5;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(60, 43, 39, 0.12);
}
.source-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.face-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.face-box {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  background: rgba(41, 37, 38, 0.18);
  box-shadow: 0 0 0 2px rgba(41, 37, 38, 0.22);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}
.face-box span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(41, 37, 38, 0.76);
  font-size: 11px;
}
.face-box:hover,
.face-box.selected {
  border-color: #fff;
  background: rgba(201, 132, 122, 0.3);
  box-shadow:
    0 0 0 3px var(--rose),
    0 8px 25px rgba(41, 37, 38, 0.2);
}
.face-box.selected span {
  background: var(--rose);
}
.selection-hint {
  padding: 11px 13px;
  border-radius: 8px;
  background: #f7eae6;
  color: #966d66;
  font-size: 11px;
  line-height: 1.6;
}
.selection-hint.hidden {
  display: none;
}
.photo-tag,
.comparison > span {
  position: absolute;
  left: 13px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 20px;
  color: #615957;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(7px);
  font-size: 10px;
}
.grade {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #e6f0e9;
  color: var(--green);
  font: 600 25px Georgia;
}
.grade.warning {
  background: #f7eadc;
  color: #bb7b43;
}
.grade.danger {
  background: #f5dedc;
  color: #b75f58;
}
.quality-card .kicker {
  margin-top: 24px;
}
.checks {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee7e3;
  color: #6d6562;
  font-size: 12px;
}
.checks i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e7f0ea;
  color: var(--green);
  font-style: normal;
}
.checks li.warn i {
  background: #f7eadc;
  color: #b77c4b;
}
.quality-card .inline-actions {
  justify-content: flex-start;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
}
.text-button {
  border: 0;
  background: none;
  color: var(--rose-dark);
  cursor: pointer;
  font-size: 12px;
}
input[type="range"] {
  accent-color: var(--rose);
  width: 100%;
}
.generation-contract {
  max-width: 440px;
  margin: 12px 0 0;
  color: #9b908c;
  font-size: 10px;
  line-height: 1.6;
}
.generating-view {
  text-align: center;
  padding-top: 105px;
}
.loader {
  width: 130px;
  height: 130px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  position: relative;
}
.loader span {
  z-index: 2;
  color: var(--rose);
  font-size: 27px;
}
.halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #f2d7d1, transparent, #ca8980, #f2d7d1);
  animation: spin 2s linear infinite;
}
.halo::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--paper);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.task-progress {
  height: 5px;
  width: min(390px, 80%);
  margin: 28px auto 9px;
  border-radius: 10px;
  background: #ede4e0;
  overflow: hidden;
}
.task-progress i {
  display: block;
  width: 3%;
  height: 100%;
  background: var(--rose);
  transition: width 0.8s ease;
}
.generating-view > small {
  color: #a79c98;
}
.mode-badge {
  padding: 7px 11px;
  border: 1px solid #dcb6af;
  border-radius: 20px;
  color: #ac7168;
  font-size: 9px;
  letter-spacing: 0.12em;
}
.comparison {
  position: relative;
  width: min(100%, 500px);
  aspect-ratio: 5 / 7;
  margin: 0 auto;
  border-radius: 14px;
  background: #eae4df;
  overflow: hidden;
}
.comparison > img,
.after-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.after-clip {
  position: absolute;
  inset: 0 0 0 auto;
  width: 50%;
  overflow: hidden;
}
.after-clip img {
  position: absolute;
  right: 0;
  max-width: none;
  width: calc(200%);
}
.comparison input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}
.comparison i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  pointer-events: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
}
.comparison .before-label {
  left: 13px;
}
.comparison .after-label {
  left: auto;
  right: 13px;
}
.review-panel {
  align-self: center;
}
.review-panel h3 {
  font-size: 16px;
}
.candidate-head {
  margin-bottom: 11px;
}
.candidate-head .kicker {
  margin: 0 0 4px;
}
.candidate-head .muted {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}
.variant-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 23px;
}
.variant-card {
  overflow: hidden;
  padding: 0 0 8px;
  border: 1px solid #e3dad5;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.variant-card.selected {
  border-color: var(--rose);
  box-shadow: 0 0 0 2px rgba(201, 132, 122, 0.16);
}
.variant-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.76;
  object-fit: cover;
  background: #ede8e5;
}
.variant-card span {
  display: grid;
  gap: 3px;
  padding: 8px 8px 0;
}
.variant-card b {
  font-size: 11px;
}
.variant-card small {
  display: -webkit-box;
  overflow: hidden;
  color: #968b87;
  font-size: 9px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.review-list {
  margin: 20px 0;
}
.review-list label {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #eee7e3;
  color: #6d6562;
  font-size: 12px;
}
.review-list input {
  accent-color: var(--rose);
}
.notice {
  margin: 20px 0;
  padding: 14px;
  border-radius: 9px;
  background: #f7eee9;
  color: #8f716b;
  font-size: 11px;
  line-height: 1.7;
}
.canvas-wrap {
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: #e9e4e0;
  position: relative;
  overflow: hidden;
}
.canvas-wrap canvas {
  max-width: 82%;
  max-height: 92%;
  box-shadow: 0 12px 30px rgba(45, 35, 32, 0.17);
}
.export-controls > label {
  display: block;
  margin-bottom: 22px;
  color: #6c6461;
  font-size: 12px;
}
.export-controls select,
.custom-size input {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid #ddd2cd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.custom-size {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.custom-size.hidden {
  display: none;
}
.background-control {
  margin: 21px 0;
}
.background-control > span {
  display: block;
  margin-bottom: 10px;
  color: #6c6461;
  font-size: 12px;
}
.swatches {
  display: flex;
  align-items: center;
  gap: 12px;
}
.swatch {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 1px solid #d8d0cc;
  background: var(--swatch);
  cursor: pointer;
}
.swatch.selected {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}
.swatches input[type="color"] {
  width: 31px;
  height: 31px;
  border: 0;
  padding: 0;
  background: none;
}
.export-info {
  display: flex;
  justify-content: space-between;
  margin: 24px 0 10px;
  padding: 12px 0;
  border-top: 1px solid #eee7e3;
  color: #8f8582;
  font-size: 10px;
}
.print-options {
  margin: 18px 0 8px;
  padding: 14px;
  border: 1px solid #e7ddd8;
  border-radius: 11px;
  background: #fffdfc;
}
.print-options legend {
  padding: 0 5px;
  color: #675f5c;
  font-size: 12px;
  font-weight: 700;
}
.print-options p {
  margin: 0 0 10px;
  color: #978b87;
  font-size: 10px;
  line-height: 1.55;
}
.print-options label {
  display: block;
  margin-top: 9px;
  color: #6c6461;
  font-size: 11px;
}
.print-options select,
.print-options input {
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid #ddd2cd;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
.print-preview {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.print-preview.hidden { display: none; }
#downloadPrintButton.hidden { display: none; }
.print-preview canvas {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  background: #f5f1ef;
  box-shadow: 0 5px 16px rgba(45, 35, 32, 0.13);
}
.print-preview small { color: #8f8582; font-size: 10px; }
.error-view {
  text-align: center;
  padding-top: 110px;
}
.error-icon {
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #f5dedc;
  color: #b75f58;
  font: 700 24px Georgia;
}
.error-view .muted {
  max-width: 520px;
  margin: 10px auto;
}
.error-view .inline-actions {
  margin-top: 25px;
}
footer {
  display: flex;
  justify-content: center;
  gap: 34px;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  color: #a28f8a;
  font-size: 10px;
}
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }
  .topbar {
    min-height: calc(60px + env(safe-area-inset-top));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }
  .brand {
    flex: 0 0 auto;
  }
  .service-state {
    min-width: 0;
    max-width: 52vw;
    justify-content: flex-end;
  }
  .service-state span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .shell {
    width: min(100% - 16px, 700px);
    padding-top: 22px;
  }
  .intro {
    display: block;
  }
  .intro h1 {
    font-size: clamp(29px, 9vw, 34px);
    line-height: 1.15;
  }
  .intro-copy {
    font-size: 13px;
    line-height: 1.7;
  }
  .privacy {
    display: inline-block;
    margin-top: 18px;
  }
  .progress {
    display: none;
  }
  .mobile-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    margin: 0 3px 12px;
    padding: 0 14px;
    border: 1px solid rgba(201, 132, 122, 0.2);
    border-radius: 14px;
    background: rgba(255, 253, 250, 0.82);
    color: var(--muted);
    font-size: 12px;
  }
  .mobile-progress strong {
    color: var(--ink);
    font-size: 13px;
  }
  .workspace {
    min-height: 0;
    border-radius: 18px;
  }
  .view {
    min-height: 0;
    padding: 26px 16px calc(30px + env(safe-area-inset-bottom));
  }
  .view h2,
  .upload-view h2 {
    font-size: 22px;
    line-height: 1.25;
  }
  .upload-visual {
    width: 174px;
    height: 174px;
    margin-bottom: 17px;
  }
  .upload-visual .avatar-art {
    left: 35px;
    transform: scale(0.9);
  }
  .upload-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 10px;
  }
  .upload-actions #demoButton {
    grid-column: 1 / -1;
  }
  .upload-actions .button {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
  }
  .photo-rules {
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 18px 8px;
  }
  .consent {
    width: 100%;
    margin-top: 18px;
    font-size: 11px;
  }
  .split,
  .result-layout,
  .export-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .split > *,
  .result-layout > *,
  .export-layout > *,
  .review-panel,
  .export-controls {
    min-width: 0;
    width: 100%;
  }
  .source-photo {
    height: min(62svh, 430px);
    min-height: 330px;
    width: min(100%, 310px);
  }
  .comparison {
    width: min(100%, 360px);
  }
  .comparison input {
    top: 50%;
    bottom: auto;
    height: 56px;
    transform: translateY(-50%);
    touch-action: pan-y;
  }
  .variant-picker {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78vw, 286px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    padding: 2px 2px 10px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }
  .variant-card {
    min-height: 0;
    scroll-snap-align: start;
    border-radius: 13px;
  }
  .variant-card b {
    font-size: 13px;
  }
  .variant-card small {
    font-size: 11px;
  }
  .variant-picker::-webkit-scrollbar {
    height: 5px;
  }
  .variant-picker::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #dacbc6;
  }
  .review-list label {
    display: flex;
    align-items: center;
    min-height: 48px;
    gap: 9px;
  }
  .review-list input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }
  .section-head {
    flex-wrap: wrap;
    gap: 15px;
  }
  .section-head h2 {
    font-size: 19px;
  }
  .canvas-wrap {
    height: min(70svh, 520px);
    min-height: 420px;
  }
  .canvas-wrap canvas {
    max-width: 88%;
    max-height: 94%;
  }
  .button,
  .text-button {
    min-height: 44px;
  }
  .text-button {
    padding: 8px 4px;
  }
  .quality-card .inline-actions {
    position: sticky;
    z-index: 6;
    bottom: calc(8px + env(safe-area-inset-bottom));
    margin-right: -8px;
    margin-left: -8px;
    padding: 8px;
    border: 1px solid rgba(233, 222, 217, 0.92);
    border-radius: 13px;
    background: rgba(255, 253, 250, 0.94);
    box-shadow: 0 10px 30px rgba(68, 48, 43, 0.14);
    backdrop-filter: blur(16px);
  }
  .mobile-sticky-primary {
    position: sticky;
    z-index: 6;
    bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 10px 30px rgba(41, 37, 38, 0.2);
  }
  .swatches {
    justify-content: space-between;
    gap: 8px;
  }
  .swatch,
  .swatches input[type="color"] {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .export-controls select,
  .custom-size input,
  .print-options select,
  .print-options input {
    min-height: 46px;
    font-size: 16px;
  }
  .export-info {
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
  }
  .download-notice {
    display: block;
    margin: 0 0 10px;
    color: #918682;
    font-size: 11px;
    line-height: 1.6;
  }
  .print-preview canvas {
    max-height: 220px;
  }
  .generating-view {
    padding-top: 72px;
  }
  footer {
    flex-wrap: wrap;
    gap: 8px 18px;
  }
}

@media (max-width: 380px) {
  .service-state {
    max-width: 48vw;
    font-size: 11px;
  }
  .inline-actions {
    align-items: stretch;
  }
  .quality-card .inline-actions .button {
    padding-right: 12px;
    padding-left: 12px;
  }
  .swatches {
    gap: 5px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .source-photo,
  .canvas-wrap {
    max-height: 76svh;
    min-height: 300px;
  }
  .comparison {
    width: min(68svh, 360px);
  }
}

@media (hover: none) {
  .button:hover {
    transform: none;
  }
}

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

/* ---- 付费弹窗 ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 15, 0.55);
  padding: 24px;
}
.modal.active {
  display: flex;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--surface, #fff);
  color: var(--text, #292526);
  border-radius: 16px;
  padding: 24px 20px 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
}
.modal-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #8a807b;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.pay-plans {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.pay-plan {
  min-height: 48px;
  border: 1px solid #ddd3cc;
  background: #faf7f4;
  color: #292526;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.pay-plan:hover {
  background: #f1e9e2;
}
.pay-qr {
  width: 240px;
  height: 240px;
  margin: 8px auto 12px;
  border-radius: 8px;
  border: 1px solid #eee;
}
.pay-status {
  font-size: 13px;
  color: #7d726c;
  min-height: 18px;
}

/* ---- 作品解锁锁定状态 ---- */
.lock-hint {
  margin: 6px 0;
  font-size: 13px;
  color: #a3602d;
}
.button.locked {
  position: relative;
  opacity: 0.72;
}
.button.locked::after {
  content: "🔒 支付后解锁";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #8a807b;
}

/* 通用隐藏：所有 .hidden 一律隐藏（供 payQr/payMockButton/lockHint 等复用） */
.hidden { display: none !important; }
