:root {
  --bg: #f7eee9;
  --ink: #6f523e;
  --panel: rgba(255, 252, 248, 0.84);
  --line: rgba(111, 82, 62, 0.16);
  --active: #2f756f;
  --active-2: #d99255;
  --shadow: 0 26px 80px rgba(74, 51, 36, 0.2);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(171, 134, 104, 0.2), rgba(247, 238, 233, 0) 36vh),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.prototype-shell {
  min-height: 100dvh;
  display: grid;
  place-items: start center;
}

.phone-stage {
  position: relative;
  width: min(100vw, 520px);
  margin: 0 auto;
  background: #fdf6f0;
  overflow: hidden;
  min-height: 0;
  box-shadow: var(--shadow);
  contain: layout paint style;
  transform: translateZ(0);
}

.phone-stage:not(.has-foot-accordion) {
  height: auto;
}

.phone-stage.has-foot-accordion {
  min-height: var(--foot-stage-height, 100dvh);
  transition: min-height 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.phone-stage.is-resetting-service-layout {
  transition: none;
}

.page-image {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.24s ease;
}

.phone-stage.is-image-loading .page-image {
  opacity: 0.92;
}

.has-foot-accordion .page-image {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: fill;
}

.foot-title-layer,
.foot-copy-layer {
  position: absolute;
  z-index: 7;
  left: 50%;
  pointer-events: none;
  transform: translateX(-50%);
  will-change: top, transform, opacity;
}

.foot-title-layer[hidden],
.foot-copy-layer[hidden] {
  display: none;
}

.foot-title-layer {
  top: var(--foot-title-top, 40px);
  width: var(--service-title-width, 24.44%);
}

.foot-copy-layer {
  top: var(--foot-copy-top, 552px);
  width: var(--service-copy-width, 42.95%);
  transition:
    top 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.foot-title-layer img,
.foot-copy-layer img {
  display: block;
  width: 100%;
  height: auto;
}

.hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
  min-width: 18px;
  min-height: 18px;
  transform-origin: center;
  will-change: transform;
  pointer-events: auto;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.foot-accordion {
  position: absolute;
  left: var(--service-left, 6.333%);
  top: var(--foot-accordion-top, 202px);
  z-index: 8;
  width: var(--service-width, 88.46%);
  pointer-events: auto;
  transform: translateZ(0);
  will-change: top;
  transition: top 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.phone-stage.is-resetting-service-layout .foot-accordion,
.phone-stage.is-resetting-service-layout .foot-copy-layer {
  transition: none;
}

.foot-accordion[hidden] {
  display: none;
}

.foot-accordion-item {
  display: grid;
  justify-items: start;
  margin: 0 0 var(--service-item-gap, 4.36%);
  contain: layout paint;
}

.foot-accordion-trigger {
  width: var(--service-trigger-width, 97.17%);
  margin-left: var(--service-trigger-left, 0.79%);
  padding: 0;
  border: 0;
  border-radius: clamp(18px, 5vw, 38px);
  background: transparent;
  display: block;
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform, filter;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.foot-accordion-trigger:active {
  transform: scale(0.985);
  filter: brightness(1.045);
}

.foot-accordion-trigger:focus-visible {
  outline: 2px solid rgba(217, 146, 85, 0.9);
  outline-offset: 4px;
}

.foot-accordion-trigger img,
.foot-accordion-heading img,
.foot-accordion-panel img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.foot-accordion-heading {
  width: 100%;
  display: grid;
  justify-items: center;
  margin: var(--service-heading-margin-top, 7.5%) 0 var(--service-heading-margin-bottom, 5.5%);
}

.foot-accordion-heading img {
  width: var(--service-heading-width, 14%);
}

.foot-accordion-panel {
  width: 100%;
  height: 0;
  margin-top: var(--service-panel-margin-top, -3.25%);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-12px) scale(0.988);
  transform-origin: top center;
  will-change: height, opacity, transform;
  backface-visibility: hidden;
  transition:
    height 0.56s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
}

.foot-accordion-item.is-open .foot-accordion-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.foot-accordion-panel img {
  transform: translateZ(0);
  backface-visibility: hidden;
}

.hotspot:hover,
.hotspot:active,
.hotspot.is-pressed {
  transform: scale(1.012);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 22px rgba(74, 51, 36, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.hotspot:focus-visible {
  outline: 2px solid rgba(217, 146, 85, 0.9);
  outline-offset: 2px;
}

.debug .hotspot,
.is-editing .hotspot {
  border-color: rgba(47, 117, 111, 0.58);
  background: rgba(47, 117, 111, 0.16);
  color: rgba(19, 37, 31, 0.82);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  padding: 4px;
  border-radius: clamp(18px, 4vw, 34px);
}

.is-editing .hotspot.is-selected {
  border-color: var(--active-2);
  background: rgba(217, 146, 85, 0.28);
  transform: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 0 2px rgba(217, 146, 85, 0.35);
}

.resize-handle {
  display: none;
}

.is-editing .resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--active-2);
  box-shadow: 0 4px 12px rgba(74, 51, 36, 0.24);
}

.floating-nav,
.editor-toggle {
  position: fixed;
  left: 50%;
  z-index: 20;
  width: min(488px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.floating-nav {
  top: calc(10px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
}

.floating-nav[hidden] {
  display: none;
}

.editor-toggle {
  top: calc(54px + env(safe-area-inset-top));
  display: flex;
  justify-content: flex-end;
}

.floating-nav button,
.editor-toggle button {
  pointer-events: auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(74, 51, 36, 0.12);
}

.editor-toggle button.is-on {
  border-color: rgba(47, 117, 111, 0.42);
  background: rgba(47, 117, 111, 0.92);
  color: #fff;
}

.customer-mode .floating-nav,
.customer-mode .editor-toggle,
.customer-mode .editor-panel {
  display: none !important;
}

.editor-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
  width: min(430px, 100vw);
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  background: #fffaf4;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(74, 51, 36, 0.22);
  transform: translateX(102%);
  transition: transform 0.22s ease;
  overflow: auto;
}

.editor-panel.is-open {
  transform: translateX(0);
}

.editor-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.94);
  backdrop-filter: blur(12px);
}

.editor-head p,
.editor-head h2,
.editor-section h3,
.editor-hint {
  margin: 0;
}

.editor-head p {
  color: rgba(111, 82, 62, 0.64);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editor-head h2 {
  margin-top: 4px;
  color: #4f3929;
  font-size: 20px;
}

.editor-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
}

.editor-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.editor-section h3 {
  color: #4f3929;
  font-size: 15px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
  color: rgba(111, 82, 62, 0.78);
  font-size: 12px;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4f3929;
  padding: 0 10px;
  outline: 0;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-actions button,
.import-config {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.import-config {
  display: inline-grid;
  place-items: center;
}

.import-config input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hotspot-list {
  display: grid;
  gap: 7px;
  max-height: 190px;
  overflow: auto;
}

.hotspot-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4f3929;
  padding: 9px 10px;
  text-align: left;
}

.hotspot-list button.is-selected {
  border-color: rgba(217, 146, 85, 0.8);
  background: rgba(217, 146, 85, 0.12);
}

.editor-hint {
  color: rgba(111, 82, 62, 0.68);
  font-size: 12px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 60;
  width: min(360px, calc(100vw - 36px));
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(82, 59, 42, 0.92);
  color: #fff;
  padding: 11px 16px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 760px) {
  body {
    padding: 28px 0;
  }

  .phone-stage {
    min-height: auto;
    border-radius: 22px;
  }
}

@media (max-width: 720px) {
  .editor-panel {
    top: auto;
    left: 0;
    width: 100vw;
    max-height: 72dvh;
    border-left: 0;
    border-top: 1px solid var(--line);
    transform: translateY(102%);
  }

  .editor-panel.is-open {
    transform: translateY(0);
  }

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

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