:root {
  --text: #3d4a4c;
  --muted: #9aa2a6;
  --line: #d8d8d8;
  --soft-line: #ececec;
  --blue: #007fba;
  --blue-deep: #006fa4;
  --teal: #0c7583;
  --gold: #c6a734;
  --green: #11b51d;
  --red: #ff4d57;
  --panel-bg: #ffffff;
  --page-bg: #ffffff;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
}

button,
select,
textarea {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 455px minmax(0, 1fr);
  background: #fbfbfb;
}

.query-panel {
  min-height: 100vh;
  padding: 28px 28px 0 24px;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 18px rgba(0, 0, 0, 0.035);
  background: var(--panel-bg);
}

.query-panel h1 {
  margin: 0 0 22px;
  text-align: center;
  color: rgb(85, 85, 85);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
}

.language-select {
  display: block;
  width: 120px;
  margin-bottom: 18px;
}

.language-select select {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  color: #222;
  border: 1px solid var(--line);
  background: #fbfbfb;
  outline: none;
}

.order-input-wrap {
  display: block;
}

.order-input-wrap textarea {
  width: 100%;
  height: 212px;
  display: block;
  resize: vertical;
  padding: 9px 8px;
  border: 1px solid var(--line);
  color: #3d4a4c;
  background: #fff;
  line-height: 2;
  outline: none;
}

.order-input-wrap textarea::placeholder {
  color: var(--muted);
}

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

.btn {
  height: 32px;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn:active {
  transform: translateY(1px);
}

.btn-search {
  background: linear-gradient(180deg, #0784bf, var(--blue-deep));
}

.btn-reset {
  background: var(--red);
}

.icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
}

.search-icon {
  border: 2px solid #fff;
  border-radius: 50%;
  width: 15px;
  height: 15px;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -5px;
  bottom: -2px;
  background: #fff;
  transform: rotate(45deg);
  transform-origin: left center;
}

.reset-icon {
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.reset-icon::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #fff;
  transform: rotate(-30deg);
}

.results-panel {
  min-width: 0;
  padding: 24px 12px 36px 18px;
  background: #fbfbfb;
  overflow-x: auto;
}

.result-count {
  height: 28px;
  text-align: center;
  color: rgb(119, 119, 119);
  font-size: 16px;
  font-weight: 400;
}

.empty-state,
.notice {
  max-width: 620px;
  margin: 80px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--soft-line);
  color: var(--muted);
  text-align: center;
  background: #fcfcfc;
}

.result-list {
  display: grid;
  gap: 24px;
}

.result-card {
  display: grid;
  grid-template-columns: 320px 210px 250px 280px;
  column-gap: 70px;
  row-gap: 0;
  min-height: 180px;
  min-width: 1120px;
  padding: 10px 16px 12px;
  border: 1px solid #bdbdbd;
  background: #fff;
  font-size: 12px;
}

.card-main {
  min-width: 0;
}

.shipment-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  cursor: pointer;
  outline: none;
}

.shipment-head:focus-visible {
  outline: 2px solid rgba(0, 127, 186, 0.35);
  outline-offset: 2px;
}

.status-badge {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background: var(--green);
  position: relative;
}

.status-badge::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
}

.status-badge::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 12px;
  width: 8px;
  height: 13px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(38deg);
}

.is-loading {
  min-height: 78px;
}

.is-loading .shipment-head {
  margin-bottom: 0;
}

.is-loading .status-badge {
  border: 0;
  background: #b9b9b9;
}

.is-loading .status-badge::before {
  inset: 7px;
  border: 4px solid #fff;
  border-left-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.is-loading .status-badge::after {
  display: none;
}

.is-loading .timeline {
  display: none;
}

.is-not-found {
  min-height: 98px;
}

.is-not-found .shipment-head {
  margin-bottom: 14px;
  cursor: default;
}

.is-not-found .status-badge {
  background: #ff8a00;
}

.is-not-found .status-badge::before {
  left: 17px;
  top: 7px;
  width: 0;
  height: 20px;
  border: 0;
  border-left: 4px solid #fff;
  border-radius: 0;
}

.is-not-found .status-badge::after {
  left: 17px;
  top: 30px;
  width: 4px;
  height: 4px;
  border: 0;
  background: #fff;
  transform: none;
}

.is-collapsed {
  min-height: 62px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.is-collapsed .shipment-head {
  margin-bottom: 0;
}

.is-collapsed .timeline {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.shipment-head h2 {
  margin: 1px 0 4px;
  color: var(--blue);
  width: 260px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-line {
  margin: 0;
  color: #354548;
  font-size: 12px;
  line-height: 18px;
}

.status-line span {
  color: var(--teal);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding-left: 22px;
  color: #0072b4;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: #fff;
}

.timeline .not-found-message {
  height: 20px;
  padding-left: 0;
  color: #ff0000;
  font-weight: 700;
}

.timeline .not-found-message::before {
  display: none;
}

.timeline .event {
  color: #0072b4;
  white-space: nowrap;
}

.timeline time {
  flex: 0 0 auto;
  color: var(--gold);
  white-space: nowrap;
}

.meta-grid {
  margin: 6px 0 0;
  display: grid;
  align-content: start;
  grid-template-rows: 18px 18px;
  gap: 0;
  color: #333;
  font-size: 12px;
  line-height: 18px;
}

.meta-grid div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.meta-grid dt {
  font-weight: 400;
}

.meta-grid dd {
  margin: 0;
  color: var(--blue);
  min-width: 0;
  white-space: nowrap;
}

.is-home {
  display: block;
  min-height: 100vh;
  border-top: 1px solid #dfdfdf;
}

.is-home .query-panel {
  width: 600px;
  min-height: 0;
  margin: 36px auto 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.is-home .query-panel h1 {
  margin-bottom: 22px;
  font-size: 32px;
}

.is-home .language-select {
  margin-bottom: 20px;
}

.is-home .order-input-wrap textarea {
  height: 212px;
}

.is-home .results-panel {
  display: none;
}

.is-home .actions {
  height: 32px;
}

.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: 1180px) {
  .page-shell {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .result-card {
    grid-template-columns: minmax(320px, 1fr) minmax(190px, 0.5fr);
  }
}

@media (max-width: 820px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .query-panel {
    min-height: auto;
    padding: 22px 16px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }

  .query-panel h1 {
    font-size: 28px;
  }

  .order-input-wrap textarea {
    height: 180px;
  }

  .results-panel {
    padding: 18px 12px 28px;
  }

  .result-card {
    grid-template-columns: minmax(320px, 1fr);
    min-width: 760px;
    gap: 10px;
  }

  .timeline li {
    display: grid;
  }

  .timeline time {
    margin-left: 0;
  }

  .is-home .query-panel {
    width: min(600px, calc(100vw - 32px));
    margin-top: 34px;
  }
}
