:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e3e6ea;
  --line-strong: #d0d5dc;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #1f6feb;
  --accent-dark: #1858c4;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  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;
  font-size: 14px;
}

/* ----------------------------- 登录页 ----------------------------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, #eef3fb 0%, #f7f8fa 55%, #eef1f5 100%);
}

.login-card {
  width: 340px;
  padding: 32px 28px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(24, 40, 76, .08);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: .5px;
}

.login-card .sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.login-card label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  color: #3d4450;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

.login-card button {
  width: 100%;
  margin-top: 22px;
  padding: 11px 0;
  font-size: 15px;
  letter-spacing: 2px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.login-card button:hover { background: var(--accent-dark); }
.login-card button:disabled { opacity: .6; cursor: default; }

.login-card .msg {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 13px;
  color: #c0392b;
  text-align: center;
}

/* ----------------------------- 顶部栏 ----------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
  background: #1f2430;
  color: #fff;
}

.brand { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #c8cdd6; }

/* ----------------------------- 按钮 ------------------------------ */
button {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

button:hover { border-color: #aeb6c2; background: #fafbfc; }
button:disabled { opacity: .45; cursor: default; }
button:disabled:hover { background: #fff; border-color: var(--line-strong); }

button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

button.ghost {
  background: transparent;
  border-color: transparent;
  color: inherit;
  padding: 6px 10px;
}

button.ghost:hover { background: rgba(127, 140, 160, .16); }

/* ----------------------------- 筛选区 ----------------------------- */
main { padding: 16px 20px 40px; }

.filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 10px;
}

.filters .row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
}

.filters .row + .row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  align-items: center;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label { font-size: 12px; color: var(--muted); }

.field select,
.field input {
  height: 34px;
  min-width: 148px;
  max-width: 240px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

/* 发货地 / 目的地：输入框，留出 placeholder 的位置 */
.field input[type="text"] { min-width: 208px; }

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

.filters .actions { gap: 12px; }
.filters .hint { font-size: 12px; color: var(--muted); }

/* ----------------------------- 结果区 ----------------------------- */
.result {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: #3d4450;
}

.pagesize { color: var(--muted); font-size: 12px; }
.pagesize select {
  height: 26px;
  margin: 0 2px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
}

.table-wrap { overflow-x: auto; max-height: 62vh; overflow-y: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #3d4450;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f2f5;
  color: #2b3140;
}

tbody tr:hover td { background: #f8fbff; }

td.awb { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }
td.time { color: #4a5262; font-variant-numeric: tabular-nums; }

td.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  background: #eef1f5;
  color: #3d4450;
}

.badge.s-in { background: #e8f1ff; color: #1858c4; }
.badge.s-ok { background: #e7f6ec; color: #1a7f45; }
.badge.s-wait { background: #fdf3e3; color: #9a6212; }
.badge.s-bad { background: #fdeceb; color: #b4322a; }

/* ----------------------------- 分页 ------------------------------ */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: #3d4450;
}

.pager #pager-info { min-width: 160px; text-align: center; color: var(--muted); }

@media (max-width: 720px) {
  .field select, .field input { min-width: 128px; max-width: 100%; }
  main { padding: 12px; }
}
