/* ============================================
   移动端优先的支付页面样式
   ============================================ */

/* 主容器样式 */
.main {
    background: #ffffff;
    border-radius: 0;
    position: relative;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    padding-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   金额卡片区域
   ============================================ */
.amount-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.6rem 0.4rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.amount-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 0.5rem 0.5rem;
    animation: moveBackground 20s linear infinite;
    opacity: 0.3;
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(0.5rem, 0.5rem);
    }
}

.amount-label {
    font-size: 0.26rem;
    opacity: 0.9;
    margin-bottom: 0.2rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.amount-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.1rem;
    margin: 0.3rem 0;
    position: relative;
    z-index: 1;
}

.currency {
    font-size: 0.4rem;
    font-weight: 600;
}

.amount-number {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.02rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.amount-desc {
    font-size: 0.24rem;
    opacity: 0.85;
    margin-top: 0.2rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   支付方式选择区域
   ============================================ */
.payment-section {
    flex: 1;
    padding: 0.5rem 0.4rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    padding: 0 0.1rem;
}

.section-title {
    font-size: 0.32rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.wait2 {
    font-size: 0.22rem;
    color: #52c41a;
    font-weight: 600;
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.payment-item {
    background: #f8f9fa;
    border-radius: 0.24rem;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.03rem solid #e9ecef;
    min-height: 1.6rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.payment-item:active {
    transform: scale(0.98);
}

.payment-icon {
    width: 0.8rem;
    height: 0.8rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 0.16rem;
    padding: 0.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.payment-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.payment-name {
    font-size: 0.28rem;
    color: #333;
    font-weight: 500;
    text-align: center;
    margin-top: 0.1rem;
    transition: color 0.3s ease;
}

.payment-check {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    width: 0.36rem;
    height: 0.36rem;
    background: #667eea;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.payment-check svg {
    width: 0.2rem;
    height: 0.2rem;
    color: #fff;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 选中状态 */
.payment-item.check {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    transform: translateY(-0.02rem);
}

.payment-item.check .payment-icon {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transform: scale(1.05);
}

.payment-item.check .payment-name {
    color: #667eea;
    font-weight: 600;
}

.payment-item.check .payment-check {
    display: flex;
    animation: checkIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   底部支付按钮
   ============================================ */
.pay-button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.3rem 0.4rem;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-top: 0.01rem solid #f0f0f0;
}

.pay-button {
    width: 100%;
    height: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.24rem;
    font-size: 0.36rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 1rem;
}

.pay-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.pay-button:active::before {
    width: 300px;
    height: 300px;
}

.pay-button:active {
    transform: scale(0.98);
}

.pay-button-text {
    font-weight: 600;
    letter-spacing: 0.02rem;
    position: relative;
    z-index: 1;
}

.pay-button-amount {
    display: flex;
    align-items: baseline;
    gap: 0.05rem;
    font-weight: 700;
    font-size: 0.38rem;
    position: relative;
    z-index: 1;
}

.pay-button .currency {
    font-size: 0.32rem;
}

.pay-button .amount {
    font-size: 0.38rem;
}

/* 禁用状态 */
.pay-button-display {
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.pay-button-display:active {
    transform: none;
}

/* ============================================
   加载遮罩层
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 0.6rem;
    height: 0.6rem;
    border: 0.06rem solid rgba(255, 255, 255, 0.3);
    border-top: 0.06rem solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   响应式设计
   ============================================ */

/* 小屏手机 (≤375px) */
@media screen and (max-width: 375px) {
    .amount-card {
        padding: 0.5rem 0.35rem;
    }
    
    .amount-number {
        font-size: 0.72rem;
    }
    
    .payment-grid {
        gap: 0.25rem;
    }
    
    .payment-item {
        min-height: 1.5rem;
        padding: 0.35rem;
    }
    
    .payment-icon {
        width: 0.7rem;
        height: 0.7rem;
    }
    
    .payment-name {
        font-size: 0.26rem;
    }
    
    .pay-button {
        height: 0.95rem;
        font-size: 0.34rem;
    }
}

/* 大屏手机 (≥414px) */
@media screen and (min-width: 414px) {
    .amount-card {
        padding: 0.7rem 0.5rem;
    }
    
    .amount-number {
        font-size: 0.88rem;
    }
    
    .payment-grid {
        gap: 0.35rem;
    }
    
    .payment-item {
        min-height: 1.7rem;
        padding: 0.45rem;
    }
    
    .payment-icon {
        width: 0.9rem;
        height: 0.9rem;
    }
}

/* 横屏模式 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .amount-card {
        padding: 0.4rem 0.4rem;
    }
    
    .amount-number {
        font-size: 0.6rem;
    }
    
    .payment-section {
        padding: 0.3rem 0.4rem;
    }
    
    .payment-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }
    
    .payment-item {
        min-height: 1.3rem;
        padding: 0.3rem;
    }
    
    .pay-button-container {
        padding: 0.25rem 0.4rem;
    }
    
    .pay-button {
        height: 0.9rem;
    }
}

/* 平板设备 (≥768px) */
@media screen and (min-width: 768px) {
    .main {
        max-width: 7.5rem;
        margin: 0 auto;
        border-radius: 0.32rem;
        margin-top: 0.3rem;
        margin-bottom: 0.3rem;
        min-height: calc(100vh - 0.6rem);
    }
    
    .amount-card {
        border-radius: 0.32rem 0.32rem 0 0;
    }
    
    .pay-button-container {
        position: relative;
        border-radius: 0 0 0.32rem 0.32rem;
        box-shadow: none;
        border-top: 0.01rem solid #f0f0f0;
    }
}