:root {
  color-scheme: light;
  --ink: #2b3544;
  --ink-deep: #202a38;
  --ink-soft: #3b485b;
  --blue: #62789c;
  --blue-soft: #8292ab;
  --canvas: #f7f8f9;
  --paper: #ffffff;
  --line: #e2e8f0;
  --line-dark: rgba(255, 255, 255, 0.16);
  --accent: #d4a373;
  --accent-hover: #c49365;
  --accent-soft: #f5ece3;
  --success: #39765a;
  --danger: #a64f3c;
  --shadow: 0 18px 45px rgba(43, 53, 68, 0.09);
  --content: 1120px;
  --radius: 8px;
  font-family:
    Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--paper);
  background: var(--blue);
}

:focus-visible {
  outline: 3px solid rgba(212, 163, 115, 0.46);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 20;
  height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.site-header__inner {
  display: flex;
  width: min(calc(100% - 48px), var(--content));
  height: 100%;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  height: 42px;
  align-items: center;
  text-decoration: none;
}

.brand-logo-frame {
  position: relative;
  display: block;
  width: 98px;
  height: 34px;
  overflow: hidden;
}

.brand-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 148px;
  height: 148px;
  max-width: none;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.language-switcher {
  display: flex;
  height: 40px;
  align-items: stretch;
  gap: 24px;
}

.language-switcher__option {
  position: relative;
  padding: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.language-switcher__option::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.language-switcher__option:hover,
.language-switcher__option.is-active {
  color: var(--ink);
}

.language-switcher__option.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.customer-main {
  width: 100%;
}

.lookup-workspace {
  position: relative;
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
}

.lookup-workspace::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  content: "";
}

.lookup-workspace__inner {
  position: relative;
  display: grid;
  width: min(calc(100% - 48px), var(--content));
  min-height: 472px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 0.86fr) minmax(480px, 1.14fr);
}

.lookup-intro {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 68px 56px 62px 0;
  flex-direction: column;
  justify-content: space-between;
}

.lookup-intro::after {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: 52px;
  width: 1px;
  background: var(--line-dark);
  content: "";
}

.lookup-intro h1 {
  max-width: 8em;
  margin: 0;
  color: var(--paper);
  font-size: clamp(42px, 4.6vw, 60px);
  font-weight: 760;
  line-height: 1.16;
}

.lookup-intro h1::before {
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 24px;
  background: var(--accent);
  content: "";
}

.route-visual {
  width: min(100%, 400px);
  margin-top: 52px;
}

.route-visual svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.route-visual.is-motion-paused * {
  animation-play-state: paused !important;
}

.route-visual__ambient,
.route-visual__track,
.route-visual__progress {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-visual__ambient {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 12;
}

.route-visual__track {
  stroke: rgba(255, 255, 255, 0.24);
  stroke-dasharray: 2 8;
  stroke-width: 2.4;
  animation: route-drift 15s linear infinite;
}

.route-visual__progress {
  stroke: var(--accent);
  stroke-dasharray: 74 236;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 5px rgba(212, 163, 115, 0.45));
  animation: route-progress 8s ease-in-out infinite;
}

.route-visual__origin-halo {
  fill: rgba(212, 163, 115, 0.12);
  stroke: rgba(212, 163, 115, 0.42);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: origin-breathe 3.4s ease-in-out infinite;
}

.route-visual__office {
  fill: var(--ink);
  stroke: var(--accent);
  stroke-width: 1.8;
}

.route-visual__office-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.route-visual__parcel-top,
.route-visual__parcel-left,
.route-visual__parcel-right {
  stroke: #f1c08d;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.route-visual__parcel-top {
  fill: #dca76f;
}

.route-visual__parcel-left {
  fill: #b97f4e;
}

.route-visual__parcel-right {
  fill: #c9915d;
}

.route-visual__parcel-tape {
  fill: none;
  stroke: rgba(43, 53, 68, 0.78);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1;
}

.route-visual__home {
  fill: var(--ink);
  stroke: var(--paper);
  stroke-linejoin: round;
  stroke-width: 2;
}

