:root {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-middle: #16213e;
    --bg-gradient-end: #0f3460;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --hover-card-bg: rgba(255, 255, 255, 0.1);
    --footer-opacity: 0.8;
    --transition-timing: 0.5s ease;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

[data-theme="light"] {
    --bg-gradient-start: #e0eafc;
    --bg-gradient-middle: #cfdef3;
    --bg-gradient-end: #e0eafc;
    --text-color: #333333;
    --card-bg: rgba(255, 255, 255, 0.35);
    --card-border: rgba(255, 255, 255, 0.5);
    --hover-card-bg: rgba(255, 255, 255, 0.5);
    --footer-opacity: 0.9;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-middle), var(--bg-gradient-end));
    /* 添加动态背景粒子效果 */
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    overflow-x: hidden;
    transition: background var(--transition-timing), color var(--transition-timing);
    min-height: 100vh;
    padding-top: 80px; /* 为导航栏留出空间 */
}

/* 顶部导航栏 */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

[data-theme="light"] .main-nav {
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00DBDE, #FC00FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .brand-logo {
    background: linear-gradient(135deg, #8ac4e2, #d3eed9);
}

.brand-name {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

[data-theme="light"] .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    margin-left: 1rem;
}

[data-theme="light"] .nav-theme-toggle {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-theme-toggle:hover {
    transform: scale(1.05) rotate(15deg);
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .nav-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.8);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* 响应式导航 */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 2rem;
        padding-top: 3rem;
        transition: left 0.3s ease;
        border-right: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    [data-theme="light"] .nav-links {
        background: rgba(255, 255, 255, 0.85);
        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 12px 20px;
        width: 200px;
        text-align: center;
    }
    
    .nav-theme-toggle {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-9px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-8px, -8px);
    }
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* 毛玻璃效果卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.4s ease;
    padding: 2rem;
    margin-bottom: 2rem;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    background: var(--hover-card-bg);
}

header {
    padding: 4rem 0;
    animation: fadeIn 1s ease-in;
    position: relative;
}

h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #00DBDE, #FC00FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] h1 {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.3rem;
    opacity: var(--footer-opacity);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(90deg, #00DBDE, #FC00FF);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #FC00FF, #00DBDE);
    z-index: -1;
    transition: transform 0.5s ease;
    transform: scaleX(0);
    transform-origin: right;
}

.cta-button:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .cta-button {
    background: linear-gradient(90deg, #8ac4e2, #d3eed9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cta-button::before {
    background: linear-gradient(90deg, #d3eed9, #8ac4e2);
}

[data-theme="light"] .cta-button:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Blog Button Specific Styles */
.blog-button {
    background: linear-gradient(90deg, #43cea2, #185a9d);
}

.blog-button::before {
    background: linear-gradient(90deg, #185a9d, #43cea2);
}

[data-theme="light"] .blog-button {
    background: linear-gradient(90deg, #36D1DC, #5B86E5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .blog-button::before {
    background: linear-gradient(90deg, #5B86E5, #36D1DC);
}

[data-theme="light"] .blog-button:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

section {
    padding: 4rem 0;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, #00DBDE, #FC00FF);
    border-radius: 2px;
}

[data-theme="light"] h2::after {
    background: linear-gradient(90deg, #8ac4e2, #d3eed9);
}

.projects-grid,
.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.project-card,
.skill-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.project-card:hover,
.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    background: var(--hover-card-bg);
}

.project-card h3,
.skill-item h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

.project-card p,
.skill-item p {
    opacity: var(--footer-opacity);
    line-height: 1.6;
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.contact-icon:hover {
    transform: scale(1.15) rotate(10deg);
    color: #00DBDE;
    background: var(--hover-card-bg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .contact-icon:hover {
    color: #8ac4e2;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

footer {
    padding: 2rem 0;
    font-size: 1rem;
    opacity: var(--footer-opacity);
    margin-top: 2rem;
    text-align: center;
}

footer a {
    color: #00DBDE;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #FC00FF;
    text-decoration: underline;
}

[data-theme="light"] footer a {
    color: #0066cc;
}

[data-theme="light"] footer a:hover {
    color: #e52e71;
}

/* 改善可访问性和焦点管理 */
*:focus {
    outline: 2px solid #00DBDE;
    outline-offset: 2px;
}

[data-theme="light"] *:focus {
    outline-color: #8ac4e2;
}

/* 跳过链接（键盘导航用户） */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* 减少动画（用户偏好） */
@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;
    }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --card-bg: rgba(255, 255, 255, 0.9);
        --card-border: rgba(0, 0, 0, 0.3);
    }
    
    [data-theme="dark"] {
        --text-color: #ffffff;
        --card-bg: rgba(0, 0, 0, 0.9);
        --card-border: rgba(255, 255, 255, 0.3);
    }
}

/* 粒子画布样式 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    h2 {
        font-size: 2rem;
    }

    .projects-grid,
    .skills-list {
        grid-template-columns: 1fr;
    }
    
    .contact-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .header-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .cta-button {
        width: 80%;
        max-width: 300px;
    }
}
