:root {
  --paper: #f6f7f3;
  --paper-deep: #e8ece7;
  --surface: #ffffff;
  --ink: #193a42;
  --muted: #68797c;
  --sea: #397f8d;
  --sea-soft: #e4eff0;
  --coral: #e8755d;
  --sun: #f2c96d;
  --leaf: #4d7b64;
  --line: rgba(25, 58, 66, .12);
  --shadow: 0 24px 60px rgba(31, 59, 64, .09);
  --display: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
  scroll-padding-top: 78px;
}

body {
  color: var(--ink);
  background: #f6f7f3;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 3%, rgba(232, 117, 93, .07) 0 13rem, transparent 13.1rem),
    radial-gradient(circle at 92% 24%, rgba(57, 127, 141, .06) 0 15rem, transparent 15.1rem);
}

button,
a,
label {
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

button:active,
a:active,
label:active {
  transform: scale(.98);
}

.site-header {
  min-height: 68px;
  padding: 9px max(22px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid rgba(25, 58, 66, .08);
  background: rgba(250, 250, 247, .9);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(130%);
}

.site-brand {
  gap: 10px;
}

.brand-seal {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ink);
  font-family: var(--body);
  font-size: 20px;
  font-weight: 850;
  box-shadow: none;
}

.site-brand strong {
  font-family: var(--body);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .01em;
}

.site-brand small {
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: .04em;
}

.header-action {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  box-shadow: none;
}

.header-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(25, 58, 66, .16);
}

.app-shell {
  width: min(100%, 1480px);
  padding: 0 22px 70px;
}

.home-hero {
  position: relative;
  grid-template-columns: minmax(0, 1.02fr) minmax(480px, .98fr);
  gap: clamp(42px, 5vw, 78px);
  min-height: auto;
  padding: 72px 14px 70px;
}

.home-copy {
  max-width: 680px;
}

.home-kicker {
  min-height: auto;
  padding: 0 0 0 12px;
  border: 0;
  border-left: 3px solid var(--coral);
  background: transparent;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}

.home-copy h1 {
  max-width: 680px;
  margin: 22px 0 19px;
  color: #17353c;
  font-family: var(--body);
  font-size: clamp(46px, 4.25vw, 62px);
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.home-copy > p {
  max-width: 625px;
  color: #5e7377;
  font-size: clamp(15px, 1.15vw, 17px);
  font-weight: 520;
  line-height: 1.8;
}

.home-actions {
  gap: 18px;
  margin-top: 29px;
}

.home-primary {
  min-width: 156px;
  min-height: 52px;
  border-radius: 12px;
  background: var(--coral);
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(232, 117, 93, .2);
}

.home-primary::after {
  content: "→";
  margin-left: 11px;
}

.home-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(232, 117, 93, .25);
}

.home-actions > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.hero-steps {
  gap: 0;
  max-width: 620px;
  margin-top: 38px;
  border-top: 1px solid var(--line);
}

.hero-steps li {
  position: relative;
  grid-template-columns: 27px 1fr;
  gap: 9px;
  padding: 15px 14px 0 0;
  border-top: 0;
}

.hero-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 15px;
  width: 1px;
  height: 31px;
  background: var(--line);
}

.hero-steps b {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(25, 58, 66, .16);
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
  font-size: 10px;
  box-shadow: none;
}

.hero-steps strong {
  font-size: 12px;
}

.hero-steps small {
  margin-top: 3px;
  font-size: 9px;
}

.home-proof {
  overflow: hidden;
  border: 1px solid rgba(25, 58, 66, .1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(31, 59, 64, .12);
  transform: none;
}

.home-proof::before {
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--sea);
}

.home-proof::after {
  display: none;
}

.proof-meta {
  min-height: 46px;
  padding: 0 21px 0 26px;
  border-bottom-color: rgba(25, 58, 66, .08);
  color: #718286;
  font-size: 9px;
  letter-spacing: .1em;
}

