:root {
  --orange: #f58220;
  --orange-dark: #dc6510;
  --blue: #1398d4;
  --blue-dark: #0878ac;
  --ink: #25313c;
  --muted: #6d7882;
  --line: #dfe5e9;
  --surface: #ffffff;
  --canvas: #f5f7f8;
  --input: #fffbc7;
  --danger: #d92d20;
  --success: #18864b;
  --shadow: 0 18px 50px rgba(32, 47, 60, .10);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 130, 32, .10), transparent 28rem),
    var(--canvas);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  background: #fff;
  border-bottom: 2px solid #f15a24;
}

.header-inner {
  width: min(1080px, calc(100% - 32px));
  min-height: 74px;
  margin: auto;
  display: flex;
  align-items: center;
}

.brand {
  position: relative;
  width: 124px;
  min-height: 58px;
  padding-top: 8px;
  color: #f15a24;
  text-decoration: none;
  display: block;
}

.speed-lines {
  position: absolute;
  top: 9px;
  left: 5px;
  width: 112px;
  height: 17px;
  transform: skewX(-26deg);
}

.speed-lines i {
  position: absolute;
  right: 0;
  height: 4px;
  background: #f15a24;
  border-radius: 1px;
}
.speed-lines i:nth-child(1) { top: 0; width: 96px; }
.speed-lines i:nth-child(2) { top: 6px; width: 108px; }
.speed-lines i:nth-child(3) { top: 12px; width: 82px; }

