/* 全局样式 — 主界面与正文不做色散/光晕，仅侧边装饰图保留色散 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #27ca22;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* 头部介绍 */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, #056c35 0%, #0d8b45 40%, #12a848 78%, #0e7d3d 100%);
    color: white;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 60, 30, 0.22);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,100 1000,0 1000,100"/></svg>') no-repeat bottom;
    background-size: 100% 100px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    overflow: hidden;
    border: 5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.hero .title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.2s both;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero .description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.92;
    animation: fadeInUp 1s ease-out 0.4s both;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.btn {
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn.primary {
    background: #fff;
    color: #277c14d4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.btn.primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.btn.secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.95);
}

.btn.secondary:hover {
    background: #fff;
    color: #27ca22;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* Hero 区域二维码卡片（右上角悬浮） */
.hero-qrcode {
    position: absolute;
    top: 100px;
    right: 30px;
    z-index: 2;
    padding: 12px 12px 8px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    animation: fadeInUp 1s ease-out 0.8s both;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.hero-qrcode:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.hero-qrcode #qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-qrcode #qrcode img,
.hero-qrcode #qrcode canvas {
    display: block;
    border-radius: 4px;
}

.hero-qrcode .qrcode-label {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #056c35;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.hero-qrcode .qrcode-label i {
    margin-right: 4px;
}

/* 通用段落样式 */
.section {
    padding: 80px 0;
    background: white;
}

.section:nth-child(even) {
    background: #f8f9fa;
}

.section:nth-child(even) .timeline-content {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.section:nth-child(even) .project-card {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.line {
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, #27ca22, #2ecc71);
    margin: 0 auto;
    border-radius: 2px;
}

/* 工作经历内分组小标题（全职 / 实习） */
.experience-subheading {
    max-width: 800px;
    margin: 2.5rem auto 1.25rem;
    padding-left: 12px;
    border-left: 4px solid #27ca22;
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
}

.experience-split:first-of-type .experience-subheading {
    margin-top: 0;
}

.project-meta {
    font-size: 0.9rem;
    color: #607d86;
    margin: 0 0 0.75rem;
}

/* 时间线 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #27ca22;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 3rem 0;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: #27ca22;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 0 4px #fff;
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 45%;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    left: 100%;
    border-left-color: white;
}

.timeline-item:nth-child(even) .timeline-content::before {
    right: 100%;
    border-right-color: white;
}

.timeline-content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.timeline-content .company {
    color: #27ca22;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.timeline-content .duration {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #27ca22;
    font-weight: bold;
}

.timeline-content a {
    color: #1c9c43;
    font-weight: 500;
    transition: color 0.2s ease;
}

.timeline-content a:hover {
    color: #157d36;
}

/* 项目网格 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.project-description {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.65;
}

.project-links {
    display: flex;
    gap: 0.5rem;
}

.project-link {
    color: #7f8c8d;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #27ca22;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 技能 */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
    padding: 5px; /* 新添加的5px外边距 */
    max-width: 1000px; /* 限制最大宽度 */
    margin-left: auto; /* 水平居中 */
    margin-right: auto; /* 水平居中 */
}

.skills-category h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skills-category h3 i {
    color: #27ca22;
}

.skills-list {
    space-y: 1.5rem;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(to right, #63d97a, #27ca22, #21a836);
    border-radius: 4px;
    transition: width 2s ease-in-out;
    width: 0%;
}

/* 联系方式 */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-3px);
}

.contact-item i {
    font-size: 2rem;
    color: #27ca22;
    width: 50px;
    text-align: center;
}

.contact-item h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: #7f8c8d;
    word-break: break-all;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .title {
        font-size: 1.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-dot {
        left: 20px;
        transform: translateX(-50%);
    }

    .timeline-content {
        width: 100%;
        margin-left: 60px;
    }

    .timeline-content::before {
        left: -15px;
        border-right-color: white;
        border-left-color: transparent;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-container {
        grid-template-columns: 1fr;
        max-width: 100%; /* 小屏幕时允许全宽 */
        padding: 10px; /* 小屏幕时增加一些padding */
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 1024px) {
    /* 中小屏（含所有手机/平板/微信内置浏览器）：二维码改为简介下方居中 */
    .hero-qrcode {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        display: block;
        width: fit-content;
        margin: 1.8rem auto 0;
        padding: 10px 10px 8px;
        z-index: 2;
    }

    .hero-qrcode .qrcode-label {
        font-size: 0.72rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .section {
        padding: 60px 0;
    }

    .project-card,
    .contact-item {
        padding: 1.5rem;
    }
}

/* 卡片内嵌二维码 */
.card-qrcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
    padding: 10px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.card-qrcode #qrcode-wechat,
.card-qrcode #qrcode-doi {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.card-qrcode #qrcode-wechat img,
.card-qrcode #qrcode-wechat canvas,
.card-qrcode #qrcode-doi img,
.card-qrcode #qrcode-doi canvas {
    display: block;
    border-radius: 4px;
}

.card-qrcode-label {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}

/* 学术模块内的内联二维码 */
.card-qrcode-inline {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 0.8rem;
    padding: 8px 12px;
}

.card-qrcode-inline .card-qrcode-label {
    margin: 0;
}

/* 滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #27ca22;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #219a1f;
}

/* 页面装饰图片（仅两侧牛马）：RGB 透镜色散 + 柔光 —— filter：drop-shadow 沿透明边缘生成偏移色边，叠加模拟色差 */
.decorative-images {
    position: fixed;
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
}

.decorative-images img {
    width: 50px;
    height: auto;
    filter:
        grayscale(14%)
        drop-shadow(-2.5px 0 0.5px rgba(255, 70, 100, 0.65))
        drop-shadow(2.5px 0 0.5px rgba(55, 200, 255, 0.55))
        drop-shadow(0 1.5px 0 rgba(230, 255, 140, 0.35))
        drop-shadow(0 0 10px rgba(80, 220, 100, 0.35))
        saturate(1.06);
}

/* 装饰层不设 pointer-events，悬停一般不触发；色散仅在默认态生效即可 */

/* 左侧区域的图片（翻转） */
.decorative-left {
    transform: scaleX(-1);
}

/* 右侧区域的图片（正常方向） */
.decorative-right {
    transform: scaleX(1);
}

/* 随机浮动动画变种 */
@keyframes floatRandom1 {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-8px) translateX(5px); }
    50% { transform: translateY(5px) translateX(-3px); }
    75% { transform: translateY(-3px) translateX(8px); }
}

@keyframes floatRandom2 {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(6px) translateX(-6px); }
    66% { transform: translateY(-5px) translateX(4px); }
}

@keyframes floatRandom3 {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    20% { transform: translateY(-4px) translateX(-2px); }
    40% { transform: translateY(7px) translateX(6px); }
    60% { transform: translateY(-6px) translateX(-4px); }
    80% { transform: translateY(3px) translateX(5px); }
}

@keyframes floatRandom4 {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-10px) translateX(8px); }
}

