:root {
  font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: #1d3348;
  background: #f2f5f8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 0; }
body { margin: 0; min-height: 100svh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px max(14px, env(safe-area-inset-right)) 11px max(14px, env(safe-area-inset-left));
  background: #1265a9;
  color: white;
  box-shadow: 0 2px 8px #102b4c20;
}
.topbar strong { font-size: 17px; white-space: nowrap; }
.topbar span { flex: 1; font-size: 13px; opacity: .9; }
.topbar button { border: 1px solid #ffffff80; background: transparent; color: white; padding: 6px 9px; }

main { width: 100%; max-width: 430px; margin: auto; padding: 14px 12px max(32px, env(safe-area-inset-bottom)); }
.panel, .card { background: white; border: 1px solid #d9e2eb; border-radius: 9px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px #102b4c0b; }
h1 { font-size: 20px; margin: 0 0 14px; }
.hint { color: #62758a; font-size: 13px; line-height: 1.5; margin: 8px 0 14px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
input { display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid #bac8d6; border-radius: 6px; font: inherit; background: white; color: inherit; min-height: 44px; }
button { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid #b5c5d7; background: white; color: #1d527e; min-height: 40px; padding: 7px 12px; }
button:disabled { opacity: .45; cursor: default; }
.primary { width: 100%; background: #1676c5; color: white; border-color: #1676c5; font-weight: 600; }

.captcha-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row img { flex: 0 0 100px; width: 100px; height: 42px; object-fit: contain; }
.captcha-row button { flex: 0 0 auto; white-space: nowrap; font-size: 13px; padding: 4px 7px; }

.tabs { display: flex; gap: 5px; margin-bottom: 12px; min-width: 0; }
.tabs button { flex: 1 1 0; min-width: 0; white-space: nowrap; font-size: 13px; padding: 7px 4px; }
.tabs button[aria-current="page"] { background: #1676c5; color: white; border-color: #1676c5; }
.date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.date-grid label { min-width: 0; }
.date-grid input { font-size: 14px; padding-inline: 6px; }

.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.metric { background: white; border: 1px solid #d9e2eb; border-radius: 8px; padding: 12px; min-width: 0; }
.metric small { display: block; color: #62758a; font-size: 12px; margin-bottom: 8px; }
.metric strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.card { padding: 13px; }
.card h2 { font-size: 16px; margin: 0 0 10px; overflow-wrap: anywhere; }
.card dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 7px; margin: 0; font-size: 14px; }
.card dt { color: #62758a; }
.card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0; }
.pager button { padding-inline: 8px; white-space: nowrap; }
.pager span { font-size: 12px; text-align: center; }
#message { color: #a12828; font-size: 14px; min-height: 20px; padding: 0 2px; }
.empty { color: #62758a; text-align: center; padding: 28px 12px; background: white; border-radius: 8px; }

/* 电脑预览采用 9:16 手机画布；真实手机仍随设备视口铺满，不裁切内容。 */
@media (min-width: 600px) {
  html { min-height: 100vh; display: grid; place-items: center; background: #dce5ed; }
  body {
    width: min(430px, 56.25vh);
    height: min(764.44px, 100vh);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f2f5f8;
    box-shadow: 0 8px 36px #21364b38;
  }
  main { max-width: none; }
  #loginView { margin-top: 28px; }
}

@media (max-width: 350px) {
  .tabs button { font-size: 12px; padding-inline: 2px; }
  .date-grid { gap: 5px; }
  .date-grid input { font-size: 13px; padding-inline: 3px; }
  .metric { padding: 10px; }
  .metric strong { font-size: 16px; }
  .captcha-row img { flex-basis: 80px; width: 80px; }
}
