/* CSS变量主题系统 */
:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;

    /* 浅色主题 */
    --bg-primary: #f7f9fc;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent: #3b82f6;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 20px rgba(0,0,0,0.1);
    --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #60a5fa;
    --shadow: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-hover: 0 10px 20px rgba(0,0,0,0.4);
    --nav-bg: rgba(30, 30, 30, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Fira Code', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.nav-links a:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

/* 主题切换按钮 */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: rotate(360deg);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 主要内容 */
main {
    margin-top: 100px;
    padding: 2rem 0;
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-family: 'Fira Code', monospace;
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: var(--shadow);
}

/* 章节标题 */
.section {
    padding: 4rem 0;
}

.section-title {
    font-family: 'Fira Code', monospace;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

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

/* 通用卡片样式 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* 文章卡片 */
.article-card .card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.card-content {
    padding: 1.5rem;
}

.author-badge {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.card-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-summary {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 项目卡片 */
.project-card {
    border: 2px solid transparent;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.project-card .card-inner {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    height: 100%;
}

.project-icon {
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 友情链接卡片 */
.friend-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.friend-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.friend-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.friend-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: 0;
}

.friend-card:hover::before {
    width: 300px;
    height: 300px;
}

.friend-card > * {
    position: relative;
    z-index: 1;
}

/* 关于页面 */
.about-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.profile-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* 技能图表 */
.skills-chart {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.skill-progress {
    flex: 1;
    height: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    margin: 0 1rem;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-sm);
    transition: width 1s ease;
}

/* 时间轴 */
.timeline {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.2rem;
    width: 2px;
    height: calc(100% + 1rem);
    background: rgba(59, 130, 246, 0.2);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-date {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 按钮 */
.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn:active {
    transform: scale(0.98);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .about-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero h1 {
        font-size: 2rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 0.5rem;
    }
}

/* 隐藏的页面 */
.page {
    display: none;
}

.page.active {
    display: block;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}