:root {
    --e-yellow: #fad105;     /* 终末地标志性工业黄 */
    --e-black: #0c0d10;      /* 深灰黑背景 */
    --e-dark: #181a1f;       /* 次级深色 */
    --e-white: #e0e2e6;      /* 文字白 */
    --e-gray: #666a73;       /* 辅助灰 */
    --e-border: rgba(250, 209, 5, 0.4);
    --e-grid: rgba(255, 255, 255, 0.03);
    --e-ease-snap: cubic-bezier(0.85, 0, 0.15, 1);
    --e-ease-out: cubic-bezier(0.1, 0.8, 0.2, 1);
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.15),
        rgba(0,0,0,0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
}

@keyframes glitch-title {
    0% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 2px); }
    10% { clip-path: inset(40% 0 10% 0); transform: translate(2px, -2px); }
    20% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, 0); }
    30% { clip-path: inset(5% 0 60% 0); transform: translate(0, 2px); }
    40% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
    100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

@keyframes slide-in-right {
    0% { opacity: 0; transform: translateX(50px); clip-path: inset(0 100% 0 0); }
    100% { opacity: 1; transform: translateX(0); clip-path: inset(0 0 0 0); }
}

@keyframes slide-in-left {
    0% { opacity: 0; transform: translateX(-50px); clip-path: inset(0 0 0 100%); }
    100% { opacity: 1; transform: translateX(0); clip-path: inset(0 0 0 0); }
}

@keyframes terminal-wipe {
    0% { opacity: 0; clip-path: inset(0 100% 0 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes bg-pan {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--e-black);
    color: var(--e-white);
    font-family: 'Rajdhani', 'Noto Sans SC', sans-serif; /* 工业感字体组合 */
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 侧边栏底部装饰性文字HUD */
.side-hud {
    margin-top: auto;
    padding-left: 28px;
    padding-bottom: 20px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 700;
    color: var(--e-yellow);
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.side-nav:hover .side-hud {
    opacity: 1;
    transform: translateX(0);
}

/* 右下角HUD */
.hud-bottom-right {
    position: fixed;
    bottom: 15px;
    right: 20px;
    font-size: 12px;
    color: var(--e-gray);
    z-index: 900;
    letter-spacing: 2px;
    pointer-events: none;
}
.blink {
    animation: blinker 1s linear infinite;
}
@keyframes blinker { 50% { opacity: 0; } }

/* 侧边栏导航 (终末地样式) */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px; /* 初始收缩状态宽 */
    height: 100vh;
    background: rgba(12, 13, 16, 0.85);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 30px 0; /* 减小上方留白让其更贴顶 */
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
    overflow: hidden;
}

.side-nav:hover {
    width: 280px; /* 悬浮展开宽度 */
}

.nav-logo {
    display: flex;
    align-items: center;
    padding: 0 0 0 28px;
    margin-bottom: 40px; /* 缩短 Logo 与下方菜单的间距 */
    width: 280px;
}

.logo-icon {
    display: inline-block;
    min-width: 24px;
    height: 24px;
    background: var(--e-yellow);
    margin-right: 20px;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--e-white);
    letter-spacing: 3px;
    line-height: 1; /* 收紧行高，防止文本框撑大 */
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.side-nav:hover .logo-text {
    opacity: 1;
}

.nav-menu {
    flex: 1;
    position: relative;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 20px 0 20px 28px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    color: var(--e-gray);
    width: 280px;
}

.nav-item.active, .nav-item:hover {
    color: var(--e-white);
    background: linear-gradient(90deg, rgba(250,209,5,0.1) 0%, transparent 100%);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    margin-right: 20px;
    transition: color 0.3s;
}

.nav-item.active .nav-icon, .nav-item:hover .nav-icon {
    color: var(--e-yellow);
}

.nav-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
}

.side-nav:hover .nav-text {
    opacity: 1;
    transform: translateX(0);
}

/* 侧边栏动态指示器 (指示当前激活项) */
.nav-active-indicator {
    position: absolute;
    left: 0;
    width: 4px;
    height: 64px; /* 匹配项的高度 */
    background: var(--e-yellow);
    transition: transform 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
    top: 0;
}

/* 主内容区偏移 */
.main-content {
    margin-left: 80px; /* 适应收缩状态 */
    position: relative;
    min-height: 100vh;
}

/* 首屏区域 */
.section-hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    padding-left: 10vw;
    background: radial-gradient(circle at 70% 50%, rgba(250, 209, 5, 0.05) 0%, transparent 50%);
}

.hero-bg-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(var(--e-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--e-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    opacity: 0.5;
    animation: bg-pan 20s linear infinite;
}

.hero-layout {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 10vw;
}

.hero-content {
    max-width: 800px;
    position: relative;
}

.hero-content::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--e-yellow);
}

