/* =========================================================================
 * 爱心告白 模块 —— 首页入口 + 全屏浮层
 * 单独成文件，只被 index.html 引用，不动 style.css / 不牵连后台页。
 * 依赖：告白模块本体 /love-confession.html（含 three+mediapipe，约 17MB 资源）
 * ========================================================================= */

/* ---------- 入口卡片（复用圣诞树原来的区块位置） ---------- */
.love-confession-stage {
    position: relative;
    margin-top: 18px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

/* 顶部流动霓虹线，暗示这是会动的交互模块 */
.love-confession-stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #ff758c, #ffd700, #ff7eb3, #ff758c);
    background-size: 300% 100%;
    animation: loveconfEdge 6s linear infinite;
}

@keyframes loveconfEdge {
    to { background-position: 300% 0; }
}

.love-confession-emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
    animation: loveconfPulse 1.8s ease-in-out infinite;
}

@keyframes loveconfPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.love-confession-hint {
    font-size: .84rem;
    color: var(--text-light);
    line-height: 1.8;
    margin: 0 0 22px;
    max-width: 460px;
}

.love-confession-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border: 0;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #ff758c, #ff7eb3, #c084fc);
    color: #fff;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 117, 140, .4);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.love-confession-open-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 12px 32px rgba(192, 132, 252, .5);
}

.love-confession-open-btn:active {
    transform: translateY(0);
}

/* 直接跳转小链接 */
.love-confession-direct {
    display: block;
    margin-top: 14px;
    width: fit-content;
    font-size: .75rem;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.love-confession-direct:hover {
    color: var(--pink);
}

/* ---------- 全屏浮层 ---------- */
.love-confession-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;   /* 与赛博猫浮层同量级：高于站点所有既有元素，低于锁屏门 99999 */
    display: grid;
    place-items: center;
    padding: 0;
    background: #05030a;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.love-confession-overlay.open {
    opacity: 1;
    visibility: visible;
}

.love-confession-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #05030a;
}

.love-confession-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px 9px 16px;
    background: rgba(12, 8, 22, .95);
    border-bottom: 1px solid rgba(255, 117, 140, .25);
}

.love-confession-bar-title {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .5px;
    color: #ffb6c1;
    text-shadow: 0 0 10px rgba(255, 117, 140, .5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.love-confession-bar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.love-confession-open-tab {
    padding: 5px 11px;
    border: 1px solid rgba(255, 117, 140, .35);
    border-radius: var(--radius-full);
    font-size: .74rem;
    color: #ffb6c1;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.love-confession-open-tab:hover {
    background: rgba(255, 117, 140, .16);
    color: #ffe4e8;
}

.love-confession-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 117, 140, .3);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #ffb6c1;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.love-confession-close:hover {
    background: rgba(255, 117, 140, .28);
    transform: rotate(90deg);
}

.love-confession-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #05030a;
}

.love-confession-body iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #05030a;
}

/* 加载提示（首次要下 ~17MB 的模型+wasm） */
.love-confession-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    background: #05030a;
    color: #ffb6c1;
    font-size: .82rem;
    line-height: 1.7;
    text-align: center;
    transition: opacity .35s ease, visibility .35s ease;
}

.love-confession-loading.hide {
    opacity: 0;
    visibility: hidden;
}

.love-confession-loading p {
    margin: 0;
    max-width: 340px;
}

body.love-confession-open {
    overflow: hidden;
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .love-confession-stage {
        min-height: 340px;
        padding: 20px;
    }

    .love-confession-emoji {
        font-size: 2.4rem;
    }

    .love-confession-open-tab {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .love-confession-emoji,
    .love-confession-stage::before {
        animation: none;
    }

    .love-confession-open-btn:hover {
        transform: none;
    }
}
