:root {
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --success-color: #43A047;
    --danger-color: #E53935;
    --warning-color: #FFC107;
    --text-primary: #263238;
    --text-secondary: #546E7A;
    --bg-gradient: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    --pay-store-bg: #E3F2FD;
    --pay-store-card: #ffffff;
    --pay-store-blue: #2196F3;
    --pay-store-blue-dark: #1976D2;
    --pay-store-yellow-bg: #FFF8E1;
    --pay-store-yellow-border: #FFC107;
    --pay-store-border: rgba(33, 150, 243, 0.22);
    --pay-store-shadow: 0 4px 18px rgba(33, 150, 243, 0.12);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(33, 150, 243, 0.12);
    --shadow-lg: 0 10px 28px rgba(33, 150, 243, 0.15);
    --transition: all 0.3s ease;
}
.hidden {
    display: none;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
    background: var(--bg-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.alert {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    color: var(--danger-color);
    font-size: 15px;
    line-height: 1.6;
    transition: var(--transition);
}

.alert:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.info {
    background: rgba(248, 249, 250, 0.8);
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.info:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: rgba(248, 249, 250, 1);
}

.info h2 {
    font-size: 18px;
    color: var(--text-primary);
    margin-right: 20px;
    font-weight: 600;
    min-width: 120px;
}

.info p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    word-break: break-all;
}

.wallet-selection {
    margin: 30px 0;
}

.wallet-selection h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.wallet-selection ul {
    list-style: none;
    padding: 0;
}

.wallet-selection li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border-radius: 16px;
    margin: 10px 0;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.wallet-selection li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--bg-gradient);
    opacity: 0;
    transition: var(--transition);
}

.wallet-selection li:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.wallet-selection li:hover::before {
    opacity: 1;
}

.wallet-selection li.selected {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--primary-color);
}

.wallet-selection img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-right: 15px;
    transition: var(--transition);
}

.wallet-selection li:hover img {
    transform: scale(1.1);
}

