/* 全局样式 */
* {
    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-title .type-cursor {
    color: #67e8f9;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    50% { opacity: 0; }
}


@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;
}

/* 项目区桌面端放宽容器：大屏不浪费空间 */
@media (min-width: 1280px) {
    .projects .container {
        max-width: 1440px;
    }
}

/* 论文全宽杂志面板：上部左文右图（.reverse 时交错），证书压轴横贯底部 */
.paper-panel {
    grid-column: 1 / -1;
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.3));
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.pp-main {
    display: grid;
    grid-template-columns: minmax(300px, 5fr) 7fr;
    gap: 2rem;
}

/* 文字栏在图墙旁垂直居中，避免底部空白感 */
.pp-text { align-self: center; }

.paper-panel.reverse .pp-text { order: 2; }
.paper-panel.reverse .pp-mosaic { order: 1; }

.pp-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.pp-venue {
    display: inline-block;
    font-size: 0.85rem;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.4);
    padding: 4px 14px;
    border-radius: 999px;
    margin: 0.7rem 0 1rem;
}

.pp-desc {
    color: var(--text-secondary);
    line-height: 1.95;
    font-size: 0.95rem;
}

.pp-text .project-tags { margin-top: 1rem; }

/* 面板内图墙马赛克：span2 通栏；证书格金色描边凸显 */
.pp-text {
    align-self: start; /* 长图墙时标题置顶，不再垂直居中悬在中间 */
}

.pp-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    align-content: start;
}

.pp-item { margin: 0; }
.pp-item.span2 { grid-column: 1 / -1; }

.pgi-frame {
    background: #0a1222;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.pp-item:hover .pgi-frame {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.22);
}

/* 图框完全顺图自然比例：图片 100% 填满，无黑边无裁切 */
.pgi-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.pp-item figcaption {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: center;
    padding-top: 7px;
    line-height: 1.5;
}

.pp-item.cert .pgi-frame {
    border-color: rgba(234, 179, 8, 0.5);
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.18), 0 8px 24px rgba(234, 179, 8, 0.08);
}

.pp-item.cert:hover .pgi-frame {
    border-color: #fbbf24;
    box-shadow: 0 10px 26px rgba(234, 179, 8, 0.16);
}

.pp-item.cert figcaption { color: #fbbf24; }

/* 压轴证书：横贯面板底部、居中放大，金色凸显 */
.pp-cert {
    margin: 1.8rem auto 0;
    max-width: 960px;
}

@media (max-width: 980px) {
    .pp-main { grid-template-columns: 1fr; padding: 0; gap: 1.3rem; }
    .paper-panel { padding: 1.4rem; }
    .paper-panel.reverse .pp-text { order: 1; }
    .paper-panel.reverse .pp-mosaic { order: 2; }
    .pp-cert { margin-top: 1.3rem; }
}

@media (max-width: 560px) {
    .pp-mosaic { grid-template-columns: 1fr; }
    .pp-item.span2 { grid-column: auto; }
}

/* 项目分组标题（按简历逻辑：论文发表/工作经历/比赛经历） */
.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);
}

/* 研究方向说明块：先讲清楚方向，再展示该方向的论文 */
.direction-intro {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(37, 99, 235, 0.02));
    border-left: 4px solid var(--accent);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    margin: 0.5rem 0 0.25rem;
}

.direction-intro h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.direction-intro p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
    margin: 0;
}

/* ============ 比赛经历 · 旗舰展示面板 ============ */
.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;
    flex-direction: column;
    gap: 0.5rem;
}

.bp-text { width: 100%; }

.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 {
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    min-height: auto;
    padding-bottom: 36px;
}

