/* ============================================
   旧衣回收 H5 - 白色主题（参照截图样式）
   浅色 · 卡片 · 时间线 · 移动端优先
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2D7A4F;
  --primary-light: #43A047;
  --primary-dark: #21633D;
  --primary-bg: #E8F5E9;
  --primary-border: #C8E6C9;

  --accent: #D96B00;
  --accent-bg: #FFF3E0;

  --bg: #F4F6F8;
  --card: #FFFFFF;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --card-radius: 16px;

  --text-primary: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-hint: #BBBBBB;

  --border: #E8E8E8;
  --divider: #F0F0F0;

  --tip-bg: #FDF8EC;
  --tip-text: #9C6D20;
  --tip-content: #8A6D3B;

  --timeline-active: #2D7A4F;
  --timeline-inactive: #CCCCCC;
  --timeline-line-active: #2D7A4F;
  --timeline-line-inactive: #E0E0E0;
}

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

html { font-size: 16px; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== 页面容器 ===== */
.page-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* ===== 顶部 Header ===== */
.header-banner {
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px 20px 40px;
  position: relative;
  overflow: hidden;
}

.header-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.header-banner::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.header-banner .logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.header-banner .logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
}

.header-banner .brand-name {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-banner .subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 400;
  margin-top: 6px;
  margin-left: 52px;
  position: relative;
  z-index: 1;
}

/* ===== 包裹信息卡片 ===== */
.package-card {
  background: var(--card);
  margin: -20px 16px 12px;
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  position: relative;
  z-index: 2;
}

.package-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.package-card .order-no {
  font-size: 13px;
  color: var(--text-muted);
}

.package-card .status-badge {
  background: var(--primary-bg);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.package-card .card-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.package-card .pkg-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: #D0E7D2;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.package-card .pkg-info {
  flex: 1;
  min-width: 0;
}

.package-card .pkg-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.package-card .pkg-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}

.package-card .pkg-reward {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ===== 区块通用样式 ===== */
.section-card {
  background: var(--card);
  margin: 0 16px 12px;
  border-radius: var(--card-radius);
  padding: 18px 16px;
  box-shadow: var(--card-shadow);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-header .bar {
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-header .title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header .extra {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 回收进度 - 竖向时间线 ===== */
.progress-timeline {
  position: relative;
  padding: 0;
}

.progress-item {
  display: flex;
  gap: 0;
  min-height: 64px;
  position: relative;
}

.progress-item:last-child {
  min-height: auto;
}

/* 左侧：时间 */
.progress-item .pt-time {
  width: 72px;
  min-width: 72px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  padding-right: 16px;
  padding-top: 2px;
  line-height: 1.4;
}

.progress-item.active .pt-time,
.progress-item.completed .pt-time {
  color: var(--text-secondary);
  font-weight: 500;
}

/* 中间：圆点 + 连接线 */
.progress-item .pt-node {
  width: 24px;
  min-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.progress-item .pt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--timeline-inactive);
  background: var(--card);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-top: 4px;
}

.progress-item.completed .pt-dot {
  border-color: var(--timeline-active);
  background: var(--timeline-active);
}

.progress-item.completed .pt-dot::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: #fff;
  font-weight: 700;
}

.progress-item.active .pt-dot {
  border-color: var(--timeline-active);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(45, 122, 79, 0.15);
}

.progress-item.active .pt-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--timeline-active);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.7; }
}

.progress-item .pt-line {
  width: 2px;
  flex: 1;
  background: var(--timeline-line-inactive);
  margin-top: 4px;
}

.progress-item.completed .pt-line {
  background: var(--timeline-line-active);
}

.progress-item:last-child .pt-line {
  display: none;
}

/* 右侧：内容 */
.progress-item .pt-content {
  flex: 1;
  padding-left: 14px;
  padding-bottom: 20px;
  min-width: 0;
}

.progress-item:last-child .pt-content {
  padding-bottom: 0;
}

.progress-item .pt-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.progress-item .pt-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.progress-item.pending .pt-title {
  color: var(--text-muted);
  font-weight: 400;
}

.progress-item.pending .pt-desc {
  color: var(--text-hint);
}

/* ===== 包裹物流 - 时间线 ===== */
.logistics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.logistics-header .shipper-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.logistics-header .waybill-no {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.logistics-timeline {
  position: relative;
  padding-left: 20px;
}

.logistics-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: var(--timeline-line-inactive);
}

