:root {
  --brand: #1677ff;
  --brand-dark: #0b5ad4;
  --brand-soft: #eaf2ff;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #e4eaf2;
  --ink: #16202c;
  --sub: #667085;
  --ok: #12805c;
  --ok-soft: #e6f6ef;
  --warn: #b45f06;
  --warn-soft: #fff3e3;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(20, 40, 80, 0.07);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录 / 注册 ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 15% 10%, #e8f1ff 0%, #f4f7fb 55%, #eef3fa 100%);
}

.auth-card {
  width: 100%;
  max-width: 880px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 340px 1fr;
  overflow: hidden;
  min-height: 520px;
}

.auth-brand {
  background: linear-gradient(150deg, #1677ff 0%, #0b4bb3 100%);
  color: #fff;
  padding: 44px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand h1 { font-size: 24px; margin: 0 0 10px; letter-spacing: .5px; }
.auth-brand p { margin: 0; opacity: .86; font-size: 13px; line-height: 1.9; }
.auth-brand .marks { margin-top: 26px; display: grid; gap: 10px; }
.auth-brand .mark { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; opacity: .95; }
.auth-brand .mark i {
  width: 6px; height: 6px; border-radius: 50%; background: #7fe3c0;
  margin-top: 7px; flex: 0 0 6px;
}
.auth-brand .foot { font-size: 12px; opacity: .6; }

.auth-form { padding: 42px 46px; display: flex; flex-direction: column; }
.auth-form h2 { margin: 0 0 4px; font-size: 22px; }
.auth-form .desc { color: var(--sub); font-size: 13px; margin: 0 0 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 7px; }

input[type="text"], input[type="password"], input[type="tel"], input[type="url"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d9e1ec;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
input::placeholder, textarea::placeholder { color: #a9b4c4; }
textarea { resize: vertical; min-height: 76px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-ghost { background: #fff; border-color: #d9e1ec; color: var(--ink); }
.btn-ghost:hover { background: #f7f9fc; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a5342a; }

.form-foot { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 20px; }

.hint {
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.hint.show { display: block; }
.hint-err { background: var(--danger-soft); color: #8c2b21; border: 1px solid #f3c4bf; }
.hint-ok { background: var(--ok-soft); color: #0b6247; border: 1px solid #b8e5d1; }
.hint-info { background: var(--brand-soft); color: #134a96; border: 1px solid #c5d9f7; }
.hint-warn { background: var(--warn-soft); color: #7a4300; border: 1px solid #f2d3a7; }

/* ---------- 应用外壳 ---------- */
.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.topbar .logo .dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(140deg, #1677ff, #0b4bb3);
}
.topbar .nav { display: flex; gap: 6px; margin-left: 12px; }
.topbar .nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--sub); font-size: 14px;
}
.topbar .nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--sub); font-size: 13px; }
.topbar .who b { color: var(--ink); font-weight: 600; }

.page { max-width: 1320px; margin: 0 auto; padding: 20px 22px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.page-head h1 { font-size: 20px; margin: 0 0 4px; }
.page-head .sub { color: var(--sub); font-size: 13px; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .k { color: var(--sub); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: .5px; }
.stat.s-blue .v { color: var(--brand); }
.stat.s-warn .v { color: var(--warn); }
.stat.s-ok .v { color: var(--ok); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; }
.card .card-sub { color: var(--sub); font-size: 13px; margin: -8px 0 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .f { display: flex; flex-direction: column; gap: 5px; }
.filters .f label { font-size: 12.5px; color: var(--sub); }
.filters .f input, .filters .f select { min-width: 150px; padding: 8px 11px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12.5px; color: var(--sub); font-weight: 600;
  padding: 10px 12px; background: #f7f9fc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 12px; border-bottom: 1px solid #eef2f7; vertical-align: middle; font-size: 13.5px; }
tbody tr:hover { background: #fafcff; }
tbody tr:last-child td { border-bottom: none; }

.mono { font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12.5px; }
.muted { color: var(--sub); }
.small { font-size: 12.5px; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag-gray { background: #f0f2f6; color: #5b6577; }
.tag-blue { background: var(--brand-soft); color: #1350a8; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

.express-cell { display: flex; flex-direction: column; gap: 3px; }
.express-cell .no { font-family: Consolas, Monaco, monospace; font-size: 12.5px; color: #1b4d8f; }
.express-cell .st { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 5px; }
.express-cell .st .dotst { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.express-cell .st.transit .dotst { background: var(--brand); }
.express-cell .st.pending .dotst { background: #c3cbd8; }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--sub); }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 28, 45, .45);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 720px;
  max-height: 86vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(10, 25, 50, .25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x {
  border: none; background: none; font-size: 20px; color: var(--sub);
  cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.modal-head .x:hover { background: #f2f5f9; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.kv-grid { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv-grid .k { color: var(--sub); }

/* ---------- 物流轨迹 ---------- */
.timeline { position: relative; padding-left: 22px; margin-top: 6px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: #e4eaf2;
}
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%; background: #c8d2e0; border: 2px solid #fff;
}
.tl-item:first-child::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(22,119,255,.15); }
.tl-item .t { font-size: 12.5px; color: var(--sub); }
.tl-item .c { font-size: 13.5px; margin-top: 2px; }
.tl-item:first-child .c { font-weight: 600; }

.express-panel {
  border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; background: #fbfcfe;
}
.express-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.express-head .no { font-family: Consolas, Monaco, monospace; font-size: 13px; color: #17457f; }
.express-head .now { font-size: 13px; color: var(--ink); }

/* ---------- H5 ---------- */
.h5-page { max-width: 480px; margin: 0 auto; background: #fff; min-height: 100vh; padding-bottom: 32px; }
.h5-banner { width: 100%; display: block; }
.h5-banner-empty {
  height: 170px;
  background: linear-gradient(135deg, #1677ff, #0b4bb3);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.h5-banner-empty b { font-size: 17px; }
.h5-banner-empty span { font-size: 12.5px; opacity: .8; }
.h5-body { padding: 18px 20px 0; }
.h5-section-title { font-size: 15px; font-weight: 700; margin: 4px 0 14px; display: flex; align-items: center; gap: 8px; }
.h5-section-title::before { content: ""; width: 3px; height: 15px; background: var(--brand); border-radius: 2px; }
.h5-note { font-size: 12.5px; color: var(--sub); background: #f7f9fc; border-radius: 9px; padding: 10px 12px; margin: 14px 0; }
.h5-success {
  background: var(--ok-soft); border: 1px solid #b8e5d1; color: #0b6247;
  border-radius: 11px; padding: 14px 16px; margin-bottom: 16px; display: none;
}
.h5-success.show { display: block; }
.h5-success .no { font-family: Consolas, Monaco, monospace; font-size: 15px; font-weight: 700; }

/* ---------- Toast ---------- */
#toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #22303f; color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(10, 25, 50, .25);
  animation: toast-in .18s ease-out;
  max-width: 90vw;
}
.toast.err { background: #b3362a; }
.toast.ok { background: #10714f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .auth-card { grid-template-columns: 1fr; max-width: 440px; }
  .auth-brand { display: none; }
  .auth-form { padding: 32px 26px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 14px; }
  .topbar .who { display: none; }
  .page { padding: 14px 12px 50px; }
  table { font-size: 12.5px; }
  thead th, tbody td { padding: 9px 8px; }
}