.sys-warning {
    color: var(--e-yellow);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    opacity: 0;
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.1s forwards;
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--e-white);
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px rgba(250, 209, 5, 0.5);
    position: relative;
    animation: slide-in-left 0.8s var(--e-ease-snap) forwards;
}
/* 标题左侧的一点切角修饰 */
.hero-title::before {
    content: '';
    position: absolute;
    top: -10px; left: 0;
    width: 30px; height: 3px;
    background: var(--e-white);
}
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    color: var(--e-yellow);
    text-shadow: -2px -2px 0px rgba(255, 0, 0, 0.5);
    animation: glitch-title 2s infinite;
    opacity: 0.8;
    z-index: -1;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--e-gray);
    margin-bottom: 40px;
    font-family: inherit;
    font-weight: 500;
    opacity: 0;
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.3s forwards;
}

.hero-desc {
    font-family: Consolas, 'Courier New', monospace; /* 彻底换回等宽代码字体，解决个别字体吞空格问题 */
    color: var(--e-gray);
    margin-bottom: 50px;
    border-left: 2px dashed rgba(255,255,255,0.2);
    padding-left: 15px;
    font-size: 1rem;
    line-height: 1.8;
    opacity: 0;
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.5s forwards;
}

.hero-desc p {
    white-space: pre-wrap; /* 强制保留并渲染所有空格 */
    margin-bottom: 5px;
}

.btn-scroll {
    color: var(--e-yellow);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--e-yellow);
    padding: 10px 20px;
    transition: all 0.3s;
}
.btn-scroll:hover {
    background: var(--e-yellow);
    color: var(--e-black);
}
.btn-scroll .arrow {
    margin-left: 10px;
    animation: moveDown 1.5s infinite;
}
@keyframes moveDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* 首页个人信息面板 (类似图2) */
.hero-profile-container {
    flex-shrink: 0;
    opacity: 0;
    animation: slide-in-right 0.8s var(--e-ease-snap) 0.5s forwards;
}

.profile-card {
    background: transparent;
    padding: 0;
    width: 600px;
}

.profile-top {
    display: flex;
    align-items: center;
    margin-bottom: 50px; /* 增大头像栏下面和数据栏的间距 */
}

.profile-avatar-wrap {
    width: 140px;
    height: 140px;
    margin-right: 40px; /* 增大头像和文本的间距 */
    border: 2px solid var(--e-yellow);
    padding: 6px;
    background: transparent;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid #5a8bd5; /* 蓝紫色内边框 */
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--e-white); /* 白色更有主标题的感觉 */
    letter-spacing: 2px;
    margin-bottom: 20px;
    line-height: 1;
}

.profile-uid {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--e-gray); /* 配合次级信息的辅助色 */
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.profile-uid::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--e-yellow);
    margin-right: 12px;
    transform: rotate(45deg); /* 加个终末地菱形修饰 */
}

.profile-stats-row {
    display: flex;
    justify-content: space-between;
    padding-left: 0;
    padding-right: 40px;
}

.p-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* 缩小数字和标题之间的间距更紧凑 */
}

