:root {
    font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif;
    color: #182b44;
    background: #f2f6fb;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

header {
    background: #fff;
    border-bottom: 1px solid #dce5ef;
    min-height: 64px;
    padding: 14px max(20px,calc((100% - 1120px)/2));
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

header strong {
    font-size: 19px;
}

.finance-brand-short {
    display: none;
}

main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

h1 {
    font-size: clamp(25px,4vw,34px);
    margin: 0 0 22px;
}

h2 {
    margin: 0 0 18px;
    font-size: 19px;
}

.card {
    background: #fff;
    border: 1px solid #dce5ef;
    border-radius: 20px;
    padding: clamp(19px,4.5vw,32px);
    box-shadow: 0 10px 28px #173c6910;
}

.payment {
    max-width: 480px;
    margin: clamp(0px,7vw,48px) auto;
}

.merchant {
    margin: 0 0 28px;
    color: #455b77;
}

.hint {
    font-size: 14px;
    color: #526984;
}

.amount {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #b7c8dd;
    border-radius: 12px;
    margin-top: 9px;
    padding: 0 14px;
    font-size: 25px;
}

.amount:focus-within {
    outline: 2px solid #1662c9;
}

.amount input {
    min-width: 0;
    width: 100%;
    padding: 12px 0;
    border: 0;
    outline: 0;
    font: inherit;
    color: inherit;
}

button,.button {
    display: inline-block;
    border: 0;
    border-radius: 11px;
    background: #2463e9;
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    padding: 12px 17px;
}

.payment button,.payment .button {
    width: 100%;
    text-align: center;
}

.payment form button {
    margin-top: 10px;
}

.plain {
    color: #145bc1;
    background: #edf4ff;
}

.error,.errorlist {
    color: #a12727;
}

.total {
    font-weight: 700;
    font-size: 32px;
}

.overview {
    display: grid;
    grid-template-columns: 260px minmax(0,1fr);
    gap: 20px;
    align-items: start;
}

.overview-switch.order-status-filter {
    display: none;
}

.qr {
    text-align: center;
}

.qr img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
}

.muted-link {
    display: block;
    margin-top: 12px;
}

.table-wrap {
    overflow: auto;
    margin-top: 8px;
}

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

th,td {
    padding: 12px 10px;
    border-bottom: 1px solid #e1eaf5;
}

th {
    font-size: 14px;
    color: #455b77;
}

a {
    color: #145bc1;
}

dd {
    margin: 5px 0 15px;
    overflow-wrap: anywhere;
}

dt {
    color: #526984;
}

.payment input:not([type=hidden]):not(#amount) {
    display: block;
    width: 100%;
    font: inherit;
    padding: 9px;
    border: 1px solid #b7c8dd;
    border-radius: 8px;
}

.payment label {
    font-weight: 650;
}

@media(max-width:700px) {
    .overview {
        grid-template-columns: minmax(0,1fr);
    }

    main {
        padding-top: 24px;
    }

}

.order-list-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-list-header h2 {
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 470px) {
    .order-list-header .order-status-filter a {
        padding-inline: 3px;
        font-size: 13px;
    }
}

.order-list-header .order-status-filter {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-status-filter {
    display: inline-flex;
    max-width: 100%;
    border: 1px solid #b7c8dd;
    border-radius: 11px;
    background: #f2f6fb;
    padding: 3px;
    gap: 3px;
}

.order-status-filter a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: #182b44;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.ledger-filter-groups {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.order-status-filter a:hover {
    background: #e3edfb;
}

.order-status-filter a[aria-current="true"] {
    background: #2463e9;
    color: #fff;
}

@media (max-width: 700px) {
    .order-list-header h2 {
        display: none;
    }

    .overview-switch.order-status-filter {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin-bottom: 12px;
    }

    .overview-switch a,
    .order-list-header .order-status-filter a {
        min-height: 36px;
    }

    .overview:not(.overview-show-qr) > .qr,
    .overview-show-qr > .orders {
        display: none;
    }
}

.order-list-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin: 12px 0;
}

.order-list-summary p {
    margin: 0;
}

.order-payment-rate {
    color: #455b77;
    font-size: 14px;
    white-space: nowrap;
}

.order-payment-rate strong {
    color: #182b44;
}

.receipt-status {
    font-weight: 650;
    white-space: nowrap;
}

.receipt-status-pending {
    color: #8a4b08;
}

.receipt-status-paid {
    color: #19613a;
}

.orders tr.order-highlight td {
    background: #e8f1ff;
    font-weight: 650;
}

