/* 文章 / 网址卡片 — 点击弹出居中模态（复刻参考图样式） */
.posts-item.has-card-popup,
.sites-item.has-card-popup {
    cursor: pointer;
    position: relative;
}

/* 子元素全部穿透，点击落在卡片容器上，避免内部 <a> 抢先跳转 */
.posts-item.has-card-popup *,
.sites-item.has-card-popup * {
    pointer-events: none !important;
}

#io-card-popup-modal.card-hover-popup,
.card-hover-popup {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.card-hover-popup[hidden] {
    display: none !important;
}
.card-hover-popup.is-active {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.card-hover-popup.is-active .card-hover-popup__dialog {
    transform: translateY(0) scale(1);
}
body.card-popup-open {
    overflow: hidden;
}

.card-hover-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-hover-popup__dialog {
    position: relative;
    z-index: 2;
    width: min(420px, 100%);
    margin-top: 36px;
    transform: translateY(12px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-hover-popup.is-active .card-hover-popup__dialog {
    transform: translateY(0) scale(1);
}

.card-hover-popup__close {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 5;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    transition: color 0.2s ease, transform 0.2s ease;
}
.card-hover-popup__close:hover {
    color: #0f172a;
    transform: scale(1.05);
}

.card-hover-popup__icon-wrap {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    width: 72px;
    height: 72px;
}
.card-hover-popup__icon-glow {
    position: absolute;
    inset: -10px;
    border-radius: 22px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.55) 0%, rgba(74, 222, 128, 0) 72%);
    filter: blur(6px);
}
.card-hover-popup__icon {
    position: relative;
    z-index: 1;
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.card-hover-popup__panel {
    padding: 52px 22px 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 28%, #ffffff 100%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
    text-align: center;
}

.card-hover-popup__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.card-hover-popup__subtitle {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: #8a8f98;
}

.card-hover-popup__card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 14px 14px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eef0f4;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    text-align: left;
}

.card-hover-popup__card-main {
    flex: 1;
    min-width: 0;
}

.card-hover-popup__card-label {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
}

.card-hover-popup__card-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.65;
    color: #6b7280;
}

.card-hover-popup__code-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-hover-popup__code-mark {
    display: inline-block;
    margin: 0;
    padding: 4px 10px;
    border-radius: 6px;
    background: #fff9c4;
    color: #1f2937;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.card-hover-popup__copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.card-hover-popup__copy:hover {
    background: #fff;
    border-color: #cbd5e1;
}
.card-hover-popup__copy .iconfont {
    font-size: 12px;
}

.card-hover-popup__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 78px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover-popup__btn--down {
    color: #fff !important;
    background: #4c498f;
    box-shadow: 0 6px 16px rgba(76, 73, 143, 0.35);
}
.card-hover-popup__btn--down:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(76, 73, 143, 0.42);
}
.card-hover-popup__btn--down .iconfont {
    font-size: 14px;
}

.card-hover-popup__footer {
    padding-top: 4px;
}
.card-hover-popup__link {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none !important;
    transition: color 0.2s ease;
}
.card-hover-popup__link:hover {
    color: #4c498f;
}

@media (max-width: 767.98px) {
    .card-hover-popup__dialog {
        margin-top: 28px;
    }
    .card-hover-popup__panel {
        padding: 48px 16px 18px;
    }
    .card-hover-popup__title {
        font-size: 20px;
    }
    .card-hover-popup__card {
        flex-direction: column;
        align-items: stretch;
    }
    .card-hover-popup__btn--down {
        width: 100%;
    }
}
