/* ============================================================
 * theme.css — 小胡的网 · CYBERPUNK EDITION
 * 深空科技感：霓虹光晕 + 扫描线 + HUD 角部 + 多层阴影
 * ============================================================ */

:root {
    /* ---- 科幻霓虹配色 ---- */
    --neon-cyan:       #00f0ff;
    --neon-cyan-soft:  rgba(0, 240, 255, 0.5);
    --neon-purple:     #a855f7;
    --neon-purple-soft:rgba(168, 85, 247, 0.5);
    --neon-pink:       #ff3d8b;
    --neon-amber:      #ffb547;

    /* ---- 深空底色 ---- */
    --space-bg:        #050814;
    --space-bg-2:       #0a0f1f;
    --panel-bg:        rgba(8, 14, 28, 0.78);
    --panel-bg-light:  rgba(12, 22, 42, 0.85);
    --panel-border:    rgba(0, 240, 255, 0.35);
    --panel-border-2:  rgba(168, 85, 247, 0.28);

    /* ---- 文字 ---- */
    --ink:             #d8f4ff;
    --ink-soft:        #88a8c5;
    --ink-dim:         #5d7993;

    /* ---- 多层发光阴影 ---- */
    --glow-cyan:       0 0 12px rgba(0, 240, 255, 0.55), 0 0 28px rgba(0, 240, 255, 0.25), 0 8px 32px rgba(0, 0, 0, 0.6);
    --glow-purple:     0 0 12px rgba(168, 85, 247, 0.55), 0 0 28px rgba(168, 85, 247, 0.25), 0 8px 32px rgba(0, 0, 0, 0.6);
    --glow-card:       0 0 0 1px rgba(0,240,255,0.18), 0 0 30px rgba(0, 240, 255, 0.18), 0 0 60px rgba(168, 85, 247, 0.12), 0 20px 60px rgba(0, 0, 0, 0.7);
    --glow-soft:       0 0 18px rgba(0, 240, 255, 0.18), 0 8px 32px rgba(0, 0, 0, 0.6);

    --nav-h:           76px;
    --font-mono:       "JetBrains Mono", "SF Mono", "Consolas", "Monaco", monospace;
    --font-display:    "Orbitron", "Josefin Sans", "Rajdhani", sans-serif;
}

/* ---- 字体加载（Google Fonts 在 head 里加） ---- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@500;700&family=JetBrains+Mono:wght@400;700&display=swap');

/* ---- 重置：让 body 背景与 canvas 天空同色，避免任何未渲染区域露出深色 ---- */
html, body {
    margin: 0;
    padding: 0;
    background: #bfe6ff !important;  /* 与 canvas clearColor / sky 顶部同色 */
    color: var(--ink);
    overflow-x: hidden;
    min-height: 100vh;
    font-family: var(--font-display);
}

/* 全局深色叠层已删除（之前在 canvas 上叠加灰蓝色边缘渐变，被误认为 3D 物体挡住摄像机） */

/* 全局扫描线纹理已禁用（mix-blend-mode: screen 在 canvas 之上会变成深色阴影，挡住视野） */

/* ---- Three.js 背景画布 ---- */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 0;
    pointer-events: auto;
    filter: saturate(1.15) contrast(1.05);
}

/* ---- 隐藏原 bootstrap 容器中的内容 ---- */
#index,
#about_scroll,
#work_scroll,
#contact_scroll {
    display: none !important;
}

/* ============================================================
 * HUD 装饰：四角的科技角线
 * ============================================================ */
.hud-corner {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 60;
    opacity: 0.7;
}
.hud-corner::before,
.hud-corner::after {
    content: "";
    position: absolute;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan-soft);
}
.hud-corner.tl { top: 14px; left: 14px; }
.hud-corner.tl::before { top: 0; left: 0; width: 22px; height: 2px; }
.hud-corner.tl::after  { top: 0; left: 0; width: 2px; height: 22px; }

.hud-corner.tr { top: 14px; right: 14px; }
.hud-corner.tr::before { top: 0; right: 0; width: 22px; height: 2px; }
.hud-corner.tr::after  { top: 0; right: 0; width: 2px; height: 22px; }

.hud-corner.bl { bottom: 14px; left: 14px; }
.hud-corner.bl::before { bottom: 0; left: 0; width: 22px; height: 2px; }
.hud-corner.bl::after  { bottom: 0; left: 0; width: 2px; height: 22px; }

.hud-corner.br { bottom: 14px; right: 14px; }
.hud-corner.br::before { bottom: 0; right: 0; width: 22px; height: 2px; }
.hud-corner.br::after  { bottom: 0; right: 0; width: 2px; height: 22px; }

/* ---- 顶部导航栏（左：品牌 / 右：导航按钮） ---- */
.topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 14px clamp(16px, 4vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 50;
    pointer-events: none;
}
.topnav > * { pointer-events: auto; }

