.admin-wrap { width: min(100% - 44px, 960px); margin-inline: auto; }
.admin-mast, .mast-tools, .admin-heading, .panel-title, .review-actions { display: flex; align-items: center; }
.admin-mast { min-height: 68px; justify-content: space-between; gap: 12px; }
.admin-mast .brand { gap: 9px; font-size: 1.35rem; }
.admin-mast .brand img { transform: rotate(-6deg); }
.mast-tools { gap: 16px; }
.local-label, #admin-logout { color: var(--night-muted); font-size: .85rem; }
#admin-logout { background: none; border-left: 1px solid var(--night-border); padding: 5px 0 5px 14px; }
#admin-logout:hover { color: var(--night-link); }
main.admin-wrap { padding-block: clamp(40px, 7vw, 84px); }
.admin-heading { align-items: flex-start; justify-content: space-between; gap: 22px; }
.admin-heading h1 { font-size: clamp(2.25rem, 5vw, 3.6rem); color: var(--blue); }
.intro, .empty, .review-id, .order-detail { color: var(--night-muted); }
.intro { margin-top: 12px; max-width: 43em; font-size: .97rem; line-height: 1.7; }
.admin-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 9px; border: 1px solid #526979; padding: 8px 15px; white-space: nowrap; }
.refresh, .secondary { background: var(--night-panel); color: var(--night-text); }
.refresh:enabled:hover, .secondary:enabled:hover { border-color: var(--blue); background: #203643; }
.refresh { margin-top: 8px; }
.action { background: var(--blue); color: #07121a; border-color: var(--blue); font-weight: 700; }
.action:enabled:hover { background: #abe2ff; border-color: #abe2ff; }
.admin-button:disabled, #admin-logout:disabled { opacity: .55; cursor: default; }
#admin-status { margin-top: 22px; font-size: .9rem; color: var(--night-muted); line-height: 1.65; }
#admin-status:empty { margin: 0; }
#admin-status[data-tone="error"] { color: #ffb9ad; }
.admin-login { max-width: 440px; margin: 22px 0 0; padding: clamp(20px, 4vw, 30px); border: 1px solid var(--night-border); border-radius: 15px; background: var(--night-panel); }
.admin-login h2 { color: var(--night-text); font-size: 1.36rem; }
.admin-login label { display: block; margin: 22px 0 7px; color: var(--night-muted); font-size: .9rem; }
.key-field { display: flex; align-items: stretch; min-height: 46px; border: 1px solid #526979; border-radius: 8px; background: #080f14; }
.key-field:focus-within { border-color: var(--blue); outline: 1px solid var(--blue); }
.key-field input { flex: 1; min-width: 0; padding: 9px 12px; border: 0; border-radius: inherit; background: transparent; color: var(--night-text); font: inherit; font-size: 16px; outline: 0; }
.key-field input::-ms-reveal { display: none; }
#admin-key-toggle { flex: none; min-width: 56px; border: 0; border-radius: 0 8px 8px 0; background: transparent; color: var(--night-link); font: inherit; font-size: .86rem; }
#admin-key-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; }
#admin-login-feedback { margin-top: 8px; font-size: .86rem; line-height: 1.6; color: #ffb9ad; }
#admin-login-feedback:empty { display: none; }
#admin-unlock-submit { width: 100%; min-height: 46px; margin-top: 20px; }
#admin-logout-retry { margin-top: 10px; }
.orders-panel { margin-top: 34px; border: 1px solid var(--night-border); border-radius: 15px; overflow: hidden; background: var(--night-panel); }
#admin-sections { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: .9rem; }
#admin-sections a { display: inline-flex; align-items: center; min-height: 36px; color: var(--night-link); text-decoration: underline; text-underline-offset: .25em; }
#admin-sections + .orders-panel { margin-top: 10px; }
#ledger-panel, #manual-panel, #credit-history { scroll-margin-top: 88px; }
.ledger-heading { justify-content: space-between; }
.ledger-heading .admin-button { min-height: 36px; padding: 5px 14px; font-size: .9rem; }
.ledger-status:not(:empty) { margin: 14px 22px; color: var(--night-muted); font-size: .86rem; line-height: 1.55; }
.ledger-status[data-error]:not(:empty) { color: #ffb9ad; }
#ledger-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .91rem; }
#ledger-table th, #ledger-table td { padding: 11px 14px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
#ledger-table thead th { color: var(--night-muted); font-size: .8rem; font-weight: 600; }
#ledger-table tr + tr, #ledger-table tbody { border-top: 1px solid var(--night-border); }
#ledger-table th:first-child { width: 28%; }
#ledger-table th:last-child, #ledger-table td:last-child { width: 16%; text-align: right; }
#ledger-table td:first-child { font-size: .84rem; color: var(--night-muted); font-variant-numeric: tabular-nums; }
.ledger-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-delta[data-sign=positive] { color: var(--night-link); }
.ledger-delta[data-sign=negative] { color: #ffb9ad; }
#ledger-new, #ledger-more { margin: 12px 18px; }
.panel-title { gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--night-border); background: #121f28; }
.panel-title h2 { font-size: 1.25rem; }
.order-count { font-size: .84rem; color: var(--night-link); }
.credit-form { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.credit-form label { display: grid; gap: 6px; font-size: .92rem; }
.credit-form input, .order-search input { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; background: #080f14; color: var(--night-text); border: 1px solid #526979; border-radius: 8px; font: inherit; }
.credit-form input[readonly] { color: var(--night-muted); border-color: var(--night-border); }
.order-search { display: grid; gap: 5px; max-width: 32rem; padding: 16px 22px 8px; color: var(--night-muted); font-size: .86rem; }
.credit-form .reference-field, .credit-form p { grid-column: 1 / -1; }
.credit-form p { margin: -6px 0 0; color: var(--night-muted); font-size: .86rem; line-height: 1.6; }
.credit-form button { justify-self: start; }
.empty { padding: 25px 22px; font-size: .91rem; }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px 22px; padding: 17px 22px; }
.order-row + .order-row { border-top: 1px solid var(--night-border); }
.order-person { min-width: 0; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.order-amount { color: var(--night-link); white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-detail { grid-column: 1 / -1; font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.credited-mark { color: #b9cdda; font-size: .88rem; }
.admin-dialog { width: min(460px, calc(100% - 28px)); padding: clamp(16px, 4vw, 24px); max-height: 90dvh; overflow-y: auto; }
.admin-dialog h2 { font-size: 1.55rem; }
#review-summary, .review-summary { margin-top: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.review-fields { margin: 16px 0 0; padding: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; background: var(--night-panel); border: 1px solid var(--night-border); border-radius: 8px; font-size: .9rem; }
.review-fields dt { color: var(--night-muted); }
.review-fields dd { margin: 0; overflow-wrap: anywhere; }
.review-note { color: #ffb9ad; line-height: 1.6; font-size: .89rem; margin-top: 12px; }
.review-note:empty { display: none; }
.danger { background: #5b272c; color: #ffe6e0; border-color: #a96868; }
.danger:enabled:hover { background: #723239; border-color: #f5afab; }
.order-row .admin-button { grid-column: 1 / -1; justify-self: start; min-height: 34px; padding: 5px 13px; font-size: .85rem; }
.order-row[data-status=reversed] .credited-mark { color: #ffb9ad; }
#reissue-form { padding: 0; margin-top: 18px; }
#reissue-form .review-actions { grid-column: 1 / -1; margin-top: 5px; }
.review-id { margin-top: 10px; font-size: .85rem; overflow-wrap: anywhere; }
.review-actions { justify-content: flex-end; gap: 10px; margin-top: 25px; }
[hidden] { display: none !important; }
@media (max-width: 560px) {
  .admin-wrap { width: calc(100% - 28px); }
  .admin-heading { display: block; }
  .admin-mast, .mast-tools { gap: 10px; }
  .admin-mast .brand { gap: 6px; font-size: 1.14rem; }
  .admin-mast .brand img { width: 29px; height: 29px; }
  .local-label, #admin-logout { font-size: .78rem; }
  #admin-logout { padding-left: 9px; }
  .refresh { margin-top: 17px; }
  .panel-title, .empty, .order-row, .order-search { padding: 14px; }
  .credit-form { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .order-row { grid-template-columns: minmax(0,1fr) auto; gap: 7px 10px; }
  .order-detail { grid-row: 2; display: grid; gap: 2px; }
  .order-row .admin-button, .credited-mark { grid-column: 1 / -1; justify-self: start; }
  .order-row .admin-button { min-height: 44px; }
  .credit-form input, .order-search input { font-size: 16px; }
  .review-actions { flex-wrap: wrap; }
  .review-actions button { min-height: 44px; }
  #ledger-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #ledger-table, #ledger-table tbody { display: block; }
  #ledger-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "name amount" "source amount" "time time"; gap: 2px 12px; padding: 12px 14px; align-items: start; }
  #ledger-table td { width: auto; padding: 0; }
  #ledger-table td:nth-child(1) { grid-area: time; margin-top: 2px; }
  #ledger-table time::after { content: " 北京时间"; }
  #ledger-table td:nth-child(2) { grid-area: name; font-weight: 600; }
  #ledger-table td:nth-child(3) { grid-area: source; color: var(--night-muted); font-size: .84rem; }
  #ledger-table td:last-child { grid-area: amount; width: auto; }
  #ledger-more, #ledger-new { min-height: 44px; margin-inline: 14px; }
  .ledger-status:not(:empty) { margin-inline: 14px; }
}
