/* =========================================================================
 * 赛博猫 · 霓虹舞池  —— 首页入口卡片 + 全屏浮层
 * -------------------------------------------------------------------------
 * 只被 index.html 引用（单独成文件是为了不动 style.css，避免牵连后台页面）。
 * 颜色一律走站点变量（--bg-card / --text / --border ...），亮色与暗色主题都适配。
 * ========================================================================= */

/* ---------- 1. 入口卡片（放在「访客足迹」区块内） ---------- */
.cybercat-card {
    position: relative;
    margin-top: 24px;
    padding: 26px 24px 22px;
    text-align: center;
    overflow: hidden;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* 顶部一条流动霓虹线，暗示这是个"会动"的模块 */
.cybercat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #ff2d95, #00e5ff, #00ffb4, #ff2d95);
    background-size: 300% 100%;
    animation: cybercatEdge 6s linear infinite;
}

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

.cybercat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-focus);
}

.cybercat-emoji {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 10px;
    display: inline-block;
    animation: cybercatBob 1.6s ease-in-out infinite;
}

@keyframes cybercatBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.cybercat-title {
    margin: 0 0 6px;
    font-size: 1.16rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
}

.cybercat-desc {
    margin: 0 0 18px;
    font-size: .84rem;
    line-height: 1.7;
    color: var(--text-light);
}

.cybercat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.cybercat-tag {
    font-size: .72rem;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    background: rgba(255, 126, 179, .12);
    border: 1px solid rgba(255, 126, 179, .3);
    color: var(--text-light);
}

[data-theme="dark"] .cybercat-tag {
    background: rgba(192, 132, 252, .14);
    border-color: rgba(192, 132, 252, .32);
}

.cybercat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: #fff;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 126, 179, .35);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.cybercat-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 10px 28px rgba(192, 132, 252, .45);
}

.cybercat-btn:active {
    transform: translateY(0);
}

/* 直接跳转的小链接（不想用浮层的人可直接开新页面） */
.cybercat-direct {
    display: block;
    margin: 12px auto 0;
    width: fit-content;
    font-size: .75rem;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

/* ---------- 2. 全屏浮层 ---------- */
/* z-index 必须足够高：站点里还有几个比普通弹窗更高的层
   （信封按钮 9995、礼物 9990、点击爱心 9999、灯箱 10000），
   模 态层要压过它们才不会被"浮"在上面。取值 20000：
   高于站点所有既有元素，又低于人机验证门（turnstile-guard.js 的 99999），
   保证进入站点时那道锁屏仍然在最上层。 */
.cybercat-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(5, 5, 16, .74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

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

.cybercat-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1240px, 100%);
    height: min(94vh, 940px);
    height: min(calc(var(--vh, 1vh) * 94), 940px);
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, .28);
    border-radius: 24px;
    background: #050510;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .62), 0 0 60px rgba(0, 229, 255, .12);
    transform: translateY(18px) scale(.98);
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.cybercat-overlay.open .cybercat-panel {
    transform: none;
}

/* 顶栏：模块本身是暗色霓虹风，这里配深色 chrome 才协调（两种主题下都适用） */
.cybercat-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px 9px 16px;
    background: rgba(10, 14, 30, .94);
    border-bottom: 1px solid rgba(0, 229, 255, .22);
}

.cybercat-bar-title {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .5px;
    color: #9fe8ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, .5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.cybercat-open-tab {
    padding: 5px 11px;
    border: 1px solid rgba(0, 229, 255, .3);
    border-radius: var(--radius-full);
    font-size: .74rem;
    color: #7fd8f0;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.cybercat-open-tab:hover {
    background: rgba(0, 229, 255, .14);
    color: #c8f4ff;
}

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

.cybercat-close:hover {
    background: rgba(255, 45, 149, .28);
    transform: rotate(90deg);
}

.cybercat-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #050510;
}

.cybercat-body iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #050510;
}

/* 加载提示：首次打开要下 ~4MB（内嵌音乐+动画帧），给个明确交代 */
.cybercat-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    background: #050510;
    color: #9fe8ff;
    font-size: .82rem;
    line-height: 1.7;
    text-align: center;
    transition: opacity .35s ease, visibility .35s ease;
}

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

.cybercat-loading p {
    margin: 0;
    max-width: 320px;
}

.cybercat-spin {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(0, 229, 255, .22);
    border-top-color: #00e5ff;
    animation: cybercatSpin .9s linear infinite;
}

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

body.cybercat-open {
    overflow: hidden;
}

/* ---------- 3. 移动端 ---------- */
@media (max-width: 768px) {
    .cybercat-card {
        margin-top: 18px;
        padding: 22px 18px 18px;
    }

    .cybercat-emoji {
        font-size: 2.2rem;
    }

    .cybercat-overlay {
        padding: 0;
    }

    .cybercat-panel {
        width: 100%;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        border: 0;
        border-radius: 0;
    }

    .cybercat-bar-title {
        font-size: .76rem;
    }

    .cybercat-open-tab {
        display: none;   /* 手机上没空间，全屏已是沉浸，不需要跳新标签页 */
    }
}

@media (prefers-reduced-motion: reduce) {
    .cybercat-emoji,
    .cybercat-card::before,
    .cybercat-spin {
        animation: none;
    }

    .cybercat-card:hover {
        transform: none;
    }
}
