/* ===== 全局重置 & 变量 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-light: #ffedd5;
    --border-light: #e2e8f0;
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(248, 250, 252, 0.75);
    /* backdrop-filter: blur(16px) saturate(180%); */
    /* -webkit-backdrop-filter: blur(16px) saturate(180%); */
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(248, 250, 252, 0.92);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.04);
}

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

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i {
    color: var(--accent);
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
    border-radius: 2px;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--text-primary);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 600;
    transition: var(--transition);
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: var(--accent) !important;
    transform: scale(1.02);
    color: #fff !important;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 4px;
    transition: var(--transition);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero-content .title-role {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-content .title-role span {
    background: var(--accent-light);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-hover);
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.avatar-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1/1;
}

.avatar-ring {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px dashed var(--accent);
    opacity: 0.4;
    animation: spin 40s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.avatar-ring-inner {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    /* background-color: #2f73ea; */
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--accent);
    font-weight: 300;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.floating-badge {
    position: absolute;
    background: var(--bg-secondary);
    border-radius: 100px;
    padding: 10px 18px;
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    animation: float 6s ease-in-out infinite;
    border: 1px solid var(--border-light);
}

.floating-badge i {
    color: var(--accent);
}

.badge-1 {
    top: 8%;
    left: -6%;
    animation-delay: 0s;
}

.badge-2 {
    top: 8%;
    right: -6%;
    animation-delay: 2s;
}

.badge-3 {
    bottom: 8%;
    left: -6%;
    animation-delay: 1s;
}

.badge-4 {
    bottom: 8%;
    right: -6%;
    animation-delay: 3s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* ===== 通用标题 ===== */
.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-sub {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 540px;
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 56px;
}

.section-header .section-sub {
    margin-top: 6px;
}

/* ===== 关于 ===== */
.about {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 18px;
    line-height: 1.8;
}

.about-text .highlight-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.about-text .highlight-list span {
    background: var(--accent-light);
    color: var(--accent-hover);
    padding: 4px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

.about-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-primary);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    flex-direction: column;
    gap: 12px;
    color: var(--text-muted);
}

.about-image i {
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.6;
}

/* ===== 简介模块 - 生活照片网格 ===== */
.about-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    padding: 8px;
}

.life-photo {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-secondary);
}

.life-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.life-photo img:hover {
    transform: scale(1.03);
}

/* 响应式：小屏设备改为单列或两列调整 */
@media (max-width: 768px) {
    .about-image-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .about-image-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 4px;
    }
}

/* ===== 教育 ===== */
.education {
    padding: 80px 0;
    background: var(--bg-primary);
}

.edu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.edu-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    /* 已在 HTML 中内联，也可在此统一定义 */
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.edu-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.edu-card .degree {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.edu-card .school {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.edu-card .detail {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.edu-card .detail i {
    width: 20px;
    color: var(--accent);
}

/* ===== 项目 ===== */
.projects {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    cursor: pointer
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.project-cover {
    height: 140px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
    position: relative;
    background-size: cover;
}

.project-cover .tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--text-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 100px;
    letter-spacing: 0.3px;
}

.project-body {
    padding: 24px 26px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-body h3 {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.project-body .date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.project-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.project-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.project-meta span {
    background: var(--bg-secondary);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

/* ===== 项目卡片 - B站按钮 ===== */
.project-body .bili-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 16px;
    background: #fb7299;
    color: #fff !important;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    width: fit-content;
    border: none;
    text-decoration: none;
    cursor: pointer;
}

.project-body .bili-link:hover {
    background: #e85a80;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
}

.project-body .bili-link i {
    font-size: 1rem;
}

/* 项目图标 - 橙色遮罩 */
.icon-orange {
    display: inline-block;
    width: 2.8rem;
    height: 2.8rem;
    background-color: #f97316;
    /* 橙色主题色 */
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    flex-shrink: 0;
    /* 防止被挤压变形 */
}

/* ===== 项目详情 - 模态框 ===== */
.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.project-overlay.active {
    display: flex;
}

.overlay-content {
    background: var(--bg-secondary);
    max-width: 820px;
    width: 100%;
    border-radius: var(--radius);
    padding: 40px 48px;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.close-overlay {
    position: sticky;
    top: 0;
    float: right;
    background: none;
    border: none;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 0 8px;
    z-index: 10;
}

.close-overlay:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.overlay-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.overlay-content .detail-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.overlay-content .detail-body p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.detail-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    margin-bottom: 20px;
}

.detail-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .overlay-content {
        padding: 28px 20px;
        max-height: 95vh;
    }

    .overlay-content h2 {
        font-size: 1.5rem;
    }

    .close-overlay {
        font-size: 1.8rem;
    }
}

/* ===== 科研 ===== */
.research {
    padding: 80px 0;
    background: var(--bg-primary);
}

.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.research-item {
    background: var(--bg-secondary);
    padding: 24px 28px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left-width: 6px;
    transition: var(--transition);
    cursor: pointer;
}

.research-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.research-item .title {
    font-weight: 700;
    font-size: 1.05rem;
}

.research-item .desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

.research-item .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.research-item .meta i {
    color: var(--accent);
    width: 18px;
}

/* ===== 技能 ===== */
.skills {
    padding: 80px 0;
    background: var(--bg-primary);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.skill-tag {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    color: var(--text-secondary);
}

.skill-tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.2);
}

.skill-tag i {
    margin-right: 8px;
    color: var(--accent);
}

.skill-tag:hover i {
    color: #fff;
}

/* ===== 联系 ===== */
.contact {
    padding: 80px 0;
    background: var(--bg-primary);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 48px 52px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.contact-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.contact-item i {
    width: 44px;
    height: 44px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.1rem;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.contact-item:hover i {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.contact-item .label {
    font-weight: 500;
}

.contact-item .value {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.social-links a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
    transform: translateY(-3px);
}

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

.contact-form input,
.contact-form textarea {
    padding: 14px 20px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-primary);
    transition: var(--transition);
    outline: none;
    color: var(--text-primary);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
    background: var(--bg-secondary);
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-form .btn {
    align-self: flex-start;
}

/* ===== Footer ===== */
.footer {
    padding: 36px 0;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer span {
    color: var(--accent);
    font-weight: 600;
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .avatar-wrapper {
        max-width: 280px;
    }

    .badge-1 {
        right: 0;
        top: 2%;
    }

    .badge-2 {
        left: 0;
        bottom: 4%;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

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

    .contact-wrapper {
        grid-template-columns: 1fr;
        padding: 32px 28px;
    }

    .contact-form .btn {
        align-self: stretch;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        gap: 28px;
        padding: 40px;
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.06);
        transition: var(--transition);
        border-left: 1px solid var(--border-light);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

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

    .contact-wrapper {
        padding: 24px 18px;
    }

    .floating-badge {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 0 60px;
    }

    .hero-content h1 {
        font-size: 1.9rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}