/* 快递查询开放平台 - 全局样式（手机优先） */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }

/* 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #1677ff, #69b1ff);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
}
.nav-links { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.nav-user { font-size: 14px; color: var(--muted); }
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 8px; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; text-align: center; transition: all .15s;
  background: var(--primary); color: #fff; line-height: 1.4;
}
.btn:hover { background: var(--primary-dark); opacity: 1; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: #e6f4ff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 容器 */
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card h2 { font-size: 18px; margin-bottom: 12px; }
.card h3 { font-size: 15px; margin-bottom: 8px; }

/* 首页 Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a, #1677ff 55%, #4096ff);
  color: #fff; padding: 56px 16px 64px; text-align: center;
}
.hero h1 { font-size: 30px; margin-bottom: 12px; letter-spacing: .5px; }
.hero p { font-size: 16px; opacity: .92; max-width: 640px; margin: 0 auto 24px; }
.hero .btn { background: #fff; color: var(--primary); font-size: 15px; padding: 10px 28px; }
.hero .btn:hover { background: #e6f4ff; }

/* 特性网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: -28px; }
.grid .card { margin-bottom: 0; }
.grid .icon { font-size: 26px; margin-bottom: 8px; }
.grid h3 { font-size: 15px; margin-bottom: 6px; }
.grid p { font-size: 13px; color: var(--muted); }

/* 步骤 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; }
.step .num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.step h4 { font-size: 14px; margin-bottom: 4px; }
.step p { font-size: 12.5px; color: var(--muted); }

/* 价格 */
.price-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.price-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.price-item.hot { border-color: var(--primary); background: #e6f4ff; }
.price-item .amt { font-size: 24px; font-weight: 700; color: var(--primary); }
.price-item .desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; background: #fff; color: var(--text); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
.form-tip { font-size: 12px; color: var(--muted); margin-top: 4px; }
textarea.input { min-height: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; background: #fafafa; }
td { white-space: nowrap; }
td .num { color: var(--muted); }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; text-align: center;
}
.stat .val { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Key 展示 */
.key-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px;
  word-break: break-all;
}
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-green { background: #d1fae5; color: var(--success); }
.badge-red { background: #fee2e2; color: var(--danger); }
.badge-gray { background: #f3f4f6; color: var(--muted); }
.badge-blue { background: #dbeafe; color: var(--primary); }

/* 快递轨迹时间线 */
.trace-list { margin-top: 12px; border-left: 2px solid #e5e7eb; padding-left: 14px; }
.trace-item { position: relative; padding: 8px 0; }
.trace-item::before {
  content: ''; position: absolute; left: -19px; top: 15px; width: 8px; height: 8px;
  border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1;
}
.trace-item:first-child::before { background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.trace-time { font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.trace-text { font-size: 14px; color: var(--text); margin-top: 2px; line-height: 1.5; }
.badge-blue { background: #dbeafe; color: var(--primary); }

/* 提示条 */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* 代码块 */
pre {
  background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-overflow-scrolling: touch; white-space: pre-wrap; word-break: break-all;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 弹层（支付二维码） */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 340px;
  text-align: center; position: relative;
}
.modal .close { position: absolute; top: 10px; right: 12px; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal h3 { font-size: 16px; margin-bottom: 4px; }
.modal .amount { font-size: 26px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.qr-wrap { background: #fff; padding: 10px; border: 1px solid var(--border); border-radius: 10px; display: inline-block; }
.qr-wrap canvas { display: block; }
.pay-status { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* 页脚 */
.footer { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 12.5px; }

/* 工具 */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.right { margin-left: auto; }
.text-center { text-align: center; }

/* 充值金额选择 */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.amount-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px; text-align: center;
  cursor: pointer; transition: all .15s; background: #fff;
}
.amount-item .a { font-size: 20px; font-weight: 700; color: var(--text); }
.amount-item .b { font-size: 12px; color: var(--muted); }
.amount-item.active { border-color: var(--primary); background: #e6f4ff; }
.amount-item.active .a { color: var(--primary); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 8px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .stat .val { font-size: 20px; }
  .grid { grid-template-columns: 1fr; margin-top: -20px; }
  .steps { grid-template-columns: 1fr; }
  .nav-links { gap: 10px; }
}
