/* ============================================================
   收银台样式 · 微玻璃拟态（Glassmorphism）
   - 通透浅色多层背景（渐变 + 柔光光斑）
   - 毛玻璃悬浮卡片：backdrop-blur + 半透明内描边
   - 深色文字保证可读性，卡片不割裂背景延展
   ============================================================ */

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
                 'Microsoft YaHei', 'Segoe UI', sans-serif;
    color: #16233b;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    /* 通透的浅色多层背景 */
    background: #e3edfb;
    background-image:
        radial-gradient(ellipse 46% 38% at 14% 8%,  rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 62%),
        radial-gradient(ellipse 42% 34% at 86% 12%, rgba(147, 197, 253, 0.55) 0%, rgba(147, 197, 253, 0) 65%),
        radial-gradient(ellipse 52% 42% at 82% 88%, rgba(199, 210, 254, 0.5)  0%, rgba(199, 210, 254, 0) 66%),
        radial-gradient(ellipse 38% 32% at 8%  84%, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(158deg, #d9e9fc 0%, #e9f2fe 45%, #e0e8fb 100%);
    background-attachment: fixed;
}

/* 背景柔光光斑（让毛玻璃有东西可"透"） */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 360px;
    height: 360px;
    top: -90px;
    right: -70px;
    background: radial-gradient(circle, rgba(125, 178, 252, 0.5) 0%, rgba(125, 178, 252, 0) 70%);
}

body::after {
    width: 400px;
    height: 400px;
    bottom: -110px;
    left: -90px;
    background: radial-gradient(circle, rgba(180, 198, 255, 0.5) 0%, rgba(180, 198, 255, 0) 70%);
}

/* ---------------- 顶部栏：收银台（玻璃条） ---------------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.42);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    backdrop-filter: blur(22px) saturate(1.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 4px 18px rgba(31, 64, 120, 0.06);
}

.topbar-title {
    color: #1d4ed8;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 8px;
    text-indent: 8px;
}

/* ---------------- 页面与玻璃卡片 ---------------- */
.cashier-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 84px 16px 40px;
}

.card {
    width: 100%;
    max-width: 480px;
    /* 轻量毛玻璃：半透明白 + 模糊 + 饱和度提升 */
    background: rgba(255, 255, 255, 0.52);
    -webkit-backdrop-filter: blur(26px) saturate(1.7);
    backdrop-filter: blur(26px) saturate(1.7);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),      /* 顶部高光 */
        inset 0 0 0 1px rgba(255, 255, 255, 0.32),   /* 细致半透明内描边 */
        inset 0 -1px 0 rgba(255, 255, 255, 0.25),
        0 24px 60px rgba(31, 64, 120, 0.12);         /* 悬浮投影 */
    padding: 46px 40px 42px;
}

/* 不支持 backdrop-filter 的老浏览器：提高不透明度兜底 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card {
        background: rgba(255, 255, 255, 0.88);
    }
    .topbar {
        background: rgba(255, 255, 255, 0.92);
    }
}

/* ---------------- 头像 ---------------- */
.avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    margin: 0 auto 26px;
    background: linear-gradient(160deg, #55a4fb 0%, #2f7cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 0 0 12px rgba(63, 151, 247, 0.14),
        0 10px 24px rgba(47, 124, 246, 0.3);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-default {
    width: 100%;
    height: 100%;
    fill: #ffffff;
}

/* ---------------- 金额 ---------------- */
.amountRow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 40px;
}

.currency {
    font-size: 40px;
    font-weight: 700;
    color: #16233b;
    transform: translateY(6px);
}

.amountInput {
    font-size: 76px;
    font-weight: 800;
    color: #16233b;
    width: 250px;
    text-align: center;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    line-height: 1.05;
    letter-spacing: 1px;
}

.amountInput::placeholder {
    color: #aeb9cb;
}

/* ---------------- 备注 ---------------- */
.remarkBox {
    border-top: 1px solid rgba(22, 35, 59, 0.08);
    padding-top: 22px;
}

.remarkLabel {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #51617a;
    margin-bottom: 8px;
}

.remarkLabel .optional {
    font-style: normal;
    color: #8b99ad;
    font-size: 13px;
}

.pencil {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #8b99ad;
    stroke-width: 1px;
}

.remarkInput {
    width: 100%;
    border: none;
    outline: none;
    background: none;
    font-size: 16px; /* ≥16px 防 iOS 聚焦自动缩放 */
    color: #16233b;
    padding: 8px 2px 18px;
    border-bottom: 1px solid rgba(22, 35, 59, 0.08);
    font-family: inherit;
}

.remarkInput::placeholder {
    color: #9fadc2;
}

.remarkInput:focus {
    border-bottom-color: #3f97f7;
}

/* ---------------- 支付产品 ---------------- */
.sectionTitle {
    font-size: 17px;
    font-weight: 600;
    color: #16233b;
    margin: 38px 0 14px;
}

.productList {
    min-height: 40px;
}

.productState {
    text-align: center;
    color: #8b99ad;
    font-size: 14px;
    padding: 1.4em 0;
}

