/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 颜色变量 */
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* 字体 */
    --font-primary: 'Poppins', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    
    /* 间距 */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

section {
    padding: var(--space-xl) 0;
}

/* ===== 排版 ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: var(--space-sm);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-lg);
    text-align: center;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

p {
    margin-bottom: var(--space-sm);
    color: var(--text-light);
}

.highlight {
    color: var(--primary-color);
}

.dot {
    color: var(--accent-color);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* ===== Hero 区域 ===== */
.hero {
    padding-top: 8rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #fef7ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
}

.hero-buttons {
    display: flex;
    gap: var(--space-sm);
}

.hero-image {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 8rem;
    box-shadow: var(--shadow-lg);
}

/* ===== 关于区域 ===== */
.about {
    background-color: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.about-stats {
    display: grid;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-xs);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== 技能区域 ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.skill-category {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-list li::before {
    content: "▸";
    color: var(--primary-color);
    margin-right: var(--space-sm);
}

/* ===== 项目区域 ===== */
.projects {
    background-color: var(--bg-light);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.project-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image .image-placeholder {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
}

.project-content {
    padding: var(--space-lg);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin: var(--space-md) 0;
}

.project-tech span {
    background-color: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-light);
}

.project-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* ===== 联系区域 ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.contact-items {
    margin: var(--space-lg) 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.contact-form {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== 页脚 ===== */
.footer {
    background-color: var(--bg-dark);
    color: white;
    text-align: center;
    padding: var(--space-lg) 0;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-xs);
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
    h1 {
        font-size: 2.75rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .hero .container,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .hero {
        text-align: center;
        padding-top: 6rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        background-color: white;
        padding: var(--space-lg);
        box-shadow: var(--shadow-lg);
        transition: 0.3s;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        display: block;
        padding: var(--space-sm);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-xs);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}
