/* ============================================
   六楼小站 - 自定义样式
   ============================================ */

/* ---- 基础设置 ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- 选中文本样式 ---- */
::selection {
    background-color: rgba(20, 184, 166, 0.25);
    color: inherit;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3f3f4f;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #4f4f5f;
}

/* ---- 图片占位符背景 ---- */
img {
    max-width: 100%;
    height: auto;
}

/* ---- 导航栏激活状态 ---- */
.nav-link.active {
    color: #1a1a2e;
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .nav-link.active {
    color: #e8e8ef;
    background-color: rgba(255, 255, 255, 0.05);
}

/* ---- 移动端菜单动画 ---- */
#mobile-menu {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.open {
    max-height: 300px;
    opacity: 1;
}

/* ---- 滚动显示动画 ---- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- 项目卡片图片区域 ---- */
.project-card .h-40 svg {
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.project-card:hover .h-40 svg {
    transform: scale(1.08);
}

/* ---- 技术标签悬停效果 ---- */
.tech-tag {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
}

.dark .tech-tag:hover {
    box-shadow: 0 4px 12px rgba(94, 234, 212, 0.12);
}

/* ---- 博客卡片悬浮放大 ---- */
.blog-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.blog-item:hover {
    transform: translateY(-4px) scale(1.02);
}

/* ---- 博客列表截断 ---- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 响应式字体 ---- */
@media (max-width: 640px) {
    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* ---- 减少动画偏好 ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---- 打字机光标 ---- */
.typewriter-cursor {
    display: inline-block;
    color: #0d9488;
    font-weight: 300;
    animation: blink 0.8s step-end infinite;
    margin-left: 2px;
}

.dark .typewriter-cursor {
    color: #5eead4;
}

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

/* ---- 霓虹发光边框 ---- */
.neon-glow {
    position: relative;
    transition: all 0.3s ease;
}

.neon-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(45deg, #14b8a6, #0d9488, #2dd4bf, #14b8a6);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: neonShift 3s ease infinite;
    pointer-events: none;
    z-index: -1;
}

.neon-glow:hover::before {
    opacity: 1;
}

.dark .neon-glow::before {
    background: linear-gradient(45deg, #5eead4, #2dd4bf, #99f6e4, #5eead4);
    background-size: 300% 300%;
}

@keyframes neonShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- 波浪分隔线 ---- */
.wave-divider {
    color: #f0f0f5;
    overflow: hidden;
    line-height: 0;
}

.dark .wave-divider {
    color: #0f0f15;
}

.wave-divider svg {
    display: block;
    width: 100%;
}

/* ---- 数字滚动动画 ---- */
.odometer {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ---- 项目卡片悬浮 ---- */
.project-card,
.tool-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover,
.tool-card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* ---- 光线扫过效果 ---- */
.card-shine {
    position: relative;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
    transform: skewX(-25deg);
    pointer-events: none;
    opacity: 0;
}

.card-shine:hover::after {
    animation: shineSweep 0.75s ease-in-out;
    opacity: 1;
}

.dark .card-shine::after {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06),
        transparent
    );
}

@keyframes shineSweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ---- 浮动气泡背景 ---- */
.bubble-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -160px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(20, 184, 166, 0.1),
        rgba(20, 184, 166, 0.03) 60%,
        transparent 80%
    );
    filter: blur(2px);
    animation: floatBubble linear infinite;
}

.dark .bubble {
    background: radial-gradient(
        circle at 30% 30%,
        rgba(94, 234, 212, 0.07),
        rgba(94, 234, 212, 0.02) 60%,
        transparent 80%
    );
}

@keyframes floatBubble {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    95% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-130vh) translateX(60px) scale(0.5);
        opacity: 0;
    }
}

/* ---- 打印样式 ---- */
@media print {
    nav,
    .animate-float,
    #theme-toggle,
    #mobile-menu-btn,
    #scroll-spy,
    .wave-divider,
    #particle-canvas,
    #mouse-trail {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }
}
