/* 主样式文件 */
/* 创建时间: 2026-05-22 | 创建人: liuzy */

/* 重置样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-light);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 粒子背景画布 */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* 顶部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.logo-bracket {
    color: var(--color-accent);
}

.logo-text {
    background: linear-gradient(135deg, var(--color-accent), var(--color-highlight));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
}

/* 移动端汉堡菜单 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: all var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* 主内容区域 */
.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - 60px);
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.page.active {
    display: block;
}

/* 通用区块样式 */
.section-padding {
    padding: var(--space-3xl) var(--space-xl);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-highlight));
    margin: var(--space-md) auto 0;
    border-radius: var(--radius-full);
}

/* ==================== 首页样式 ==================== */

/* Hero 区域 */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: radial-gradient(ellipse at center, rgba(41, 98, 255, 0.1) 0%, transparent 70%);
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--color-accent-light), var(--color-highlight), var(--color-accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 4s ease infinite;
}

.typing-text {
    position: relative;
}

.typing-text::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-accent);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* 最新文章卡片 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-base);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
    background: var(--bg-card-hover);
}

.article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.article-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.article-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.article-summary {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.article-tag {
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

/* 技术栈卡片 */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-base);
}

.tech-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-accent);
}

.tech-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    animation: float 3s ease-in-out infinite;
}

.tech-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.tech-card p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* 快速导航 */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.nav-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-base);
    display: block;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-highlight);
}

.nav-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.nav-card p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ==================== 内容页面样式 ==================== */

.page-header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.content-layout {
    display: flex;
    max-width: var(--content-max-width);
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: var(--space-xl);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-link {
    display: block;
    padding: var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link.active {
    border-left: 3px solid var(--color-accent);
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: var(--space-xl);
    max-width: calc(var(--content-max-width) - var(--sidebar-width));
}

.article-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
}

.article-content h2 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin: var(--space-xl) 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--text-primary);
    margin: var(--space-lg) 0 var(--space-md);
}

.article-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.article-content ul, .article-content ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-xl);
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

/* 代码块 */
.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.code-lang {
    font-family: var(--font-code);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.code-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.code-copy:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.code-content {
    padding: var(--space-md);
    overflow-x: auto;
}

.code-content pre {
    font-family: var(--font-code);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

/* 语法高亮 */
.code-keyword {
    color: #ff79c6;
}

.code-string {
    color: #f1fa8c;
}

.code-comment {
    color: #6272a4;
    font-style: italic;
}

.code-type {
    color: #8be9fd;
}

.code-function {
    color: #50fa7b;
}

.code-number {
    color: #bd93f9;
}

/* ==================== 关于我页面样式 ==================== */

.about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
}

.about-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--color-accent), var(--color-highlight));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-heading);
}

.about-header h1 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.about-role {
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.about-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.about-section h2 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.about-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.tech-tag {
    font-size: var(--text-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.tech-tag:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.learning-list {
    padding-left: var(--space-xl);
}

.learning-list li {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
    position: relative;
    padding-left: var(--space-md);
}

.learning-list li::marker {
    color: var(--color-accent);
}

.contact-info p {
    margin-bottom: var(--space-sm);
}

.contact-info a {
    color: var(--color-accent-light);
}

.contact-info a:hover {
    text-decoration: underline;
}

/* ==================== 页脚样式 ==================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.footer .beian {
    margin-top: var(--space-sm);
}

.footer .beian a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer .beian a:hover {
    color: var(--text-link);
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -300px;
        top: var(--header-height);
        z-index: 999;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .content-area {
        max-width: 100%;
    }
    
    .content-layout {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--space-xl);
        transition: left var(--transition-base);
    }
    
    .nav-menu.open {
        left: 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .articles-grid,
    .tech-grid,
    .nav-cards {
        grid-template-columns: 1fr;
    }
    
    .section-padding {
        padding: var(--space-xl) var(--space-md);
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}