*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #222;
  background: #fff;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

/* Header */
.site-header {
  background: #003399;
  color: #fff;
  padding: 14px 12px 16px;
  text-align: center;
}

.site-title {
  margin: 0 0 12px;
  font-weight: 700;
}

.title-zh {
  display: block;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.title-ru {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  opacity: 0.95;
}

.site-slogan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
}

.site-logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.slogan-text {
  flex: 0 1 auto;
  min-width: 0;
}

.slogan-zh {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.slogan-ru {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.92;
}

/* Search */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 10px 24px;
}

.search-section {
  padding: 14px 12px 16px;
  background: #fff;
}

.waybill-input {
  display: block;
  width: 100%;
  padding: 12px 10px;
  font-size: 16px;
  text-align: center;
  border: 1px solid #b8c4d9;
  border-radius: 2px;
  outline: none;
  background: #fff;
}

.waybill-input:focus {
  border-color: #003399;
  box-shadow: 0 0 0 2px rgba(0, 51, 153, 0.15);
}

.waybill-input::placeholder {
  color: #888;
  font-size: 13px;
}

.search-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  flex: 1;
  min-height: 48px;
  padding: 8px 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #003399;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.btn:active {
  opacity: 0.88;
}

.btn-link {
  text-decoration: none;
}

.btn-line {
  display: block;
  white-space: nowrap;
}

.btn-line-ru {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.95;
}

.search-message {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
  color: #a94442;
  background: #f2dede;
  border-radius: 4px;
}

.search-message.is-error {
  color: #8a6d3b;
  background: #fcf8e3;
}

.empty-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 32px;
  min-height: 200px;
}

.empty-placeholder[hidden] {
  display: none !important;
}

.empty-placeholder-chart {
  width: 36%;
  max-width: 112px;
  margin: 0 auto;
}

.empty-placeholder-chart svg,
.empty-placeholder-chart img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

/* Info grid */
.result-section {
  margin-top: 8px;
}

.info-card {
  border: 1px solid #e8e8e8;
  background: #fff;
}

.info-row {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
}

.info-row:last-child {
  border-bottom: none;
}

.info-cell {
  flex: 1;
  padding: 10px 8px;
  min-width: 0;
  border-right: 1px solid #e8e8e8;
}

.info-cell:last-child {
  border-right: none;
}

.info-cell.full {
  flex: 1 1 100%;
  border-right: none;
  text-align: right;
}

.info-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
}

.info-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #555;
  font-weight: 400;
}

.info-cell.highlight .info-label,
.info-cell.highlight .info-sub {
  color: #c00;
  font-weight: 600;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0 4px 0 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 20px 36px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 0;
  width: 2px;
  background: #ccc;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 5px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #003399;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #003399;
}

.timeline-item.is-latest .timeline-dot {
  background: #2e8b57;
  box-shadow: 0 0 0 1px #2e8b57;
}

.timeline-badge {
  position: absolute;
  left: -2px;
  top: -2px;
  padding: 2px 6px 2px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #2e8b57;
  border-radius: 3px 0 0 3px;
  clip-path: polygon(0 0, 100% 0, 85% 50%, 100% 100%, 0 100%);
  z-index: 1;
}

.timeline-time {
  font-size: 14px;
  font-weight: 700;
  color: #003399;
}

.timeline-item.is-latest .timeline-time {
  color: #2e8b57;
}

.timeline-status {
  margin-top: 4px;
  font-size: 14px;
  color: #003399;
  word-break: break-word;
}

.timeline-item.is-latest .timeline-status {
  color: #2e8b57;
  font-weight: 600;
}

.timeline-loading {
  text-align: center;
  padding: 24px;
  color: #666;
  font-size: 14px;
}

.site-footer {
  margin-top: auto;
  padding: 16px 12px 22px;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: #aaa;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  transition: color 0.35s ease, transform 0.35s ease;
}

.site-footer.is-triple-hit {
  color: #003399;
  transform: scale(1.03);
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 3px;
}

.footer-toast {
  position: fixed;
  left: 50%;
  bottom: 56px;
  z-index: 100;
  max-width: min(320px, 88vw);
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  color: #fff;
  background: rgba(0, 51, 153, 0.94);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.footer-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
