:root {
  color-scheme: light;
  --ink: #123b2d;
  --muted: #5d6367;
  --surface: #ffffff;
  --canvas: #fbf8ec;
  --line: #e1e1dc;
  --primary: #159447;
  --primary-dark: #0b7035;
  --primary-soft: #eaf8ee;
  --yellow: #ffd85a;
  --yellow-soft: #fff6d9;
  --success: #159447;
  --focus: #124e78;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
}

button, input, select { font: inherit; }

button, a, input, select { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; }

.page {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.login-page {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 22px 18px calc(32px + env(safe-area-inset-bottom));
}

.login-card {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 24px 18px 28px;
  background: transparent;
  border: 0;
  border-radius: 24px;
  box-shadow: none;
  text-align: center;
}

.brand-lockup { display: block; width: min(74vw, 300px); height: auto; margin: 0 auto 18px; }
.hero-illustration { display: block; width: min(100%, 420px); height: auto; margin: 0 auto 18px; border-radius: 18px; }

.eyebrow {
  margin: 0 0 8px;
  color: #0f5a3d;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, h3, p { text-wrap: pretty; }

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.22;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.lead {
  margin: 14px 0 26px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.helper {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.primary-button, .secondary-button, .location-button, .date-option, .slot-option, .category-option {
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out;
}

.primary-button {
  width: 100%;
  padding: 14px 18px;
  color: #fff;
  background: var(--primary);
  font-size: 19px;
  font-weight: 800;
}

.primary-button:hover, .primary-button:active { background: var(--primary-dark); }

.primary-button:active, .secondary-button:active, .location-button:active,
.date-option:active, .slot-option:active, .category-option:active { transform: scale(0.985); }

.primary-button[disabled] { opacity: 0.55; cursor: wait; }

.secondary-button {
  width: 100%;
  padding: 12px 18px;
  color: var(--primary);
  border: 1px solid #d8b6ae;
  background: var(--surface);
  font-weight: 700;
}

.wechat-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.agreement {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 2px 0;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
}

.agreement input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); }

.agreement a { color: var(--primary); }

.preview-tip {
  margin: 20px 0 0;
  padding: 12px 14px;
  color: #5e480e;
  border-radius: 12px;
  background: var(--yellow-soft);
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-line { display: flex; align-items: center; gap: 10px; }

.topbar-logo { display: block; width: 150px; height: auto; }

.topbar-link { color: var(--primary); font-size: 14px; font-weight: 700; text-decoration: none; }

.progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 22px;
}

.progress-step { position: relative; color: #a19589; text-align: center; font-size: 13px; line-height: 1.4; }

.progress-step::before {
  content: attr(data-step);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  border: 1px solid #cfc2b3;
  border-radius: 50%;
  color: #8d8178;
  background: #fff;
  font-weight: 800;
}

.progress-step.is-active { color: var(--primary); font-weight: 800; }
.progress-step.is-active::before { color: #fff; border-color: var(--primary); background: var(--primary); }

.page-title { margin-bottom: 18px; }
.page-title p { margin: 7px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }

.section-card {
  margin: 14px 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(81, 47, 17, 0.045);
}

.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { font-size: 21px; }
.required { color: var(--primary); font-size: 14px; }

.location-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 14px;
  color: var(--primary);
  border: 1px solid #d8b6ae;
  background: var(--primary-soft);
  font-size: 17px;
  font-weight: 800;
}

.location-button.is-done { color: var(--success); border-color: #a9d7bd; background: #effaf3; }

.field { display: block; margin-top: 14px; }
.field-label { display: block; margin-bottom: 7px; font-size: 16px; font-weight: 800; }
.field input, .field select {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid #cfc2b3;
  border-radius: 12px;
  outline: 0;
  background: #fff;
  font-size: 17px;
}
.field input::placeholder { color: #9a8e82; }
.field input:focus, .field select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(18, 78, 120, 0.12); }
.field-error { min-height: 20px; margin: 6px 0 0; color: var(--primary); font-size: 14px; line-height: 1.4; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.date-option, .slot-option, .category-option {
  padding: 12px 8px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.date-option strong, .slot-option strong { display: block; font-size: 17px; }
.date-option small, .slot-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.date-option.is-selected, .slot-option.is-selected, .category-option.is-selected { color: #1b2b1e; border: 2px solid #ebb62a; background: var(--yellow); font-weight: 800; }
.date-option.is-selected small, .slot-option.is-selected small { color: var(--primary); }

.category-option { min-height: 54px; font-weight: 700; }

.section-note { margin: -4px 0 14px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.photo-input { width: 100%; min-height: 54px; padding: 14px; color: var(--primary-dark); border: 1px dashed #9bcdb0; border-radius: 14px; background: var(--primary-soft); font-size: 16px; font-weight: 700; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.photo-card { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #f2f2ed; }
.photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-remove { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(42, 33, 27, .75); font-size: 22px; line-height: 1; cursor: pointer; }
.photo-empty { margin-top: 12px; padding: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; background: #fcfcf8; text-align: center; font-size: 14px; line-height: 1.5; }

.address-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.address-status.is-success { color: var(--success); }
.address-status.is-error { color: var(--primary); }

.form-actions { margin-top: 18px; }
.form-actions .helper { text-align: center; }

.error-banner, .success-banner {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.6;
}
.error-banner { color: var(--primary-dark); background: var(--primary-soft); border: 1px solid #ebc5bd; }
.success-banner { color: #125f37; background: #effaf3; border: 1px solid #a9d7bd; }

.success-page { padding-top: 54px; text-align: center; }
.success-symbol { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: var(--success); font-size: 17px; font-weight: 900; }
.success-page h1 { font-size: 30px; }
.appointment-number { margin: 20px 0; padding: 17px; border: 1px dashed #d9ba64; border-radius: 14px; background: var(--yellow-soft); }
.appointment-number span { display: block; color: var(--muted); font-size: 14px; }
.appointment-number strong { display: block; margin-top: 5px; color: var(--primary); font-size: 25px; letter-spacing: 1px; }
.summary-list { margin: 22px 0; padding: 0; text-align: left; list-style: none; }
.summary-list li { display: flex; gap: 14px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.5; }
.summary-list li span:first-child { color: var(--muted); }
.summary-list li span:last-child { max-width: 70%; text-align: right; font-weight: 700; }

.qr-page { width: min(100%, 620px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom)); }
.privacy-page { padding-top: max(24px, env(safe-area-inset-top)); }
.privacy-card { margin-top: 22px; }
.privacy-card h1 { margin-bottom: 24px; }
.privacy-card h2 { margin-top: 24px; font-size: 20px; }
.privacy-card p { color: var(--muted); font-size: 16px; line-height: 1.75; }
.back-link { display: inline-block; color: var(--primary); font-size: 16px; font-weight: 700; text-decoration: none; }
.qr-card { margin-top: 24px; padding: 28px 20px; border: 1px solid var(--line); border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 12px 28px rgba(81, 47, 17, 0.08); }
.qr-lead { margin: 12px auto 22px; max-width: 420px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.qr-frame { width: min(100%, 380px); padding: 10px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qr-frame img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qr-url { margin: 14px 0 0; color: var(--ink); font-size: 18px; font-weight: 800; }
.qr-note { margin: 8px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.booking-illustration { display: block; width: min(100%, 420px); height: auto; margin: 8px auto 18px; border-radius: 18px; }

.noscript { padding: 18px; color: var(--primary); background: var(--primary-soft); font-size: 18px; }

@media (min-width: 640px) {
  .page { padding-left: 26px; padding-right: 26px; }
  .section-card { padding: 22px; }
  .login-card { padding: 18px 34px 30px; }
}

@media (max-width: 390px) {
  .choice-grid.three { grid-template-columns: 1fr; }
  .date-option, .slot-option { padding-left: 5px; padding-right: 5px; }
  .section-card { padding: 15px; }
}

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