.pagination {
    display: flex;
    gap: 14px;
    margin-top: 18px;
}

.nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav form {
    margin: 0;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr));
    gap: 14px;
    align-items: end;
}

.filters label,.purpose label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.filters input:not([type=checkbox]),.filters select,.purpose textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #b7c8dd;
    border-radius: 8px;
    padding: 9px;
    font: inherit;
    color: inherit;
    background: #fff;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ledger-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0 0 0 auto;
    color: #526984;
    font-size: 16px;
}

.ledger-summary div {
    display: flex;
    gap: 4px;
}

.ledger-summary dt, .ledger-summary dd {
    margin: 0;
}

.ledger-summary .ledger-pending-count {
    color: #b42318;
    font-weight: 700;
}

.ledger-query-refresh {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
}

.filter-actions .button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    font-size: 14px;
}

.ledger-query-refresh svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ledger-query-card {
    position: relative;
}

.ledger-query-refresh {
    position: absolute;
    inset: 4px 8px auto auto;
}

.ledger-query {
    padding: 0;
}

.ledger-query summary {
    min-height: 48px;
    padding: 12px 56px 12px 14px;
    cursor: pointer;
}

.ledger-query summary span {
    margin-inline-start: 5px;
    color: #526984;
    font-size: 13px;
    white-space: nowrap;
}

.ledger-query .filters {
    padding: 0 14px 14px;
}

.ledger-range-presets:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / -1;
}

.ledger-range-presets button {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
}

.ledger-range-presets [aria-pressed="true"] {
    color: #fff;
    background: #2463e9;
}

.ledger-end-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
}

.ledger-end-now {
    border: 0;
    padding: 4px 8px;
    color: #1558bc;
    background: #edf4ff;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.ledger-end-now:hover {
    background: #e0ebff;
}

.ledger-end-now[hidden] {
    display: none;
}

.ledger-account-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 18px;
    margin: 12px 0;
}

.ledger-account-status .ledger-sync-status {
    margin: 4px 0;
}

.ledger-balance {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}

.filters .ledger-refund-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
}

.ledger-refund-filter input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.ledger-refund-summary {
    display: block;
    margin-top: 4px;
    font-size: 0.875em;
    color: #526980;
}

.ledger-balance strong {
    color: #182b44;
    font-size: 1.125em;
}

@media (max-width: 700px) {
    .ledger-sync-status {
        margin: 8px 0;
        font-size: 12px;
    }

    .ledger-summary {
        width: 100%;
        margin: 0;
        font-size: 14px;
    }

    .ledger-entries {
        padding: 10px;
    }

    .ledger-entries .order-status-filter a {
        min-height: 36px;
        padding-inline: 5px;
        font-size: 13px;
    }
}

.purpose textarea {
    display: block;
    max-width: 640px;
    margin-bottom: 12px;
}

.message {
    padding: 12px;
    border-radius: 10px;
    background: #e6f0ff;
}

.arrival-toast {
    position: fixed;
    inset: auto 16px 16px auto;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    background: #145bc1;
}

