/* 基础重置与变量 */
:root {
    --primary-color: #64ffda;
    --secondary-color: #00bfa5;
    --bg-color: #0a192f;
    --bg-alt: #112240;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --font-main: 'Noto Sans SC', sans-serif;
    --transition: all 0.3s ease-in-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero 区域 */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-text {
    flex: 1;
}

.subtitle {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px;
    color: #e6f1ff;
}

.typing-text {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    height: 60px; /* 防止抖动 */
}

.description {
    max-width: 500px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: rgba(100, 255, 218, 0.1);
}

.btn-outline {
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* 简单的代码展示块 */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.code-block {
    background: #112240;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
    width: 100%;
    max-width: 400px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.code-block:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.code-header {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

pre {
    color: #a8b2d1;
    overflow-x: auto;
}

.keyword { color: #c678dd; }
.variable { color: #e06c75; }
.string { color: #98c379; }
.key { color: #61afef; }
.boolean { color: #d19a66; }
.function { color: #56b6c2; }

/* 鼠标滚动指示器 */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

/* 通用 Section 样式 */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    color: #e6f1ff;
}

.section-title::after {
    content: "";
    display: block;
    width: 200px;
    height: 1px;
    background: var(--text-secondary);
    margin-left: 20px;
    opacity: 0.3;
}

.alt-bg {
    background-color: var(--bg-alt);
}

/* 关于我 */
.about-content {
    display: flex;
    gap: 50px;
}

.about-card {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

/* 技能 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.skill-category h3 {
    margin-bottom: 20px;
    color: #e6f1ff;
}

.skill-bar {
    margin-bottom: 20px;
}

.skill-bar .info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.skill-bar .bar {
    height: 10px;
    background: #233554;
    border-radius: 5px;
    overflow: hidden;
}

.skill-bar .progress {
    display: block;
    height: 100%;
    background: var(--primary-color);
    border-radius: 5px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* 工作经历 - 时间轴 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--text-secondary);
    opacity: 0.3;
}

.timeline-item {
    padding-left: 30px;
    margin-bottom: 50px;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -4px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(100, 255, 218, 0.2);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-content h3 {
    color: #e6f1ff;
    font-size: 1.2rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 400;
}

/* 项目展示 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: #112240;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    color: #e6f1ff;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tags span {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
}

.project-links {
    display: flex;
    gap: 20px;
}

.project-links a {
    font-size: 0.9rem;
    color: #e6f1ff;
}

.project-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 联系方式 */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info h3 {
    color: #e6f1ff;
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.info-item .icon {
    font-size: 1.2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: #112240;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #e6f1ff;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #152749;
}

/* 页脚 */
footer {
    padding: 20px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background-color: var(--bg-color);
}

/* 动画类 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* 简化：移动端隐藏菜单，实际项目需添加 JS 切换 */
    }
    
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 50px;
    }
    
    .hero-visual {
        justify-content: center;
    }
    
    .hero-btns {
        justify-content: center;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-dot {
        left: 16px;
    }
}