/* 基础样式和变量 */
:root {
    --bg-dark: #121212;
    --bg-darker: #0a0a0a;
    --bg-light: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent: #00ff88;
    --accent-hover: #00cc6a;
    --border: #333;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.navbar.scrolled {
    background-color: var(--bg-darker);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px;
    transition: var(--transition);
    border-radius: 3px;
}

/* 主页 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 136, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(0, 255, 136, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: var(--accent);
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: rgba(0, 255, 136, 0.2);
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
}

.tag {
    background-color: var(--bg-light);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 136, 0.3);
    transition: var(--transition);
}

.tag:hover {
    background-color: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

.btn-primary {
    display: inline-block;
    background-color: var(--accent);
    color: var(--bg-dark);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--accent);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4);
}

.hero-animation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.3;
}

.code-matrix {
    width: 300px;
    height: 300px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><text x="10" y="20" fill="%2300ff88" font-size="14" font-family="monospace">01010101</text><text x="10" y="40" fill="%2300ff88" font-size="14" font-family="monospace">10101010</text><text x="10" y="60" fill="%2300ff88" font-size="14" font-family="monospace">01010101</text><text x="10" y="80" fill="%2300ff88" font-size="14" font-family="monospace">10101010</text></svg>');
    background-repeat: repeat;
    animation: matrixScroll 20s linear infinite;
}

@keyframes matrixScroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

/* 关于我 */
.about {
    padding: 100px 0;
    background-color: var(--bg-darker);
    position: relative;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

.about-content {
    display: flex;
    gap: 4rem;
    margin-bottom: 4rem;
    align-items: center;
}

.profile-pic {
    flex: 1;
}

.profile-pic img {
    width: 100%;
    max-width: 300px;
    border-radius: 20px;
    border: 3px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bio {
    flex: 2;
}

.bio p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.skills {
    background-color: var(--bg-light);
    padding: 3rem;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.skills h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-name {
    margin-bottom: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.skill-bar {
    height: 10px;
    background-color: var(--bg-dark);
    border-radius: 5px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background-color: var(--accent);
    border-radius: 5px;
    transition: width 1.5s ease-in-out;
}

/* 项目展示 */
.projects {
    padding: 100px 0;
    background-color: var(--bg-dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-light);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
}

.project-tags span {
    background-color: rgba(0, 255, 136, 0.1);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

/* 博客 */
.blog {
    padding: 100px 0;
    background-color: var(--bg-darker);
}

.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-post {
    display: flex;
    gap: 2rem;
    background-color: var(--bg-light);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.post-image {
    flex: 1;
    min-height: 200px;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 2rem;
}

.post-content {
    flex: 2;
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-meta .category {
    background-color: rgba(0, 255, 136, 0.1);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.8rem;
}

.post-content h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.post-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.read-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.read-more:hover {
    text-decoration: underline;
}

/* 联系方式 */
.contact {
    padding: 100px 0;
    background-color: var(--bg-dark);
}

.contact-content {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info {
    flex: 1;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.icon {
    font-size: 1.5rem;
}

.text {
    font-size: 1.1rem;
}

.contact-form {
    flex: 2;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

/* 页脚 */
.footer {
    background-color: var(--bg-darker);
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-icon:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .about-content,
    .contact-content {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-pic,
    .bio,
    .contact-info,
    .contact-form {
        flex: none;
        width: 100%;
    }
    
    .bio,
    .contact-info {
        margin-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        height: 60px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-links {
        position: absolute;
        right: 0;
        top: 60px;
        height: calc(100vh - 60px);
        background-color: var(--bg-darker);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 70%;
        transform: translateX(100%);
        transition: var(--transition);
        z-index: 1000;
        border-left: 1px solid var(--border);
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links li {
        opacity: 0;
    }
    
    .nav-links.active li {
        opacity: 1;
        transition: opacity 0.3s ease 0.3s;
    }
    
    .burger {
        display: block;
    }
    
    .burger.active .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .burger.active .line2 {
        opacity: 0;
    }
    
    .burger.active .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 0 60px;
    }
    
    .hero-content,
    .hero-animation {
        margin-bottom: 3rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skills {
        padding: 2rem 1.5rem;
    }
    
    .blog-post {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .btn-primary {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content,
    .contact-content {
        gap: 2rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
}