.bp-cut {
    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-hero {
    margin: 0;
    width: 46%;
    flex-shrink: 0;
    position: relative;
    text-align: center;
    transform: rotate(-2deg);
    animation: bpHeroFloat 7s ease-in-out infinite;
}

@keyframes bpHeroFloat {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    50% { transform: rotate(-3.5deg) translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
    .bp-hero { animation: none; transform: rotate(-2deg); }
}


/* 实习卡片：查看英文版证明按钮（统一样式） */
.project-en-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1.1rem;
    padding: 8px 18px;
    background: rgba(37, 99, 235, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 999px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.project-en-btn:hover {
    background: rgba(37, 99, 235, 0.28);
    border-color: #60a5fa;
    color: #bfdbfe;
}

/* 比赛经历面板：原型机运行视频（标语下方、通栏展示） */
.bp-video {
    margin: 0 0 1.8rem;
}

.bp-video video,
.bp-video .bp-video-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.bp-video .bp-video-cover {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.bp-video .bp-video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bp-video .bp-video-cover:hover img {
    transform: scale(1.03);
}

.bp-video .bp-video-playbtn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.62);
    border: 2px solid rgba(96, 165, 250, 0.75);
    backdrop-filter: blur(4px);
}

.bp-video .bp-video-playbtn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 13px 0 13px 22px;
    border-color: transparent transparent transparent #e2e8f0;
}

.bp-video .bp-video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.bp-video .bp-video-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.bp-video .bp-video-player canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.bp-video .bp-video-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(2, 6, 23, 0.72);
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

.bp-video .bp-video-loading.done {
    opacity: 0;
    pointer-events: none;
}

.bp-video .bp-video-spin {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(96, 165, 250, 0.3);
    border-top-color: #60a5fa;
    animation: bpvideospin 0.9s linear infinite;
}

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

.bp-video .bp-video-ctrls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(2, 6, 23, 0.78));
}

.bp-ctrl-play {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(96, 165, 250, 0.5);
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.25s ease;
}

.bp-ctrl-play:hover {
    background: rgba(37, 99, 235, 0.32);
}

.bp-ctrl-seek {
    flex: 1;
    min-width: 0;
    accent-color: #60a5fa;
    cursor: pointer;
}

