/**
 * unified-pay-modal.css — 统一支付弹窗样式
 *
 * 所有页面（Chat / 定价 / 钱包）共用同一个支付弹窗。
 * 从 pricing/index.html 提取并增强。
 *
 * 版本: 1.0.0
 * 创建: 2026-04-12
 */

/* ── 遮罩层 ── */
.upm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.upm-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── 卡片 ── */
.upm-card {
    background: linear-gradient(135deg, #0f172a, #1a1040);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
    padding: 32px 36px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    transform: scale(.95);
    transition: transform .3s ease;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .5);
    position: relative;
}

.upm-overlay.active .upm-card {
    transform: scale(1);
}

/* ── 关闭按钮 ── */
.upm-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    color: #9CA3AF;
    font-size: 16px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
}

.upm-close-btn:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* ── 套餐信息头 ── */
.upm-plan-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.upm-plan-icon {
    font-size: 24px;
}

.upm-plan-info {
    text-align: left;
}

.upm-plan-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.upm-plan-desc {
    font-size: 12px;
    color: #6B7280;
}

/* ── 价格 ── */
.upm-price {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #A78BFA;
}

.upm-price-original {
    text-decoration: line-through;
    color: #6B7280;
    font-size: 14px;
    margin-right: 6px;
}

.upm-first-badge {
    display: inline-block;
    font-size: 11px;
    color: #34D399;
    margin-top: 2px;
}

.upm-cycle {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 16px;
}

/* ── 优惠码（折叠式） ── */
.upm-coupon-wrap {
    margin-bottom: 16px;
    text-align: center;
}

.upm-coupon-toggle {
    font-size: 12px;
    color: #6B7280;
    text-decoration: none;
    transition: color .2s;
    cursor: pointer;
}

.upm-coupon-toggle:hover {
    color: #A78BFA;
}

.upm-coupon-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .3s ease, opacity .3s ease, margin .3s ease;
    margin-top: 0;
    text-align: left;
}

.upm-coupon-body.expanded {
    max-height: 120px;
    opacity: 1;
    margin-top: 10px;
}

.upm-coupon-row {
    display: flex;
    gap: 8px;
}

.upm-coupon-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}

.upm-coupon-input:focus {
    border-color: rgba(167, 139, 250, .4);
}

.upm-coupon-input::placeholder {
    color: #4B5563;
}

.upm-coupon-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .08);
    color: #D1D5DB;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.upm-coupon-btn:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.upm-coupon-result {
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

.upm-coupon-result.success {
    display: block;
    color: #10B981;
}

.upm-coupon-result.error {
    display: block;
    color: #EF4444;
}

/* ── 加载/QR区域 ── */
.upm-loading {
    padding: 24px 0;
}

.upm-loading .upm-spinner {
    width: 24px;
    height: 24px;
    margin: 0 auto 12px;
    border: 3px solid rgba(167, 139, 250, .2);
    border-top-color: #A78BFA;
    border-radius: 50%;
    animation: upm-spin 1s linear infinite;
}

.upm-loading-text {
    font-size: 12px;
    color: #6B7280;
}

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

.upm-qr-section {
    display: none;
}

.upm-qr-section.visible {
    display: block;
}

.upm-qr-frame {
    display: inline-block;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    margin-bottom: 16px;
}

.upm-qr-canvas {
    border-radius: 8px;
    background: #fff;
    display: block;
}

/* ── 状态文字 ── */
.upm-status {
    font-size: 14px;
    margin-bottom: 8px;
    color: #A78BFA;
}

.upm-status.waiting {
    animation: upm-pulse 1.5s ease-in-out infinite;
}

.upm-status.success {
    color: #10B981;
    font-weight: 600;
    animation: none;
}

.upm-status.error {
    color: #EF4444;
    animation: none;
}

@keyframes upm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}

.upm-order-no {
    font-size: 12px;
    color: #4B5563;
    margin-bottom: 16px;
}

/* ── 底部按钮 ── */
.upm-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.upm-btn-mock {
    display: none;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    border: none;
    color: #D1D5DB;
    cursor: pointer;
    transition: all .2s;
}

.upm-btn-mock.visible {
    display: inline-block;
}

.upm-btn-mock:hover {
    background: rgba(255, 255, 255, .15);
}

.upm-btn-cancel {
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    border: none;
    color: #6B7280;
    cursor: pointer;
    transition: all .2s;
}

.upm-btn-cancel:hover {
    color: #D1D5DB;
    background: rgba(255, 255, 255, .08);
}
