/* ==========================================
   简约二次元风格支付页面样式
   ========================================== */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 字体设置 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8f2ff 50%, #f0f8ff 100%);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* 加载状态 */
body.loading .main-content {
    display: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8f2ff 50%, #f0f8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.loading-content {
    text-align: center;
    color: #666;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(45deg, #4a90e2, #7bb3f0);
    animation: spin 1.5s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-inner {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.spinner-inner::after {
    content: '♡';
    color: #4a90e2;
    font-size: 18px;
}

.loading-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 隐藏加载状态 */
body:not(.loading) .loading-overlay {
    display: none;
}

/* 主要内容区域 */
.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anime-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* 页面头部 */
.anime-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.brand-mascot {
    margin-right: 15px;
}

.mascot-face {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4a90e2, #7bb3f0);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 15px rgba(74, 144, 226, 0.25);
}

.mascot-eyes {
    display: flex;
    gap: 6px;
    position: absolute;
    top: 15px;
}

.eye {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: relative;
}

.pupil {
    width: 3px;
    height: 3px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mascot-mouth {
    position: absolute;
    bottom: 12px;
    color: white;
    font-size: 10px;
}

.brand-info {
    flex: 1;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    color: #4a90e2;
    margin-bottom: 3px;
}

.brand-subtitle {
    font-size: 13px;
    color: #7bb3f0;
    font-weight: 500;
}

/* 主支付卡片 */
.payment-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
}

/* 商户信息卡片 */
.merchant-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #4a90e2, #7bb3f0);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.25);
}

.merchant-avatar {
    position: relative;
    margin-right: 12px;
}

.avatar-ring {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: relative;
}

.avatar-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: white;
}

.merchant-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.merchant-label {
    font-size: 11px;
    opacity: 0.8;
}

/* 金额展示卡片 */
.amount-display-card {
    text-align: center;
    background: linear-gradient(135deg, #f8fbff, #fff);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(74, 144, 226, 0.15);
}

.amount-label {
    font-size: 13px;
    color: #4a90e2;
    margin-bottom: 8px;
    font-weight: 500;
}

.amount-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 12px;
}

.currency {
    font-size: 20px;
    font-weight: 600;
    color: #4a90e2;
    margin-right: 4px;
}

.amount-number {
    font-size: 40px;
    font-weight: 700;
    color: #4a90e2;
    line-height: 1;
}

.expire-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(74, 144, 226, 0.08);
    color: #4a90e2;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(74, 144, 226, 0.15);
}

/* 二维码区域 */
.qr-section {
    position: relative;
    padding: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

/* 二维码容器 */
.qr-container {
    position: relative;
    width: 240px;
    height: 240px;
    z-index: 2;
}

.qr-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.qr-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid #4a90e2;
}

.qr-corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 12px 0 0 0;
}

.qr-corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 12px 0 0;
}

.qr-corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 12px;
}

.qr-corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 12px 0;
}

.qr-code {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 216px;
    height: 216px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 6px 24px rgba(74, 144, 226, 0.15);
    z-index: 2;
}

.qr-code img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.qr-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    border-radius: 12px;
    animation: qrShine 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes qrShine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* 支付提示 */
.payment-tip {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.06), rgba(123, 179, 240, 0.08));
    border: 1px solid rgba(74, 144, 226, 0.15);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.tip-icon {
    font-size: 16px;
    color: #4a90e2;
}

.tip-text {
    font-size: 12px;
    color: #4a90e2;
    line-height: 1.5;
    font-weight: 500;
}

/* 订单详情卡片 */
.order-details-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    margin-bottom: 18px;
    box-shadow: 0 6px 24px rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #4a90e2, #7bb3f0);
    padding: 12px 18px;
    color: white;
}

.header-title {
    font-size: 15px;
    font-weight: 600;
}

.details-content {
    padding: 18px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(74, 144, 226, 0.08);
    font-size: 13px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #4a90e2;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
    text-align: right;
}