.brand-wordmark {
  position: absolute;
  z-index: 1;
  left: 8px;
  top: 14px;
  display: block;
  white-space: nowrap;
}
.brand-wordmark strong {
  display: block;
  padding: 0 4px;
  width: max-content;
  color: #f15a24;
  background: #fff;
  font-size: 1.42rem;
  font-style: italic;
  font-weight: 950;
  letter-spacing: -.12em;
  line-height: 1.05;
  transform: skewX(-7deg);
}
.brand-wordmark small {
  display: block;
  margin-top: 2px;
  color: #f15a24;
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.page-shell {
  width: min(960px, calc(100% - 32px));
  margin: 40px auto 72px;
}

.intro { text-align: center; margin-bottom: 32px; }
.intro h1 { margin: 4px 0 5px; font-size: clamp(1.75rem, 4vw, 2.4rem); }
.intro > p:last-child { margin: 0; color: var(--muted); }
.eyebrow, .section-kicker {
  margin: 0;
  color: var(--orange-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
}

.form-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(213, 220, 225, .9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card-heading {
  min-height: 102px;
  padding: 24px clamp(22px, 5vw, 46px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #fff;
  background: linear-gradient(110deg, var(--blue-dark), var(--blue));
}
.card-heading h2 { margin: 3px 0 0; font-size: 1.55rem; }
.card-heading .section-kicker { color: rgba(255, 255, 255, .74); }
.required-note { font-size: .82rem; white-space: nowrap; }
.required-note i, em { color: #ffede9; font-style: normal; }

#recipient-form { padding: 8px clamp(22px, 5vw, 46px) 34px; }
.field-group {
  margin: 0;
  padding: 30px 0;
  border: 0;
  border-bottom: 1px dashed #cbd3d8;
}

label, legend { font-weight: 800; }
legend { padding: 0; }
label em, legend em { color: var(--danger); }

.label-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.text-button {
  padding: 5px 0;
  color: var(--orange-dark);
  background: transparent;
  border: 0;
  font-size: .86rem;
  font-weight: 800;
}

input, select {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--input);
  border: 1px solid #ebe692;
  border-radius: 11px;
  outline: 0;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder { color: #8e8b66; }
input:focus, select:focus { background: #fffef0; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(245, 130, 32, .14); }
input.invalid, select.invalid { border-color: var(--danger); background: #fff5f4; }
select:disabled { opacity: .58; cursor: not-allowed; }

.hint { margin: 8px 0 0; color: var(--muted); font-size: .84rem; }
.error { min-height: 1.2em; margin: 5px 0 0; color: var(--danger); font-size: .83rem; font-weight: 700; }
.address-warning { margin: 4px 0 0; color: var(--danger); font-size: .86rem; }
.select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.optional { margin-left: 6px; color: var(--muted); font-size: .72rem; font-weight: 500; }
.locker-group { display: grid; grid-template-columns: 1fr 1.35fr; align-items: end; gap: 22px; }
.locker-picker { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.locker-picker input { margin: 0; background: #f2f4f5; border-color: var(--line); }

.primary-button, .secondary-button, .ghost-button, .icon-button {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 0;
  font-weight: 800;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.primary-button { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(19, 152, 212, .24); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.secondary-button { color: #fff; background: var(--orange); border-radius: 10px; white-space: nowrap; }
.secondary-button:hover { background: var(--orange-dark); }
.secondary-button:disabled {
  cursor: not-allowed;
  color: #667984;
  background: #dbe4e8;
  box-shadow: none;
}
.ghost-button { color: var(--blue-dark); background: #edf8fd; border: 1px solid #caeaf7; }
.ghost-button:hover { background: #def2fa; }
.form-actions { padding-top: 32px; display: flex; justify-content: center; gap: 14px; }
.single-action .primary-button { min-width: 160px; }
dialog {
  width: min(480px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(18, 30, 40, .28);
}
dialog::backdrop { background: rgba(20, 30, 40, .46); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 1.3rem; }
.icon-button { width: 38px; min-height: 38px; padding: 0; color: var(--muted); background: #f0f3f5; font-size: 1.5rem; }
.location-list { display: grid; gap: 9px; margin: 20px 0; }
.location-list button { padding: 13px 15px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; text-align: left; font-weight: 800; }
.location-list button:hover { border-color: var(--orange); background: #fffaf5; }
.location-list small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.full-button { width: 100%; }

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 26px;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  color: #fff;
  background: #22313d;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(20, 30, 40, .24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--success); }

.tracking-shell { width: min(820px, calc(100% - 32px)); }
.tracking-card {
  overflow: hidden;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface);
  border: 1px solid rgba(213, 220, 225, .9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.tracking-summary {
  padding-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}
.summary-label { margin: 0 0 4px; color: var(--muted); font-size: .8rem; }
.tracking-number-row { display: flex; align-items: center; gap: 10px; }
.tracking-number-row strong { font-size: clamp(1.3rem, 4vw, 1.75rem); letter-spacing: .04em; }
.copy-button {
  padding: 5px 10px;
  color: var(--blue-dark);
  background: #edf8fd;
  border: 1px solid #caeaf7;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 800;
}
.status-pill {
  padding: 8px 14px;
  color: #95500b;
  background: #fff1da;
  border: 1px solid #ffd49b;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}
.shipment-meta {
  margin: 24px 0 38px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  background: #f7f9fa;
  border-radius: 14px;
}
.shipment-meta span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .76rem; }
.shipment-meta strong { font-size: .93rem; }
.timeline-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.timeline-heading h2 { margin: 3px 0 0; font-size: 1.4rem; }
.timeline-heading > span { color: var(--muted); font-size: .78rem; }
.tracking-timeline { margin: 28px 0 0; padding: 0; list-style: none; }
.tracking-timeline li {
  position: relative;
  min-height: 104px;
  padding: 0 0 26px 56px;
  color: #9aa3aa;
}
.tracking-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 36px;
  bottom: -2px;
  width: 3px;
  background: #dce2e6;
}
.tracking-timeline li.completed::before { background: var(--success); }
.tracking-timeline li.current::before { background: linear-gradient(var(--orange) 0 45%, #dce2e6 45% 100%); }
.timeline-dot {
  position: absolute;
  left: 0;
  top: -4px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #f2f4f5;
  border: 2px solid #cfd6db;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 900;
}
.tracking-timeline .completed, .tracking-timeline .current { color: var(--ink); }
.tracking-timeline .completed .timeline-dot { color: #fff; background: var(--success); border-color: var(--success); }
.tracking-timeline .current .timeline-dot { color: #fff; background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 5px #fff1e5; }
.tracking-timeline strong { display: block; margin-bottom: 3px; }
.tracking-timeline p { margin: 0; color: var(--muted); font-size: .86rem; }
.tracking-timeline time { display: block; margin-top: 5px; color: var(--blue-dark); font-size: .76rem; font-weight: 700; }
.tracking-actions { padding-top: 12px; display: flex; justify-content: center; gap: 12px; }
.action-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.phone-login-shell { width: min(680px, calc(100% - 32px)); }
.phone-login-card #phone-login-form { padding-top: 0; }
.login-illustration {
  width: 82px;
  height: 82px;
  margin: 32px auto 0;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff2dd, #fffaf2);
  border: 1px solid #ffdfb5;
  border-radius: 50%;
  font-size: 2.1rem;
}
.login-field-group { padding-top: 24px; }
.login-actions { padding-top: 28px; }
.verification-field-group { padding-top: 24px; }
.verification-input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.verification-input-row .secondary-button { align-self: end; min-height: 48px; border-radius: 11px; }

.processing-shell {
  width: min(620px, calc(100% - 32px));
  min-height: calc(100vh - 76px);
  margin: auto;
  padding: 64px 0;
  display: grid;
  place-items: center;
}
.processing-card {
  width: 100%;
  padding: clamp(38px, 8vw, 70px) clamp(24px, 7vw, 58px);
  background: #fff;
  border: 1px solid rgba(213, 220, 225, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.processing-card h1 { margin: 8px 0; font-size: clamp(1.7rem, 5vw, 2.25rem); }
.processing-card > p:not(.eyebrow) { margin: 0; color: var(--muted); }
.processing-spinner {
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border: 4px solid #e0eef4;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: processing-spin .9s linear infinite;
}
.processing-spinner.complete {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
  font-size: 2rem;
  font-weight: 900;
  animation: none;
}
.loading-bar {
  overflow: hidden;
  height: 7px;
  margin: 30px auto 0;
  background: #e9eef1;
  border-radius: 999px;
}
.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue));
  border-radius: inherit;
  animation: processing-slide 1.15s ease-in-out infinite;
}
.processing-return { margin-top: 28px; }
@keyframes processing-spin { to { transform: rotate(360deg); } }
@keyframes processing-slide {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(245%); }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 20px, 960px); margin-top: 26px; }
  .intro { margin-bottom: 25px; }
  .card-heading { padding: 20px; }
  #recipient-form { padding: 4px 20px 27px; }
  .select-grid, .locker-group { grid-template-columns: 1fr; }
  .locker-picker { grid-template-columns: 1fr; }
  .locker-picker input { margin-top: 10px; }
  .secondary-button { width: 100%; }
  .verification-input-row { grid-template-columns: 1fr; }
  .shipment-meta { grid-template-columns: 1fr; gap: 13px; }
}

@media (max-width: 430px) {
  .header-inner { width: calc(100% - 22px); min-height: 68px; }
  .brand { transform: scale(.92); transform-origin: left center; }
  .card-heading { align-items: flex-end; }
  .required-note { font-size: .74rem; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .single-action { grid-template-columns: 1fr; }
  .tracking-summary { align-items: flex-start; flex-direction: column; }
  .tracking-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .login-actions { grid-template-columns: 1fr; }
}


