/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00f3ff;
    --secondary-color: #7b2cbf;
    --accent-color: #ff006e;
    --text-light: #ffffff;
    --text-gray: #a0a0a0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-fast: all 0.2s ease;
    --shadow-glow: 0 0 20px rgba(0, 243, 255, 0.3);
    --shadow-glow-strong: 0 0 30px rgba(0, 243, 255, 0.5);
}

html {
    scroll-behavior: smooth;
    /* 优化滚动性能 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #000000;
    color: var(--text-light);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    /* 性能优化 */
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    /* 中文排版优化 */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 背景容器 ========== */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#fluidCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 2px;
    position: relative;
    transition: var(--transition-smooth);
}

.logo:hover {
    filter: drop-shadow(0 0 10px var(--primary-color));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: var(--transition-smooth);
    /* 改进可访问性 */
    outline-offset: 4px;
}

.nav-link:focus {
    outline: 2px solid var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.4rem;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 3px;
    transition: var(--transition-smooth);
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* ========== 主内容区 ========== */
.main-content {
    position: relative;
    z-index: 10;
    padding-top: 80px;
}

/* ========== Hero 区域 ========== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem;
}

.hero-content {
    max-width: 900px;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-gray);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    animation: fadeInUp 1s ease-out 0.4s backwards;
    position: relative;
    overflow: hidden;
    /* 性能优化 */
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.cta-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.3), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4),
                0 10px 30px rgba(0, 243, 255, 0.2);
    transform: translateY(-2px) scale(1.05);
}

.cta-button:active {
    transform: translateY(0) scale(0.98);
    transition: var(--transition-fast);
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.cta-button:hover .arrow-icon {
    transform: translateX(5px);
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-gray);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

/* ========== 内容区域 ========== */
.content-section {
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-container {
    max-width: 1200px;
    width: 100%;
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-light), var(--text-gray));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.2rem;
    margin-bottom: 4rem;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    /* 兼容性前缀与回退 */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    /* 无支持时的回退背景不透明度稍增 */
    background-color: rgba(255, 255, 255, 0.06);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    /* 确保卡片立即可见 */
    opacity: 1;
    /* 性能优化 */
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.glass-card:hover::before {
    transform: scaleX(1);
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 10px 40px rgba(0, 243, 255, 0.2),
                0 0 0 1px rgba(0, 243, 255, 0.1);
}

/* 添加焦点样式以改进可访问性 */
.glass-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.glass-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Blog 卡片 */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-card {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.blog-date {
    color: var(--text-gray);
}

.blog-category {
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 20px;
}

.blog-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.read-more:hover {
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* About 内容 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* 社交链接 */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    transition: var(--transition-smooth);
}

/* 涟漪效果容器与动画 */
.social-link { position: relative; overflow: hidden; }
.social-link .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.35);
    animation: rippleAnim 0.6s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    transform: translateY(-3px);
}

/* ========== 页脚 ========== */
.footer {
    position: relative;
    z-index: 10;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.footer-content p {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 页脚统计信息样式 */
.footer-stats {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stats-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    font-size: 0.9rem;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.stats-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.stats-item:hover::before {
    left: 100%;
}

.stats-item:hover {
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    transform: translateY(-2px);
}

.stats-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
    transition: var(--transition-smooth);
}

.stats-item:hover .stats-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.stats-text {
    color: var(--text-gray);
    font-weight: 500;
}

.stats-number {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.stats-unit {
    color: var(--text-gray);
    font-size: 0.8rem;
}

.footer-links {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links span {
    margin: 0 0.5rem;
    color: var(--text-gray);
    opacity: 0.5;
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.8));
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes scroll {
    0% {
        opacity: 0;
        top: 8px;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        top: 20px;
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.95);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        padding: 2rem 0;
        border-top: 1px solid var(--glass-border);
        backdrop-filter: blur(20px);
        /* 防止滚动穿透 */
        overscroll-behavior: contain;
    }

    .nav-menu.active {
        left: 0;
    }

    /* 菜单打开时禁止背景滚动 */
    body.menu-open {
        overflow: hidden;
    }

    .nav-item {
        margin: 1rem 0;
    }

    .hamburger {
        display: flex;
        /* 增大点击区域 */
        padding: 0.5rem;
        margin: -0.5rem;
    }

    .hero {
        padding: 4rem 1rem;
        min-height: 100vh;
        /* 移动端视口修正 */
        min-height: 100dvh;
    }

    .content-section {
        padding: 4rem 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-content {
        padding: 2rem;
    }

    .social-links {
        justify-content: center;
    }

    /* 移动端页脚统计优化 */
    .footer-stats {
        margin: 1rem 0;
    }

    .stats-item {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    .stats-icon {
        width: 14px;
        height: 14px;
    }

    .stats-number {
        font-size: 0.9rem;
    }

    /* 移动端触摸优化 */
    .glass-card {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* 改进移动端按钮尺寸 */
    .cta-button {
        padding: 1.2rem 2.5rem;
        font-size: 1rem;
    }

    /* 移动端字体优化 */
    body {
        font-size: 16px;
        /* 防止iOS自动缩放 */
        -webkit-text-size-adjust: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    /* 小屏幕进一步优化 */
    .hero-subtitle {
        font-size: 0.9rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* 减小间距以适应小屏幕 */
    .content-section {
        padding: 3rem 1rem;
    }

    .card-grid {
        gap: 1rem;
    }
}

/* 平板横屏优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        min-height: 80vh;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1920px) {
    .nav-container,
    .section-container {
        max-width: 1600px;
    }

    .hero-title {
        font-size: 7rem;
    }

    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 2rem 1rem;
    }

    .scroll-indicator {
        display: none;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-color), var(--primary-color));
}

/* ========== 骨架屏加载效果 ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.15) 40px,
        rgba(255, 255, 255, 0.05) 80px
    );
    background-size: 1000px 100%;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
    border-radius: 8px;
}

.skeleton-card {
    height: 200px;
    border-radius: 20px;
}

/* ========== 页面加载动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* 淡入上移动画 */
@keyframes fadeInUpAnim {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUpAnim 0.6s ease-out forwards;
}

/* ========== 平滑滚动增强 ========== */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
    
    .smooth-scroll-item {
        scroll-margin-top: 100px;
    }
}

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

/* ========== 加载指示器 ========== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== 改进的hover效果 ========== */
.interactive-element {
    transition: var(--transition-smooth);
    cursor: pointer;
}

.interactive-element:hover {
    transform: translateY(-2px);
}

.interactive-element:active {
    transform: translateY(0);
    transition: var(--transition-fast);
}

/* ========== 图片加载优化 ========== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ========== 性能优化类 ========== */
.gpu-accelerated {
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ========== 焦点可见性改进 ========== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

/* ========== 文本选择样式 ========== */
::selection {
    background: rgba(0, 243, 255, 0.3);
    color: var(--text-light);
}

::-moz-selection {
    background: rgba(0, 243, 255, 0.3);
    color: var(--text-light);
}
