/* ==========================================
   完美像素官网 - 自定义样式（明亮版）
   Perfect Pixel Website - Custom Styles (Bright Version)
   ========================================== */

/* ==================== 全局样式 ==================== */

/* 设置平滑滚动 */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    /* 优化字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 动画效果 ==================== */

/* 渐变色背景动画 */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 悬浮动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 慢速脉冲动画 */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* ==================== 导航栏样式 ==================== */

/* 导航链接悬停效果 */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

/* 导航链接激活状态 */
.nav-link.active {
    color: #6366F1;
    font-weight: 600;
}

/* ==================== 返回顶部按钮 ==================== */

/* 按钮显示状态 */
#back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== 响应式设计 ==================== */

/* 平板设备（768px以下） */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* 手机设备（480px以下） */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

/* ==================== 文本选择样式 ==================== */

/* 自定义文本选择颜色 */
::selection {
    background-color: rgba(99, 102, 241, 0.2);
    color: #1a1a1a;
}

::-moz-selection {
    background-color: rgba(99, 102, 241, 0.2);
    color: #1a1a1a;
}

/* ==================== 滚动条样式 ==================== */

/* 滚动条整体 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 5px;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366F1, #8B5CF6, #A855F7);
    border-radius: 5px;
    border: 2px solid #f5f5f5;
    transition: background 0.3s ease;
}

/* 滚动条滑块悬停 */
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8B5CF6, #A855F7, #0066FF);
}

/* ==================== 加载动画 ==================== */

/* 页面加载时的淡入效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 应用淡入动画 */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* ==================== 光标效果 ==================== */

/* 链接和按钮的光标 */
a, button {
    cursor: pointer;
}

/* ==================== 打印样式 ==================== */

/* 打印时的样式优化 */
@media print {
    header,
    #back-to-top {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* ==================== 可访问性增强 ==================== */

/* 焦点可见性 - 键盘导航 */
a:focus,
button:focus {
    outline: 2px solid #6366F1;
    outline-offset: 4px;
}

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

/* ==================== 性能优化 ==================== */

/* GPU加速 - 提升动画性能 */
#back-to-top {
    will-change: transform, opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ==================== 装饰性元素 ==================== */

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #6366F1, #8B5CF6, #0066FF);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradient 3s ease infinite;
}

/* ==================== 辅助类 ==================== */

/* 禁止选择文本 */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* 隐藏元素但保留空间 */
.invisible {
    visibility: hidden;
}

/* 完全隐藏元素 */
.hidden {
    display: none;
}

/* ==================== 结束 ==================== */