.p-stat-label {
    font-size: 1.1rem;
    color: var(--e-gray); /* 灰色或者白色，避免全屏黄 */
    font-weight: 700;
    font-family: 'Noto Sans SC', sans-serif;
    letter-spacing: 2px;
}

.p-stat-value {
    font-size: 1.5rem; /* 让数字看起来大一些更具有数据感 */
    color: var(--e-yellow);
    font-weight: 700;
    letter-spacing: 2px;
    font-family: 'Rajdhani', sans-serif;
}

/* 栏目通用 */
section {
    padding: 120px 40px;
    position: relative;
}
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
.section-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--e-yellow);
    margin: 0 30px;
    letter-spacing: 2px;
}
.header-line {
    flex: 1;
    height: 1px;
    background: var(--e-border);
    position: relative;
}
.header-line::after {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    background: var(--e-yellow);
    top: -2.5px;
}
.header-line:first-child::after { right: 0; }
.header-line:last-child::after { left: 0; }

/* 状态面板 (数据区) */
.section-stats {
    background: #0f1013;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.stat-card {
    background: var(--e-dark);
    padding: 2px; /* 边框 */
    position: relative;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--e-yellow) 0%, transparent 20%);
    opacity: 0.2;
}

.stat-card-inner {
    background: var(--e-dark);
    padding: 40px 30px;
    height: 100%;
    clip-path: polygon(0 0, calc(100% - 19px) 0, 100% 19px, 100% 100%, 19px 100%, 0 calc(100% - 19px));
}
.stat-label {
    font-size: 12px;
    color: var(--e-gray);
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 700;
}
.stat-value {
    font-size: 4rem;
    font-weight: 900;
    color: var(--e-white);
    line-height: 1;
    margin-bottom: 20px;
    font-family: 'Rajdhani', sans-serif;
}
.stat-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    position: relative;
}
.stat-bar .fill {
    height: 100%;
    background: var(--e-yellow);
    width: 0; /* JS动画使用 */
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* 影像资料 (Video Gallery) */
.section-gallery {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--e-black);
    color: var(--e-white);
}

.gallery-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.5);
    transition: background-image 0.5s var(--e-ease-snap);
}

.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.8) 100%),
                linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 40%);
    z-index: 1;
}

/* 左上角标题 */
.gallery-header {
    position: absolute;
    top: 60px;
    left: 80px;
    z-index: 10;
}
.gallery-header-en {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.header-icon {
    display: inline-block;
    border: 1px solid var(--e-white);
    padding: 0 4px;
    margin-right: 10px;
    font-size: 0.8rem;
}
.gallery-header-cn {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    font-family: 'Noto Sans SC', sans-serif;
}

/* 左下角信息面板 */
.gallery-info {
    position: absolute;
    bottom: 80px;
    left: 80px;
    z-index: 10;
    max-width: 600px;
}
.gallery-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.g-tag {
    background: rgba(255, 255, 255, 0.15);
    color: var(--e-white);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}
.g-date {
    color: var(--e-yellow);
    font-weight: 900;
    font-size: 14px;
    font-family: 'Rajdhani', sans-serif;
}
.g-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-family: 'Noto Sans SC', sans-serif;
}
.g-actions {
    display: flex;
    align-items: stretch;
    height: 44px;
}
.g-btn-play {
    background: var(--e-yellow);
    border: none;
    width: 60px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}
