/* 首页内嵌兑换弹窗样式 */
.redeem-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px 12px;
    -webkit-tap-highlight-color: transparent;
}
.redeem-modal.show { display: block; }

.redeem-mbox {
    max-width: 720px;
    width: 92%;
    margin: 4vh auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: redeem-pop 0.18s ease-out;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    max-height: 92vh;
}
@keyframes redeem-pop {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.redeem-mhead {
    padding: 18px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.redeem-mhead h3 {
    margin: 0;
    font-size: 1.18em;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    flex: 1;
    padding-right: 10px;
}
.redeem-mclose {
    background: transparent;
    color: #fff;
    border: 0;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    flex-shrink: 0;
    opacity: 0.85;
}
.redeem-mclose:hover { opacity: 1; }

.redeem-mbody {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
}

.redeem-desc {
    color: #374151;
    font-size: 0.95em;
    line-height: 1.7;
    background: #f8fafc;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin-bottom: 14px;
    word-break: break-word;
    white-space: normal;
}
.redeem-desc .redeem-empty { color: #9ca3af; }

.redeem-virtual-tip {
    color: #b45309;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88em;
    margin-bottom: 10px;
}

.redeem-physical .redeem-row { margin-bottom: 12px; }
.redeem-physical label {
    display: block;
    color: #4b5563;
    font-size: 0.85em;
    margin-bottom: 4px;
}
.redeem-physical input,
.redeem-physical textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 0.95em;
    font-family: inherit;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
    resize: vertical;
}
.redeem-physical input:focus,
.redeem-physical textarea:focus {
    outline: 0;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.redeem-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.88em;
    margin-top: 4px;
}

.redeem-mfoot {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafbff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.redeem-mfoot-single { justify-content: flex-end; }

.redeem-meta-line {
    color: #475569;
    font-size: 0.92em;
}
.redeem-meta-line b {
    color: #4c1d95;
    font-weight: 700;
    font-size: 1.05em;
    margin: 0 2px;
}
.redeem-meta-line .redeem-dot {
    color: #cbd5e1;
    margin: 0 6px;
}

.redeem-btn-confirm {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: 0;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}
.redeem-btn-confirm:hover { opacity: 0.92; }
.redeem-btn-confirm:disabled {
    background: #cbd5e1;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
}

/* 结果弹窗 */
.redeem-result-box .redeem-mhead {
    background: linear-gradient(135deg, #10b981, #059669);
}
.redeem-result-msg {
    color: #065f46;
    font-size: 1em;
    background: #d1fae5;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.redeem-result-links { margin-top: 4px; }
.redeem-link-tip {
    color: #4b5563;
    font-size: 0.9em;
    margin-bottom: 8px;
}
.redeem-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    padding: 9px 11px;
    border-radius: 7px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.redeem-link-label {
    font-size: 0.82em;
    color: #6b7280;
    flex-shrink: 0;
}
.redeem-link-url {
    flex: 1;
    color: #2563eb;
    font-size: 0.85em;
    word-break: break-all;
    text-decoration: none;
    min-width: 0;
}
.redeem-link-url:hover { text-decoration: underline; }
.redeem-link-copy {
    background: #4f46e5;
    color: #fff;
    border: 0;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.78em;
    cursor: pointer;
    flex-shrink: 0;
}
.redeem-link-copy:hover { background: #4338ca; }

/* Toast */
.redeem-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    padding: 9px 18px;
    border-radius: 22px;
    font-size: 0.88em;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.18s, transform 0.18s;
    pointer-events: none;
}
.redeem-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 兑换商品在 games-list 中的徽章/价格（与 .game-date 配合做右侧对齐） */
.redeem-meta {
    font-size: 0.78em;
    color: #6b7280;
    margin-left: 8px;
    display: inline-grid;
    grid-template-columns: 64px 70px;
    column-gap: 4px;
    align-items: baseline;
    flex-shrink: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.redeem-meta .redeem-cost {
    color: #4c1d95;
    font-weight: 600;
}
.redeem-meta .redeem-stock-ok { color: #047857; }
.redeem-meta .redeem-stock-empty { color: #ef4444; }

/* 商品标题前的 [实物]/[虚拟] 标签 */
.redeem-type-tag {
    display: inline-block;
    font-size: 0.85em;
    font-weight: 600;
    padding: 0 4px;
    border-radius: 3px;
    margin-right: 2px;
    vertical-align: 1px;
}
.redeem-type-physical { color: #b91c1c; }
.redeem-type-virtual { color: #1e40af; }

@media (max-width: 600px) {
    .redeem-mbox { margin: 2vh auto; min-height: 0; max-height: 96vh; border-radius: 10px; width: 96%; }
    .redeem-mhead { padding: 13px 16px; }
    .redeem-mhead h3 { font-size: 1.05em; }
    .redeem-mbody { padding: 16px; }
    .redeem-mfoot { padding: 13px 16px; }
    .redeem-meta-line { font-size: 0.85em; }
    .redeem-btn-confirm { padding: 9px 18px; font-size: 0.9em; }
}
