/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #121212;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar-menu a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-menu a:hover {
    color: var(--accent);
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.navbar-menu a:hover::after {
    width: 100%;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* 首页横幅 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    text-align: center;
    padding-top: 70px;
    position: relative;
    overflow: hidden;
}

/* 科技感粒子网络背景 */
#hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

/* 打字机效果 */
.hero-typing {
    min-height: 1.8em;
}

.type-cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
    font-weight: bold;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--accent), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s both;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 关于我 */
.about {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.avatar {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 3px solid var(--accent);
    box-shadow: var(--shadow-hover);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--accent);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

/* 项目展示 */
.projects {
    padding: 80px 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.project-image {
    width: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 3rem;
}

/* 图片按原始比例完整显示：横版矮、竖版高，不裁切不压字 */
.project-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 项目分组标题（按简历逻辑：论文发表/工作经历/比赛经历） */
.project-group-title {
    grid-column: 1 / -1;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.25rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--accent);
}

/* ============ 比赛经历 · 旗舰展示面板 ============ */
.biped-showcase {
    grid-column: 1 / -1;
    position: relative;
    background:
        radial-gradient(ellipse at 85% -10%, rgba(6, 182, 212, 0.12), transparent 55%),
        linear-gradient(135deg, #0c1424 0%, #14213c 55%, #0c1424 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 18px;
    padding: 2.2rem 2.4rem 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.bp-kicker {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.25em;
    color: #22d3ee;
    border: 1px solid rgba(34, 211, 238, 0.45);
    padding: 0.28rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.1rem;
}

.bp-title {
    font-size: 1.7rem;
    margin-bottom: 0.4rem;
    background: linear-gradient(45deg, #e2e8f0, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bp-tagline {
    color: var(--text-secondary);
    margin-bottom: 1.6rem;
    font-size: 0.95rem;
}

.bp-body {
    display: flex;
    gap: 2.2rem;
    align-items: flex-start;
}

.bp-text { flex: 1.05; }

.bp-text p {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 1.2rem;
}

.bp-text b { color: var(--text-primary); }

.bp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bp-chips span {
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #bfdbfe;
}

/* 机器人抠图舞台：透明底、放大突破框架 */
.bp-stage {
    flex: 1;
    position: relative;
    min-height: 480px;
}

.bp-cut {
    position: absolute;
    margin: 0;
    text-align: center;
}

.bp-cut img {
    width: 100%;
    filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.55));
}

.bp-cut figcaption {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.bp-r1 { width: 32%; left: 2%; top: 0; transform: rotate(-5deg); }
.bp-r2 { width: 29%; left: 42%; top: 12%; transform: rotate(4deg); }
.bp-real { width: 56%; right: -7%; top: 26%; transform: rotate(3deg); z-index: 3; }
.bp-real-b { width: 46%; left: -6%; top: 60%; transform: rotate(-6deg); z-index: 2; }

.bp-real img,
.bp-real-b img { filter: drop-shadow(0 26px 40px rgba(34, 211, 238, 0.28)); }

/* 佐证证书墙 */
.bp-certs { margin-top: 9.5rem; }

.bp-certs-label {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: #22d3ee;
    margin-bottom: 1.4rem;
    display: block;
}

.bp-cert-row {
    display: flex;
    align-items: flex-start;
    padding-left: 0.5rem;
}

.bp-cert {
    margin: 0;
    width: 24%;
    background: #f1f5f9;
    padding: 6px 6px 8px;
    border-radius: 8px;
    cursor: zoom-in;
    transform: rotate(-3.5deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
    position: relative;
}

.bp-cert:nth-child(2n) { transform: rotate(2.5deg); }
.bp-cert + .bp-cert { margin-left: -1.4rem; }
.bp-cert:hover {
    transform: rotate(0deg) translateY(-12px) scale(1.07);
    z-index: 6;
    box-shadow: 0 24px 44px rgba(34, 211, 238, 0.25);
}

.bp-cert img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.bp-cert figcaption {
    font-size: 0.68rem;
    line-height: 1.45;
    color: #1e293b;
    padding-top: 5px;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tag {
    padding: 0.3rem 0.8rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 15px;
    font-size: 0.8rem;
}

.project-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-hover);
}

/* 视频动态 */
.videos {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.videos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.video-wrapper {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-wrapper iframe {
    width: 100%;
    height: 250px;
}

.video-content {
    padding: 1.5rem;
}

.video-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.video-description {
    color: var(--text-secondary);
}

/* 荣誉证书 */
.certifications {
    padding: 80px 0;
}

.certifications-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    min-height: 500px;
}

.certifications-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.certifications-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-btn {
    padding: 0.8rem 1rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-btn:hover {
    background: var(--bg-tertiary);
}

.category-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.certifications-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* 证书区：瀑布流布局，竖版证书占高卡片、横版占矮卡片，缩略图尽量大且可读 */
.certifications-grid {
    column-count: 2;
    column-gap: 1.5rem;
}

.certificate-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.certificate-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.certificate-image {
    width: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 2rem;
}

/* 证书缩略图按原始比例放大显示，保证可读性 */
.certificate-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 隐蔽的中英文切换按钮（仅实习证明分类出现） */
.lang-toggle {
    display: block;
    margin: 0 0 1.25rem auto;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.certificate-name {
    padding: 1rem;
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
}

/* 联系方式 */
.contact {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.contact-info a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-hover);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 表单本体：竖向排列、等宽、不再乱挤 */
.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-primary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form button {
    padding: 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background: var(--accent-hover);
}

/* 页脚 */
.footer {
    padding: 2rem 0;
    background: var(--bg-secondary);
    text-align: center;
    color: var(--text-secondary);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.show {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: white;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    top: -60px;
    right: 0;
}

.lightbox-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 灯箱大图：HTML中是 id，必须用 # 选择器才能约束尺寸（等比完整显示） */
#lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1.1rem;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(15, 23, 42, 0.95);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 2rem;
        transition: left 0.3s ease;
    }

    .navbar-menu.active {
        left: 0;
    }

    .navbar-toggle {
        display: flex;
        z-index: 1001;
    }

    .navbar-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .navbar-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .certifications-layout {
        grid-template-columns: 1fr;
    }

    .certifications-sidebar {
        order: 2;
    }

    .certifications-content {
        order: 1;
    }

    .certifications-categories {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .certifications-grid {
        column-count: 1;
    }

    /* 旗舰展示面板：移动端降级 */
    .biped-showcase { padding: 1.6rem 1.2rem; }
    .bp-title { font-size: 1.3rem; }
    .bp-body { flex-direction: column; }
    .bp-stage { width: 100%; min-height: 380px; }
    .bp-real { width: 62%; right: -2%; }
    .bp-real-b { width: 48%; left: -2%; }
    .bp-certs { margin-top: 6.5rem; }
    .bp-cert-row { flex-wrap: wrap; gap: 1.2rem; }
    .bp-cert { width: 46%; margin: 0 !important; }

    .category-btn {
        white-space: nowrap;
        min-width: 120px;
    }

    .lightbox-close {
        top: -40px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: -50px;
    }

    .lightbox-next {
        right: -50px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    .projects-grid,
    .videos-container {
        grid-template-columns: 1fr;
    }
}