.wallet-selection span {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.pay-button, .pay-approvalbutton {
    width: 100%;
    background: var(--bg-gradient);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.pay-button::before, .pay-approvalbutton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.pay-button:hover::before, .pay-approvalbutton:hover::before {
    left: 100%;
}

.pay-button:hover, .pay-approvalbutton:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 440px;
    margin: 20px auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.modal-close:active {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(0.95) rotate(90deg);
}

@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        min-height: 100vh;
        background: #fff;
    }

    .container {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
    }

    .header {
        text-align: center;
        margin-bottom: 10px;
        padding: 15px;
    }

    .header p {
        font-size: 14px;
        color: #333;
        margin: 10px 0;
    }

    .alert {
        background: #fff3f3;
        border: none;
        border-radius: 0;
        padding: 10px 15px;
        margin: 10px 0;
        color: #ff4d4f;
        font-size: 13px;
    }

    .info {
        display: flex;
        padding: 15px;
        margin: 0;
        border-radius: 0;
        background: #fff;
        border: none;
        position: relative;
    }

    .info::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 15px;
        right: 15px;
        height: 1px;
        background: #f0f0f0;
    }

    .info:last-child::after {
        display: none;
    }

    .info h2 {
        color: #999;
        font-size: 14px;
        font-weight: normal;
        margin: 0;
        min-width: 75px;
    }

    .info p {
        color: #333;
        font-size: 14px;
        margin: 0;
        flex: 1;
        text-align: right;
        padding-left: 15px;
        word-break: break-all;
    }

    .wallet-selection {
        margin: 15px 0 80px;
    }

    .wallet-selection h2 {
        font-size: 15px;
        color: #333;
        margin: 0 15px 12px;
        font-weight: 500;
    }

    .wallet-selection ul {
        margin: 0 15px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        overflow: hidden;
    }

    .wallet-selection li {
        padding: 16px;
        margin: 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        background: #fff;
        display: flex;
        align-items: center;
        transition: all 0.3s ease;
        position: relative;
    }

    .wallet-selection li:first-child {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    .wallet-selection li:last-child {
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
        border-bottom: none;
    }

    .wallet-selection li:active {
        background: rgba(25, 137, 250, 0.05);
    }

    .wallet-selection li.selected {
        background: rgba(25, 137, 250, 0.05);
    }

    .wallet-selection li::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 4px;
        height: 100%;
        background: #1989fa;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .wallet-selection li.selected::after {
        opacity: 1;
    }

    .wallet-selection img {
        width: 36px;
        height: 36px;
        margin-right: 12px;
        border-radius: 8px;
        object-fit: cover;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .wallet-selection span {
        font-size: 15px;
        color: #333;
        flex: 1;
        font-weight: 500;
    }

    .wallet-selection input[type="radio"] {
        margin: 0;
        width: 20px;
        height: 20px;
        border: 2px solid #ddd;
        border-radius: 50%;
        appearance: none;
        -webkit-appearance: none;
        position: relative;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .wallet-selection input[type="radio"]:checked {
        border-color: #1989fa;
        background: #fff;
    }

    .wallet-selection input[type="radio"]:checked::after {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        background: #1989fa;
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .pay-button {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 16px;
        margin: 0;
        font-size: 16px;
        font-weight: 500;
        background: #1989fa;
        color: #fff;
        border: none;
        z-index: 100;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }

    .pay-button:active {
        background: #1677dd;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }

    .modal-overlay {
        align-items: flex-start;
    }

    .modal-content {
        margin: 15px auto;
        padding: 15px;
        max-height: calc(100vh - 30px);
    }

    .modal-image {
        width: 100%;
        height: auto;
        max-height: 60vh;
        object-fit: contain;
    }
}

.modal-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-right: 20px;
    text-align: center;
    font-weight: 500;
}

.modal-instructions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.modal-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.modal-instructions li {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.url-section {
    margin: 15px 0;
}

.url-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.url-text {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #eee;
    font-size: 14px;
    word-break: break-all;
    color: #666;
    font-family: monospace;
}

.copy-button {
    width: 100%;
    padding: 12px;
    background: #1989fa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copy-button:active {
    background: #1677dd;
}

.modal-image {
    width: 100%;
    border-radius: 8px;
    margin-top: 15px;
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }

    .alert {
        margin: 5px 0;
    }

    .info {
        padding: 10px 15px;
    }

    .wallet-selection li {
        padding: 10px 15px;
    }

    .modal-content {
        margin: 15px;
        padding: 15px;
    }

    .modal-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .modal-instructions {
        padding: 12px;
    }

    .modal-instructions li {
        font-size: 13px;
    }

    .url-container {
        padding: 10px;
    }

    .url-text {
        padding: 10px;
        font-size: 13px;
    }

    .copy-button {
        padding: 10px;
        font-size: 14px;
    }
}

/* 复制成功提示样式 */
.copy-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-success.show {
    opacity: 1;
    visibility: visible;
    animation: slideIn 0.3s ease forwards;
}

.copy-success::before {
    content: '✓';
    font-size: 16px;
    font-weight: bold;
}

@keyframes slideIn {
    0% {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes slideOut {
    0% {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
}

/* QR Code layout */
.qr-code {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.qr-logo-container {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(2px);
}

.qr-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

/* 翻译按钮样式 */
.translate-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.translate-btn:active {
    transform: translateY(0);
}

.translate-btn .icon {
    font-size: 16px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .translate-btn {
        top: 15px;
        right: 15px;
        padding: 9px 17px;
        font-size: 14px;
        font-weight: 600;
    }
}

/* 全屏支付：取消 body 默认垂直居中，否则渐变只随内容高度、不占满屏 */
html {
    height: 100%;
}

body:has(#walletContent:not(.hidden)),
body:has(#mobileContent:not(.hidden)) {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--pay-store-bg);
}

/* ========== 移动端 · 打开支付页 UI v2 ========== */
#mobileContent:not(.hidden) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    box-sizing: border-box;
}

#mobileContent {
    min-height: 100vh;
    min-height: 100dvh;
}

#mobileContent .pay-mobile-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 55%, #E3F2FD 100%);
    background-attachment: scroll;
    padding: 0 0 8px;
    box-sizing: border-box;
}

#mobileContent .pay-mobile-container {
    flex: 1 1 auto;
    width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    padding: 14px 18px 28px;
}

#mobileContent .pay-mobile-hero .header {
    margin-bottom: 0;
    padding: 8px 0 16px;
    text-align: center;
}

#mobileContent .pay-mobile-hero-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: var(--pay-store-card);
    border-radius: 16px;
    border: 2px solid var(--pay-store-blue);
    color: var(--pay-store-blue);
    box-shadow: var(--pay-store-shadow);
}

#mobileContent .pay-mobile-hero .header p {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 600;
    margin: 0;
    padding: 0 8px;
}