.route-visual__home-line {
  fill: none;
  stroke: var(--paper);
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.route-visual__destination-glow {
  fill: rgba(212, 163, 115, 0.18);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: destination-arrival 8s ease-out infinite;
}

.route-visual__firework {
  fill: var(--paper);
  opacity: 0;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 1.45;
  transform-box: fill-box;
  transform-origin: center;
}

.route-visual__firework--primary {
  animation: firework-primary 8s cubic-bezier(0.2, 0.75, 0.25, 1) infinite;
  filter: drop-shadow(0 0 3px rgba(212, 163, 115, 0.72));
}

.route-visual__firework--secondary {
  animation: firework-secondary 8s cubic-bezier(0.2, 0.75, 0.25, 1) infinite;
  stroke: rgba(255, 255, 255, 0.9);
}

.route-visual__spark {
  fill: var(--accent);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: arrival-spark 8s ease-out infinite;
}

.route-visual__spark--two {
  animation-delay: 0.16s;
}

.route-visual__spark--three {
  animation-delay: 0.3s;
}

.route-visual__milestone {
  fill: var(--ink);
  stroke: var(--accent);
  stroke-width: 1.4;
  transform-box: fill-box;
  transform-origin: center;
  animation: milestone-pulse 4s ease-in-out infinite;
}

.route-visual__milestone--two {
  animation-delay: 1.1s;
}

.route-visual__courier {
  offset-path: path("M18 77 C72 20 126 95 180 42 C205 18 232 20 262 36");
  offset-rotate: 0deg;
  animation: courier-travel 8s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.route-visual__origin-label path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 1;
}

.route-visual__origin-label text {
  fill: rgba(255, 255, 255, 0.74);
  font-family: inherit;
  font-size: 8px;
  font-weight: 600;
}

.lookup-console {
  display: flex;
  min-width: 0;
  padding: 68px 0 62px 64px;
  flex-direction: column;
  justify-content: center;
}

.search-form {
  width: 100%;
}

.search-form > label {
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 650;
}

.search-row {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 112px;
}

.search-row input,
.admin-page input {
  width: 100%;
  min-width: 0;
  height: 60px;
  border: 1px solid transparent;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 0 20px;
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-row input::placeholder,
.admin-page input::placeholder {
  color: #96a1b2;
}

.search-row input:focus,
.admin-page input:focus {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  outline: 0;
}

.search-row button,
.wide-button {
  position: relative;
  min-width: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-deep);
  background: var(--accent);
  cursor: pointer;
  font-size: 16px;
  font-weight: 760;
  transition: background 160ms ease, transform 160ms ease;
}

.search-row button:hover,
.wide-button:hover {
  background: var(--accent-hover);
}

.search-row button:active,
.wide-button:active {
  transform: translateY(1px);
}

.search-row button:disabled {
  cursor: wait;
}

.button-progress {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.button-progress i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  animation: loading-dot 850ms ease-in-out infinite;
}

.button-progress i:nth-child(2) {
  animation-delay: 110ms;
}

.button-progress i:nth-child(3) {
  animation-delay: 220ms;
}

.lookup-workspace.is-searching .button-label {
  visibility: hidden;
}

.lookup-workspace.is-searching .button-progress {
  display: flex;
}

.tracking-community {
  display: flex;
  margin: 18px 0 0;
  align-items: baseline;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  gap: 5px;
}

.tracking-community strong {
  color: var(--accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  transition: transform 200ms ease, color 200ms ease;
}

.tracking-community.is-updated strong {
  color: var(--paper);
  transform: translateY(-2px);
}

.response-zone {
  min-height: 32px;
  margin-top: 26px;
}

.message {
  min-height: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.message:empty {
  display: none;
}

.has-query-error .message {
  color: #f0b8aa;
}

.result {
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
}

.result.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease, transform 280ms ease;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-label {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.result-state {
  display: inline-flex;
  min-height: 26px;
  border: 1px solid #cfe0d6;
  border-radius: 999px;
  padding: 2px 10px;
  align-items: center;
  color: var(--success);
  background: #f2f7f4;
  font-size: 12px;
  font-weight: 650;
}

.tracking-number {
  display: block;
  margin: 10px 0 22px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 760;
  line-height: 1.12;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.result dl {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.result dl > div {
  min-width: 0;
}

.result dt {
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.result dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 650;
}

.tracking-link {
  display: inline-flex;
  min-height: 38px;
  margin-top: 22px;
  border-bottom: 1px solid currentColor;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.tracking-link::after {
  margin-left: 8px;
  content: "↗";
  font-size: 15px;
}

.notice-section {
  display: grid;
  width: min(calc(100% - 48px), var(--content));
  margin: 0 auto;
  padding: 72px 0 78px;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 72px;
}

.notice-section__heading {
  position: sticky;
  top: 28px;
  align-self: start;
}

.notice-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 740;
  line-height: 1.25;
}

.notice-section h2::after {
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 18px;
  background: var(--accent);
  content: "";
}

.notice-section ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: notice;
}

.notice-section li {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 22px 0 22px 54px;
  color: #4b586a;
  counter-increment: notice;
  font-size: 15px;
}

.notice-section li:last-child {
  border-bottom: 1px solid var(--line);
}

.notice-section li::before {
  position: absolute;
  top: 20px;
  left: 0;
  display: grid;
  width: 30px;
  height: 30px;
  border: 1px solid #d9c0a8;
  border-radius: 50%;
  place-items: center;
  color: #926b49;
  content: counter(notice, decimal-leading-zero);
  font-size: 10px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.site-footer {
  display: flex;
  width: min(calc(100% - 48px), var(--content));
  min-height: 74px;
  margin: 0 auto;
  align-items: center;
  justify-content: flex-end;
}

.site-footer a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.customer-page .site-header,
.customer-page .lookup-intro > *,
.customer-page .lookup-console > * {
  opacity: 0;
}

.customer-page.is-entered .site-header {
  opacity: 1;
  transition: opacity 280ms ease;
}

.customer-page.is-entered .lookup-intro > *,
.customer-page.is-entered .lookup-console > * {
  opacity: 1;
  transition: opacity 420ms ease, transform 420ms ease;
}

.customer-page .lookup-intro > *,
.customer-page .lookup-console > * {
  transform: translateY(10px);
}

.customer-page.is-entered .lookup-intro > *,
.customer-page.is-entered .lookup-console > * {
  transform: translateY(0);
}

.customer-page.is-entered .lookup-console > * {
  transition-delay: 90ms;
}

/* 管理匯入頁 */
.admin-page {
  display: grid;
  min-height: 100vh;
  padding: 48px 24px;
  place-items: center;
  background: var(--canvas);
}

.admin-page .shell {
  width: min(100%, 680px);
}

.admin-panel {
  border-top: 5px solid var(--ink);
  border-radius: var(--radius);
  padding: 46px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.admin-panel .eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
}

.admin-panel h1 {
  margin: 0 0 34px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.2;
}

.admin-page .search-form {
  display: grid;
  gap: 12px;
}

.admin-page .search-form > label {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.admin-page input {
  border-color: var(--line);
  border-radius: var(--radius);
}

.admin-page input[type="file"] {
  height: auto;
  padding: 14px;
}

.wide-button {
  min-height: 56px;
  margin-top: 16px;
  border-radius: var(--radius);
}

.admin-page .message {
  margin-top: 18px;
  color: var(--danger);
}

@keyframes route-drift {
  to {
    stroke-dashoffset: -100;
  }
}

@keyframes route-progress {
  0% {
    stroke-dashoffset: 76;
  }
  52%,
  70% {
    stroke-dashoffset: -165;
  }
  100% {
    stroke-dashoffset: -236;
  }
}

@keyframes courier-travel {
  0%,
  8% {
    opacity: 0;
    offset-distance: 0%;
  }
  14% {
    opacity: 1;
  }
  70%,
  84% {
    opacity: 1;
    offset-distance: 100%;
  }
  92%,
  100% {
    opacity: 0;
    offset-distance: 100%;
  }
}

@keyframes destination-arrival {
  0%,
  67%,
  100% {
    opacity: 0;
    transform: scale(0.7);
  }
  73% {
    opacity: 0.72;
    transform: scale(1);
  }
  86% {
    opacity: 0.18;
    transform: scale(1.35);
  }
  92% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes firework-primary {
  0%,
  68% {
    opacity: 0;
    transform: scale(0.22) rotate(-8deg);
  }
  74% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  83% {
    opacity: 0.72;
    transform: scale(1.14) rotate(3deg);
  }
  91%,
  100% {
    opacity: 0;
    transform: scale(1.28) rotate(5deg);
  }
}

@keyframes firework-secondary {
  0%,
  73% {
    opacity: 0;
    transform: scale(0.2) rotate(8deg);
  }
  79% {
    opacity: 0.92;
    transform: scale(1) rotate(0deg);
  }
  87% {
    opacity: 0.58;
    transform: scale(1.12) rotate(-3deg);
  }
  95%,
  100% {
    opacity: 0;
    transform: scale(1.24) rotate(-5deg);
  }
}

@keyframes arrival-spark {
  0%,
  72% {
    opacity: 0;
    transform: translateY(3px) scale(0.3);
  }
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  91%,
  100% {
    opacity: 0;
    transform: translateY(-5px) scale(0.45);
  }
}

@keyframes origin-breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes milestone-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.78);
  }
  45% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes loading-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 920px) {
  .lookup-workspace__inner {
    grid-template-columns: minmax(0, 0.78fr) minmax(420px, 1.22fr);
  }

  .lookup-intro {
    padding-right: 38px;
  }

  .lookup-console {
    padding-left: 38px;
  }

  .notice-section {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 44px;
  }
}

@media (max-width: 720px) {
  .site-header {
    height: 62px;
  }

  .site-header__inner,
  .lookup-workspace__inner,
  .notice-section,
  .site-footer {
    width: min(calc(100% - 32px), var(--content));
  }

  .brand-logo-frame {
    width: 86px;
    height: 30px;
  }

  .brand-logo {
    width: 132px;
    height: 132px;
  }

  .language-switcher {
    height: 36px;
    gap: 18px;
  }

  .language-switcher__option {
    font-size: 13px;
  }

  .lookup-workspace__inner {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .lookup-intro {
    padding: 38px 0 24px;
  }

  .lookup-intro::after {
    display: none;
  }

  .lookup-intro h1 {
    max-width: none;
    font-size: clamp(36px, 11vw, 48px);
  }

  .lookup-intro h1::before {
    width: 34px;
    margin-bottom: 18px;
  }

  .route-visual {
    width: 100%;
    margin-top: 22px;
  }

  .route-visual svg {
    width: min(100%, 440px);
  }

  .lookup-console {
    border-top: 1px solid var(--line-dark);
    padding: 28px 0 40px;
  }

  .response-zone {
    margin-top: 22px;
  }

  .notice-section {
    padding: 48px 0 56px;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .notice-section__heading {
    position: static;
  }

  .notice-section h2 {
    font-size: 24px;
  }

  .site-footer {
    min-height: 64px;
  }
}

@media (max-width: 460px) {
  .site-header__inner,
  .lookup-workspace__inner,
  .notice-section,
  .site-footer {
    width: min(calc(100% - 24px), var(--content));
  }

  .language-switcher {
    gap: 14px;
  }

  .language-switcher__option {
    font-size: 12px;
  }

  .lookup-intro {
    padding-top: 32px;
  }

  .lookup-intro h1 {
    font-size: 36px;
  }

  .route-visual {
    margin-top: 16px;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .search-row input {
    height: 56px;
    padding: 0 14px;
    font-size: 16px;
  }

  .search-row button {
    font-size: 15px;
  }

  .tracking-community {
    flex-wrap: wrap;
  }

  .result {
    padding: 22px 18px;
  }

  .result-heading {
    align-items: flex-start;
  }

  .tracking-number {
    font-size: 32px;
  }

  .result dl {
    grid-template-columns: 1fr;
  }

  .notice-section li {
    padding-left: 46px;
    font-size: 14px;
  }

  .notice-section li::before {
    width: 27px;
    height: 27px;
  }

  .admin-page {
    padding: 20px 12px;
  }

  .admin-panel {
    padding: 30px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .customer-page .site-header,
  .customer-page .lookup-intro > *,
  .customer-page .lookup-console > * {
    opacity: 1;
    transform: none;
  }
}