.productState .miniSpinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(22, 35, 59, 0.12);
    border-top-color: #3f97f7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}

/* 支付产品：自定义下拉框（收起只占一行；展开为浮层列表，通道多时可滚动，不挤页面） */
.psSelect {
    position: relative;
}

.psBtn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 0 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 2px 10px rgba(31, 64, 120, 0.06);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.psSelect.open .psBtn {
    border-color: #3f97f7;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 0 0 3px rgba(63, 151, 247, 0.15);
}

.psLabel {
    flex: 1;
    font-size: 16px;
    color: #16233b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psLabel.placeholder {
    color: #8b99ad;
}

.psArrow {
    width: 16px;
    height: 10px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.psSelect.open .psArrow {
    transform: rotate(180deg);
}

.psPanel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    display: none;
    padding: 6px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(31, 64, 120, 0.18);
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.psSelect.open .psPanel {
    display: block;
    animation: psDrop 0.16s ease;
}

@keyframes psDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.psItem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 12px;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.psItem:active {
    background: #f2f6fc;
}

.psItemName {
    flex: 1;
    font-size: 15px;
    color: #16233b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psCheck {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid #c3cede;
    background: #fff;
    opacity: 0;
}

.psItem.selected {
    background: rgba(63, 151, 247, 0.08);
}

.psItem.selected .psItemName {
    color: #2b7de9;
    font-weight: 600;
}

.psItem.selected .psCheck {
    opacity: 1;
    border-color: #3f97f7;
    background: #3f97f7;
    box-shadow: inset 0 0 0 3px #fff;
}

/* ---------------- 商户停用提示页 ---------------- */
.closedCard {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 30px;
}

.closedIcon {
    width: 74px;
    height: 74px;
    margin-bottom: 22px;
}

.closedTitle {
    font-size: 18px;
    font-weight: 600;
    color: #16233b;
    margin-bottom: 8px;
}

.closedDesc {
    font-size: 14px;
    color: #8b99ad;
}

/* ---------------- 支付按钮（主 CTA，实心蓝，压在玻璃上） ---------------- */
.payBtn {
    width: 100%;
    border: none;
    outline: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #55a4fb 0%, #2f7cf6 100%);
    color: #ffffff;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 3px;
    padding: 20px;
    margin-top: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow:
        0 12px 28px rgba(47, 124, 246, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.payBtn:active {
    transform: scale(0.985);
    box-shadow: 0 8px 18px rgba(47, 124, 246, 0.32);
}

.cardIcon {
    width: 22px;
    height: 22px;
}

/* ---------------- 弹窗 ---------------- */
.dialogBg {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #2f323b;
    opacity: 0.95;
    z-index: 2000;
}

.dialog {
    display: none;
    position: fixed;
    z-index: 2001;
    width: 80%;
    max-width: 320px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    padding: 24px;
    text-align: center;
}

.dialog_title {
    font-size: 16px;
    font-weight: 600;
    color: #16233b;
    margin-bottom: 12px;
}

.dialog_detail {
    font-size: 14px;
    color: #51617a;
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: break-all;
}

.dialog_btns {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.vx_btn {
    display: inline-block;
    padding: 10px 28px;
    border: 1px solid #2f7cf6;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #ffffff;
    background-color: #2f7cf6;
    transition: all 0.2s ease;
    font-family: inherit;
}

.vx_btn:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* ---------------- 轻提示 / 加载中（玻璃质感） ---------------- */
.layer-toast {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(30, 64, 124, 0.16);
    padding: 12px 22px;
    font-size: 14px;
    color: #16233b;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.layer-toast.show {
    opacity: 1;
}

.layer-loading-mask {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(233, 242, 254, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 2500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20%;
}

.layer-loading-box {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 6px 24px rgba(30, 64, 124, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(22, 35, 59, 0.1);
    border-top-color: #2f7cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------- 小屏适配（手机版） ---------------- */
@media (max-width: 420px) {
    .cashier-page {
        padding: 70px 12px 28px;
    }
    .card {
        padding: 26px 20px 24px;
        border-radius: 22px;
    }
    .avatar {
        width: 72px;
        height: 72px;
        margin: 0 auto 16px;
        box-shadow:
            0 0 0 6px rgba(63, 151, 247, 0.14),
            0 8px 18px rgba(47, 124, 246, 0.28);
    }
    .amountRow {
        margin: 0 0 26px;
    }
    .amountInput {
        font-size: 58px;
        width: 190px;
    }
    .currency {
        font-size: 30px;
        transform: translateY(3px);
    }
    .remarkBox {
        padding-top: 18px;
    }
    .remarkInput {
        padding-bottom: 14px;
    }
    .sectionTitle {
        margin: 26px 0 10px;
    }
    .psBtn {
        min-height: 52px;
        padding: 0 14px;
        border-radius: 14px;
    }
    .psLabel {
        font-size: 15px;
    }
    .psPanel {
        max-height: 240px;
    }
    .payBtn {
        padding: 16px;
        margin-top: 26px;
        font-size: 17px;
    }
}