.g-btn-play:hover {
    background: var(--e-white);
}
.play-icon {
    color: var(--e-black);
    font-size: 1.2rem;
}
.g-btn-more {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-left: 2px solid var(--e-yellow);
    color: var(--e-white);
    padding: 0 30px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.3s;
}
.g-btn-more:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 右下角轮播区域 */
.gallery-carousel-wrapper {
    position: absolute;
    bottom: 60px;
    right: 60px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 20px;
}
.carousel-nav {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--e-white);
    color: var(--e-black);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: 900;
    transition: all 0.3s;
}
.carousel-nav:hover {
    background: var(--e-yellow);
    transform: scale(1.1);
}
.gallery-carousel {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}
.g-card {
    position: relative;
    cursor: pointer;
    transition: all 0.4s var(--e-ease-snap);
    opacity: 0.6;
    transform: scale(0.9);
    transform-origin: bottom center;
}
.g-card:hover {
    opacity: 0.8;
}
.g-card.active {
    opacity: 1;
    transform: scale(1);
    border-bottom: 4px solid var(--e-yellow);
}
.g-card img {
    width: 240px;
    height: 135px;
    object-fit: cover;
    display: block;
}
.g-card.active img {
    width: 280px;
    height: 158px;
}
.g-card-meta {
    position: absolute;
    bottom: 10px; right: 10px;
    font-size: 10px;
    font-weight: 900;
    color: var(--e-yellow);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.g-card-idx {
    color: var(--e-white);
    margin-right: 5px;
}

/* 资源发布区 (暗黑工业风) */
.section-resources {
    background-color: var(--e-black);
    color: var(--e-white);
    position: relative;
    overflow: hidden;
    padding: 80px 60px 80px 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    width: 100%;
}

/* 巨型水印文字 */
.res-watermark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    font-size: 22vw;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.04);
    z-index: 0;
    pointer-events: none;
    letter-spacing: -3px;
    white-space: nowrap;
    opacity: 0.8;
}

/* 终端代码滚动特效区 */
.res-code-terminal {
    position: absolute;
    left: 250px;
    bottom: 120px;
    width: 600px;
    height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 0;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}
.res-code-line {
    animation: code-fade-in 0.3s ease-out forwards;
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
}
@keyframes code-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.res-layout {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 1;
    gap: 40px;
}

/* 左侧文字分类导航 */
.res-sidebar {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 30px;
}

.res-nav-btn {
    position: relative;
    cursor: pointer;
}

.res-nav-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--e-gray);
    letter-spacing: 2px;
    transition: all 0.3s;
    font-family: 'Noto Sans SC', sans-serif;
    white-space: nowrap;
    position: relative;
    display: inline-block;
}

.res-nav-text::before,
.res-nav-text::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s var(--e-ease-snap);
    color: var(--e-yellow);
}
.res-nav-text::before {
    content: '[';
    left: 0px;
}
.res-nav-text::after {
    content: ']';
    right: 0px;
}

.res-nav-btn.active .res-nav-text,
.res-nav-btn:hover .res-nav-text {
    color: var(--e-yellow);
    text-shadow: 0 0 10px rgba(250, 209, 5, 0.3);
    letter-spacing: 4px;
    padding: 0 12px;
}

.res-nav-btn.active .res-nav-text::before,
.res-nav-btn:hover .res-nav-text::before {
    opacity: 1;
    left: 0;
}
.res-nav-btn.active .res-nav-text::after,
.res-nav-btn:hover .res-nav-text::after {
    opacity: 1;
    right: -4px;
}

/* 右侧主内容区 */
.res-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* 防止flex子元素溢出 */
}

/* 顶部小标 */
.res-top-badge {
    font-size: 13px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    color: var(--e-gray);
    margin-bottom: 30px;
}
.res-top-badge .badge-plus {
    border: 1px solid var(--e-gray);
    padding: 0 4px;
    margin: 0 10px;
}
.res-top-badge .badge-text {
    font-size: 9px;
    line-height: 1;
    color: var(--e-gray);
}

.res-main-showcase {
    display: flex;
    flex: 1;
    position: relative;
}

/* 单个资源面板，默认隐藏 */
.res-panel {
    display: none;
    width: 100%;
    align-items: stretch;
    gap: 40px;
    min-height: 75vh;
    position: relative;
}
.res-panel.active {
    display: flex;
}
.section-resources.in-view .res-panel.active {
    animation: slide-in-glitch 0.5s var(--e-ease-snap) forwards;
}

