/* ==========================================================================
   JIHECANG 弹窗运行时样式表 (Popup Runtime CSS)
   ========================================================================== */

/* 1. 遮罩层与背景锁定 */
.jihecang-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 15, 29, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    animation: popupFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    box-sizing: border-box;
}

body.popup-scroll-locked {
    overflow: hidden !important;
    touch-action: none;
}

/* 2. 弹窗卡片基础结构 */
.jihecang-popup-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.92);
    animation: popupScaleUp 0.32s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
    color: #f3f4f6;
    box-sizing: border-box;
}

/* 3. 关闭按钮 */
.jihecang-popup-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.22s ease;
    padding: 0;
    outline: none;
}

.jihecang-popup-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: rotate(90deg) scale(1.08);
}

/* 4. 经典图文布局 (center_card) */
.popup-card-container {
    display: flex;
    flex-direction: column;
}

.popup-header-media {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
    background: #0b0f19;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.popup-header-media:hover .popup-card-img {
    transform: scale(1.03);
}

.popup-card-body {
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.popup-heading {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #f9fafb;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.popup-body {
    font-size: 14px;
    line-height: 1.6;
    color: #9ca3af;
    margin-bottom: 22px;
    white-space: pre-line;
    max-height: 160px;
    overflow-y: auto;
}

/* 5. 纯海报大图布局 (banner_hero) */
.jihecang-popup-card.layout-banner_hero {
    max-width: 500px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.jihecang-popup-card.layout-banner_hero .jihecang-popup-close-btn {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 50%;
    z-index: 10;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: background 0.2s, transform 0.2s;
}

.jihecang-popup-card.layout-banner_hero .jihecang-popup-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.popup-banner-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
    cursor: pointer;
    background: #111827;
}

.popup-banner-container .popup-mint-success-view {
    padding: 36px 24px;
}

.popup-hero-img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
}

.popup-banner-container:hover .popup-hero-img {
    transform: scale(1.02);
}

.popup-banner-dismiss {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.popup-banner-dismiss .popup-dismiss-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: background 0.2s, color 0.2s;
}

.popup-banner-dismiss .popup-dismiss-wrapper:hover {
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
}

.popup-hero-title {
    display: none;
}

/* 6. PC 双拼横向布局 (split_horizontal) */
.jihecang-popup-card.layout-split_horizontal {
    max-width: 480px;
}

.popup-split-container {
    display: flex;
    flex-direction: column;
}

.popup-media-col {
    width: 100%;
    height: 180px;
    background: #0d1322;
    overflow: hidden;
    position: relative;
}

.popup-split-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popup-split-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-weight: 700;
    letter-spacing: 2px;
}

.popup-content-col {
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 992px) {
    .jihecang-popup-card.layout-split_horizontal {
        max-width: 760px;
    }

    .popup-split-container {
        flex-direction: row;
    }

    .popup-media-col {
        width: 46%;
        height: auto;
        min-height: 320px;
    }

    .popup-content-col {
        width: 54%;
        padding: 36px 32px 28px;
    }

    .popup-content-col .popup-heading {
        text-align: left;
    }

    .popup-content-col .popup-body {
        text-align: left;
    }

    .popup-content-col .popup-dismiss-wrapper {
        justify-content: flex-start;
    }
}

/* 7. 操作按钮设计 */
.popup-action-area {
    width: 100%;
    margin-top: 4px;
}

.popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    transition: all 0.22s ease;
    box-sizing: border-box;
}

/* 金色高光渐变 (默认) */
.popup-btn--gold {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #1e1b12;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}
.popup-btn--gold:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #b45309 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.48);
}

/* 品牌科技蓝 */
.popup-btn--brand {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}
.popup-btn--brand:hover {
    background: linear-gradient(135deg, #818cf8 0%, #3730a3 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.48);
}

/* 大促热烈红 */
.popup-btn--red {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.35);
}
.popup-btn--red:hover {
    background: linear-gradient(135deg, #f87171 0%, #991b1b 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.48);
}

/* 沉稳暗夜深色 */
.popup-btn--dark {
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e5e7eb;
}
.popup-btn--dark:hover {
    background: #374151;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* 8. “今日不再提示” 勾选框 */
.popup-dismiss-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    user-select: none;
}

.popup-dismiss-wrapper input[type="checkbox"] {
    accent-color: #f59e0b;
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}

/* 9. 动效系统 */
@keyframes popupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popupScaleUp {
    from {
        transform: scale(0.9);
        opacity: 0.5;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 出场动画 */
.jihecang-popup-overlay.closing {
    animation: popupFadeOut 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.jihecang-popup-overlay.closing .jihecang-popup-card {
    animation: popupScaleDown 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes popupFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes popupScaleDown {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* 10. 优惠券原地原子领券 (Zero-Redirect Mint) 成功与反馈态 */
.popup-feedback-transition {
    animation: popupFadeIn 0.25s ease-out forwards;
}

.popup-mint-success-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0;
}

.popup-mint-badge-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
    animation: badgePopBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes badgePopBounce {
    0% {
        transform: scale(0.4) rotate(-15deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.popup-mint-success-view.status-success .popup-heading {
    color: #fbbf24;
}

.popup-btn.is-loading {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
}

.popup-btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-top-color: #111827;
    border-radius: 50%;
    margin-left: 6px;
    animation: popupSpinnerRotate 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes popupSpinnerRotate {
    to {
        transform: rotate(360deg);
    }
}