/* 品牌：六边形风格徽章 */
.brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px 10px 10px;
    background: var(--panel-bg);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    box-shadow: var(--glow-soft);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.brand::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.8;
}
.brand:hover {
    transform: translateY(-2px);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.brand-logo {
    width: 34px; height: 34px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan-soft), inset 0 0 8px rgba(0,240,255,0.2);
    filter: saturate(1.2) contrast(1.1);
}
.brand-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: 0 0 10px var(--neon-cyan-soft);
}

/* ---- 导航按钮组 ---- */
.topnav-btns {
    position: relative;
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--panel-bg);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    box-shadow: var(--glow-soft);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.topnav-btns::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.8;
}

.navbtn {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
/* 按钮底部装饰线 */
.navbtn::after {
    content: "";
    position: absolute;
    left: 50%; bottom: 4px;
    width: 0; height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
    transform: translateX(-50%);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
/* 悬停光波扫过 */
.navbtn::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.18), transparent);
    transition: left 0.6s ease;
}
.navbtn:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan-soft);
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}
.navbtn:hover::before { left: 100%; }
.navbtn:hover::after { width: 70%; }
.navbtn.is-active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    box-shadow: inset 0 0 16px rgba(0, 240, 255, 0.18), 0 0 14px rgba(0, 240, 255, 0.35);
}
.navbtn.is-active::after { width: 70%; background: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); }

/* ============================================================
 * 中央舞台提示
 * ============================================================ */
.stage {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 60px;
}

.hint {
    position: relative;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--panel-bg);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 2px;
    box-shadow: var(--glow-soft);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    animation: hintFloat 3.2s ease-in-out infinite;
}
.hint::before {
    content: ">";
    color: var(--neon-cyan);
    font-weight: 700;
    text-shadow: 0 0 8px var(--neon-cyan);
    animation: blink 1.2s steps(2) infinite;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0.3; }
}
.hint .dot {
    width: 8px; height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-cyan), 0 0 0 4px rgba(0,240,255,0.18);
    animation: dotPulse 1.4s ease-in-out infinite;
}
@keyframes hintFloat {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-4px); }
}
@keyframes dotPulse {
    0%,100% { transform: scale(1);   opacity: 1;   }
    50%     { transform: scale(1.4); opacity: 0.6; }
}

/* ============================================================
 * 内容卡片：科幻弹窗
 * ============================================================ */
.card-panel {
    position: fixed;
    top: 90px;
    right: clamp(16px, 3vw, 40px);
    transform: translateX(120%);
    width: min(420px, 34vw);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    z-index: 40;
    padding: 32px 30px 26px;
    background: var(--panel-bg-light);
    backdrop-filter: blur(22px) saturate(200%);
    -webkit-backdrop-filter: blur(22px) saturate(200%);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    box-shadow: var(--glow-card);
    opacity: 0;
    visibility: hidden;
    /* 切角设计 */
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity   0.4s ease,
        visibility 0s linear 0.55s;
}

/* 卡片内部边框光晕（叠加在 clip-path 之上） */
.card-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(168, 85, 247, 0.35);
    pointer-events: none;
    box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.08);
}

/* 卡片顶部装饰条 */
.card-panel::after {
    content: "";
    position: absolute;
    top: 0; left: 16px; right: 16px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan) 30%, var(--neon-purple) 70%, transparent);
    box-shadow: 0 0 12px var(--neon-cyan);
    pointer-events: none;
}

.card-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity   0.4s ease,
        visibility 0s linear 0s;
}

/* 卡片内的小关闭按钮 */
.card-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 2px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 240, 255, 0.05);
    color: var(--neon-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: var(--font-mono);
    transition: all 0.25s ease;
    z-index: 2;
}
.card-close:hover {
    background: var(--neon-cyan);
    color: var(--space-bg);
    transform: rotate(90deg);
    box-shadow: 0 0 14px var(--neon-cyan);
}

/* 卡片标题（霓虹水印风格） */
.card-watermark {
    position: relative;
    display: inline-block;
    margin-bottom: 18px;
    padding-bottom: 6px;
}
.card-title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: var(--neon-cyan);
    text-shadow:
        0 0 8px var(--neon-cyan-soft),
        0 0 18px rgba(0, 240, 255, 0.35);
    position: relative;
    display: inline-block;
}
/* 标题下方装饰双线 */
.card-title::after,
.card-title::before {
    content: "";
    position: absolute;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--neon-cyan), transparent);
    box-shadow: 0 0 6px var(--neon-cyan-soft);
}
.card-title::after  { width: 90%; bottom: -8px; opacity: 0.7; }
.card-title::before { width: 50%; bottom: -12px; opacity: 0.4; }

