:root {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #173b5e;
  background: #edf4fb;
  --blue: #287cf0;
  --blue-dark: #1558b7;
  --ink: #102f59;
  --muted: #7b8fa7;
  --line: #dce8f5;
  --mint: #2eae8f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 80% 0, #dceeff 0, transparent 42%), #edf4fb;
}
button, input { font: inherit; }
.app-shell {
  width: min(540px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: 18px 14px 100px;
  background: rgba(255, 255, 255, .32);
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #acd0fb;
  border-radius: 11px;
  background: #e8f3ff;
  color: var(--blue);
  font-weight: 800;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.header-auth {
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: #f0f4fa;
  color: #7b8fa7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.header-auth[data-tone=ok] { color: #208469; background: #e2f8ef; }
.app-view { animation: app-enter 180ms ease-out; }
@keyframes app-enter {
  from { opacity: .4; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.app-hero, .wait-card, .account-card, .history-panel, .profile-card, .usage-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
}
.app-hero {
  padding: 22px 18px;
  margin-bottom: 13px;
  background: linear-gradient(135deg, #fafdff, #eef6ff 70%, #effbf8);
  box-shadow: 0 10px 28px rgba(47, 100, 155, .07);
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
.app-hero h1, .view-heading h2, .card-heading h2, .wait-heading h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -.04em;
}
.app-hero h1 { font-size: 26px; line-height: 1.28; }
.app-hero h1 em { color: var(--blue); font-style: normal; }
.hero-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.hero-dims li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid #d7e7f8;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #4e6a88;
  font-size: 11px;
  font-weight: 700;
}
.hero-dims i { color: var(--blue); font-size: 14px; }
.wait-card { padding: 16px; margin-bottom: 13px; }
.wait-heading { display: flex; gap: 12px; align-items: flex-start; }
.wait-heading h2 { font-size: 18px; }
.wait-heading p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.wait-pulse {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(40, 124, 240, .45);
  animation: wait-pulse 1.6s ease-out infinite;
}
@keyframes wait-pulse {
  to { box-shadow: 0 0 0 10px rgba(40, 124, 240, 0); }
}
.wait-progress, .history-progress, .usage-progress {
  overflow: hidden;
  border-radius: 99px;
  background: #edf2f7;
}
.wait-progress { height: 8px; margin: 14px 0 10px; }
.wait-progress span, .history-progress span, .usage-progress span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #287cf0, #5ab8a1);
}
.wait-meta { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wait-meta strong { color: var(--ink); font-size: 13px; }
.wait-meta small { color: var(--muted); font-size: 11px; }
.text-link { display: inline-block; margin-top: 10px; color: var(--blue); font-size: 12px; text-decoration: none; }
.account-card { padding: 18px; box-shadow: 0 14px 36px rgba(42, 87, 132, .08); }
.card-heading, .view-heading, .usage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-heading h2 { font-size: 20px; }
.quota-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f3ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.view-heading { padding: 9px 4px 16px; }
.view-heading h2 { font-size: 22px; }
.view-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.feedback {
  margin: 12px 0 0;
  padding: 10px 11px;
  border: 1px solid #efc9c9;
  border-radius: 9px;
  background: #fff2f2;
  color: #bd4b4b;
  font-size: 12px;
  line-height: 1.5;
}
.feedback[data-tone=success] { border-color: #c5e8d9; background: #effaf6; color: #24886c; }
.feedback[data-tone=action] { border-color: #ebdbab; background: #fff9e9; color: #8b6c28; }
.account-form { display: grid; gap: 12px; padding-top: 17px; }
.account-form label { display: grid; gap: 6px; color: #526c88; font-size: 12px; font-weight: 700; }
.account-form input:not([type=checkbox]) {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d2e2f1;
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: #4a6380;
  font-size: 12px;
  font-weight: 400;
}
.account-form input:not([type=checkbox])::placeholder {
  color: #a8b9cb;
  font-size: 12px;
  font-weight: 400;
  opacity: 1;
}
.account-form input:focus { border-color: #69a6f3; box-shadow: 0 0 0 3px rgba(40, 124, 240, .12); }
.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500 !important;
  color: #5f7894 !important;
}
.check-row input { margin-top: 3px; }
.check-row a { color: var(--blue); text-decoration: none; }
.field-action { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 7px; align-items: end; }
.inline-button, .icon-button {
  height: 44px;
  border: 1px solid #bed7f4;
  border-radius: 9px;
  background: #f4f9ff;
  color: var(--blue);
  cursor: pointer;
}
.inline-button { font-size: 12px; }
.icon-button { width: 40px; display: grid; place-items: center; }
.primary-button, .secondary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 11px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button {
  border: 0;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 16px rgba(40, 124, 240, .18);
}
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.card-foot { display: flex; justify-content: flex-end; margin-top: 2px; }
.sample-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.sample-link:hover { text-decoration: underline; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 13px; cursor: pointer; }
.history-panel { padding: 8px 14px; }
.history-list { display: grid; }
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 14px 3px;
  border-bottom: 1px solid #e8eff7;
}
.history-row:last-child { border-bottom: 0; }
.history-row strong, .history-row small { display: block; }
.history-row strong { color: var(--ink); font-size: 14px; }
.history-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-status {
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef3f8;
  color: #6c8096;
  font-size: 10px;
}
.history-status--completed_with_external_pending, .history-status--completed { background: #e5f8ef; color: #228b6b; }
.history-status--running, .history-status--queued, .history-status--company_lookup_running, .history-status--authorizing { background: #e8f3fd; color: #1671c7; }
.history-status--wait_authorization { background: #fff5dd; color: #9b711b; }
.history-status--partial { background: #fff5dd; color: #9b711b; }
.history-status--query_failed, .history-status--session_expired, .history-status--needs_user_action, .history-status--expired, .history-status--authorization_failed, .history-status--company_lookup_empty, .history-status--company_lookup_unresolved, .history-status--not_queried, .history-status--cancelled { background: #fdecec; color: #ba4a4a; }
.history-progress { grid-column: 1 / -1; height: 4px; }
.history-row > a { grid-column: 2; grid-row: 1; color: var(--blue); font-size: 12px; text-decoration: none; }
.history-empty { padding: 36px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.history-empty.error { color: #c34949; }
.profile-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #287cf0, #65a6fc);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(40, 124, 240, .2);
}
.profile-card span, .profile-card small { display: block; color: var(--muted); font-size: 11px; }
.profile-card strong { display: block; margin: 4px 0; color: var(--ink); font-size: 18px; }
.usage-card { margin-top: 12px; padding: 18px; }
.usage-heading h3 { margin: 0; color: var(--ink); font-size: 17px; }
.usage-heading > span { padding: 5px 8px; border-radius: 99px; color: #21886b; background: #e5f8ef; font-size: 11px; }
.usage-number { display: flex; align-items: baseline; gap: 7px; margin: 22px 0 13px; color: var(--muted); }
.usage-number strong { color: var(--blue); font-size: 30px; line-height: 1; }
.usage-number span { font-size: 11px; }
.usage-number i { font-style: normal; color: #b8c8d7; }
.usage-progress { height: 8px; }
.usage-card > p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.me-actions { display: grid; gap: 10px; margin-top: 16px; text-align: center; }
.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(540px, 100%);
  height: 68px;
  margin: auto;
  padding: 7px 16px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(215, 228, 242, .92);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 -10px 25px rgba(35, 78, 121, .1);
  backdrop-filter: blur(16px);
}
.bottom-nav-item {
  display: grid;
  place-items: center;
  gap: 1px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #92a4b7;
  cursor: pointer;
}
.bottom-nav-item i { font-size: 20px; line-height: 1; }
.bottom-nav-item small { font-size: 10px; }
.bottom-nav-item.active { color: var(--blue); background: #edf5ff; font-weight: 700; }
footer { margin: 18px 0 0; color: #8a9bb1; font-size: 11px; text-align: center; }
.login-dialog, .doc-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 22px 20px 18px;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(16, 47, 89, .22);
}
.login-dialog::backdrop, .doc-dialog::backdrop { background: rgba(16, 36, 64, .46); }
.login-dialog h2, .doc-dialog h2 { margin: 0; font-size: 22px; color: var(--ink); }
.dialog-copy, .doc-body { margin: 8px 0 0; color: #6e839d; font-size: 13px; line-height: 1.7; }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #f3f7fb;
  color: #6e839d;
  cursor: pointer;
}
.wechat-loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(237, 244, 251, .92);
  color: var(--ink);
  text-align: center;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  margin: auto;
  border: 3px solid #d7e6f8;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 700px) {
  body { display: flex; justify-content: center; align-items: flex-start; }
  .app-shell {
    min-height: 0;
    margin: 22px auto;
    padding: 26px 26px 100px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, .56);
    box-shadow: 0 18px 60px rgba(42, 87, 132, .09);
  }
  .app-hero h1 { font-size: 34px; }
  .bottom-nav {
    right: auto;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(35, 78, 121, .16);
  }
}