@media (max-width: 700px) {
    header {
        flex-wrap: wrap;
    }

    .nav {
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    .nav a, .nav button {
        padding-block: 10px;
    }

    .table-wrap {
        overscroll-behavior-inline: contain;
    }
}

.nav .finance-dropdown summary {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    background: #eaf1ff;
    color: #175cd3;
    cursor: pointer;
    list-style: none;
}

.finance-dropdown summary::-webkit-details-marker {
    display: none;
}

.finance-dropdown {
    position: relative;
}

.finance-dropdown summary:hover, .finance-dropdown summary:focus-visible,
.finance-dropdown[open] summary {
    background: #dce9ff;
}

.finance-message-panel, .finance-account-panel {
    position: absolute;
    z-index: 10;
    inset: calc(100% + 8px) 0 auto auto;
    border: 1px solid #b7c8dd;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px #173c6929;
}

.finance-message-panel {
    width: min(340px, calc(100vw - 32px));
    max-height: min(430px, 60vh);
    overflow: auto;
    padding: 14px;
    font-size: 14px;
}

.finance-account-panel {
    width: min(260px, calc(100vw - 32px));
    padding: 4px;
}

.finance-account-identity {
    margin: 0;
    padding: 10px;
    border-bottom: 1px solid #dce5ef;
    overflow-wrap: anywhere;
}

.finance-account-identity strong {
    font-size: 14px;
}

.finance-account-panel a, .finance-account-panel button {
    width: 100%;
    justify-content: flex-start;
}

.finance-message-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.finance-message-panel h2 {
    margin: 0;
    font-size: 16px;
}

.finance-nav .finance-message-panel a,
.finance-nav .finance-message-read-all button,
.finance-message-panel time {
    font-size: 12px;
}

.finance-nav .finance-message-read-all button {
    color: #175cd3;
}

header .finance-message-panel strong {
    font-size: inherit;
}

.finance-message-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.finance-message-panel li {
    border-bottom: 1px solid #dce5ef;
}

.finance-nav .finance-message-item {
    width: 100%;
    gap: 10px;
    white-space: normal;
    text-align: left;
    font-weight: 400;
}

.finance-message-panel time {
    display: block;
    margin-top: 4px;
    color: #526984;
}

@media (max-width: 700px) {
    header {
        position: relative;
    }

    .finance-dropdown {
        position: static;
    }

    .finance-message-panel, .finance-account-panel {
        inset: calc(100% + 4px) 16px auto auto;
    }
}

.finance-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 16px;
    padding: 1px 4px;
    border-radius: 12px;
    background: #b42318;
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.finance-nav,.nav-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.nav-account {
    border-inline-start: 1px solid #dce5ef;
    padding-inline-start: 8px;
    margin-inline-start: 4px;
}

.finance-nav a,.finance-nav button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #182b44;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.finance-nav a:hover,.finance-nav button:hover,.finance-nav [aria-current="page"] {
    color: #2463e9;
    background: #eaf1ff;
}

.finance-nav svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-icon {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: #eaf1ff;
    color: #2463e9;
}

.finance-badge {
    background: #bb450a;
    box-shadow: 0 0 0 2px #fff;
    font-weight: 700;
}

@media (max-width: 700px) {
    .finance-header {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .finance-brand-full {
        display: none;
    }

    .finance-brand-short {
        display: block;
        font-size: 16px;
        white-space: nowrap;
    }

    .finance-nav, .nav-account {
        flex-wrap: nowrap;
    }
}

@media (max-width: 470px) {
    .finance-nav {
        gap: 2px;
    }

    .finance-nav a,.finance-nav button {
        gap: 4px;
        padding-inline: 6px;
    }

    .nav-account {
        padding-inline-start: 3px;
        margin-inline-start: 0;
    }

    .finance-header {
        padding-inline: 10px;
    }

    .finance-nav > a {
        padding-inline: 4px;
        font-size: 13px;
    }

    .finance-nav > a svg {
        width: 16px;
        height: 16px;
    }

    .finance-nav .finance-dropdown summary {
        width: 38px;
        height: 44px;
    }
}

.checkout-card {
    --checkout-accent: #2563eb;
    --checkout-tint: #eaf3ff;
    --checkout-instruction-text: #284970;
    max-width: 540px;
    padding: clamp(20px, 5vw, 36px);
}

.checkout-card[data-checkout-theme="teal"] {
    --checkout-accent: #0f766e;
    --checkout-tint: #e6f5f2;
    --checkout-instruction-text: #15534e;
}

.checkout-intro {
    margin-bottom: 22px;
    text-align: center;
}

.checkout-intro h1 {
    margin-bottom: 10px;
    font-size: clamp(23px, 5.4vw, 32px);
}

.checkout-intro p {
    margin: 0;
    color: #526984;
    font-size: 14px;
    line-height: 1.65;
}

.checkout-merchant {
    margin: 0 0 14px;
}

.checkout-merchant dt {
    font-size: 14px;
}

.checkout-merchant dd {
    margin: 4px 0 0;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 650;
}

.checkout-instruction {
    margin: 0 0 22px;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--checkout-tint);
    color: var(--checkout-instruction-text);
    font-size: 14px;
    line-height: 1.5;
}

.checkout-card .amount {
    margin-top: 7px;
    min-height: 56px;
    font-size: 22px;
}

.checkout-card .amount:focus-within {
    outline-color: var(--checkout-accent);
}

.checkout-card .hint {
    font-size: 13px;
    line-height: 1.55;
    color: #526984;
    margin: 8px 0 6px;
}

.checkout-card button {
    background: var(--checkout-accent);
    min-height: 48px;
}

@media (max-width: 390px) {
    .checkout-card {
        margin-block: 0;
    }
}

.checkout-assurance {
    margin-top: 16px;
    color: #526984;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.checkout-assurance p {
    margin: 0;
}

.checkout-assurance p:first-child {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.checkout-assurance svg {
    flex: none;
    color: var(--checkout-accent);
}
