/* ============================================================
   基础特效
   ============================================================ */
.hw-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: var(--hw-overlay-color, rgba(20,0,30,0.15));
    z-index: 99990;
}

.hw-float-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 99991;
}

.hw-float-item {
    position: absolute;
    top: -60px;
    font-size: 32px;
    opacity: 0.7;
    animation: hwFall linear infinite;
    user-select: none;
}

@keyframes hwFall {
    0%   { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

.hw-neon .site-title,
.hw-neon .entry-title,
.hw-neon .post-title {
    animation: hwNeonPulse 2.5s ease-in-out infinite;
    text-shadow: 0 0 8px var(--hw-neon-color, #ff6b00),
                 0 0 20px var(--hw-neon-color, #ff6b00);
}

@keyframes hwNeonPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.75; }
}

/* ============================================================
   糖果爆炸
   ============================================================ */
.hw-candy {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    z-index: 999999;
    will-change: transform, opacity;
    animation: hwCandyPop 0.9s ease-out forwards;
}

@keyframes hwCandyPop {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0.3); opacity: 0; }
}

/* ============================================================
   蜘蛛网
   ============================================================ */
.hw-web-corner {
    position: fixed;
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 99989;
    opacity: 0.5;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0 0 L100 0 M0 0 L70 70 M0 0 L0 100 M0 0 L30 80 M20 0 L0 20 M40 0 L0 40 M60 0 L0 60 M80 0 L0 80" stroke="%23cccccc" stroke-width="1.5" fill="none"/></svg>') no-repeat center/contain;
}
.hw-web-tl { top: 0; left: 0; }
.hw-web-tr { top: 0; right: 0; transform: scaleX(-1); }
.hw-web-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.hw-web-br { bottom: 0; right: 0; transform: scale(-1, -1); }

/* ============================================================
   幽灵跟随光标
   ============================================================ */
#hw-ghost {
    position: fixed;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    font-size: 32px;
    line-height: 1;
    pointer-events: none;
    z-index: 999998;
    opacity: 0.85;
    will-change: transform;
    filter: drop-shadow(0 0 8px rgba(180, 120, 255, 0.6));
    transition: opacity 0.4s;
}
#hw-ghost.hw-ghost-hide { opacity: 0; }

/* ============================================================
   四角南瓜灯
   ============================================================ */
.hw-jack {
    position: fixed;
    width: 46px;
    height: 46px;
    font-size: 38px;
    line-height: 46px;
    text-align: center;
    pointer-events: none;
    z-index: 99992;
    opacity: 0.75;
    user-select: none;
    filter: drop-shadow(0 0 6px rgba(255, 140, 0, 0.4));
    transition: filter 0.2s, transform 0.2s;
}
.hw-jack-tl { top: 8px; left: 10px; }
.hw-jack-tr { top: 8px; right: 10px; }
.hw-jack-bl { bottom: 8px; left: 10px; }
.hw-jack-br { bottom: 8px; right: 10px; }

.hw-jack.hw-jack-blink {
    filter: drop-shadow(0 0 18px rgba(255, 80, 0, 1)) brightness(1.6);
    transform: scale(1.12);
}

/* ============================================================
   页面抖动
   ============================================================ */
@keyframes hwShake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    15% { transform: translate(-2px, 1px) rotate(-0.2deg); }
    30% { transform: translate(2px, -1px) rotate(0.2deg); }
    45% { transform: translate(-1px, 2px) rotate(-0.15deg); }
    60% { transform: translate(1px, -2px) rotate(0.15deg); }
    75% { transform: translate(-2px, -1px) rotate(-0.1deg); }
}
body.hw-shake {
    animation: hwShake 0.6s ease-in-out;
}

/* ============================================================
   恐怖低语气泡
   ============================================================ */
.hw-whisper {
    position: fixed;
    padding: 8px 14px;
    background: rgba(30, 10, 40, 0.85);
    color: #d9b8ff;
    font-size: 14px;
    border-radius: 18px;
    border: 1px solid rgba(180, 120, 255, 0.4);
    pointer-events: none;
    z-index: 999997;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: hwWhisperIn 0.5s ease-out forwards, hwWhisperOut 0.6s ease-in 3.4s forwards;
}
@keyframes hwWhisperIn {
    from { opacity: 0; transform: translateY(12px) scale(0.85); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hwWhisperOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-16px) scale(0.9); }
}