@keyframes slide-in-glitch {
    0% { opacity: 0; transform: translateX(20px); clip-path: inset(0 100% 0 0); }
    100% { opacity: 1; transform: translateX(0); clip-path: inset(0 0 0 0); }
}

/* Staggered load for panel contents */
.section-resources.in-view .res-panel.active .res-title-wrapper,
.section-resources.in-view .res-panel.active .res-tags-grid,
.section-resources.in-view .res-panel.active .res-description,
.section-resources.in-view .res-panel.active .btn-download {
    opacity: 0;
}

.section-resources.in-view .res-panel.active .res-title-wrapper {
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.1s forwards;
}
.section-resources.in-view .res-panel.active .res-tags-grid {
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.2s forwards;
}
.section-resources.in-view .res-panel.active .res-description {
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.3s forwards;
}
.section-resources.in-view .res-panel.active .btn-download {
    animation: terminal-wipe 0.4s var(--e-ease-snap) 0.4s forwards;
}
.section-resources.in-view .res-panel.active .res-image-wrapper {
    animation: slide-in-right 0.6s var(--e-ease-snap) 0.2s forwards;
    opacity: 0;
}

/* 左侧信息块 */
.res-info-block {
    position: relative;
    flex: 0 0 42%;
    z-index: 10;
    min-width: 320px;
    pointer-events: auto;
}

.res-title-wrapper {
    display: flex;
    align-items: center;
    border-bottom: 4px solid var(--e-yellow);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.res-title-icon {
    font-size: 2rem;
    margin-right: 12px;
    color: var(--e-yellow);
}

.res-title {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 3px;
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--e-white);
}

/* 属性标签矩阵 */
.res-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 20px;
}

.res-tag-group {
    display: flex;
    width: calc(50% - 8px);
    font-size: 12px;
    font-weight: 700;
    outline: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-label {
    padding: 7px 12px;
    color: #fff;
    min-width: 65px;
    text-align: center;
    font-family: 'Noto Sans SC', sans-serif;
}
.tag-label.dark { background: var(--e-dark); color: var(--e-white); }
.tag-label.yellow { background: var(--e-yellow); color: var(--e-black); }

.tag-value {
    padding: 7px 12px;
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    color: var(--e-white);
}

/* 详情文字 */
.res-description {
    font-size: 13px;
    color: var(--e-gray);
    line-height: 1.8;
    margin-bottom: 25px;
    padding-left: 18px;
    border-left: 3px solid rgba(255, 255, 255, 0.12);
    font-weight: 500;
}

.btn-download {
    background: var(--e-yellow);
    color: var(--e-black);
    padding: 12px 32px;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 2px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rajdhani', 'Noto Sans SC', sans-serif;
    display: inline-block;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    position: relative;
    overflow: hidden;
}
.btn-download::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: rgba(255, 255, 255, 0.4);
    transform: skewX(-45deg);
    transition: left 0.5s var(--e-ease-snap);
}
.btn-download:hover {
    background: var(--e-white);
    color: var(--e-black);
}
.btn-download:hover::before {
    left: 150%;
}

/* 右侧大图 — 占据右半屏 */
.res-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 强制 GPU 硬件加速，防止动画结束时掉层导致画面突变 */
    transform: translateZ(0);
    will-change: transform, opacity;
}
.res-feature-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    filter: drop-shadow(-15px 15px 25px rgba(0, 0, 0, 0.5));
}
.res-pointcloud-canvas {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 移除 drop-shadow 滤镜，它会导致 WebGL 在动画期间和结束后的 GPU 混合模式发生突变，且极大消耗性能 */
    opacity: 0.9;
    cursor: grab;
    pointer-events: auto;
    /* 强制开启硬件加速，保持渲染层叠上下文一致 */
    transform: translateZ(0);
    will-change: transform;
}
.res-pointcloud-canvas:active {
    cursor: grabbing;
}
.res-pointcloud-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* ==========================================================================
   MD 教程档案区 (Archives)
   ========================================================================== */