.proof-layout {
  grid-template-columns: .88fr 1.12fr;
  gap: 25px;
  min-height: 360px;
  padding: 25px 24px 23px 30px;
}

.proof-copy em {
  color: var(--sea);
  font-size: 10px;
  letter-spacing: .09em;
}

.proof-copy strong {
  margin-top: 14px;
  font-family: var(--body);
  font-size: clamp(30px, 2.8vw, 43px);
  font-weight: 850;
  line-height: 1.14;
  letter-spacing: -.045em;
}

.proof-copy p {
  margin-top: 19px;
  padding: 0 0 0 12px;
  border-left: 3px solid var(--coral);
  font-size: 12px;
  line-height: 1.65;
}

.proof-photo {
  min-height: 290px;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 10px;
  background: linear-gradient(#bde1e8 0 54%, #58a4b5 54% 68%, #edd69b 68%);
  box-shadow: 0 0 0 1px rgba(25, 58, 66, .08), 8px 9px 0 rgba(57, 127, 141, .1);
}

.proof-sun {
  width: 48px;
  height: 48px;
}

.proof-child {
  width: 57px;
  height: 110px;
  box-shadow: 0 12px 18px rgba(25, 58, 66, .13);
}

.proof-points {
  background: #fbfcfa;
}

.proof-points div {
  padding: 13px 12px;
}

.proof-points b {
  font-size: 10px;
}

.proof-points span {
  font-size: 8px;
}

.workbench {
  grid-template-columns: minmax(380px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(25, 58, 66, .08);
  border-radius: 28px;
  background: #edf1ed;
  box-shadow: none;
}

.workbench::before {
  display: none;
}

.input-panel,
.preview-panel {
  border: 1px solid rgba(25, 58, 66, .08);
  border-radius: 19px;
  background: #fff;
  box-shadow: none;
}

.input-panel {
  padding: 25px 24px;
}

.panel-heading > span {
  color: var(--coral);
  font-size: 9px;
  letter-spacing: .13em;
}

.panel-heading h2 {
  margin-top: 7px;
  font-family: var(--body);
  font-size: 27px;
  font-weight: 820;
  letter-spacing: -.035em;
}

.panel-heading p {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
}

.form {
  gap: 0;
  margin-top: 20px;
}

.form-section {
  padding: 19px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  grid-template-columns: 32px 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.section-heading > b {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  font-family: var(--body);
  font-size: 11px;
  box-shadow: none;
}

.section-heading strong {
  font-size: 13px;
}

.section-heading small {
  font-size: 9px;
}

.field-row {
  grid-template-columns: .82fr 1.18fr;
  gap: 9px;
}

.field > span {
  font-size: 10px;
}

.field input {
  height: 47px;
  border: 1px solid rgba(25, 58, 66, .12);
  border-radius: 10px;
  background: #f7f8f5;
  font-size: 14px;
  box-shadow: none;
}

.field input:focus {
  border-color: var(--sea);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(57, 127, 141, .1);
}

.topic-toggle {
  top: 7px;
  background: #e6eff0;
}

.topic-menu {
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(31, 59, 64, .14);
}

.page-count-field {
  margin-top: 13px;
}

.page-count-control {
  gap: 6px;
}

.page-count-control button,
.custom-page-count {
  border: 1px solid rgba(25, 58, 66, .11);
  border-radius: 9px;
  background: #f8f9f6;
}

.page-count-control button {
  min-height: 46px;
}

.page-count-control button.is-selected {
  border-color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -3px var(--coral);
}

.custom-page-count {
  min-height: 38px;
}

.upload-panel {
  min-height: 218px;
  padding: 18px 14px;
  border: 1.5px dashed rgba(25, 58, 66, .22);
  border-radius: 13px;
  background: #f8faf7;
}

.upload-panel.is-dragging {
  border-color: var(--coral);
  background: #fff5f1;
}

.upload-illustration {
  width: 72px;
  height: 51px;
}

.upload-illustration span {
  border-width: 4px;
  box-shadow: 0 6px 13px rgba(31, 59, 64, .1);
}

.upload-panel > strong {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 800;
}

.upload-panel > p {
  max-width: 275px;
  font-size: 9px;
}

.upload-actions {
  width: min(100%, 286px);
}

.upload-action {
  min-height: 42px;
  border-radius: 9px;
}

.upload-album {
  box-shadow: none;
}

.template-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.template-card {
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 108px;
  padding: 6px;
  border: 1px solid rgba(25, 58, 66, .11);
  border-radius: 11px;
  text-align: center;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(25, 58, 66, .25);
}

.template-card.is-selected {
  border-color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -3px var(--coral);
}

.template-card > span:last-child {
  padding: 0;
}

.template-card strong {
  font-size: 10px;
}

.template-card em {
  display: none;
}

.template-thumb {
  width: 100%;
  height: 60px;
  border-width: 4px;
  border-radius: 6px;
  box-shadow: none;
}

.template-card.is-selected::after {
  right: 5px;
  top: 5px;
  width: 19px;
  height: 19px;
  font-size: 9px;
  box-shadow: none;
}

.form-status {
  margin-top: 2px;
  border-radius: 9px;
}

.primary-btn {
  min-height: 55px;
  margin-top: 4px;
  border-radius: 11px;
  background: var(--coral);
  box-shadow: 0 10px 22px rgba(232, 117, 93, .18);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(232, 117, 93, .23);
}

.privacy-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 0;
  border-radius: 9px;
  background: #f7f8f5;
}

.preview-panel {
  top: 84px;
  gap: 13px;
  padding: 18px;
  background: #fff;
}

.preview-toolbar {
  min-height: 48px;
}

.preview-toolbar .eyebrow {
  color: var(--coral);
  font-size: 8px;
}

.preview-toolbar h2 {
  color: var(--ink);
  font-family: var(--body);
  font-size: 21px;
  font-weight: 800;
}

.ghost-btn {
  width: 37px;
  height: 37px;
  border-color: var(--line);
  background: #f7f8f5;
  color: var(--ink);
}

.counter {
  color: var(--muted);
}

.play-btn,
.pay-btn {
  min-height: 38px;
  border-radius: 9px;
}

.play-btn {
  background: #e6eff0;
  color: var(--ink);
}

.pay-btn {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.stage-wrap {
  padding: 9px;
  border: 1px solid rgba(25, 58, 66, .08);
  border-radius: 13px;
  background: #ecebe6;
}

.stage {
  border-width: 5px;
  border-radius: 2px;
  box-shadow: 0 14px 30px rgba(31, 59, 64, .12);
}

.stage.is-empty {
  min-height: 430px;
}

.empty-state {
  min-height: 430px;
  padding: 38px;
  background: #eaf5f8;
}

.empty-state > span {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  box-shadow: none;
}

.empty-state h2 {
  margin-top: 19px;
  font-family: var(--body);
  font-size: 28px;
  font-weight: 820;
  letter-spacing: -.04em;
}

.empty-state > p {
  margin-top: 10px;
  font-size: 12px;
}

.empty-rules {
  gap: 8px;
  margin-top: 23px;
}

.empty-rules div {
  min-height: 66px;
  padding: 11px 12px;
  border-top: 2px solid var(--sea);
  background: rgba(255, 255, 255, .65);
}

.filmstrip {
  gap: 7px;
}

.slide-chip {
  flex-basis: 190px;
  min-height: 93px;
  border-color: var(--line);
  border-radius: 10px;
  background: #f7f8f5;
  color: var(--ink);
}

.slide-chip.active {
  border-color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -3px var(--coral);
}

.slide-chip em {
  color: var(--sea);
}

.slide-chip strong {
  color: var(--ink);
}

.slide-chip small {
  color: var(--muted);
}

.chip-number,
.slide-chip.active .chip-number {
  background: var(--ink);
  color: #fff;
}

.payment-dialog {
  border-radius: 19px;
}

.payment-dialog::backdrop {
  background: rgba(17, 39, 44, .62);
  backdrop-filter: blur(8px);
}

.payment-card {
  padding: 26px 27px 22px;
  border-radius: 19px;
  background: #fff;
}

.payment-heading h2 {
  font-family: var(--body);
  font-size: 24px;
  font-weight: 820;
}

.payment-qr {
  border-radius: 13px;
  box-shadow: 0 0 0 1px var(--line), 0 12px 26px rgba(31, 59, 64, .1);
}

.payment-confirm {
  border-radius: 10px;
}

@keyframes ui-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-copy,
.home-proof {
  animation: ui-enter .42s cubic-bezier(.16, 1, .3, 1) both;
}

.home-proof {
  animation-delay: .06s;
}

@media (max-width: 1120px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr);
    gap: 38px;
  }

  .home-copy h1 {
    font-size: clamp(43px, 4.4vw, 55px);
  }

  .workbench {
    grid-template-columns: 390px minmax(0, 1fr);
  }

  .preview-toolbar {
    align-items: flex-start;
  }
}

@media (max-width: 920px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 54px;
  }

  .home-copy {
    max-width: 760px;
  }

  .home-proof {
    max-width: 820px;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .input-panel {
    padding: 27px;
  }

  .form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .form-section:nth-of-type(2) {
    grid-row: span 2;
  }

  .form > .form-status,
  .form > .primary-btn {
    grid-column: 1 / -1;
  }

  .preview-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 680px) {
  html {
    scroll-padding-top: 64px;
  }

  body::before {
    background: radial-gradient(circle at 5% 2%, rgba(232, 117, 93, .06) 0 9rem, transparent 9.1rem);
  }

  .site-header {
    min-height: 62px;
    padding: 8px 13px;
  }

  .brand-seal {
    width: 37px;
    height: 37px;
    border-radius: 10px;
    font-size: 18px;
  }

  .site-brand strong {
    font-size: 16px;
  }

  .site-brand small {
    display: none;
  }

  .header-action {
    min-height: 36px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 11px;
  }

  .app-shell {
    width: 100%;
    padding: 0 0 calc(36px + env(safe-area-inset-bottom));
  }

  .home-hero {
    display: grid;
    gap: 28px;
    padding: 34px 15px 40px;
    overflow: hidden;
  }

  .home-copy {
    min-width: 0;
  }

  .home-kicker {
    padding-left: 9px;
    font-size: 10px;
  }

  .home-copy h1 {
    max-width: 100%;
    margin: 17px 0 14px;
    overflow-wrap: anywhere;
    font-size: clamp(35px, 9.8vw, 41px);
    line-height: 1.18;
    letter-spacing: -.055em;
    text-wrap: wrap;
  }

  .home-copy > p {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.7;
  }

  .home-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 22px;
  }

  .home-primary {
    width: 100%;
    min-height: 50px;
  }

  .home-actions > span {
    text-align: center;
  }

  .hero-steps {
    gap: 6px;
    margin-top: 25px;
  }

  .hero-steps li {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 11px 4px 0 0;
  }

  .hero-steps li:not(:last-child)::after {
    right: 2px;
    top: 12px;
    height: 43px;
  }

  .hero-steps b {
    width: 25px;
    height: 25px;
    margin: 0;
  }

  .hero-steps strong {
    font-size: 10px;
  }

  .hero-steps small {
    display: block;
    font-size: 8px;
  }

  .home-proof {
    display: block;
    width: 100%;
    border-radius: 14px;
  }

  .proof-meta {
    min-height: 38px;
    padding: 0 13px 0 18px;
    font-size: 7px;
  }

  .proof-layout {
    grid-template-columns: .92fr 1.08fr;
    gap: 11px;
    min-height: 205px;
    padding: 14px 13px 14px 18px;
  }

  .proof-copy em {
    font-size: 7px;
  }

  .proof-copy strong {
    margin-top: 8px;
    font-size: clamp(21px, 6.3vw, 26px);
  }

  .proof-copy p {
    margin-top: 11px;
    padding-left: 7px;
    border-left-width: 2px;
    font-size: 8px;
    line-height: 1.45;
  }

  .proof-photo {
    min-height: 170px;
    border-width: 5px;
    border-radius: 7px;
    box-shadow: 5px 5px 0 rgba(57, 127, 141, .08);
  }

  .proof-sun {
    width: 29px;
    height: 29px;
  }

  .proof-child {
    width: 35px;
    height: 69px;
    font-size: 15px;
  }

  .proof-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-points div {
    padding: 8px 9px;
    border-bottom: 1px solid rgba(25, 58, 66, .07);
  }

  .proof-points b {
    font-size: 8px;
  }

  .proof-points span {
    font-size: 7px;
  }

  .workbench {
    display: grid;
    gap: 9px;
    margin: 0 7px;
    padding: 7px;
    border-radius: 21px;
    background: #e9eeea;
  }

  .input-panel,
  .preview-panel {
    border-radius: 16px;
  }

  .input-panel {
    padding: 22px 13px 18px;
  }

  .panel-heading {
    padding-inline: 2px;
  }

  .panel-heading h2 {
    font-size: 25px;
  }

  .form {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 17px;
  }

  .form-section,
  .form-section:nth-of-type(2) {
    grid-row: auto;
    padding: 17px 0;
  }

  .form-section:first-child {
    padding-top: 0;
  }

  .form > .form-status,
  .form > .primary-btn {
    grid-column: auto;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field input {
    height: 49px;
  }

  .topic-menu {
    left: 9px;
    right: 9px;
    top: 70px;
    max-height: calc(100dvh - 82px);
  }

  .upload-panel {
    min-height: 208px;
  }

  .template-picker {
    gap: 5px;
  }

  .template-card {
    min-height: 104px;
    padding: 5px;
  }

  .template-thumb {
    height: 58px;
  }

  .template-card strong {
    font-size: 9px;
  }

  .primary-btn {
    min-height: 54px;
  }

  .preview-panel {
    gap: 10px;
    padding: 14px 9px 18px;
  }

  .preview-toolbar {
    position: static;
    gap: 9px;
    margin: 0;
    padding: 2px 2px 3px;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .preview-toolbar h2 {
    max-width: calc(100vw - 48px);
    font-size: 19px;
  }

  .toolbar-actions {
    grid-template-columns: 40px minmax(48px, 1fr) 40px minmax(96px, 1fr);
  }

  .ghost-btn {
    width: 40px;
    height: 40px;
  }

  .pay-btn {
    min-height: 47px;
  }

  .stage-wrap {
    padding: 4px;
    border-radius: 8px;
  }

  .stage {
    border-width: 3px;
  }

  .stage.is-empty {
    min-height: 290px;
  }

  .empty-state {
    min-height: 290px;
    padding: 22px 14px;
  }

  .empty-state > span {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .empty-state h2 {
    margin-top: 13px;
    font-size: 21px;
  }

  .empty-state > p {
    font-size: 10px;
  }

  .empty-rules {
    grid-template-columns: 1fr;
    margin-top: 15px;
  }

  .empty-rules div {
    grid-template-columns: 82px 1fr;
    min-height: auto;
    padding: 8px 9px;
    border-top: 0;
    border-left: 2px solid var(--sea);
  }

  .filmstrip {
    margin-inline: -9px;
    padding-inline: 9px;
  }

  .slide-chip {
    flex-basis: 170px;
  }

  .payment-dialog {
    width: calc(100vw - 18px);
  }

  .payment-card {
    padding: 22px 16px calc(15px + env(safe-area-inset-bottom));
  }

  .payment-heading h2 {
    font-size: 22px;
  }

  .payment-qr {
    width: min(210px, 58vw);
    height: min(210px, 58vw);
  }
}

@media (max-width: 370px) {
  .home-copy h1 {
    font-size: 34px;
  }

  .template-card strong {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-copy,
  .home-proof {
    animation: none;
  }
}