/* ============================================================
   墓碑弹窗彩蛋
   ============================================================ */
#hw-tomb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 12, 0.88);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: hwFadeIn 0.35s ease-out;
}
@keyframes hwFadeIn { from { opacity: 0; } to { opacity: 1; } }

.hw-tomb {
    width: 260px;
    height: 340px;
    background: linear-gradient(180deg, #6b6b6b 0%, #4a4a4a 60%, #383838 100%);
    border-radius: 130px 130px 12px 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(180, 120, 255, 0.5), inset 0 0 40px rgba(0, 0, 0, 0.5);
    animation: hwTombRise 0.7s cubic-bezier(0.22, 1.2, 0.36, 1);
}
@keyframes hwTombRise {
    from { transform: translateY(80px) scale(0.85); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.hw-tomb::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.18);
    border-radius: 118px 118px 8px 8px;
    pointer-events: none;
}
.hw-tomb .hw-tomb-rip {
    color: #e0e0e0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 4px;
    font-family: Georgia, serif;
}
.hw-tomb .hw-tomb-sub {
    color: #b9b9b9;
    font-size: 13px;
    margin-top: 10px;
    letter-spacing: 2px;
}
.hw-tomb .hw-tomb-emoji {
    font-size: 48px;
    margin-top: 18px;
    animation: hwTombEmoji 1.6s ease-in-out infinite;
}
@keyframes hwTombEmoji {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-8px) rotate(4deg); }
}
.hw-tomb-close {
    margin-top: 26px;
    padding: 10px 26px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.25s;
}
.hw-tomb-close:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 18px rgba(180, 120, 255, 0.5);
}

/* ============================================================
   鼠标拖尾烟雾
   ============================================================ */
.hw-smoke {
    position: fixed;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180,120,255,0.55) 0%, rgba(120,60,180,0) 70%);
    pointer-events: none;
    z-index: 999995;
    will-change: transform, opacity;
    animation: hwSmokeFade 0.9s ease-out forwards;
}
@keyframes hwSmokeFade {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.8) translateY(-10px); opacity: 0; }
}

/* ============================================================
   一键关闭 / 恢复悬浮按钮 + 二级菜单
   ============================================================ */
#hw-switch-wrap {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#hw-switch-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff7a1a, #d93600);
    color: #fff;
    font-size: 22px;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(217, 54, 0, 0.45);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#hw-switch-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(217, 54, 0, 0.65);
}
#hw-switch-btn.hw-switch-off {
    background: linear-gradient(135deg, #6b6b6b, #3a3a3a);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

#hw-switch-menu {
    position: absolute;
    top: 54px;
    right: 0;
    min-width: 160px;
    background: #1e1028;
    border: 1px solid rgba(180, 120, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
#hw-switch-menu.hw-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
#hw-switch-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: #1e1028;
    border-left: 1px solid rgba(180, 120, 255, 0.35);
    border-top: 1px solid rgba(180, 120, 255, 0.35);
    transform: rotate(45deg);
}
.hw-switch-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #e4d4ff;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}
.hw-switch-item:hover {
    background: rgba(180, 120, 255, 0.18);
    color: #fff;
}
.hw-switch-item + .hw-switch-item {
    border-top: 1px solid rgba(180, 120, 255, 0.15);
}
.hw-switch-item .hw-switch-icon {
    margin-right: 8px;
    font-size: 14px;
}

/* 关闭态：隐藏所有特效元素（保留按钮本身） */
body.hw-disabled .hw-overlay,
body.hw-disabled .hw-float-container,
body.hw-disabled .hw-web-corner,
body.hw-disabled #hw-ghost,
body.hw-disabled .hw-jack,
body.hw-disabled .hw-whisper,
body.hw-disabled .hw-smoke,
body.hw-disabled .hw-candy {
    display: none !important;
}