.section-archives {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 60px 80px 20px;
    background: #08080a;
}

.archive-layout {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 1;
    gap: 40px;
    height: 90vh;
}

/* 左侧文字分类导航 (参考 res-sidebar) */
.archive-sidebar {
    width: max-content;
    min-width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 30px;
}

.sidebar-header {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--e-gray);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 2px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.chapter-item {
    font-size: 15px;
    font-weight: 700;
    color: var(--e-gray);
    letter-spacing: 1px;
    transition: all 0.3s;
    font-family: 'Noto Sans SC', sans-serif;
    white-space: nowrap;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.chapter-item::before,
.chapter-item::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s var(--e-ease-snap);
    color: var(--e-yellow);
}
.chapter-item::before {
    content: '[';
    left: -10px;
}
.chapter-item::after {
    content: ']';
    right: -10px;
}

.chapter-item.active,
.chapter-item:hover {
    color: var(--e-yellow);
    text-shadow: 0 0 10px rgba(250, 209, 5, 0.3);
}

.chapter-item.active::before,
.chapter-item:hover::before {
    opacity: 1;
    left: -15px;
}
.chapter-item.active::after,
.chapter-item:hover::after {
    opacity: 1;
    right: -15px;
}

/* 右侧内容区 */
.archive-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-right: 5vw;
    overflow-y: auto;
    height: 100%;
}

/* 自定义滚动条 */
.archive-content-wrapper::-webkit-scrollbar {
    width: 8px;
}
.archive-content-wrapper::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}
.archive-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.archive-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--e-yellow);
}

.markdown-body {
    color: #d0d0d0;
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.8;
    font-size: 1.05rem;
}

.loading-text {
    color: var(--e-yellow);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-align: center;
    margin-top: 50px;
    animation: pulse 1.5s infinite;
}

/* Markdown 具体标签样式 */
.markdown-body > *:first-child {
    margin-top: 0;
}

.markdown-body h1, 
.markdown-body h2, 
.markdown-body h3, 
.markdown-body h4 {
    color: var(--e-white);
    font-family: 'Rajdhani', 'Noto Sans SC', sans-serif;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    font-weight: 700;
}

.markdown-body h1 {
    font-size: 2.5rem;
    color: var(--e-yellow);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(250, 209, 5, 0.3);
    padding-bottom: 10px;
}

.markdown-body h2 {
    font-size: 1.8rem;
    border-left: 4px solid var(--e-yellow);
    padding-left: 15px;
    background: linear-gradient(90deg, rgba(250, 209, 5, 0.1) 0%, transparent 100%);
    padding-top: 5px;
    padding-bottom: 5px;
}

.markdown-body h3 {
    font-size: 1.4rem;
    color: #fff;
}

.markdown-body p {
    margin-bottom: 1.2em;
}

.markdown-body a {
    color: var(--e-yellow);
    text-decoration: none;
    border-bottom: 1px dashed var(--e-yellow);
    transition: all 0.2s ease;
}

.markdown-body a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.markdown-body ul, 
.markdown-body ol {
    margin-bottom: 1.2em;
    padding-left: 20px;
}

.markdown-body li {
    margin-bottom: 0.5em;
}

.markdown-body ul li::marker {
    color: var(--e-yellow);
    content: '▶ ';
    font-size: 0.8em;
}

.markdown-body blockquote {
    margin: 1.5em 0;
    padding: 15px 20px;
    background: rgba(250, 209, 5, 0.05);
    border-left: 4px solid var(--e-yellow);
    color: #b0b0b0;
    font-style: normal;
}

.markdown-body code {
    font-family: 'Consolas', 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
    color: #a3d9a5;
    font-size: 0.9em;
    border: 1px solid rgba(255,255,255,0.1);
}