.bp-ctrl-time {
    flex-shrink: 0;
    min-width: 92px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.bp-video .bp-video-player video {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    pointer-events: none;
}

.bp-video .bp-video-player canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.bp-video .bp-video-state {
    position: absolute;
    top: 14px;
    right: 14px;
    min-width: 34px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: #e2e8f0;
    font-size: 0.8rem;
    pointer-events: none;
}

.bp-video figcaption {
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    padding-top: 10px;
}

.bp-hero canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    cursor: grab;
    touch-action: pan-y;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.bp-hero canvas:active {
    cursor: grabbing;
}

.bp-360-tip {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(96, 165, 250, 0.55);
    color: #dbeafe;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    pointer-events: none;
    white-space: nowrap;
    animation: bp360tip 2.2s ease-in-out infinite;
}

@keyframes bp360tip {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.bp-hero {
    position: relative;
}
    display: block;
}

/* 透明背景 360° 旋转动画（WebP）：与静态建模图同样打光 */
.bp-hero img,
.bp-hero video {
    /* 打光：左上柔光 + 青色边缘光 */
    filter: drop-shadow(-6px -6px 18px rgba(34, 211, 238, 0.25)) drop-shadow(0 20px 32px rgba(0, 0, 0, 0.5));
}

.bp-hero figcaption {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

/* 实拍照片：白框相框，斜排并微微突破下边框；滚动错峰入场，悬停置顶转正 */
.bp-photo {
    margin: 0;
    background: #f8fafc;
    padding: 6px 6px 5px;
    border-radius: 6px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(48px) rotate(var(--r, 0deg));
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.45s ease, box-shadow 0.3s ease;
    will-change: transform;
}

/* 滚动进入视野后由 IntersectionObserver 错峰添加 .bp-in */
.bp-photo.bp-in {
    opacity: 1;
    transform: rotate(var(--r, 0deg));
}

/* 悬停：置顶 + 转正放大 + 阴影加深 */
.bp-photo.bp-in:hover {
    z-index: 10;
    opacity: 1;
    transform: rotate(0deg) scale(1.06);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

/* 悬停某张时，另一张轻微后退让位（:has 现代浏览器可用，旧浏览器自动降级） */
.bp-photos:has(.bp-photo:hover) .bp-photo.bp-in:not(:hover) {
    transform: rotate(var(--r, 0deg)) scale(0.97);
    filter: brightness(0.92);
}

.bp-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.bp-photo figcaption {
    font-size: 0.72rem;
    color: #334155;
    padding: 4px 2px 2px;
    text-align: center;
}

/* 实拍照片：对角错位排列，仅一角轻微重叠 */
.bp-photos {
    flex: 1;
    position: relative;
    min-height: 460px;
    max-width: 56%;
}

.bp-p1 {
    width: 74%;
    position: absolute;
    top: 0;
    right: 0;
    --r: 2.5deg;
    z-index: 2;
}

.bp-p2 {
    width: 66%;
    position: absolute;
    bottom: -56px;
    left: -4px;
    --r: -4.5deg;
    z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
    .bp-photo {
        opacity: 1;
        transform: rotate(var(--r, 0deg));
        transition: none;
    }
}

/* 佐证证书墙：瀑布流，横版竖版各按原始比例贴合展示 */
.bp-certs { margin-top: 7rem; }

.bp-cert-row {
    column-count: 2;
    column-gap: 1.5rem;
}

.bp-cert {
    margin: 0 0 1.5rem;
    background: #f1f5f9;
    padding: 7px 7px 9px;
    border-radius: 8px;
    cursor: zoom-in;
    transform: rotate(-1.2deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
    position: relative;
    break-inside: avoid;
}

.bp-cert:nth-child(2n) { transform: rotate(1.2deg); }
.bp-cert:hover {
    transform: rotate(0deg) translateY(-10px) scale(1.04);
    z-index: 6;
    box-shadow: 0 24px 44px rgba(34, 211, 238, 0.25);
}

.bp-cert img {
    width: 100%;
    height: auto;
    display: block;
}

.bp-cert figcaption {
    font-size: 0.72rem;
    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);
}

/* 播放器按 16:9 自适应容器宽度，避免黑边/压扁 */
.video-wrapper iframe,
.video-wrapper video {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    border: 0;
}

.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-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 0 0 1.25rem;
}

.lang-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.lang-toggle {
    padding: 0.4rem 1.1rem;
    font-size: 0.85rem;
    background: rgba(34, 211, 238, 0.08);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    background: rgba(34, 211, 238, 0.2);
    transform: translateY(-1px);
}

.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:disabled {
    opacity: 0.6;
    cursor: wait;
}

.form-tip {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.form-tip.ok {
    color: #4ade80;
}

.form-tip.err {
    color: #f87171;
}

.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：图片+说明纵向排列，按钮固定在视口边缘（手机上也不会跑出屏幕） */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 19, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 64px 12px 24px;
}

.lightbox.show {
    display: flex;
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

/* 加载期间锁定占位盒，加载完成立即收缩到图片真实尺寸（不再留空框） */
.lightbox-content.loading {
    min-width: min(88vw, 480px);
    min-height: min(56vh, 340px);
}

.lightbox-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: lbSpin 0.8s linear infinite;
}

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

/* 灯箱大图：等比完整显示；换图期间隐藏旧图避免残影 */
#lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

#lightbox-image.loading {
    opacity: 0;
}

/* 说明文字回到正常文档流，紧跟图片下方，不再绝对定位（消灭空行与重叠） */
.lightbox-caption {
    flex: 0 0 auto;
    margin-top: 12px;
    max-width: 92vw;
    text-align: center;
    color: #fff;
    font-size: clamp(0.85rem, 2.5vw, 1.05rem);
    line-height: 1.6;
}

.lightbox-counter {
    flex: 0 0 auto;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* 控制按钮固定在视口边缘 */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    z-index: 2001;
    color: white;
    font-size: 1.6rem;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close {
    top: 14px;
    right: 14px;
}

.lightbox-prev {
    left: 12px;
    top: 50%;
    margin-top: -24px;
}

.lightbox-next {
    right: 12px;
    top: 50%;
    margin-top: -24px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(96, 165, 250, 0.85);
}

/* 动画 */
@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-layout > * {
        min-width: 0;
    }



    .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: 6rem; }
    .bp-cert-row { column-count: 1; }
    .bp-cert { margin: 0 0 1.2rem !important; }
    .bp-stage { gap: 0.8rem; padding-bottom: 20px; }
    .bp-hero { width: 64%; }
    .bp-photos { min-height: 220px; max-width: none; }
    .bp-p1 { width: 72%; right: 0; }
    .bp-p2 { width: 64%; left: 0; bottom: -36px; }

    .category-btn {
        white-space: nowrap;
        min-width: 120px;
    }

    .lightbox {
        padding: 60px 8px 18px;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .lightbox-prev {
        margin-top: -20px;
    }

    .lightbox-next {
        margin-top: -20px;
    }

    #lightbox-image {
        max-height: calc(100vh - 190px);
    }
}

@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;
    }
}

/* 视频浏览器兼容性小标注 */
.bp-video-note {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    padding-top: 6px;
    opacity: 0.85;
}