.npe-checkout-layer,
.npe-checkout-dialog,
.npe-toast {
    box-sizing: border-box;
}

body {
    background-color: #eaf4f1 !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
}

.npe-checkout-layer[hidden] {
    display: none;
}

.npe-checkout-layer {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(21, 34, 48, .58);
}

.npe-checkout-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(18, 41, 56, .28);
    color: #1f2937;
}

.npe-order-dialog {
    width: min(660px, 100%);
}

.npe-dialog-label {
    margin: 0 0 5px;
    color: #139655;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.npe-checkout-dialog h2 {
    margin: 0 40px 20px 0;
    font-size: 24px;
    font-weight: 800;
}

.npe-dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f4;
    color: #4b5563;
    font-size: 22px;
    line-height: 1;
}

.npe-product-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    border-left: 4px solid #139655;
    background: #f2f8f5;
}

.npe-product-summary b,
.npe-product-summary span {
    display: block;
}

.npe-product-summary span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.npe-product-summary strong {
    flex: 0 0 auto;
    color: #139655;
    font-size: 23px;
}

.npe-checkout-dialog .form-text {
    margin: 6px 0 18px;
}

.npe-pay-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

.npe-pay-list legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 700;
}

.npe-pay-list label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid #dfe7e3;
    border-radius: 10px;
    cursor: pointer;
}

.npe-pay-list label:has(input:checked) {
    border-color: #139655;
    box-shadow: inset 0 0 0 1px #139655;
    background: #f3fbf7;
}

.npe-pay-icon {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    font-weight: 800;
}

.npe-pay-icon.wechat { background: #07c160; }
.npe-pay-icon.alipay { background: #1677ff; }

.npe-form-error {
    min-height: 20px;
    margin: 0 0 7px;
    color: #dc3545;
}

.npe-submit {
    width: 100%;
    min-height: 44px;
}

.npe-query-form {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
    gap: 8px;
}

.npe-query-heading {
    margin: -10px 0 12px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.npe-recover-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 12px;
    color: #6b7280;
    font-size: 12px;
}

.npe-recover-divider::before,
.npe-recover-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: #e5e7eb;
}

.npe-recover-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 16px;
}

.npe-recovery-list {
    display: grid;
    gap: 10px;
}

.npe-recovery-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.npe-recovery-item:last-child {
    border-bottom: 0;
}

.npe-recovery-item b,
.npe-recovery-item span {
    display: block;
}

.npe-recovery-item code {
    color: #139655;
    font-size: 12px;
}

.npe-recovery-item span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.npe-order-notice {
    margin-top: 14px;
    padding: 14px;
    background: #fff;
    color: #4b5563;
    line-height: 1.65;
}

.npe-order-notice.expired {
    border-left: 3px solid #d97706;
}

.npe-order-result {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8faf9;
    color: #6b7280;
}

.npe-order-head,
.npe-order-line,
.npe-license-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.npe-order-head {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.npe-order-line {
    padding-top: 12px;
    color: #374151;
}

.npe-status {
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
    font-size: 12px;
    font-weight: 700;
}

.npe-status.delivered {
    background: #dff4e8;
    color: #0d7a43;
}

.npe-payment-box {
    display: grid;
    grid-template-columns: 156px 1fr;
    align-items: center;
    gap: 20px;
    margin-top: 16px;
    padding: 14px;
    background: #fff;
}

.npe-payment-box img {
    width: 156px;
    height: 156px;
    object-fit: contain;
}

.npe-payment-box strong,
.npe-payment-box span {
    display: block;
}

.npe-payment-box strong {
    margin: 5px 0;
    color: #139655;
    font-size: 24px;
}

.npe-license-line {
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed #139655;
    background: #fff;
}

.npe-license-line code {
    user-select: all;
    word-break: break-all;
}

.npe-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1000001;
    padding: 10px 16px;
    border-radius: 8px;
    background: #17261f;
    color: #fff;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}

.npe-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.npe-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .npe-checkout-layer { padding: 10px; }
    .npe-checkout-dialog { max-height: calc(100vh - 20px); padding: 22px 18px; }
    .npe-pay-list { grid-template-columns: 1fr; }
    .npe-query-form, .npe-recover-form { grid-template-columns: 1fr; }
    .npe-payment-box { grid-template-columns: 1fr; text-align: center; }
    .npe-payment-box img { margin: auto; }
    .npe-order-line, .npe-license-line { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .npe-toast { transition: none; }
}
