:root {
  color-scheme: light;
  --ink: #17362f;
  --muted: #60756f;
  --panel: rgba(255, 252, 243, 0.95);
  --panel-soft: rgba(255, 252, 243, 0.14);
  --panel-line: rgba(211, 171, 86, 0.42);
  --gold: #c99536;
  --gold-deep: #9d6a19;
  --green: #174338;
  --deep: #092521;
}

.crab-companion { position: fixed; z-index: 20; left: 18px; bottom: max(6px, env(safe-area-inset-bottom)); width: 112px; pointer-events: none; }
.crab-companion[hidden], .crab-greeting[hidden] { display: none; }
.crab-character { display: block; position: relative; width: 112px; height: 82px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; pointer-events: auto; }
.crab-character:hover { background: none; box-shadow: none; }
.crab-character svg { width: 112px; height: 79px; overflow: visible; filter: drop-shadow(0 4px 3px #09252140); transform-origin: 50% 85%; animation: crab-idle 3s ease-in-out infinite; }
.crab-greeting { position: absolute; left: 50%; bottom: 92px; width: 246px; max-width: calc(100vw - 28px); transform: translateX(clamp(-190px, calc(50vw - 180px), -12px)); padding: 13px 31px 13px 15px; border: 1px solid #c9953670; border-radius: 8px; background: #fffbed; color: #174338; font-size: 13px; line-height: 1.7; box-shadow: 0 5px 20px #09252122; pointer-events: auto; }
.crab-greeting::after { content: ''; position: absolute; bottom: -7px; left: 24px; width: 12px; height: 12px; background: #fffbed; border-right: 1px solid #c9953670; border-bottom: 1px solid #c9953670; transform: rotate(45deg); }
.crab-close { position: absolute; right: 0; top: 0; width: 30px; height: 30px; min-height: 0; margin: 0; padding: 0; background: none; box-shadow: none; color: #60756f; font-size: 20px; font-weight: 400; }
.crab-close:hover { background: #1743380a; box-shadow: none; }
.crab-bubbles { position: absolute; left: 66px; top: 13px; }
.crab-bubbles i { position: absolute; width: 8px; height: 8px; border: 1px solid #b9dfdc; border-radius: 50%; opacity: 0; animation: crab-bubble 6s ease-out infinite; }
.crab-bubbles i:nth-child(2) { width: 5px; height: 5px; left: 9px; animation-delay: 0.8s; }
.crab-bubbles i:nth-child(3) { left: -7px; animation-delay: 1.6s; }
.crab-claw { transform-box: fill-box; transform-origin: bottom center; }
.crab-eyes { transform-box: fill-box; transform-origin: center; animation: crab-blink 4.8s linear infinite; }
.crab-pupils { animation: crab-look 6s ease-in-out infinite; }
.is-walking .crab-character svg { animation: crab-scuttle .36s ease-in-out infinite; }
.is-walking .crab-legs { transform-box: fill-box; transform-origin: center; animation: crab-steps .18s ease-in-out infinite alternate; }
.is-greeting:not(.is-walking) .crab-character svg { animation: crab-hello .9s ease-in-out 1, crab-idle 3s .9s ease-in-out infinite; }
.is-greeting:not(.is-walking) .crab-claw-left { animation: crab-wave .45s ease-in-out 6 alternate; }
.is-greeting:not(.is-walking) .crab-claw-right { animation: crab-wave .45s .15s ease-in-out 6 alternate-reverse; }
@keyframes crab-idle { 0%,100% { transform: rotate(-3deg); } 50% { transform: translateY(-3px) rotate(3deg); } }
@keyframes crab-scuttle { 0%,100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-7px); } }
@keyframes crab-steps { from { transform: skewY(-8deg) scaleX(.94); } to { transform: skewY(8deg) scaleX(1.06); } }
@keyframes crab-wave { from { transform: rotate(-18deg) translateY(0); } to { transform: rotate(26deg) translateY(-8px); } }
@keyframes crab-hello { 0%,100% { transform: scale(1); } 15% { transform: scale(1.1,.82); } 40% { transform: translateY(-23px) rotate(-9deg) scale(.96,1.08); } 65% { transform: translateY(-6px) rotate(8deg); } 80% { transform: scale(1.08,.9); } }
@keyframes crab-blink { 0%,42%,46%,100% { transform: scaleY(1); } 44% { transform: scaleY(.12); } }
@keyframes crab-look { 0%,35%,100% { transform: translateX(0); } 45%,55% { transform: translateX(3px); } 70%,80% { transform: translateX(-3px); } }
@keyframes crab-bubble { 0%, 55% { opacity: 0; transform: translateY(0) scale(0.6); } 65% { opacity: 0.85; } 100% { opacity: 0; transform: translateY(-48px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) {
  .crab-companion .crab-character svg, .crab-companion .crab-claw, .crab-companion .crab-bubbles i, .crab-companion .crab-eyes, .crab-companion .crab-pupils, .crab-companion .crab-legs { animation: none; }
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--deep);
}

.pickup-page {
  min-height: 100svh;
  width: 100%;
  background:
    linear-gradient(180deg, transparent 0, transparent 27vw, rgba(8, 39, 34, 0.92) 50vw, #092521 100%),
    url("assets/chenghu-crab-farm.png") center top / 100% auto no-repeat,
    #092521;
  position: relative;
  overflow: hidden;
}

.pickup-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 19, 18, 0.02) 0, rgba(5, 19, 18, 0.16) 36vw, rgba(5, 19, 18, 0.62) 60vw, rgba(5, 19, 18, 0.18) 100%);
  pointer-events: none;
}

.layout-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 38px 18px 28px;
  display: grid;
  gap: 18px;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 390px;
  padding-top: min(62vw, 420px);
  color: #fff8dc;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0;
  color: #f3d28a;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 10vw, 72px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: 0;
}

.subtitle {
  margin: 10px 0 0;
  font-size: 17px;
  color: rgba(255, 248, 220, 0.92);
}

.origin-card {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(243, 210, 138, 0.34);
  border-radius: 8px;
  background: rgba(7, 31, 28, 0.42);
  backdrop-filter: blur(8px);
}

.origin-card p {
  margin: 0;
  color: rgba(255, 248, 220, 0.88);
  font-size: 14px;
  line-height: 1.75;
}

.origin-card .origin-kicker {
  margin-bottom: 6px;
  color: #f3d28a;
  font-size: 15px;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.feature-item {
  min-height: 104px;
  padding: 13px 12px;
  border: 1px solid rgba(243, 210, 138, 0.26);
  border-radius: 8px;
  background: rgba(7, 31, 28, 0.36);
  backdrop-filter: blur(8px);
}

.feature-item span {
  display: block;
  color: #f3d28a;
  font-size: 15px;
  font-weight: 700;
}

.feature-item p {
  margin: 7px 0 0;
  color: rgba(255, 248, 220, 0.82);
  font-size: 12px;
  line-height: 1.55;
}

.form-panel {
  align-self: end;
}

.pickup-form {
  padding: 20px 16px 18px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.pickup-announcement {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0 0 18px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid rgba(201, 149, 54, 0.38);
  border-radius: 8px;
  background: rgba(248, 231, 187, 0.5);
  color: var(--green);
}

.announcement-icon {
  width: 21px;
  height: 21px;
  color: var(--gold-deep);
}

.announcement-copy {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.announcement-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: announcement-scroll 16s linear infinite;
}

.announcement-track span {
  flex: 0 0 auto;
  padding-right: 48px;
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

@keyframes announcement-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
}

.section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-title.recipient {
  margin-top: 18px;
}

.specification-card {
  margin: 4px 0 18px;
  padding: 16px;
  border: 1px solid rgba(201, 149, 54, 0.4);
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.52);
}

.specification-heading,
.specification-package {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.specification-heading span,
.specification-package span,
.specification-details dt {
  color: var(--muted);
  font-size: 12px;
}

.specification-heading strong {
  color: var(--green);
  font-size: 20px;
}

.specification-package {
  margin-top: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23, 67, 56, 0.12);
}

.specification-package strong {
  color: var(--gold-deep);
  font-size: 15px;
}

.specification-details {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.specification-details div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.specification-details dt,
.specification-details dd {
  margin: 0;
  line-height: 1.55;
}

.specification-details dd {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(23, 67, 56, 0.16);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#credential-stage[hidden],
#specification-stage[hidden],
#recipient-stage[hidden] {
  display: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(201, 149, 54, 0.9);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 149, 54, 0.16);
}

button {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  color: #fffbe9;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 12px 24px rgba(157, 106, 25, 0.26);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.submit-error {
  margin: 10px 2px 0;
  color: #a12d24;
  font-size: 13px;
  line-height: 1.5;
}

.notice {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.notice.submitted {
  color: var(--green);
  font-weight: 700;
}

.text-command {
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid rgba(23, 67, 56, 0.24);
  color: var(--green);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

.secondary-button {
  border: 1px solid rgba(23, 67, 56, 0.28);
  color: var(--green);
  background: transparent;
  box-shadow: none;
}

.success-panel {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.success-panel[hidden] {
  display: none;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fffbe9;
  background: var(--green);
  font-size: 34px;
  font-weight: 700;
}

.success-panel h2 {
  margin: 18px 0 8px;
  color: var(--green);
  font-size: 26px;
  letter-spacing: 0;
}

.success-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.success-panel .success-order {
  margin-bottom: 22px;
  color: var(--ink);
}

.success-order strong {
  color: var(--gold-deep);
}

.success-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.success-actions button {
  min-width: 0;
  margin: 0;
  padding-inline: 10px;
  font-size: 14px;
}

.tracking-panel[hidden],
.tracking-result[hidden] {
  display: none;
}

.tracking-heading {
  margin-bottom: 20px;
}

.eyebrow-dark {
  margin: 0 0 5px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 700;
}

.tracking-heading h2 {
  margin: 0;
  color: var(--green);
  font-size: 24px;
  letter-spacing: 0;
}

.tracking-result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(23, 67, 56, 0.14);
}

.tracking-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tracking-summary div {
  min-width: 0;
}

.tracking-summary span,
.tracking-summary strong {
  display: block;
}

.tracking-summary span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.tracking-summary strong {
  overflow-wrap: anywhere;
  color: var(--green);
  font-size: 15px;
}

.status-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.status-stage {
  position: relative;
  display: grid;
  grid-template-rows: 18px auto;
  justify-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.status-stage:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 7px;
  left: calc(50% + 9px);
  width: calc(100% - 18px);
  height: 3px;
  background: rgba(23, 67, 56, 0.16);
}

.stage-marker {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 3px solid #d7d9d2;
  border-radius: 50%;
  background: #fff;
}

.status-stage.is-complete {
  color: var(--green);
  font-weight: 700;
}

.status-stage.is-complete .stage-marker,
.status-stage.is-complete:not(:last-child)::after {
  border-color: var(--gold);
  background: var(--gold);
}

.status-stage.is-current .stage-marker {
  box-shadow: 0 0 0 4px rgba(201, 149, 54, 0.18);
}

.tracking-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.tracking-details div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.tracking-details dt,
.tracking-details dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.tracking-details dt {
  color: var(--muted);
}

.tracking-details dd {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.tracking-return {
  margin-top: 20px;
}

@media (max-width: 420px) {
  .layout-shell {
    padding-inline: 16px;
  }

  .brand-panel {
    min-height: auto;
    padding-top: 60vw;
  }

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

  .status-progress {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-block: 22px;
  }

  .status-stage {
    grid-template-columns: 18px minmax(0, 1fr);
    grid-template-rows: 28px;
    justify-items: start;
    align-items: start;
    gap: 10px;
    text-align: left;
  }

  .status-stage:not(:last-child)::after {
    top: 16px;
    left: 7px;
    width: 3px;
    height: 12px;
  }

  .stage-marker {
    margin-top: 1px;
  }

  .tracking-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 900px) {
  body {
    min-height: 100vh;
  }

  .pickup-page {
    min-height: 100vh;
    background:
      linear-gradient(90deg, rgba(4, 24, 21, 0.7) 0%, rgba(4, 24, 21, 0.48) 45%, rgba(4, 24, 21, 0.22) 68%, rgba(4, 24, 21, 0.42) 100%),
      url("assets/chenghu-crab-farm.png") center top / cover no-repeat;
  }

  .pickup-page::before {
    background: linear-gradient(180deg, rgba(5, 19, 18, 0.08), rgba(5, 19, 18, 0.26));
  }

  .layout-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    align-items: start;
    gap: 56px;
    padding: 190px 44px 44px;
  }

  .brand-panel {
    min-height: 0;
    justify-content: flex-start;
    max-width: 660px;
    padding-top: 0;
  }

  .origin-card {
    max-width: 560px;
    padding: 20px;
  }

  .feature-grid {
    max-width: 620px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .feature-item {
    min-height: 132px;
  }

  .form-panel {
    align-self: start;
  }

  .pickup-form {
    padding: 26px 24px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-track {
    animation: none;
    transform: none;
  }

  .announcement-track span:last-child {
    display: none;
  }
}
