:root {
  --ink: #172033;
  --muted: #667085;
  --line: #dce4ee;
  --panel: #ffffff;
  --accent: #1769d5;
  --accent-dark: #0f55b6;
  --good: #16845c;
  --warn: #a96d00;
  --danger: #b42318;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f4f7fb;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: grid;
  gap: 28px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 50, 81, .06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: min(226px, 52vw);
  height: auto;
  object-fit: contain;
}

h1 {
  margin: 0 0 7px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

p { margin: 0; color: var(--muted); }

.query-panel { max-width: 100%; }

.query-panel label {
  display: block;
  margin-bottom: 9px;
  font-weight: 700;
}

.query-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
}

input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 15px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: #669ce8;
  box-shadow: 0 0 0 3px rgba(23, 105, 213, .14);
}

button {
  height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }
button:disabled { cursor: wait; opacity: .62; }
button.secondary { color: var(--ink); background: #eef2f7; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-top: 20px;
}

.result-card,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(31, 50, 81, .04);
}

.result-card { min-height: 360px; padding: 22px; }
.side-panel { padding: 22px; }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-weight: 700;
}

.section-title small { color: var(--muted); font-weight: 400; }

.match-box {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  line-height: 1.75;
}

.muted,
.empty { color: var(--muted); }

.result-box { margin-top: 16px; }

.zto-match-box {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding-left: 20px;
  border-color: #b9d7fb;
  border-left: 5px solid var(--accent);
  background: #f8fbff;
}

.zto-match-brand { display: flex; align-items: center; gap: 10px; }

.zto-mark {
  display: inline-grid;
  min-width: 39px;
  height: 22px;
  place-items: center;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-style: italic;
  font-weight: 800;
}

.zto-match-tag {
  align-self: center;
  padding: 2px 8px;
  border: 1px solid #b8d7ff;
  border-radius: 99px;
  color: #0969da;
  background: #e8f2ff;
  font-size: 12px;
  font-weight: 700;
}

.zto-match-detail { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }

.zto-handoff {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 20px 22px 24px;
  border: 1px solid #b9d7fb;
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: #f8fbff;
}

.zto-handoff-title { font-size: 19px; font-weight: 700; }
.zto-handoff-note { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.zto-official-link {
  display: inline-flex;
  min-width: 214px;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 18px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 3px 0 #0d52b0;
}

.zto-official-link:hover { background: var(--accent-dark); }
.zto-official-link span { font-size: 22px; line-height: 1; }

.shipment-summary {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.route-row { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 18px; }
.route-text { color: #30343b; font-size: 24px; font-weight: 700; line-height: 1.35; }
.route-arrow { display: inline-block; margin: 0 14px; color: #de1f2f; letter-spacing: 4px; }
.shipment-status { color: #222; font-size: 18px; font-weight: 700; white-space: nowrap; }

.summary-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 18px;
  color: #30343b;
  font-size: 16px;
}

.summary-fields strong { font-weight: 700; }
.summary-headline { margin-top: 18px; color: #70757f; font-size: 16px; font-weight: 700; line-height: 1.55; }
.service-line { margin-top: 18px; color: #30343b; font-size: 16px; font-weight: 700; }

.tracking-panel,
.signature-panel {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.tracking-title,
.signature-title {
  padding: 14px 18px;
  color: #30343b;
  background: #f6f8fb;
  font-size: 18px;
  font-weight: 700;
}

.tracking-list { display: grid; gap: 0; padding: 16px 20px 20px; }

.tracking-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding: 12px 0;
  color: #30343b;
  font-size: 16px;
  line-height: 1.55;
  border-bottom: 1px solid #edf0f4;
}

.tracking-row:last-child { border-bottom: 0; }
.tracking-time { white-space: nowrap; color: var(--muted); }
.tracking-message { font-weight: 700; }

.signature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 18px;
}

.signature-link { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.signature-link img { display: block; width: 100%; max-height: 360px; object-fit: contain; }

.raw-details { margin-top: 18px; color: var(--muted); }
.raw-details summary { cursor: pointer; font-weight: 700; }
.raw-text { max-height: 360px; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; line-height: 1.7; white-space: pre-wrap; }

.notice,
.error {
  padding: 14px 16px;
  border-radius: 6px;
}

.notice { border: 1px solid rgba(169, 109, 0, .25); color: var(--warn); background: #fff7e6; }
.error { border: 1px solid rgba(180, 35, 24, .2); color: var(--danger); background: #fff1f0; }

.side-panel ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.9; }

dialog { width: min(420px, calc(100% - 32px)); border: 0; border-radius: 6px; padding: 0; box-shadow: 0 28px 70px rgba(12, 22, 40, .25); }
dialog::backdrop { background: rgba(16, 28, 48, .45); }
.captcha-form { padding: 22px; }
.captcha-form h2 { margin: 0 0 8px; }
.captcha-form img { display: block; max-width: 100%; margin: 16px 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

@media (max-width: 820px) {
  .shell { width: min(100% - 20px, 1120px); padding: 18px 0; }
  .hero { gap: 22px; padding: 22px; }
  .brand { align-items: flex-start; flex-direction: column; gap: 14px; }
  h1 { font-size: 28px; }
  .query-row,
  .content-grid,
  .route-row,
  .tracking-row,
  .zto-handoff { grid-template-columns: 1fr; }
  .zto-handoff { gap: 16px; }
  .zto-official-link { width: 100%; }
  .zto-match-box { grid-template-columns: 1fr; }
  .zto-match-tag { justify-self: start; }
  .route-text { font-size: 22px; }
  .route-arrow { margin: 0 8px; }
  .summary-fields,
  .summary-headline,
  .service-line,
  .tracking-row { font-size: 16px; }
  .tracking-list { padding: 16px 18px 20px; }
}