.card-marker {
    position: absolute;
    font-size: 80px;
    opacity: 0.08;
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    left: 0; top: -16px;
    color: var(--neon-purple);
    pointer-events: none;
    text-shadow: 0 0 30px var(--neon-purple-soft);
}

.card-subtitle {
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
    line-height: 24px;
    letter-spacing: 0.5px;
    margin: 12px 0 18px;
    padding-left: 12px;
    border-left: 2px solid var(--neon-purple);
    box-shadow: -2px 0 8px -2px var(--neon-purple-soft);
}
.card-info {
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 22px;
    margin: 6px 0;
    letter-spacing: 0.3px;
}
.card-info a.info-link {
    color: var(--neon-cyan);
    text-decoration: none;
    border-bottom: 1px dashed var(--neon-cyan-soft);
    padding-bottom: 1px;
    text-shadow: 0 0 6px var(--neon-cyan-soft);
    transition: all 0.2s ease;
}
.card-info a.info-link:hover {
    color: #fff;
    border-bottom-style: solid;
    border-bottom-color: var(--neon-cyan);
    text-shadow: 0 0 12px var(--neon-cyan);
    box-shadow: 0 4px 12px -2px var(--neon-cyan-soft);
}

/* 卡片滚动条美化 */
.card-panel::-webkit-scrollbar { width: 6px; }
.card-panel::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 0;
    box-shadow: 0 0 6px var(--neon-cyan-soft);
}
.card-panel::-webkit-scrollbar-track {
    background: rgba(0, 240, 255, 0.05);
}

/* 卡片分隔小标题（Work 区的 Game 段） */
.card-mini-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--neon-purple);
    text-shadow: 0 0 8px var(--neon-purple-soft);
    margin: 20px 0 8px;
    padding-left: 12px;
    display: inline-block;
    position: relative;
    border-left: 2px solid var(--neon-purple);
}
.card-mini-title::after {
    content: "";
    position: absolute;
    left: -2px; bottom: -4px;
    width: 60%; height: 1px;
    background: linear-gradient(90deg, var(--neon-purple), transparent);
    box-shadow: 0 0 4px var(--neon-purple-soft);
}

/* ---- 底部备案链接 ---- */
.footer {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    padding: 10px 16px;
    text-align: center;
    pointer-events: none;
}
.footer .beian-link {
    position: relative;
    pointer-events: auto;
    display: inline-block;
    padding: 6px 18px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 2px;
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: var(--glow-soft);
    transition: all 0.3s ease;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    white-space: nowrap;
}
.footer .beian-link:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
    transform: translateY(-1px);
    box-shadow: var(--glow-cyan);
}

/* ---- 进入动画 ---- */
.card-panel.is-open .card-watermark,
.card-panel.is-open .card-subtitle,
.card-panel.is-open .card-info,
.card-panel.is-open .card-mini-title {
    animation: cardItemIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card-panel.is-open .card-subtitle   { animation-delay: 0.05s; }
.card-panel.is-open .card-info       { animation-delay: 0.10s; }
.card-panel.is-open .card-mini-title  { animation-delay: 0.15s; }
@keyframes cardItemIn {
    from { opacity: 0; transform: translateX(20px); filter: blur(4px); }
    to   { opacity: 1; transform: translateX(0); filter: blur(0); }
}

/* 卡片打开时整体扫描线动画 */
.card-panel.is-open::before {
    animation: scanline 1.5s ease-out;
}
@keyframes scanline {
    0%   { background: linear-gradient(180deg, transparent 0%, transparent 0%); }
    100% { background: linear-gradient(180deg, transparent 100%, transparent 100%); }
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    :root { --nav-h: 64px; }
    .topnav {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
    .brand { padding: 6px 14px 6px 6px; }
    .brand-name { font-size: 13px; letter-spacing: 2px; }
    .navbtn { padding: 7px 14px; font-size: 11px; letter-spacing: 2px; }

    .card-panel {
        right: 50%;
        transform: translateX(50%);
        width: calc(100vw - 24px);
        max-width: 460px;
        max-height: 45vh;
        top: 140px;
    }
    .card-panel.is-open {
        transform: translateX(50%);
    }

    .stage { padding-bottom: 80px; }
    .hint { font-size: 11px; padding: 8px 16px; }

    .hud-corner { width: 40px; height: 40px; }
    .hud-corner.tl, .hud-corner.tr { top: 8px; }
    .hud-corner.bl, .hud-corner.br { bottom: 8px; }
    .hud-corner.tl, .hud-corner.bl { left: 8px; }
    .hud-corner.tr, .hud-corner.br { right: 8px; }
}

/* ---- 减少动画偏好 ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}

/* ---- 选中文本颜色 ---- */
::selection {
    background: var(--neon-cyan);
    color: var(--space-bg);
    text-shadow: none;
}
