/* ===== 全局变量 ===== */
:root {
    --primary-color: #4A90E2;
    --primary-dark: #3A7BC8;
    --secondary-color: #50E3C2;
    --bg-color: #F5F7FA;
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --white: #FFFFFF;
    --accent-color: #E74C3C;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

/* ===== 导航栏 ===== */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-left .logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-left .logo:hover {
    color: var(--primary-dark);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-right a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-right a:hover {
    color: var(--primary-color);
}

.nav-right a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-right a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

/* ===== Hero Section ===== */
.hero {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(80, 227, 194, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
    font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
    letter-spacing: 2px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.gradient-text {
    background: linear-gradient(90deg, var(--secondary-color), var(--white), var(--secondary-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 1px;
    font-style: italic;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-illustration {
    animation: fadeInRight 1s ease 0.3s both;
}

.floating-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.code-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.code-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.code-lines div {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    animation: typing 2s steps(4) infinite;
}

.code-lines div:nth-child(1) { width: 80%; animation-delay: 0s; }
.code-lines div:nth-child(2) { width: 60%; animation-delay: 0.2s; }
.code-lines div:nth-child(3) { width: 40%; animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { width: 0; }
    50% { width: var(--width); }
}

/* ===== 通用 Section ===== */
.section {
    padding: 100px 0;
}

.section-bg {
    background: var(--white);
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-color);
    letter-spacing: 1px;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 50px;
    font-size: 18px;
}

/* ===== 关于我 ===== */
.about-card {
    background: var(--white);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 10px 30px var(--shadow);
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: center;
}

.about-avatar {
    display: flex;
    justify-content: center;
}

.avatar-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.about-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.about-name::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.about-role {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

.about-description {
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== 博客文章 ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.blog-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px var(--shadow-hover);
}

.blog-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.blog-content {
    padding: 25px;
}

.blog-tag {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 15px;
}

.blog-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    transition: color 0.3s ease;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.blog-card:hover .blog-title {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.blog-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

/* ===== 技能云 ===== */
.skills-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-tag {
    padding: 12px 24px;
    background: var(--white);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 3px 10px var(--shadow);
    transition: all 0.3s ease;
    cursor: default;
    letter-spacing: 0.5px;
    font-family: 'Noto Sans SC', sans-serif;
}

.skill-tag:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow-hover);
}

.skill-blue { color: #4A90E2; }
.skill-green { color: #50E3C2; }
.skill-purple { color: #9B59B6; }
.skill-orange { color: #E67E22; }
.skill-red { color: #E74C3C; }

/* ===== 联系方式 ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-card {
    background: var(--white);
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-hover);
}

.contact-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.contact-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

.contact-card p {
    color: var(--text-light);
    font-size: 16px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--primary-dark);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--white);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
}

.section-bg .btn-outline {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.section-bg .btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ===== 页脚 ===== */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
}

.footer p {
    margin: 10px 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--white);
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 15px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--primary-dark);
}

.back-to-top svg {
    transform: rotate(180deg);
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-illustration {
        display: none;
    }

    .hero-buttons {
        justify-content: center;
    }

    .about-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-right a {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-right.active a {
        display: block;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px var(--shadow);
        gap: 20px;
    }

    .nav-right.active a::after {
        display: none;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-title {
        font-size: 28px;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .skills-cloud {
        gap: 10px;
    }

    .skill-tag {
        padding: 10px 20px;
        font-size: 14px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}
