/* Marketplace v5 — index nav/footer/bg, points-only, scroll FX */

.mp-page {
    margin: 0;
    padding-top: 72px;
    color: var(--text-dark, #2c2416);
    overflow-x: hidden;
    background-color: var(--bg-beige, #faf8f3);
}

.mp-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(250, 248, 243, 0.85) 0%, rgba(250, 248, 243, 0.7) 100%),
        url('bg.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

.mp-page #particle-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.mp-main {
    position: relative;
    z-index: 1;
    padding: 0 0 48px;
}

/* 与顶栏 .container 同宽（1200px + 左右 20px） */
.mp-container {
    width: 100%;
}

/* Hero */
.mp-hero {
    position: relative;
    text-align: center;
    padding: 36px 0 28px;
    margin-bottom: 8px;
}

.mp-hero-glow {
    position: absolute;
    left: 50%;
    top: 0;
    width: min(520px, 90vw);
    height: 120px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.22) 0%, transparent 70%);
    animation: mp-glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mp-glow-pulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.mp-eyebrow {
    font-size: 11px;
    letter-spacing: 0.38em;
    color: var(--primary-gold-dark, #b8941f);
    margin: 0 0 8px;
    text-transform: uppercase;
}

.mp-title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 600;
    color: var(--red-brown, #5c4033);
    margin: 0 0 8px;
    letter-spacing: 0.04em;
}

.mp-subtitle {
    font-size: clamp(14px, 2vw, 16px);
    color: var(--text-light, #6b5b4f);
    margin: 0 auto 16px;
    max-width: 560px;
    line-height: 1.65;
}

.mp-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    font-size: 13px;
    color: var(--text-light);
}

.mp-meta strong {
    color: var(--primary-gold-dark);
}

.mp-meta-dot { opacity: 0.4; }

.mp-scroll-hint {
    margin: 18px 0 0;
    font-size: 11px;
    letter-spacing: 0.25em;
    color: rgba(92, 64, 51, 0.45);
    animation: mp-hint-bob 2.2s ease-in-out infinite;
}

@keyframes mp-hint-bob {
    0%, 100% { transform: translateY(0); opacity: 0.45; }
    50% { transform: translateY(4px); opacity: 0.85; }
}

/* Product flow */
.mp-flow {
    display: flex;
    flex-direction: column;
    gap: clamp(28px, 5vh, 48px);
}

.mp-product {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 36px);
    align-items: center;
    padding: clamp(20px, 3vw, 28px);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 8px 32px rgba(92, 64, 51, 0.06);
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.mp-product.mp-visible {
    opacity: 1;
    transform: translateY(0);
}

.mp-product:nth-child(even) .mp-product-visual { order: 2; }
.mp-product:nth-child(even) .mp-product-copy { order: 1; }

.mp-product:nth-child(even) .mp-product-index {
    left: 16px;
    right: auto;
}

.mp-product-index {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 200;
    color: rgba(92, 64, 51, 0.07);
    line-height: 1;
    pointer-events: none;
    transition: transform 0.4s ease, color 0.4s ease;
}

.mp-product.mp-visible .mp-product-index {
    color: rgba(212, 175, 55, 0.15);
}

.mp-badge-limited {
    position: absolute;
    top: 12px;
    left: 16px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 0.12em;
    background: var(--primary-gold, #d4af37);
    color: #fff;
    border-radius: 2px;
}

.mp-visual {
    position: relative;
    aspect-ratio: 4/5;
    max-height: min(36vh, 320px);
    margin: 0 auto;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 8px 24px rgba(92, 64, 51, 0.08);
    background: #faf8f3;
}

.mp-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(212, 175, 55, 0.12) 100%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}

.mp-product.mp-visible .mp-visual:hover::after { opacity: 1; }

.mp-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.mp-visual:hover img { transform: scale(1.04); }

.mp-category {
    font-size: 11px;
    letter-spacing: 0.26em;
    color: var(--primary-gold-dark);
    margin: 0 0 6px;
}

.mp-product-name {
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 600;
    color: var(--red-brown);
    margin: 0 0 8px;
    line-height: 1.2;
}

.mp-variants-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 14px;
    font-size: 14px;
}

.mp-variants-label {
    color: #8a7355;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 12px;
}

.mp-variants-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mp-variant-chip {
    padding: 6px 14px;
    border: 1px solid rgba(92, 64, 51, 0.35);
    border-radius: 999px;
    background: rgba(255, 252, 245, 0.7);
    color: #5c4033;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.mp-variant-chip:hover,
.mp-variant-chip.active {
    border-color: #b8860b;
    background: rgba(212, 175, 55, 0.18);
    color: #3d2914;
}

.redeem-model-hint {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(184, 134, 11, 0.35);
    color: #5c4033;
    font-size: 13px;
    line-height: 1.5;
}

.redeem-info-model .redeem-model-value {
    color: #8b4513;
    font-weight: 600;
}

#mp-lang-debug {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10050;
    max-height: 130px;
    margin: 0;
    padding: 8px 10px;
    overflow: auto;
    background: rgba(10, 10, 12, 0.92);
    color: #7dffb3;
    font: 11px/1.35 ui-monospace, Consolas, monospace;
    border-top: 1px solid rgba(125, 255, 179, 0.35);
    pointer-events: none;
}

.mp-product-desc {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-light);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-points {
    font-size: 15px;
    color: var(--primary-gold-dark);
    margin-bottom: 14px;
}

.mp-points i { margin-right: 6px; }

.mp-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.mp-btn {
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 12px;
    letter-spacing: 0.06em;
    cursor: pointer;
    border: 1px solid rgba(212, 175, 55, 0.55);
    transition: box-shadow 0.25s, transform 0.2s;
}

.mp-btn-primary {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(184, 148, 31, 0.15));
    color: var(--red-brown);
}

.mp-btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.mp-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mp-btn-ghost {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-gold-dark);
}

.mp-btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--text-light);
    text-decoration: underline;
    padding-left: 0;
}

.mp-empty-flow {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}

.mp-footer { margin-top: 24px; }

/* Modals — light theme (not marketplace.css dark) */
.mp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mp-modal.active { display: flex; }

.mp-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(44, 36, 22, 0.45);
    backdrop-filter: blur(4px);
}

.mp-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-beige, #faf8f3);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(92, 64, 51, 0.2);
    padding: 28px 24px 24px;
}

.mp-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
}

.redeem-icon { font-size: 32px; text-align: center; margin-bottom: 8px; }

.redeem-title {
    text-align: center;
    color: var(--red-brown);
    margin-bottom: 16px;
}

.redeem-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    font-size: 14px;
}

.redeem-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.marketplace-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
    animation: mp-toast-in 0.35s ease;
}

@keyframes mp-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.marketplace-toast-title {
    font-weight: 600;
    color: var(--red-brown);
}

.marketplace-toast-msg {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .mp-page { padding-top: 64px; }

    .mp-product {
        grid-template-columns: 1fr;
    }

    .mp-product:nth-child(even) .mp-product-visual,
    .mp-product:nth-child(even) .mp-product-copy {
        order: unset;
    }

    .mp-visual { max-height: 40vh; }

}

@media (prefers-reduced-motion: reduce) {
    .mp-product,
    .mp-scroll-hint,
    .mp-hero-glow { animation: none; transition: none; }
    .mp-product { opacity: 1; transform: none; }
}