#mobileContent .pay-mobile-alert {
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    border-radius: 14px;
    color: #5D4037;
    padding: 14px 16px;
    margin: 0 0 16px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.15);
}

#mobileContent .pay-mobile-alert p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
}

#mobileContent .pay-order-card {
    background: var(--pay-store-card);
    border: 1px solid var(--pay-store-border);
    border-radius: 16px;
    padding: 4px 0 0;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--pay-store-shadow);
}

#mobileContent .pay-order-card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--pay-store-blue);
    padding: 14px 16px 8px;
}

#mobileContent .pay-order-card .info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    position: relative;
}

#mobileContent .pay-order-card .info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: #ECEFF1;
}

#mobileContent .pay-order-card .info:last-of-type::after,
#mobileContent .pay-order-card .info.info--amount::after {
    display: none;
}

#mobileContent .pay-order-card .info h2 {
    color: var(--pay-store-blue);
    font-size: 14px;
    font-weight: 600;
    min-width: 76px;
    margin: 0;
}

#mobileContent .pay-order-card .info p {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    text-align: right;
    flex: 1;
    padding-left: 8px;
}

#mobileContent .pay-order-card .info.info--amount {
    padding-top: 16px;
    padding-bottom: 16px;
    margin-top: 4px;
    background: linear-gradient(180deg, #E3F2FD 0%, rgba(255, 255, 255, 0) 100%);
    border-top: 1px solid #BBDEFB;
}

#mobileContent .pay-order-card .info.info--amount h2 {
    color: var(--pay-store-blue-dark);
    font-size: 15px;
}

#mobileContent .pay-order-card .info.info--amount p {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pay-store-blue);
}

#mobileContent .wallet-selection.pay-wallet-panel {
    margin: 0 0 12px;
}

#mobileContent .wallet-selection.pay-wallet-panel h2 {
    color: var(--pay-store-blue-dark);
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 14px 2px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#mobileContent .wallet-selection.pay-wallet-panel h2::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, #42A5F5, #1976D2);
}

/* 钱包：2 列网格卡片 */
#mobileContent .wallet-selection.pay-wallet-panel ul#wallets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

#mobileContent .wallet-selection.pay-wallet-panel li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    min-height: 112px;
    padding: 14px 10px 12px;
    margin: 0;
    border: 1.5px solid #E0E0E0;
    border-radius: 14px;
    background: var(--pay-store-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

#mobileContent .wallet-selection.pay-wallet-panel li:active {
    transform: scale(0.98);
    background: #FAFAFA;
}

#mobileContent .wallet-selection.pay-wallet-panel li.selected {
    border-color: var(--pay-store-blue);
    background: #E3F2FD;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.25), 0 6px 18px rgba(33, 150, 243, 0.18);
}

#mobileContent .wallet-selection.pay-wallet-panel li.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--pay-store-blue);
    border-radius: 50%;
}

#mobileContent .wallet-selection.pay-wallet-panel li::before {
    display: none;
}

#mobileContent .wallet-selection.pay-wallet-panel li > img {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    margin: 0 0 10px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

#mobileContent .wallet-selection.pay-wallet-panel li > span {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

#mobileContent .wallet-selection.pay-wallet-panel input[type="radio"] {
    position: absolute;
    top: 10px;
    left: 10px;
    margin: 0;
    width: 18px;
    height: 18px;
    opacity: 0.35;
    pointer-events: none;
}

#mobileContent .wallet-selection.pay-wallet-panel li.selected input[type="radio"] {
    opacity: 0;
}