/* 左侧翻转图片的动画 */
@keyframes floatRandomLeft1 {
    0%, 100% { transform: scaleX(-1) translateY(0px) translateX(0px); }
    25% { transform: scaleX(-1) translateY(-8px) translateX(-5px); }
    50% { transform: scaleX(-1) translateY(5px) translateX(3px); }
    75% { transform: scaleX(-1) translateY(-3px) translateX(-8px); }
}

@keyframes floatRandomLeft2 {
    0%, 100% { transform: scaleX(-1) translateY(0px) translateX(0px); }
    33% { transform: scaleX(-1) translateY(6px) translateX(6px); }
    66% { transform: scaleX(-1) translateY(-5px) translateX(-4px); }
}

@keyframes floatRandomLeft3 {
    0%, 100% { transform: scaleX(-1) translateY(0px) translateX(0px); }
    20% { transform: scaleX(-1) translateY(-4px) translateX(2px); }
    40% { transform: scaleX(-1) translateY(7px) translateX(-6px); }
    60% { transform: scaleX(-1) translateY(-6px) translateX(4px); }
    80% { transform: scaleX(-1) translateY(3px) translateX(-5px); }
}

@keyframes floatRandomLeft4 {
    0%, 100% { transform: scaleX(-1) translateY(0px) translateX(0px); }
    50% { transform: scaleX(-1) translateY(-10px) translateX(-8px); }
}

/* 在较小屏幕上隐藏装饰图片 */
@media (max-width: 1200px) {
    .decorative-images {
        display: none;
    }
}

/* 在超大屏幕上稍微增大装饰图片 */
@media (min-width: 1600px) {
    .decorative-images img {
        width: 60px; /* 超大屏幕时稍大一些 */
    }
    
    .skills-container {
        max-width: 1200px; /* 超大屏幕时适度增加最大宽度 */
    }
}