/* 蜜蜂订单查询 —— 移动优先，微信内置浏览器可用 */
:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --card-2: #fbfbf9;
  --line: #e6e6e1;
  --text: #16181c;
  --text-2: #5f6368;
  --text-3: #8b8f96;
  --accent: #f59e0b;
  --accent-ink: #7a4b00;
  --ok: #12894a;
  --ok-bg: #e6f6ec;
  --warn: #b45309;
  --warn-bg: #fdf1dd;
  --danger: #c62f2f;
  --danger-bg: #fdeaea;
  --shadow: 0 1px 2px rgba(16, 18, 22, .05), 0 8px 24px -12px rgba(16, 18, 22, .18);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --card: #171a1f;
    --card-2: #1d2127;
    --line: #2a2f37;
    --text: #f0f2f5;
    --text-2: #a8aeb8;
    --text-3: #7c838e;
    --accent: #f5a524;
    --accent-ink: #ffd48a;
    --ok: #4ade80;
    --ok-bg: #10321f;
    --warn: #fbbf24;
    --warn-bg: #3a2a0c;
    --danger: #f87171;
    --danger-bg: #3b1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px -16px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- 头部 ---------- */
.head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px 16px;
}
.logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #fbbf24, #f59e0b);
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 12px -4px rgba(245, 158, 11, .6);
  flex: 0 0 auto;
}
.head h1 {
  font-size: 17px;
  font-weight: 650;
  margin: 0;
  letter-spacing: .2px;
}
.head p {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card.tight { padding: 13px 14px; }

/* ---------- 主按钮 ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #241500;
  font-size: 17px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.985); filter: brightness(.95); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.ghost {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
  min-height: 46px;
  font-size: 15px;
  font-weight: 550;
  box-shadow: none;
}
.btn svg { width: 21px; height: 21px; flex: 0 0 auto; }

/* ---------- 手输 ---------- */
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 12.5px;
  margin: 16px 0 12px;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.field { display: flex; gap: 8px; }
input[type=text], input[type=password] {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  color: var(--text);
  font-size: 16px; /* iOS 小于 16px 会触发放大 */
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  outline: none;
  transition: border-color .15s ease;
}
input:focus { border-color: var(--accent); }
.field .btn { width: auto; min-width: 84px; min-height: 48px; font-size: 15px; padding: 0 16px; }

/* ---------- 状态 ---------- */
.busy {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
  font-weight: 550;
  margin-top: 12px;
}
.busy[hidden] { display: none; }
[hidden] { display: none !important; }
.spinner {
  width: 17px; height: 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  font-size: 12.5px;
  color: var(--text-3);
  margin: 10px 2px 0;
  line-height: 1.5;
}

/* ---------- 结果 ---------- */
.result { display: none; padding: 0; overflow: hidden; }
.result.show { display: block; animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.rhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--line);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.s-pass  { color: var(--ok);     background: var(--ok-bg); }
.s-ambiguous { color: var(--warn); background: var(--warn-bg); }
.s-unknown, .s-bad, .s-decode_failed { color: var(--danger); background: var(--danger-bg); }

.rbody { padding: 18px 16px 16px; }

.big {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 550;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.order-no {
  font-size: 40px;
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.size-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #241500;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .5px;
}
.size-tag.muted { background: var(--card-2); color: var(--text-2); border: 1px solid var(--line); }

.msg {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.kv {
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
}
.kv > div {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.kv > div:last-child { border-bottom: none; }
.kv dt {
  flex: 0 0 76px;
  color: var(--text-3);
  margin: 0;
}
.kv dd {
  flex: 1;
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}
.kv dd.plain { font-family: inherit; font-size: 13.5px; }

.candidates { margin: 14px 0 0; padding: 0; list-style: none; }
.candidates li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--card-2);
  font-size: 13.5px;
}
.candidates b { font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- 最近查询 ---------- */
.sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
  letter-spacing: .4px;
  margin: 4px 4px 8px;
}
.recent { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.recent li:last-child { border-bottom: none; }
.recent .r-order {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.recent .r-sn {
  color: var(--text-3);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.recent .r-time { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.recent .r-none { color: var(--text-3); font-size: 13px; padding: 10px 2px; }

/* ---------- 页脚 ---------- */
.foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 18px;
  line-height: 1.9;
}
.foot a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line); }

/* ---------- 上传页 ---------- */
.drop {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 26px 16px;
  text-align: center;
  background: var(--card-2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.drop:active, .drop.over { border-color: var(--accent); background: var(--warn-bg); }
.drop b { display: block; font-size: 15px; margin-bottom: 4px; }
.drop span { font-size: 12.5px; color: var(--text-3); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl.fixed { table-layout: fixed; }
.tbl td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl th, .tbl td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--text-3); font-weight: 600; font-size: 12px; white-space: nowrap; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.skip { background: var(--card-2); color: var(--text-3); border: 1px solid var(--line); }
.tag.err { background: var(--danger-bg); color: var(--danger); }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