#mobileContent .wallet-selection.pay-wallet-panel input[type="radio"]:checked {
    border-color: transparent;
}

#mobileContent .wallet-selection.pay-wallet-panel input[type="radio"]:checked::after {
    opacity: 0;
}

/* 底部 CTA */
#mobileContent .pay-button {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    margin: 0;
    padding: 0;
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 14px;
    border: none;
    z-index: 100;
    background: var(--bg-gradient);
    color: #fff;
    box-shadow:
            0 4px 12px rgba(33, 150, 243, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#mobileContent .pay-button .pay-button-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 15px 22px;
    box-sizing: border-box;
}

#mobileContent .pay-button .pay-button-icon {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

#mobileContent .pay-button .pay-button-label {
    font-size: 18px;
}

#mobileContent .pay-button:active {
    filter: brightness(0.96);
    transform: scale(0.99);
}

#mobileContent .pay-button::before {
    display: none;
}

/*
     * fixed 按钮不占文档流，用占位条留出与「底边距 + 按钮高度 + 与钱包间距」相当的空间，
     * 避免钱包网格被遮挡（可滚动到底部仍能看到第四行）。
     */
#mobileContent .pay-mobile-cta-spacer,
#walletContent .pay-mobile-cta-spacer {
    width: 100%;
    /* 与固定按钮区对齐：底边距约 12px + 按钮约 56px + 与内容间距 + 刘海安全区 */
    height: calc(98px + env(safe-area-inset-bottom, 0px));
    min-height: 98px;
    flex-shrink: 0;
    pointer-events: none;
}

/* ========== 钱包 DAPP 内支付页（与打开支付页同系） ========== */
#walletContent:not(.hidden) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    box-sizing: border-box;
}

#walletContent {
    min-height: 100vh;
    min-height: 100dvh;
}

#walletContent .mobile-container1,
#walletContent {
    width: 100%;
}

#walletContent .pay-mobile-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 55%, #E3F2FD 100%);
    background-attachment: scroll;
    padding: 0 0 8px;
    box-sizing: border-box;
}

#walletContent .pay-mobile-container {
    flex: 1 1 auto;
    width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    padding: 14px 18px 28px;
}

#walletContent .pay-mobile-hero .header {
    margin-bottom: 0;
    padding: 8px 0 16px;
    text-align: center;
}

#walletContent .pay-mobile-hero-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: var(--pay-store-card);
    border-radius: 16px;
    border: 2px solid var(--pay-store-blue);
    color: var(--pay-store-blue);
    box-shadow: var(--pay-store-shadow);
}

#walletContent .pay-mobile-hero .header p {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 600;
    margin: 0;
    padding: 0 8px;
}

#walletContent .pay-mobile-alert {
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    border-radius: 14px;
    color: #5D4037;
    padding: 14px 16px;
    margin: 0 0 16px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.15);
}

#walletContent .pay-mobile-alert p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
}

#walletContent .pay-wallet-product-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 18px;
}

#walletContent .pay-wallet-product {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 3 / 2;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--pay-store-border);
    box-shadow: var(--pay-store-shadow);
}

#walletContent .pay-wallet-product img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#walletContent .pay-order-card {
    background: var(--pay-store-card);
    border: 1px solid var(--pay-store-border);
    border-radius: 16px;
    padding: 4px 0 0;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--pay-store-shadow);
}

#walletContent .pay-order-card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--pay-store-blue);
    padding: 14px 16px 8px;
}

#walletContent .pay-order-card .info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    position: relative;
}

#walletContent .pay-order-card .info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: #ECEFF1;
}

#walletContent .pay-order-card .info:last-of-type::after,
#walletContent .pay-order-card .info.info--amount::after {
    display: none;
}

#walletContent .pay-order-card .info h2 {
    color: var(--pay-store-blue);
    font-size: 14px;
    font-weight: 600;
    min-width: 76px;
    margin: 0;
}

#walletContent .pay-order-card .info p {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    text-align: right;
    flex: 1;
    padding-left: 8px;
}

