/* ========== 全局重置与基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f8fafc;
}

/* ========== 导航栏 ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3182ce;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #3182ce;
}

/* 移动端菜单按钮 (默认隐藏) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #2d3748;
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* ========== 英雄区域 ========== */
.hero {
    max-width: 800px;
    margin: 4rem auto 2rem;
    padding: 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #1a202c;
}

.hero .highlight {
    color: #3182ce;
}

.hero p {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background: #3182ce;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.btn:hover {
    background: #2b6cb0;
    transform: translateY(-2px);
}

/* ========== 通用区块 ========== */
.section {
    max-width: 900px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    color: #1a202c;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #3182ce;
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* ========== 关于我 ========== */
.about-content {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.about-content img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
}

.about-text {
    flex: 1;
    min-width: 250px;
}

/* ========== 技能标签 ========== */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.skill-tag {
    background: #edf2f7;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 500;
    color: #2d3748;
    transition: all 0.2s;
}

.skill-tag:hover {
    background: #3182ce;
    color: white;
    transform: scale(1.05);
}

/* ========== 作品卡片 ========== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.project-card h3 {
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.project-card p {
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.project-card .tag {
    display: inline-block;
    background: #e2e8f0;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* ========== 联系区域 ========== */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.2s;
}

.contact-links a:hover {
    color: #3182ce;
}

.contact-links .icon {
    font-size: 1.4rem;
}

/* ========== 页脚 ========== */
footer {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

/* ========== 响应式设计 (手机) ========== */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        background: white;
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }
    /* ========== 作品卡片多媒体样式 ========== */

/* 多媒体容器，让图片和视频统一撑满卡片宽度 */
.project-media {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.project-media img,
.project-media video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;       /* 图片保持比例裁剪，美观 */
    aspect-ratio: 16 / 9;    /* 固定宽高比，防止加载抖动 */
}

/* YouTube / Bilibili 响应式容器 */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;   /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
}