:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #9aa0a6;
  --line: #edeff2;
  --primary: #0a0a0a;
  --primary-hover: #262626;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --err-bg: #fef2f2;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* 头部 */
.header {
  margin-bottom: 32px;
  text-align: center;
}
.header h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0.5px;
}

/* 表单 */
.query-form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.04);
}
.query-form .field { margin-bottom: 20px; }
.query-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}
.query-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.query-form input::placeholder { color: #c2c6cc; }
.query-form input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
  background: #fff;
}

.btn {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { opacity: 0.85; }
.btn:disabled { background: #b0b0b0; cursor: not-allowed; }

.error-msg {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--err-bg);
  color: var(--err);
  font-size: 13px;
}

/* 加载进度提示 */
.loading-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 10px;
  background: #f7f8fa;
  text-align: center;
}
.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  border: 3px solid #e2e5ea;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}
.loading-bar {
  height: 5px;
  border-radius: 3px;
  background: #e9ebef;
  overflow: hidden;
}
.loading-bar-inner {
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: var(--primary);
  animation: loading-slide 1.2s ease-in-out infinite;
}
@keyframes loading-slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* 结果区 */
.results { margin-top: 28px; }
.result-head { margin-bottom: 14px; }
.result-head .summary { font-size: 14px; color: #555; font-weight: 500; }

.merged-list { display: flex; flex-direction: column; gap: 14px; }

/* 订单卡片（单列，舒适间距） */
.order-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.order-item .merged-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.plat-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.plat-xindakj { background: #0a0a0a; }
.plat-gantanhao { background: #d97706; }
.plat-bbtx { background: #16a34a; }

.order-item .oi-status {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

/* 头部徽章组 */
.order-item .head-badges {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; justify-content: flex-end;
}

/* 状态色块 */
.status-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.st-ok { background: #e9f9ef; color: #16a34a; }
.st-err { background: #fdecec; color: #dc2626; }
.st-warn { background: #fdf3e4; color: #d97706; }
.st-default { background: #eef1f5; color: #666677; }

/* 支付状态色块 */
.pay-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pay-paid { background: #e6f4ff; color: #1d4ed8; }
.pay-unpaid { background: #fdf3e4; color: #c2410c; }

.order-item .oi-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 10px;
}

/* 姓名 · 电话 */
.order-item .oi-people {
  display: flex; gap: 12px;
  font-size: 13px;
  padding: 5px 0;
  line-height: 1.5;
}
.order-item .oi-people .k {
  color: var(--muted);
  flex: 0 0 68px;
  font-size: 12px;
}
.order-item .oi-people .v {
  color: #444;
  flex: 1;
  word-break: break-all;
}

/* 普通字段行 */
.order-item .oi-row {
  display: flex; gap: 12px;
  font-size: 13px;
  padding: 5px 0;
  line-height: 1.5;
}
.order-item .oi-row .k {
  color: var(--muted);
  flex: 0 0 68px;
  font-size: 12px;
}
.order-item .oi-row .v {
  color: #444;
  word-break: break-all;
  flex: 1;
}

/* 物流单号（突出 + 复制） */
.order-item .oi-express {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f8ff;
  border: 1px solid #e3edff;
}
.order-item .oi-express .k {
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 68px;
}
.order-item .oi-express .v {
  color: #333;
  font-size: 13px;
  flex: 1;
  word-break: break-all;
}
.order-item .oi-express .v b {
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.3px;
}
.copy-btn {
  flex: 0 0 auto;
  border: 1px solid #d0d7e2;
  background: #fff;
  color: #4470c4;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover { background: #eef4ff; border-color: #b8cdf0; }
.copy-btn.copied { background: var(--ok); color: #fff; border-color: var(--ok); }

.order-item .oi-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #faf7f0;
  color: #b45309;
  font-size: 12px;
  line-height: 1.6;
}

/* 已发货订单卡片左侧高亮 */
.order-item.shipped {
  border-left: 3px solid #16a34a;
}

/* ============ 物流详情弹窗 ============ */
.express-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}
.express-overlay.show {
  visibility: visible;
  opacity: 1;
}

.express-modal {
  width: 100%;
  max-width: 640px;
  height: 80vh; /* 占屏五分之四 */
  background: #fff;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.express-overlay.show .express-modal {
  transform: translateY(0);
}

.express-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.express-modal-title {
  font-size: 16px;
  font-weight: 650;
}
.express-close {
  border: none;
  background: #f0f2f5;
  color: #666;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.express-close:hover { background: #e2e5ea; }

.express-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
  -webkit-overflow-scrolling: touch;
}

.express-loading, .express-empty, .express-error {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
}
.express-error { color: var(--err); }

/* 物流头部 */
.express-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.express-company { display: flex; align-items: center; gap: 12px; }
.express-logo {
  width: 44px; height: 44px; border-radius: 10px;
  object-fit: contain; background: #f5f6f8; padding: 4px;
}
.express-company-name { font-size: 16px; font-weight: 650; }
.express-number { font-size: 12px; color: var(--muted); margin-top: 3px; }
.express-status {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e9f9ef;
  color: #16a34a;
  font-size: 13px;
  font-weight: 600;
}

.express-latest {
  padding: 10px 12px;
  background: #f7f8fa;
  border-radius: 10px;
  color: #444;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.express-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 16px;
}

/* 轨迹时间线 */
.express-timeline { position: relative; }
.tl-item {
  position: relative;
  padding-left: 24px;
  padding-bottom: 22px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 6px; top: 12px; bottom: -2px;
  width: 2px;
  background: #e7ebf3;
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  position: absolute;
  left: 2px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #c8cdd6;
}
.tl-item.latest .tl-dot {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}
.tl-desc { font-size: 14px; color: #333; line-height: 1.6; }
.tl-item.latest .tl-desc { font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.sys-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 32px;
  text-align: center;
  background: var(--card);
  border-radius: 12px;
}
.sys-error.bar {
  color: var(--err);
  background: var(--err-bg);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 10px;
}

@media (max-width: 480px) {
  .page { padding: 24px 14px 48px; }
  .query-form { padding: 22px 18px; }
  .header h1 { font-size: 24px; }
}