:root {
  --app-width: 540px;
  --canvas: #f5f4f0;
  --shell-navy: #17283b;
  --gold-ink: #785524;
  --nav-height: 59px;
  --checkout-height: 70px;
  --bottom-safe: env(safe-area-inset-bottom, 0px);
  --left-safe: env(safe-area-inset-left, 0px);
  --right-safe: env(safe-area-inset-right, 0px);
}
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: calc(var(--nav-height) + var(--checkout-height) + var(--bottom-safe)); }
body { background: #e8ebeb; }
.app-shell { max-width: var(--app-width); min-height: 100vh; min-height: 100dvh; margin: auto; background: var(--canvas); box-shadow: 0 0 0 1px #1328430d, 0 14px 65px #13284311; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: calc(5px + env(safe-area-inset-top, 0px)) max(18px, var(--right-safe)) 5px max(18px, var(--left-safe)); background: var(--shell-navy); color: #fff; }
.top .brand { min-height: 46px; font-size: 22px; letter-spacing: -.045em; gap: 9px; }
.top .brand-mark { width: 31px; height: 31px; border-radius: 9px; background: #263b54; border: 1px solid #52637a; color: #f2d8a2; font-size: 19px; }
.top .brand small { font-size: 12px; font-weight: 650; letter-spacing: .04em; color: #d7e0e8; margin-left: 3px; }
.balance-link { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; border-radius: 11px; padding: 0 9px; background: #ffffff0c; border: 1px solid #fff2; color: #f2dbb1; white-space: nowrap; font-size: 14px; }
.balance-link strong { max-width: 154px; overflow: hidden; text-overflow: ellipsis; }
.wrap { padding: 0 max(14px, var(--right-safe)) calc(var(--nav-height) + var(--bottom-safe) + 22px) max(14px, var(--left-safe)); }
body[data-active-view="lookup"] .wrap { padding-bottom: calc(var(--nav-height) + var(--checkout-height) + var(--bottom-safe) + 18px); }
body.keyboard-open .wrap { padding-bottom: 16px; }
.intro { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 16px 3px 12px; }
.intro h1, .report-summary h1 { font-size: clamp(28px, 8.3vw, 36px); line-height: 1.16; letter-spacing: -.052em; }
.intro p, .report-summary p { margin-top: 5px; color: var(--muted); line-height: 1.5; font-size: 13px; }
.demo { margin-top: 4px; border: 1px solid #ded5c2; background: #efe9dd; color: #6e5732; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 680; white-space: nowrap; }
.lookup { display: grid; gap: 10px; }
.input-card, .report-card { padding: 9px 12px 11px; border-color: #e3e5e3; border-radius: 17px; box-shadow: 0 3px 12px #17283b05; }
.input-card { padding-block: 5px 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 6px; }
.section-head h2, .report-card h2, .account-records h2 { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.quiet { display: inline-flex; align-items: center; min-height: 44px; color: #315477; border: 0; background: transparent; font-size: 13px; font-weight: 650; padding: 0 2px; }
.quiet:hover { text-decoration: underline; }
.with-chevron { gap: 5px; white-space: nowrap; }
.with-chevron span { font-size: 17px; line-height: 1; }
.input-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: #edf0f1; border: 1px solid #e8ebec; border-radius: 11px; }
.input-modes button { color: var(--ink); border: 1px solid transparent; border-radius: 8px; min-height: 44px; background: transparent; font-size: 14px; font-weight: 650; }
.input-modes button[aria-pressed="true"] { border-color: #dbe2e7; background: white; box-shadow: 0 2px 4px #1529410a; color: #203b58; }
.input-line { min-height: 50px; display: flex; align-items: center; margin-top: 9px; border: 1px solid #cdd7df; background: #fbfcfd; border-radius: 12px; }
.input-line:focus-within { border-color: #4775a1; box-shadow: 0 0 0 2px #4775a124; }
.input-line:has(input[aria-invalid="true"]) { border-color: #bc594b; }
.code-field { width: 100%; min-width: 0; align-self: stretch; padding: 12px 10px; background: transparent; border: 0; border-radius: 12px; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; outline: none; }
.code-field:focus-visible { outline: none; }
.code-field::placeholder { color: #647488; font-size: 16px; }
.input-message { margin-top: 3px; }
.record-list { padding: 0 12px; border-color: #e3e5e3; }
.record { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; min-height: 61px; border-bottom: 1px solid #e9edee; }
.record:last-child { border: 0; }
.record:first-child { border-radius: 9px 9px 0 0; }
a.record:hover { background: #f6f8fa; }
.record-main { min-width: 0; display: grid; gap: 4px; }
.record-name { font-weight: 720; font-size: 14px; overflow-wrap: anywhere; }
.record-subtitle { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.record-end { display: flex; align-items: center; gap: 7px; flex: none; }
.record-end > span[aria-hidden] { color: #65788c; font-size: 19px; }
.dock { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, var(--app-width)); background: #fff; padding: 0 var(--right-safe) var(--bottom-safe) var(--left-safe); box-shadow: 0 -5px 23px #17283b0b; }
body.keyboard-open .dock { visibility: hidden; pointer-events: none; }
.checkout { display: flex; align-items: center; justify-content: space-between; min-height: var(--checkout-height); padding: 8px 14px; gap: 10px; border-top: 1px solid #dce3e5; }
.checkout-price { display: grid; gap: 3px; min-width: 0; }
.checkout-price span { color: var(--muted); font-size: 11px; }
.checkout-price strong { color: var(--ink); font-size: 19px; font-weight: 810; line-height: 1.1; overflow-wrap: anywhere; }
.query-submit.btn { flex: 0 0 61%; min-height: 48px; border-radius: 12px; font-size: 15px; background: #203b58; border-color: #203b58; }
.query-submit.btn:hover { background: #2b4f72; }
.bottom-nav { display: grid; grid-template-columns: repeat(3,1fr); min-height: var(--nav-height); border-top: 1px solid #e7ebec; }
.bottom-nav a { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 54px; color: #52677c; font-size: 11px; font-weight: 620; }
.bottom-nav a[aria-current] { color: #203b58; font-weight: 800; }
.nav-icon { position: relative; display: block; width: 38px; height: 25px; border-radius: 99px; }
.bottom-nav a[aria-current] .nav-icon { background: #e8eff5; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; left: 50%; top: 50%; }
.icon-search::before { width: 9px; height: 9px; border: 1.6px solid currentColor; border-radius: 50%; transform: translate(-62%,-60%); }
.icon-search::after { width: 6px; height: 1.7px; background: currentColor; border-radius: 1px; transform: translate(30%, 255%) rotate(46deg); }
.icon-records::before { width: 12px; height: 13px; border: 1.6px solid currentColor; border-radius: 3px; transform: translate(-50%, -50%); }
.icon-records::after { width: 6px; height: 1.5px; background: currentColor; box-shadow: 0 3px currentColor; transform: translate(-50%, -2px); }
.icon-user::before { width: 5px; height: 5px; border: 1.6px solid currentColor; border-radius: 50%; transform: translate(-50%, -90%); }
.icon-user::after { width: 12px; height: 5px; border: 1.6px solid currentColor; border-radius: 7px 7px 2px 2px; transform: translate(-50%, 41%); }
.sheet { width: min(calc(100% - var(--left-safe) - var(--right-safe)), var(--app-width)); max-width: none; max-height: calc(100vh - 20px); max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 10px); border-radius: 22px 22px 0 0; margin: auto auto 0; overscroll-behavior: contain; }
.sheet .dialog-body { padding: 9px 15px calc(16px + var(--bottom-safe)); gap: 12px; }
.sheet-handle { width: 32px; height: 4px; margin: 0 auto; border-radius: 20px; background: #d5dce0; }
.sheet .dialog-head h2 { font-size: 20px; }
.sheet .close, .sheet .btn { min-height: 44px; }
.sheet .close { width: 44px; }
.help-item { padding: 10px 11px; border-radius: 10px; background: #f1f4f7; }
.help-item p { margin-top: 3px; color: var(--muted); }
.amounts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.amounts .btn { padding-inline: 4px; }
.amounts button[aria-pressed="true"] { border-color: var(--blue); background: #e9f3ff; color: var(--blue); }
.wallet { display: grid; gap: 8px; padding: 19px; color: #f7f9fb; border-radius: 17px; background: linear-gradient(145deg,#203a56,#17283b); }
.wallet h2 { color: #d7e3ee; font-size: 14px; }
.wallet-amount { font-size: 36px; letter-spacing: -.05em; }
.wallet .recharge { min-height: 46px; align-self: start; background: #eddab6; color: #2e3a49; border-color: #eddab6; font-size: 14px; }
.wallet .recharge:hover { background: #f3e6ce; }
.account-records { margin-top: 15px; }
.account-records h2 { margin: 0 0 8px 3px; }
.admin-link { margin: 6px 2px 0; }
.back { margin-top: 3px; }
.report-summary { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 6px 2px 14px; }
.report-summary h1 { font-size: clamp(24px, 7vw, 30px); overflow-wrap: anywhere; }
.report-card { margin-bottom: 10px; padding: 14px 12px; }
.report-card dl { margin: 6px 0 0; }
.report-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0f3; font-size: 14px; overflow-wrap: anywhere; }
.report-row:last-child { border-bottom: 0; padding-bottom: 0; }
.report-row dt { color: var(--muted); }
.report-row dd { margin: 0; text-align: right; font-weight: 670; }
.full { width: 100%; justify-content: center; }
.report-next { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.toast { bottom: calc(var(--nav-height) + var(--bottom-safe) + 8px); }
body[data-active-view="lookup"] .toast { bottom: calc(var(--nav-height) + var(--checkout-height) + var(--bottom-safe) + 8px); }
body.keyboard-open .toast { bottom: auto; top: calc(8px + env(safe-area-inset-top, 0px)); }
@media (min-width: 540px) {
  .wrap { padding-inline: 22px; }
  .top { padding-inline: 22px; }
}
@media (max-width: 350px) {
  .wrap { padding-inline: max(10px, var(--left-safe)) max(10px, var(--right-safe)); }
  .input-card { padding-inline: 9px; }
  .record-end { gap: 4px; }
}
@media (orientation: landscape) and (max-height: 490px) {
  :root { --nav-height: 47px; --checkout-height: 56px; }
  .bottom-nav a { min-height: 46px; gap: 1px; }
  .checkout { padding-block: 5px; }
  .query-submit.btn { min-height: 44px; }
  .sheet { width: min(calc(100% - var(--left-safe) - var(--right-safe)), var(--app-width)); }
}
.catalog-filters { display: flex; gap: 6px; overflow: auto; scrollbar-width: none; padding: 2px 2px 11px; }
.catalog-filters::-webkit-scrollbar { display: none; }
.catalog-filters button { flex: none; min-height: 44px; padding: 7px 11px; border-radius: 10px; background: #ebece8; border: 1px solid transparent; color: #485c6f; font-size: 13px; font-weight: 680; white-space: nowrap; }
.catalog-filters button[aria-pressed="true"] { background: #203b58; color: white; }
.catalog-list { display: grid; gap: 7px; }
.catalog-item { display: grid; grid-template-columns: 37px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 77px; padding: 10px; border: 1px solid #e1e5e6; border-radius: 13px; background: #fff; }
.catalog-item:hover { background: #f6f9fc; border-color: #bacbd9; }
.service-mark { flex: none; width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; background: #e9f1f8; color: #315674; font-size: 22px; font-weight: 660; }
.service-mark[data-group="锁与风险"] { background: #ecedf4; color: #435075; }
.service-mark[data-group="深度报告"] { background: #f5eadb; color: #785524; }
.catalog-copy { display: grid; gap: 4px; overflow-wrap: anywhere; }
.catalog-copy strong { font-size: 15px; line-height: 1.25; }
.catalog-copy small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.catalog-price { display: flex; align-items: center; gap: 6px; color: var(--gold-ink); font-size: 12px; white-space: nowrap; }
.catalog-price span { color: #667c90; font-size: 20px; }
.service-summary { display: flex; align-items: start; gap: 12px; padding: 3px 2px 15px; }
.service-summary .service-mark { width: 44px; height: 44px; }
.service-summary h1 { font-size: clamp(22px,7vw,30px); letter-spacing: -.035em; line-height: 1.25; overflow-wrap: anywhere; }
.service-summary p { margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.lookup .input-card { padding-top: 11px; }
.lookup .input-line { margin-top: 0; }
.batch-box .code-field { min-height: 104px; resize: vertical; }
.input-hint { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.input-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.input-tools .btn { min-height: 44px; padding-inline: 10px; }
.input-tools .quiet { padding-inline: 5px; }
.scan-button { display: inline-flex; align-items: center; gap: 6px; background: #eef4f9; color: #264a6a; }
.scan-icon { display: inline-block; width: 16px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; background: repeating-linear-gradient(to right,transparent 0 2px,currentColor 2px 3px,transparent 3px 4px) center / 12px 6px no-repeat; }
.sample { margin-top: 12px; padding: 0 12px 4px; border-color: #e3e5e3; }
.sample summary { min-height: 46px; padding-block: 13px; cursor: pointer; font-size: 14px; font-weight: 690; color: #315477; }
.sample dl { margin: 0 0 11px; }
#scan-preview { background: #14253a; border-radius: 12px; overflow: hidden; min-height: 140px; }
#scan-preview video { display: block; max-width: 100%; max-height: 270px; margin: auto; }
#scan-preview.decoding { position: absolute; width: 320px; max-width: 100%; visibility: hidden; pointer-events: none; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.scan-actions > form { flex: 1 0 100%; }
.file-button { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.file-button:focus-within { outline: 3px solid #64a2dd; outline-offset: 2px; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.amounts button { display: grid; gap: 3px; }
.amounts button strong, .amounts button small { font-size: 12px; }
.amounts button small { color: var(--muted); }
#batch-result > .record-list { margin-bottom: 10px; }
.login-form { display: grid; gap: 9px; }
.login-form .field.code-field { background: #f7f9fa; border: 1px solid #cbd7e3; }
.login-code { display: flex; gap: 7px; }
.login-code .btn { white-space: nowrap; }
@media (max-width: 350px) {
  .catalog-item { grid-template-columns: 31px minmax(0,1fr) auto; gap: 7px; padding: 8px; }
  .catalog-item .service-mark { width: 31px; height: 31px; }
  .catalog-price { gap: 4px; }
  .amounts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