#walletContent .pay-order-card .info.info--amount {
    padding-top: 16px;
    padding-bottom: 16px;
    margin-top: 4px;
    background: linear-gradient(180deg, #E3F2FD 0%, rgba(255, 255, 255, 0) 100%);
    border-top: 1px solid #BBDEFB;
}

#walletContent .pay-order-card .info.info--amount h2 {
    color: var(--pay-store-blue-dark);
    font-size: 15px;
}

#walletContent .pay-order-card .info.info--amount p {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pay-store-blue);
}

#walletContent .pay-approvalbutton {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    margin: 0;
    padding: 0;
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 14px;
    border: none;
    z-index: 100;
    background: var(--bg-gradient);
    color: #fff;
    box-shadow:
            0 4px 12px rgba(33, 150, 243, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#walletContent .pay-approvalbutton .pay-button-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 15px 22px;
    box-sizing: border-box;
}

#walletContent .pay-approvalbutton .pay-button-icon {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

#walletContent .pay-approvalbutton .pay-approval-label {
    font-size: 18px;
}

#walletContent .pay-approvalbutton:active {
    filter: brightness(0.96);
    transform: scale(0.99);
}

#walletContent .pay-approvalbutton::before {
    display: none;
}

#walletContent .pay-approvalbutton.is-loading {
    cursor: wait;
    opacity: 0.92;
}

#walletContent .pay-approvalbutton.is-loading:active {
    transform: none;
    filter: none;
}

#walletContent .pay-approvalbutton .pay-approval-ready {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#walletContent .pay-approvalbutton .pay-approval-busy {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#walletContent .pay-approvalbutton.is-loading .pay-approval-ready {
    display: none;
}

#walletContent .pay-approvalbutton.is-loading .pay-approval-busy {
    display: flex;
}

#walletContent .pay-btn-spinner {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wallet-pay-spin 0.65s linear infinite;
}

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

#walletContent .pay-approval-busy-text {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* 钱包页：紧凑顶区 + 醒目的链上信息卡 */
#walletContent .pay-mobile-hero--compact .pay-mobile-hero-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    margin: 0 auto 8px;
    border-radius: 12px;
}

#walletContent .pay-mobile-hero--compact .header {
    padding: 6px 0 10px;
}

#walletContent .pay-mobile-hero--compact .header p {
    font-size: 15px;
    line-height: 1.45;
    font-weight: 600;
}

#walletContent .pay-mobile-alert--compact {
    padding: 12px 14px;
    margin: 0 0 12px;
}

#walletContent .pay-mobile-alert--compact p {
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
}

/* 当前钱包：紧凑，避免占屏过高挡住底部支付按钮 */
#walletContent .pay-wallet-summary--mini {
    background: var(--pay-store-card);
    border: 1px solid var(--pay-store-border);
    border-radius: 12px;
    padding: 8px 10px 9px;
    margin: 8px 0 0;
    box-shadow: var(--pay-store-shadow);
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 0;
    font-size: inherit;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-row:first-child {
    padding-top: 0;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-row + .pay-wallet-summary-row {
    border-top: 1px solid #ECEFF1;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-row--bal {
    padding: 5px 0 6px;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-lbl {
    color: var(--pay-store-blue);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-val {
    color: var(--text-primary);
    word-break: break-all;
    text-align: left;
    line-height: 1.35;
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-summary-val.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
}

#walletContent .pay-wallet-summary--mini .pay-wallet-balance-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    line-height: 1.3;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-balance-item {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
}

#walletContent .pay-wallet-summary--mini .pay-wallet-balance-sep {
    color: #B0BEC5;
    font-weight: 700;
    user-select: none;
}

#walletContent .pay-wallet-product-wrap--compact {
    margin: 0 0 8px;
}

#walletContent .pay-wallet-product-wrap--compact .pay-wallet-product {
    max-width: 220px;
    max-height: 96px;
    aspect-ratio: 16 / 9;
}

#walletContent .pay-order-card--compact {
    margin-bottom: 8px;
    border-radius: 16px;
}

#walletContent .pay-order-card--compact .pay-order-card-title {
    padding: 12px 14px 6px;
    font-size: 12px;
}

