:root {
    --github-black: #0d1117;
    --github-dark-gray: #161b22;
    --github-border: #30363d;
    --github-text: #c9d1d9;
    --github-blue: #58a6ff;
    --github-green: #3fb950;
    --github-purple: #bc8cff;
    --header-height: 70px;
    --section-spacing: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--github-black);
    color: var(--github-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 导航栏样式 - GitHub风格 */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid var(--github-border);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo-icon {
    color: var(--github-green);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--github-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--github-blue);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--github-blue);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--github-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero区域样式 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(88, 166, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 0.5s;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--github-blue), var(--github-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #8b949e;
}

.typed-text {
    color: var(--github-green);
    font-weight: 600;
}

.typed-cursor {
    color: var(--github-green);
    animation: blink 1s infinite;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--github-green);
    color: var(--github-black);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(63, 185, 80, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--github-text);
    border: 1px solid var(--github-border);
}

.btn-secondary:hover {
    border-color: var(--github-blue);
    color: var(--github-blue);
    transform: translateY(-3px);
}

/* 通用部分样式 */
section {
    padding: var(--section-spacing) 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--github-blue), var(--github-green));
    border-radius: 2px;
}

.section-header p {
    color: #8b949e;
    max-width: 600px;
    margin: 0 auto;
}

/* 关于我部分 */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--github-blue);
}

.about-text p {
    margin-bottom: 1.5rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.skill-tag {
    background-color: var(--github-dark-gray);
    border: 1px solid var(--github-border);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    transform: translateY(-2px);
    border-color: var(--github-blue);
    color: var(--github-blue);
}

.about-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.about-image:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--github-blue), var(--github-green));
    opacity: 0.2;
    z-index: 1;
}

.code-window {
    background-color: var(--github-dark-gray);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--github-border);
}

.window-header {
    background-color: var(--github-black);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--github-border);
    display: flex;
    align-items: center;
}

.window-buttons {
    display: flex;
    gap: 0.5rem;
}

.window-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-btn.close {
    background-color: #ff5f56;
}

.window-btn.minimize {
    background-color: #ffbd2e;
}

.window-btn.maximize {
    background-color: #27ca3f;
}

.window-title {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: #8b949e;
}

.code-content {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.code-line {
    margin-bottom: 0.5rem;
}

.code-comment {
    color: #8b949e;
}

.code-keyword {
    color: #ff7b72;
}

.code-function {
    color: #d2a8ff;
}

.code-var {
    color: #79c0ff;
}

.code-string {
    color: #a5d6ff;
}

.code-number {
    color: #79c0ff;
}

.code-property {
    color: #7ee787;
}

/* 项目展示部分 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--github-dark-gray);
    border: 1px solid var(--github-border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--github-blue);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--github-blue), var(--github-green));
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image-placeholder {
    font-size: 4rem;
    color: white;
    opacity: 0.7;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-links {
    display: flex;
    gap: 0.5rem;
}

.project-link {
    color: #8b949e;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--github-blue);
}

.project-description {
    color: #8b949e;
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--github-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 时间轴样式 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background-color: var(--github-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: calc(50% - 40px);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
    padding-right: 60px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 60px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--github-green);
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-content {
    background-color: var(--github-dark-gray);
    border: 1px solid var(--github-border);
    border-radius: 10px;
    padding: 1.5rem;
    position: relative;
}

.timeline-content::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 15px;
    height: 15px;
    background-color: var(--github-dark-gray);
    border: 1px solid var(--github-border);
    transform: rotate(45deg);
    z-index: 0;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    right: -8px;
    border-left: none;
    border-bottom: none;
}

.timeline-item:nth-child(even) .timeline-content::after {
    left: -8px;
    border-right: none;
    border-top: none;
}

.timeline-date {
    color: var(--github-green);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* 联系表单部分 */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--github-dark-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--github-blue);
    border: 1px solid var(--github-border);
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    background-color: var(--github-blue);
    color: white;
    transform: scale(1.1);
}

.contact-text h3 {
    margin-bottom: 0.3rem;
}

.contact-text p {
    color: #8b949e;
}

.contact-form {
    background-color: var(--github-dark-gray);
    border: 1px solid var(--github-border);
    border-radius: 10px;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--github-black);
    border: 1px solid var(--github-border);
    border-radius: 6px;
    color: var(--github-text);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--github-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* 页脚样式 */
footer {
    background-color: var(--github-dark-gray);
    border-top: 1px solid var(--github-border);
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--github-black);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--github-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--github-border);
}

.social-link:hover {
    background-color: var(--github-blue);
    color: white;
    transform: translateY(-3px);
}

.copyright {
    color: #8b949e;
    font-size: 0.9rem;
}

/* 动画关键帧 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 968px) {
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: calc(100% - 80px);
        left: 0;
        padding-left: 60px;
        padding-right: 0;
        text-align: left;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        left: -8px;
        border-right: none;
        border-top: none;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--github-dark-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--github-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--github-blue);
}

/* 粒子背景效果 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.particle {
    position: absolute;
    background-color: rgba(88, 166, 255, 0.3);
    border-radius: 50%;
}