.detail-value.highlight {
    color: #4a90e2;
    font-size: 15px;
}

.total-row {
    background: rgba(74, 144, 226, 0.04);
    margin: 0 -18px;
    padding: 12px 18px;
    border-radius: 0 0 20px 20px;
}

.total-amount {
    font-size: 16px;
    color: #4a90e2;
}

.contact-qq {
    color: #4a90e2;
    font-size: 12px;
}

/* 底部操作区域 */
.bottom-actions {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.08);
}

.order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-number {
    font-size: 11px;
    color: #4a90e2;
    font-weight: 500;
}

.refresh-btn {
    background: linear-gradient(135deg, #4a90e2, #7bb3f0);
    border: none;
    border-radius: 12px;
    padding: 6px 12px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
}

.btn-icon {
    font-size: 12px;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #4a90e2;
}

.security-icon {
    color: #4a90e2;
}

/* 错误状态样式 */
.error-state {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    min-height: 260px;
    background: linear-gradient(135deg, #fff3f3, #fef8f8);
    border: 2px solid #ffc4c4;
    border-radius: 20px;
    padding: 25px 18px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.2);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-state.show {
    display: flex;
    animation: errorShow 0.5s ease-out;
}

@keyframes errorShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.error-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #ff6b6b;
}

.error-title {
    font-size: 16px;
    font-weight: 700;
    color: #d63031;
    margin-bottom: 8px;
}

.error-message {
    font-size: 12px;
    color: #d63031;
    line-height: 1.5;
    opacity: 0.8;
}

/* 成功跳转倒计时样式 */
.redirect-countdown {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    min-height: 300px;
    background: linear-gradient(135deg, #f3fef3, #f8fff8);
    border: 2px solid #c4ffc4;
    border-radius: 20px;
    padding: 30px 18px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.15);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.redirect-countdown.show {
    display: flex;
    animation: successShow 0.5s ease-out;
}

@keyframes successShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.redirect-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #4caf50;
    font-weight: bold;
}

.redirect-title {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 10px;
}

.redirect-message {
    font-size: 13px;
    color: #388e3c;
    line-height: 1.5;
    margin-bottom: 20px;
}

#redirect-seconds {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
}

.redirect-cancel {
    background: transparent;
    border: 2px solid #81c784;
    color: #388e3c;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.redirect-cancel:hover {
    background: #81c784;
    color: white;
    transform: translateY(-1px);
}

/* 隐藏二维码容器 */
.qr-container.hide {
    display: none;
}

/* 错误状态下的样式修改 */
.payment-tip.error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 182, 182, 0.15));
    border: 1px solid #ffc4c4;
}

.payment-tip.error .tip-icon {
    color: #ff6b6b;
}

.payment-tip.error .tip-text {
    color: #d63031;
    font-weight: 600;
}

/* 过期状态样式 */
.expire-time.expired {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 182, 182, 0.2));
    color: #d63031;
    border: 1px solid #ffc4c4;
}

.expire-time.timeout {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 235, 59, 0.15));
    color: #ff6f00;
    border: 1px solid #ffc107;
}

.expire-time.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(129, 199, 132, 0.15));
    color: #2e7d32;
    border: 1px solid #4caf50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .anime-header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .brand-mascot {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .brand-title {
        font-size: 20px;
    }
    
    .payment-card {
        padding: 18px;
        border-radius: 20px;
    }
    
    .amount-number {
        font-size: 36px;
    }
    
    .qr-container {
        width: 200px;
        height: 200px;
    }
    
    .qr-code {
        top: 10px;
        left: 10px;
        width: 180px;
        height: 180px;
        padding: 10px;
    }
    
    .error-state,
    .redirect-countdown {
        width: 90%;
        max-width: 260px;
    }
}

@media (max-width: 480px) {
    .anime-header {
        margin-bottom: 20px;
    }
    
    .payment-card {
        margin-bottom: 15px;
        border-radius: 18px;
    }
    
    .order-info {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
}