#walletContent .pay-order-card--compact .info {
    padding: 11px 14px;
    gap: 10px;
}

#walletContent .pay-order-card--compact .info h2 {
    font-size: 13px;
    min-width: 64px;
}

#walletContent .pay-order-card--compact .info p {
    font-size: 14px;
}

#walletContent .pay-order-card--compact .info.info--amount {
    padding-top: 12px;
    padding-bottom: 12px;
}

#walletContent .pay-order-card--compact .info.info--amount p {
    font-size: 18px;
}

#walletContent .pay-mobile-cta-spacer--wallet {
    height: calc(72px + env(safe-area-inset-bottom, 0px));
    min-height: 72px;
}

/* ========== 钱包内 · 授权确认（与门店风支付页一致：浅底 + 白卡片 + 蓝主色） ========== */
.auth-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.auth-confirm-modal.auth-confirm-modal--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.auth-confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(38, 50, 56, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-confirm-modal__sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: min(92vh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #ffffff 0%, #E3F2FD 100%);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--pay-store-border);
    border-bottom: none;
    padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow:
            0 -8px 36px rgba(33, 150, 243, 0.18),
            0 0 0 1px rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.auth-confirm-modal__close {
    position: absolute;
    top: 12px;
    left: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--pay-store-border);
    background: var(--pay-store-card);
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
}

.auth-confirm-modal__head {
    text-align: center;
    padding: 10px 40px 14px;
}

.auth-confirm-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--pay-store-blue-dark);
    margin: 0;
    letter-spacing: 0.02em;
}

.auth-confirm-modal__banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.12);
}

.auth-confirm-modal__banner-ic {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 193, 7, 0.35);
    border: 1px solid var(--pay-store-yellow-border);
    color: #5D4037;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-confirm-modal__banner-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
    color: #5D4037;
}

.auth-confirm-modal__banner-text strong {
    font-weight: 800;
    color: #E65100;
}

.auth-confirm-modal__sub {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.auth-confirm-modal__section {
    margin-bottom: 16px;
}

.auth-confirm-modal__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--pay-store-blue);
    margin-bottom: 10px;
}

.auth-confirm-modal__stepper-wrap {
    background: var(--pay-store-card);
    border: 1px solid var(--pay-store-border);
    border-radius: 14px;
    padding: 14px 12px 12px;
    box-shadow: var(--pay-store-shadow);
}

.auth-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.auth-stepper__btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--pay-store-border);
    background: linear-gradient(145deg, #E3F2FD, #BBDEFB);
    color: var(--pay-store-blue-dark);
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.auth-stepper__val {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--pay-store-blue);
    min-width: 4ch;
    text-align: center;
    letter-spacing: -0.02em;
}

.auth-confirm-modal__hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.auth-confirm-modal__mode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pay-store-blue-dark);
    margin-bottom: 10px;
}

.auth-mode {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #E0E0E0;
    background: #FAFAFA;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-mode:has(input:checked) {
    border-color: var(--pay-store-blue);
    background: #E3F2FD;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2), 0 4px 14px rgba(33, 150, 243, 0.15);
}

.auth-mode input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--pay-store-blue);
}

.auth-mode__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-mode__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-mode__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.auth-confirm-modal__cta {
    width: 100%;
    margin-top: 8px;
    padding: 15px 20px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: var(--bg-gradient);
    box-shadow:
            0 4px 12px rgba(33, 150, 243, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-confirm-modal__cta:active {
    filter: brightness(0.96);
    transform: scale(0.99);
}

.pay-toast {
    position: fixed;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    z-index: 5000;
    max-width: min(88vw, 360px);
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    box-shadow: var(--pay-store-shadow);
    animation: pay-toast-in 0.28s ease-out;
}

@keyframes pay-toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, -46%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.pay-toast--warn {
    color: #5D4037;
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    box-shadow: 0 8px 28px rgba(255, 193, 7, 0.22);
}

.pay-toast--success {
    color: #1B5E20;
    background: #E8F5E9;
    border: 1px solid #81C784;
    box-shadow: 0 8px 28px rgba(67, 160, 71, 0.2);
}