.markdown-body pre {
    background: #050505;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.5em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: #e0e0e0;
    border: none;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 4px;
    margin: 1.5em 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.markdown-body th, 
.markdown-body td {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.markdown-body th {
    background: rgba(250, 209, 5, 0.1);
    font-weight: 700;
    color: var(--e-yellow);
}

/* 页脚 */
.footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    text-align: center;
    background: #08080a;
}
.footer-logo {
    color: var(--e-yellow);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 10px;
}
.footer p {
    color: var(--e-gray);
    font-size: 12px;
    letter-spacing: 1px;
}

/* ==========================================================================
   响应式移动端适配 (Mobile Responsive)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* 隐藏部分装饰元素 */
    .hud-bottom-right { display: none; }
    
    /* 全局主内容区域取消左侧 margin，给底部导航留出空间 */
    .main-content {
        margin-left: 0;
        padding-bottom: 60px; /* 底部导航栏的高度 */
    }

    /* 侧边导航栏 -> 变成底部 Tab 导航 */
    .side-nav {
        top: auto;
        bottom: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0;
        justify-content: space-around;
        background: rgba(10, 10, 12, 0.95);
        z-index: 1000;
    }
    .nav-logo { display: none; }
    .nav-menu {
        flex-direction: row;
        width: 100%;
        margin-top: 0;
        justify-content: space-around;
        align-items: center;
    }
    .nav-item {
        margin: 0;
        padding: 5px;
        flex-direction: column;
        gap: 2px;
        justify-content: center;
        align-items: center;
        width: auto;
    }
    .nav-icon {
        width: 24px; height: 24px; margin-right: 0;
    }
    .nav-icon svg {
        width: 20px; height: 20px;
    }
    .nav-text {
        opacity: 1;
        transform: translateX(0);
        font-size: 10px;
        letter-spacing: 0;
    }
    .nav-active-indicator {
        width: 40px;
        height: 3px;
        bottom: 0;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        transition: left 0.4s;
    }

    /* 首屏区域 */
    .section-hero {
        padding-left: 5vw;
        padding-right: 5vw;
    }
    .hero-content {
        left: 5vw;
        right: 5vw;
    }
    .hero-title-main { font-size: 3.5rem; }
    .hero-title-sub { font-size: 1.5rem; }
    .hero-stats {
        position: relative;
        right: auto;
        bottom: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
        margin-top: 40px;
    }

    /* 资源发布区 */
    .section-resources {
        padding: 40px 20px;
        height: auto;
        min-height: calc(100vh - 60px);
    }
    .res-layout {
        flex-direction: column;
        gap: 20px;
    }
    .res-sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-right: 0;
        padding-bottom: 10px;
        align-items: center;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 15px;
    }
    .res-nav-btn {
        white-space: nowrap;
    }
    .res-info-block {
        flex: 1;
    }
    .res-panel {
        flex-direction: column;
    }
    /* 移动端隐藏 3D 模型 */
    .res-image-wrapper {
        display: none !important;
    }

    /* 影像资料区 */
    .section-gallery {
        padding: 20px;
        height: calc(100vh - 60px);
    }
    .gallery-info {
        position: relative;
        left: auto;
        bottom: auto;
        margin-top: 80px;
        margin-bottom: 30px;
        max-width: 100%;
    }
    .g-title { font-size: 1.5rem; }
    .gallery-carousel-wrapper {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
    }
    .gallery-carousel {
        width: 100%;
    }

    /* MD 档案区 */
    .section-archives {
        padding: 40px 20px;
        height: auto;
        min-height: calc(100vh - 60px);
    }
    .archive-layout {
        flex-direction: column;
        height: auto;
        gap: 20px;
    }
    .archive-sidebar {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-right: 0;
        padding-bottom: 10px;
        align-items: center;
        overflow-x: auto;
    }
    .sidebar-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        margin-right: 20px;
    }
    .chapter-list {
        flex-direction: row;
        width: max-content;
        gap: 15px;
        align-items: center;
    }
    .archive-content-wrapper {
        padding-right: 0;
        height: auto;
        min-height: 60vh;
    }
}