.logistics-item {
  position: relative;
  padding-bottom: 20px;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.4s ease forwards;
}

.logistics-item:last-child {
  padding-bottom: 0;
}

.logistics-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--timeline-inactive);
  z-index: 1;
}

.logistics-item:first-child::before {
  width: 10px;
  height: 10px;
  left: -18px;
  top: 5px;
  background: var(--timeline-active);
  box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.2);
}

.logistics-item .log-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}

.logistics-item:first-child .log-desc {
  color: var(--text-primary);
  font-weight: 500;
}

.logistics-item .log-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.logistics-item:nth-child(1) { animation-delay: 0.05s; }
.logistics-item:nth-child(2) { animation-delay: 0.1s; }
.logistics-item:nth-child(3) { animation-delay: 0.15s; }
.logistics-item:nth-child(4) { animation-delay: 0.2s; }
.logistics-item:nth-child(5) { animation-delay: 0.25s; }
.logistics-item:nth-child(6) { animation-delay: 0.3s; }
.logistics-item:nth-child(7) { animation-delay: 0.35s; }
.logistics-item:nth-child(8) { animation-delay: 0.4s; }

/* ===== 温馨提示 ===== */
.tips-card {
  background: var(--tip-bg);
  margin: 0 16px 16px;
  border-radius: 12px;
  padding: 14px 16px;
}

.tips-card .tips-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tip-text);
  margin-bottom: 8px;
}

.tips-card .tips-content {
  font-size: 12px;
  color: var(--tip-content);
  line-height: 1.8;
}

.tips-card .tips-content p {
  margin-bottom: 2px;
}

/* ===== 加载状态 ===== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--divider);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 空状态 / 错误提示 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.empty-state .empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ===== Mock 提示 ===== */
.mock-tip {
  margin: 0 16px 12px;
  padding: 10px 14px;
  background: var(--accent-bg);
  border: 1px solid #FFE0B2;
  border-radius: 10px;
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 底部 ===== */
.footer {
  text-align: center;
  padding: 20px 16px 32px;
  color: var(--text-hint);
  font-size: 12px;
}

.footer .eco-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ===== 响应式 ===== */
@media (min-width: 480px) {
  body {
    background: #E8EAED;
  }
  .page-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    min-height: calc(100vh - 40px);
    overflow: hidden;
  }
  .header-banner {
    border-radius: 0;
  }
}

/* ========== 2026-10 新增：运单号查询 / 顺丰验证 / 备案号 ========== */
.query-form { margin-top: 4px; }
.query-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.query-input,
.phone-verify input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-primary);
  font-size: 16px; /* 16px 以上 iOS 聚焦时不会自动放大页面 */
  letter-spacing: 0.5px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.query-input:focus,
.phone-verify input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.15);
}
.query-error {
  min-height: 18px;
  margin: 6px 2px 4px;
  font-size: 12px;
  color: #C62828;
}
.query-btn,
.phone-verify button {
  height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.query-btn { width: 100%; }
.query-btn:active,
.phone-verify button:active { background: var(--primary-dark); }
.query-btn:focus-visible,
.phone-verify button:focus-visible,
.requery-btn:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.query-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.notice-card {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--tip-bg);
  color: var(--tip-content);
  font-size: 13px;
  line-height: 1.7;
}
.notice-card strong { color: var(--tip-text); }

.phone-verify { padding: 4px 0 2px; }
.phone-verify .pv-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}
.phone-verify .pv-reason {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 10px;
}
.phone-verify .pv-row { display: flex; gap: 8px; }
.phone-verify input { flex: 1; min-width: 0; letter-spacing: 4px; }
.phone-verify button { flex: none; padding: 0 18px; white-space: nowrap; }

.requery-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 4px 16px 0;
  padding: 12px;
  border: 1px solid var(--primary-border);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
}

.footer .beian { margin-top: 14px; line-height: 2; }
.footer .beian a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 6px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer .beian .ga-icon { width: 14px; height: 14px; }
.phone-verify input::placeholder { letter-spacing: normal; }

@media (prefers-reduced-motion: reduce) {
  .logistics-item { animation: none; opacity: 1; transform: none; }
}
