/* ==============================================
   NaNa 个人网站 - 主样式文件
   科技未来感设计 - Main CSS
   ============================================== */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

html {
    scroll-behavior: auto;
}

/* 选择文本颜色 */
::selection {
    background: rgba(74, 222, 128, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(74, 222, 128, 0.3);
    color: #fff;
}

/* ==============================================
   导航栏样式 - 增强可见性版本
   ============================================== */
#navbar {
    background: rgba(15, 17, 24, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(74, 222, 128, 0.3);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled {
    background: rgba(15, 17, 24, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.2);
    border-bottom: 2px solid rgba(74, 222, 128, 0.4);
}

/* 导航链接增强可读性 - 超强对比版 */
#navbar a {
    color: #e5e7eb !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8),
                 0 0 20px rgba(74, 222, 128, 0.3);
    font-weight: 600 !important;
}

#navbar a:hover {
    color: #4ade80 !important;
}

/* 移动端菜单 */
#mobile-menu {
    transition: all 0.3s ease;
}

/* ==============================================
   滚动条样式
   ============================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #151821;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4ade80, #22c55e);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #4ade80 #151821;
}

/* ==============================================
   过滤按钮样式
   ============================================== */
.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    background: transparent;
    border: 2px solid rgba(74, 222, 128, 0.3);
    color: #9ca3af;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 0.875rem;
}

.filter-btn:hover {
    border-color: #4ade80;
    color: #4ade80;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #4ade80;
    color: #0f1118;
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

@media (max-width: 640px) {
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* ==============================================
   卡片样式
   ============================================== */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card-3d:hover::before {
    opacity: 1;
}

/* ==============================================
   表单样式
   ============================================== */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==============================================
   容器响应式
   ============================================== */
.container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1536px) {
    .container {
        max-width: 1280px;
    }
}

@media (max-width: 1280px) {
    .container {
        max-width: 1024px;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 768px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 640px;
    }
}

/* ==============================================
   工具类
   ============================================== */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* GPU 加速 */
.gpu-accelerated {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ==============================================
   粒子背景容器
   ============================================== */
#particles-bg {
    width: 100%;
    height: 100%;
}

/* ==============================================
   统计卡片悬停效果
   ============================================== */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* ==============================================
   作品集网格
   ============================================== */
.portfolio-item {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.portfolio-item.hidden {
    opacity: 0;
    transform: scale(0.8);
}

/* ==============================================
   YouTube 懒加载容器
   ============================================== */
.youtube-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

.youtube-wrapper:hover {
    transform: scale(1.02);
}

.youtube-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==============================================
   进度条
   ============================================== */
#progress-bar {
    transition: width 0.1s linear;
}

/* ==============================================
   移动端优化
   ============================================== */
@media (max-width: 768px) {
    /* 减小标题尺寸 */
    .section-title {
        font-size: 2rem !important;
    }

    /* 减小Hero标题 */
    h1 {
        font-size: 2.5rem !important;
    }

    /* 统计卡片单列 */
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ==============================================
   打印样式
   ============================================== */
@media print {
    #navbar,
    #particles-bg,
    .animate-bounce {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ==============================================
   高对比度模式
   ============================================== */
@media (prefers-contrast: high) {
    .border-neon-400\/20 {
        border-color: #4ade80 !important;
    }
}

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

    .animate-bounce,
    .animate-pulse {
        animation: none !important;
    }
}

/* ==============================================
   Focus 可见性(键盘导航)
   ============================================== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

/* ==============================================
   通知消息样式
   ============================================== */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background: #4ade80;
    color: #0f1118;
}

.notification.error {
    background: #ef4444;
    color: white;
}

/* ==============================================
   加载指示器
   ============================================== */
.spinner {
    border: 3px solid rgba(74, 222, 128, 0.3);
    border-top-color: #4ade80;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* ==============================================
   暗黑模式切换(预留)
   ============================================== */
.dark-mode-toggle {
    width: 50px;
    height: 26px;
    background: #1a1f2e;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.dark-mode-toggle.active {
    background: #4ade80;
}

.dark-mode-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.dark-mode-toggle.active::after {
    transform: translateX(24px);
}

/* ==============================================
   Tab 切换样式
   ============================================== */
.works-tab-btn {
    background: rgba(26, 31, 46, 0.5);
    border: 2px solid rgba(74, 222, 128, 0.2);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s ease;
}

.works-tab-btn:hover {
    border-color: rgba(74, 222, 128, 0.5);
    color: #4ade80;
    transform: translateY(-2px);
}

.works-tab-btn.active {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border-color: #4ade80;
    color: #0f1118;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.works-tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.works-tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease-out;
}

/* ==============================================
   导航链接高亮
   ============================================== */
.nav-link {
    position: relative;
}

.nav-link.active {
    color: #4ade80 !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 2px;
}

/* ==============================================
   活动页面Tab切换样式
   ============================================== */
.event-tab-btn {
    background: rgba(26, 31, 46, 0.5);
    border: 2px solid rgba(168, 85, 247, 0.2);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-tab-btn:hover {
    border-color: rgba(168, 85, 247, 0.5);
    color: #c084fc;
    transform: translateY(-2px);
}

.event-tab-btn.active {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    border-color: #c084fc;
    color: #0f1118;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.event-content {
    display: none;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.event-content.active {
    display: block;
    opacity: 1;
}

/* ==============================================
   页面视图容器
   ============================================== */
#main-page {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#main-page.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#events-page {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#events-page.active {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0);
}

#youtube-page {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#youtube-page.active {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0);
}
