/* NASA Industrial Punk — 洁净工业质感 × 现代极简 NASA 朋克
   1. 主基底 = 阳极氧化铝面板灰 (#EBEBEB)
   2. 核心点缀 = 国际橘 (#FF3C00) + 航空蓝 (#0032A0)
   3. 几何：直角/极小圆角，无悬浮阴影，卡片镶嵌在面板中
   4. 字体：标题 Helvetica/Inter 粗体加宽字间距，正文/数据 IBM Plex Mono 等宽
   5. 工程坐标纸网格 + CRT 扫描线 + Canvas 神经元星座粒子
   6. 机械展开交互 + 仪表盘式数据读取
*/
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --bg: #EBEBEB;
    --bg-alt: #E2E2E2;
    --panel: #F0F0F0;
    --panel-alt: #E8E8E8;
    --panel-deep: #DEDEDE;
    --grid-line: #D0D0D0;
    --divider: #B8B8B8;
    --divider-bold: #999;
    --divider-soft: rgba(160, 160, 160, .45);
    --divider-strong: rgba(120, 120, 120, .65);
    --text: #1A1A1A;
    --text-dim: #4A4A4A;
    --text-faint: #777;
    --orange: #FF3C00;
    --blue: #0032A0;
    --accent: #1A1A1A;
    --accent-warm: #FF3C00;
    --accent-red: #FF3C00;
    --accent-cyan: #0032A0;
    --accent-nasa: #0032A0;
    --accent-yellow: #FFC843;
    --code: #1A1A1A;
    --focus-ring: #0032A0;
    --radius: 2px;
    --panel-blur: 6px;
    --card-blur: 4px;
    --noise-opacity: .026;
    --trans: 120ms cubic-bezier(.4, .2, .2, 1);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    color-scheme: light;
}

@media (min-resolution: 2dppx), (min-width: 1600px) {
    :root {
        --panel-blur: 4px;
        --card-blur: 2px;
        --noise-opacity: .016;
    }
}

/* ====== 全局排版 ====== */
html, body {
    margin: 0;
    color: var(--text);
    font-weight: 500;
    letter-spacing: .4px;
}

body {
    position: relative;
    min-height: 100vh;
    background: var(--bg);
}

h1, h2, h3, h4 {
    margin: 0;
    font-family: 'Helvetica Neue', 'Inter', 'Arial', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ====== 背景：工程网格 + CRT 扫描线 + 噪点 ====== */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0, 0, 0, .03) 39px, rgba(0, 0, 0, .03) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0, 0, 0, .03) 39px, rgba(0, 0, 0, .03) 40px);
    opacity: .6;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, .015) 2px,
        rgba(0, 0, 0, .015) 4px
    );
    mix-blend-mode: multiply;
}

/* SVG 噪点滤镜 */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: var(--noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 96 96' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000'%3E%3Crect x='4' y='6' width='1' height='1' opacity='.18'/%3E%3Crect x='12' y='38' width='1' height='1' opacity='.12'/%3E%3Crect x='18' y='70' width='1' height='1' opacity='.16'/%3E%3Crect x='27' y='24' width='1' height='1' opacity='.14'/%3E%3Crect x='34' y='54' width='1' height='1' opacity='.2'/%3E%3Crect x='40' y='11' width='1' height='1' opacity='.1'/%3E%3Crect x='46' y='86' width='1' height='1' opacity='.17'/%3E%3Crect x='55' y='28' width='1' height='1' opacity='.14'/%3E%3Crect x='62' y='62' width='1' height='1' opacity='.16'/%3E%3Crect x='71' y='14' width='1' height='1' opacity='.11'/%3E%3Crect x='78' y='42' width='1' height='1' opacity='.18'/%3E%3Crect x='83' y='74' width='1' height='1' opacity='.13'/%3E%3Crect x='90' y='20' width='1' height='1' opacity='.15'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 96px 96px;
}

/* ====== 容器 ====== */
.container {
    position: relative;
    z-index: 10;
    width: min(1160px, 92%);
    margin: 32px auto 60px;
    padding: 36px 44px 50px;
    background: rgba(240, 240, 240, .78);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border: 1px solid rgba(184, 184, 184, .5);
    border-radius: 0;
    box-sizing: border-box;
}

/* ====== Header ====== */
header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 8px;
}

.logo {
    font-family: 'Helvetica Neue', 'Inter', 'Arial', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--text-faint);
    text-transform: uppercase;
    white-space: nowrap;
}

/* NASA Worm Logo */
.nasa-worm {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nasa-worm svg {
    height: 22px;
    width: auto;
}

/* 任务信息 */
.mission-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.2px;
    color: var(--text-faint);
    text-transform: uppercase;
    white-space: nowrap;
}

.mission-info .mission-id {
    color: var(--orange);
    font-weight: 600;
}

.mission-info .mission-status {
    color: #2a9d2a;
    font-weight: 600;
}

/* 语言切换器 — 飞船控制台物理按钮 */
.lang-switch {
    display: flex;
    gap: 0;
    margin-left: auto;
    align-items: center;
}

.lang-switch button {
    border: 1px solid var(--divider-bold);
    background: var(--bg-alt);
    padding: 6px 14px;
    border-radius: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    cursor: pointer;
    color: var(--text-faint);
    font-weight: 600;
    text-transform: uppercase;
    transition: color var(--trans), background var(--trans), border-color var(--trans);
}

.lang-switch button + button {
    border-left: none;
}

.lang-switch button.active {
    color: #fff;
    border-color: var(--orange);
    background: var(--orange);
}

.lang-switch button:hover:not(.active) {
    color: var(--text);
    background: var(--panel);
}

/* ====== 英雄区 ====== */
.hero {
    padding: 50px 0 36px;
    display: grid;
    gap: 40px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
}

.tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--orange);
    font-weight: 600;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.08;
    color: var(--text);
    letter-spacing: 3px;
}

.hero p {
    max-width: 54ch;
    line-height: 1.7;
    font-size: 14px;
    color: var(--text-dim);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
}

/* ====== 大分节标题 ====== */
.section {
    margin: 60px 0 36px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    position: relative;
    padding-left: 16px;
    color: var(--text);
}

.section-header h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    background: var(--orange);
}

/* REF-ID 标签 */
.ref-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-faint);
    font-weight: 500;
    white-space: nowrap;
}

.section-header .bar {
    flex: 1;
    height: 1px;
    background: var(--divider);
}

/* ====== 项目网格 ====== */
.projects-grid {
    --project-card-width: 360px;
    --project-card-height: 254px;
    --project-gap: 24px;
    --project-stack-overlap: 258px;
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: visible;
    margin-top: 10px;
    min-height: var(--project-card-height);
    padding-top: 16px;
    position: relative;
}

/* 项目卡片 — 现代复古未来主义 */
.project-card {
    width: var(--project-card-width);
    flex: 0 0 var(--project-card-width);
    height: var(--project-card-height);
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid rgba(184, 184, 184, .4);
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: var(--project-card-height);
    position: relative;
    overflow: hidden;
    transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
    cursor: pointer;
}

.project-card.project-card-expanded {
    margin-left: var(--project-gap);
}

.project-card.project-card-expanded:first-child,
.project-card.project-card-stack-start:first-child {
    margin-left: 0;
}

.project-card.project-card-stacked {
    margin-left: calc(-1 * var(--project-stack-overlap));
}

.project-card.project-card-stack-start {
    margin-left: var(--project-gap);
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--orange) 50%, transparent 50%);
    opacity: 0;
    transition: opacity 200ms ease;
}

.project-card:hover::before {
    opacity: 1;
}

/* 标题区 — 轻盈的顶部条 */
.project-card .card-nameplate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: visible;
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(184, 184, 184, .3);
    gap: 12px;
    background: transparent;
}

.project-card .card-nameplate h4 {
    margin: 0;
    font-family: 'Helvetica Neue', 'Inter', 'Arial', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: var(--text);
    text-transform: uppercase;
}

.project-card .card-nameplate .card-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.2px;
    color: var(--orange);
    font-weight: 600;
    white-space: nowrap;
    padding: 3px 10px;
    border: 1px solid rgba(255, 60, 0, .3);
    border-radius: 0;
    background: rgba(255, 60, 0, .04);
}

.project-card .card-body {
    padding: 16px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.7;
    font-weight: 400;
}

.project-card:hover {
    border-color: rgba(255, 60, 0, .35);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, .1);
}

.project-card.project-card-stacked:hover {
    transform: translateY(-42px);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .18);
}

.project-card:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.project-card-active {
    transform: translateY(-1px) scale(0.995);
}

/* 项目标签 — 轻盈现代风格 */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.project-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: .8px;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid rgba(184, 184, 184, .4);
    border-radius: 0;
    color: var(--text-faint);
    background: rgba(255, 255, 255, .3);
    text-transform: uppercase;
    transition: border-color 200ms ease, color 200ms ease;
}

.project-card:hover .project-tag {
    border-color: rgba(255, 60, 0, .3);
    color: var(--orange);
}

/* 隐藏 GitHub 图标 */
.project-github {
    display: none !important;
}

.empty {
    outline: 1px dashed var(--divider);
    outline-offset: -6px;
}

.empty-note {
    margin-top: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--orange);
}

/* ====== 项目卡片展开 — NASA 文档 ====== */
.project-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
}

.project-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nasa-document {
    position: relative;
    width: min(820px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: #FAFAF5;
    border: 1px solid var(--divider-bold);
    border-radius: 0;
    padding: 48px 56px 40px;
    box-sizing: border-box;
    transform: scale(.92) translateY(20px);
    clip-path: inset(5% 5% 5% 5%);
    transition: transform 600ms cubic-bezier(.22, .61, .36, 1),
                clip-path 600ms cubic-bezier(.22, .61, .36, 1);
}

.nasa-document::-webkit-scrollbar {
    display: none;
}

.project-overlay.active .nasa-document {
    transform: scale(1) translateY(0);
    clip-path: inset(0 0 0 0);
}

/* NASA News Release Document — Masthead */

/* Classified watermark on document */
.nasa-doc-classified {
    position: relative;
}

.nasa-doc-classified::before {
    content: "CLASSIFIED";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 16px;
    color: rgba(183, 28, 28, .07);
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
}

[data-theme="dark"] .nasa-doc-classified::before {
    color: rgba(183, 28, 28, .1);
}

.nasa-doc-masthead {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 2px;
}

.nasa-doc-logo svg {
    height: 38px;
    width: auto;
}

.masthead-label {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 38px;
    font-style: italic;
    font-weight: 400;
    color: #1A1A1A;
    line-height: 1;
    transform: translateY(-2px);
}

.nasa-doc-org {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    line-height: 1.7;
    color: #555;
    letter-spacing: .3px;
    margin-bottom: 16px;
}

.nasa-doc-rule {
    height: 2px;
    background: #1A1A1A;
    margin-bottom: 0;
}

/* Meta: Contact + Release info */
.nasa-doc-meta {
    display: flex;
    flex-direction: column;
    margin-bottom: 28px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: #333;
    font-weight: 500;
}

.nasa-doc-meta .meta-row {
    display: flex;
    justify-content: space-between;
}

.nasa-doc-meta .meta-for-release {
    font-style: italic;
    font-weight: 500;
}

/* Release number (inline in meta) */
.nasa-doc-release-no {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #333;
    font-weight: 500;
}

/* Title — underlined, all caps (per 1970s NASA release) */
.nasa-doc-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-bottom: 28px;
    color: #111;
}

/* NASA 文档正文 */
.nasa-doc-body {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    line-height: 1.85;
    color: #222;
    font-weight: 400;
    max-width: 68ch;
}

.nasa-doc-body p {
    margin: 0 0 18px;
}

.nasa-doc-body h3 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 28px 0 12px;
    color: #111;
}

.nasa-doc-body h2 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 32px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
    color: #111;
}

.nasa-doc-body h4 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 24px 0 10px;
    color: #222;
}

.nasa-doc-body h5 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    margin: 20px 0 8px;
    color: #333;
}

.nasa-doc-body h6 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    margin: 18px 0 8px;
    color: #555;
}

/* Code block — engineering specification printout */
.nasa-doc-body .code-block {
    position: relative;
    background: rgba(0, 0, 0, .03);
    color: #333;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    padding: 18px 20px 18px 22px;
    margin: 18px 0 20px;
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, .1);
    border-left: 3px solid var(--divider-bold);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

.nasa-doc-body .code-block::-webkit-scrollbar {
    height: 4px;
}

.nasa-doc-body .code-block::-webkit-scrollbar-track {
    background: transparent;
}

.nasa-doc-body .code-block::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .12);
    border-radius: 2px;
}

.nasa-doc-body .code-block code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    border: none;
}

.nasa-doc-body .code-block .code-lang {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
}

/* Inline code */
.nasa-doc-body code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    background: rgba(0, 0, 0, .06);
    padding: 2px 6px;
    border: 1px solid rgba(0, 0, 0, .08);
}

/* Table */
.nasa-doc-body .table-wrap {
    overflow-x: auto;
    margin: 18px 0 20px;
}

.nasa-doc-body table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    line-height: 1.7;
}

.nasa-doc-body th {
    text-align: left;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 10px;
    color: #555;
    padding: 8px 12px;
    border-bottom: 2px solid #1A1A1A;
    white-space: nowrap;
}

.nasa-doc-body td {
    padding: 7px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    color: #333;
}

.nasa-doc-body tbody tr:hover {
    background: rgba(0, 0, 0, .025);
}

/* Blockquote */
.nasa-doc-body blockquote {
    margin: 18px 0 20px;
    padding: 14px 20px;
    border-left: 3px solid var(--orange);
    background: rgba(255, 60, 0, .03);
    font-style: italic;
    color: #444;
}

.nasa-doc-body blockquote p {
    margin: 0 0 6px;
}

.nasa-doc-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Horizontal rule */
.nasa-doc-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .15) 20%, rgba(0, 0, 0, .15) 80%, transparent);
    margin: 28px 0;
}

/* Checklist */
.nasa-doc-body .checklist {
    list-style: none;
    padding-left: 0;
}

.nasa-doc-body .check-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
}

.nasa-doc-body .check-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(0, 0, 0, .25);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.nasa-doc-body .check-item.checked .check-box {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.nasa-doc-body .check-item.checked {
    color: var(--text-faint);
}

/* Lists */
.nasa-doc-body ul,
.nasa-doc-body ol {
    padding-left: 24px;
    margin: 10px 0 18px;
}

.nasa-doc-body li {
    margin-bottom: 4px;
}

/* Links */
.nasa-doc-body a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}

.nasa-doc-body a:hover {
    border-bottom-color: var(--orange);
}

/* Strong / Em */
.nasa-doc-body strong {
    font-weight: 700;
    color: #111;
}

.nasa-doc-body em {
    font-style: italic;
}

/* Signature — right-aligned per 1970s government document convention */
.nasa-doc-signature {
    margin-top: 48px;
    margin-left: auto;
    width: fit-content;
    text-align: left;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: #333;
}

.nasa-doc-signature .sig-handwriting {
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 32px;
    color: #1A1A1A;
    margin: 8px 0 4px;
    transform: rotate(-2deg);
    display: inline-block;
}

.nasa-doc-signature .sig-line {
    width: 200px;
    height: 1px;
    background: #1A1A1A;
    margin: 4px 0 8px;
}

.nasa-doc-signature .sig-name {
    font-weight: 700;
    letter-spacing: 1px;
}

.nasa-doc-signature .sig-title {
    color: #666;
    font-size: 11px;
    line-height: 1.6;
}

/* Document end mark */
.nasa-doc-end {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-style: italic;
    color: #666;
    margin-top: 36px;
    letter-spacing: 1px;
}

/* Telemetry readout near -end- */
.nasa-doc-telemetry {
    text-align: center;
    margin-top: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: rgba(102, 102, 102, .55);
    line-height: 1.6;
    user-select: none;
}

/* 关闭按钮 — 物理按钮 */
.nasa-doc-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: stretch;
    gap: 8px;
}

.nasa-doc-action {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    background: transparent;
    border: 1px solid var(--divider-bold);
    border-radius: 0;
    padding: 6px 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--trans), border-color var(--trans), background var(--trans);
}

.nasa-doc-action:hover {
    color: var(--orange);
    border-color: var(--orange);
    background: rgba(255, 60, 0, .05);
}

.nasa-doc-github[hidden] {
    display: none;
}

.nasa-doc-github {
    text-transform: none;
}

/* ====== Badge Envelope Card — NASA Business-Card Style ====== */
.badge-card-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.badge-card-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.badge-envelope {
    position: relative;
    width: min(520px, 92vw);
    background: #FAFAF5;
    border: 1px solid var(--divider-bold);
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
    transform: scale(.94) translateY(12px);
    transition: transform 400ms cubic-bezier(.22, .61, .36, 1);
    overflow: hidden;
}

.badge-card-overlay.active .badge-envelope {
    transform: scale(1) translateY(0);
}

/* Envelope top band */
.envelope-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px 16px;
    border-bottom: 2px solid #1A1A1A;
}

.envelope-sender {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.envelope-sender .sender-logo svg {
    height: 20px;
    width: auto;
}

.envelope-sender .sender-org {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    line-height: 1.6;
    color: #555;
    letter-spacing: .3px;
}

.envelope-stamp {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-right: 36px;
}

.envelope-stamp .stamp-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
    text-align: right;
}

.envelope-stamp .stamp-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope-stamp .stamp-icon svg {
    width: 32px;
    height: 32px;
}

/* Main content area — the "letter" */
.envelope-body {
    padding: 24px 28px 28px;
}

.envelope-title {
    font-family: 'Helvetica Neue', 'Inter', 'Arial', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #1A1A1A;
    margin: 0 0 4px;
}

.envelope-kind {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--orange);
    font-weight: 600;
    margin-bottom: 16px;
}

/* Proficiency gauge — for skills */
.envelope-proficiency {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.proficiency-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
    white-space: nowrap;
}

.proficiency-dots {
    display: flex;
    gap: 6px;
}

.proficiency-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 0;
    border: 1px solid rgba(184, 184, 184, .6);
    background: transparent;
    transition: background 200ms ease, border-color 200ms ease;
}

.proficiency-dots .dot.filled {
    background: var(--orange);
    border-color: var(--orange);
}

/* Cert info block */
.envelope-cert-info {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
}

.cert-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cert-info-label {
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
}

.cert-info-value {
    font-weight: 600;
    color: var(--text);
}

.cert-info-value.status-active {
    color: #2a9d2a;
}

.cert-info-value.status-expired {
    color: #cc3333;
}

.cert-info-value.status-retired {
    color: var(--text-faint);
}

/* Comment */
.envelope-comment {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Divider */
.envelope-divider {
    height: 1px;
    background: var(--divider);
    margin-bottom: 16px;
}

/* Footer link */
.envelope-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid rgba(184, 184, 184, .5);
    transition: color 200ms ease, border-color 200ms ease;
}

.envelope-link:hover {
    color: var(--orange);
    border-color: var(--orange);
}

.envelope-link .arrow {
    font-size: 13px;
    line-height: 1;
}

/* Close button for envelope */
.envelope-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 1px solid rgba(184, 184, 184, .5);
    border-radius: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 200ms ease, border-color 200ms ease;
    z-index: 1;
}

.envelope-close:hover {
    color: var(--orange);
    border-color: var(--orange);
}

/* Dark theme overrides for envelope */
[data-theme="dark"] .badge-envelope {
    background: #2A2A28;
    border-color: #555;
}

[data-theme="dark"] .envelope-header {
    border-bottom-color: #666;
}

[data-theme="dark"] .envelope-title {
    color: #E8E8E8;
}

[data-theme="dark"] .envelope-comment {
    color: #CCC;
}

[data-theme="dark"] .envelope-link {
    border-color: #555;
}

/* ====== Badges ====== */
.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.badge {
    position: relative;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid rgba(184, 184, 184, .4);
    padding: 8px 14px 8px 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .6px;
    font-weight: 600;
    border-radius: 0;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: border-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
    text-decoration: none;
}

.badge:hover {
    border-color: rgba(255, 60, 0, .35);
    color: var(--orange);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, .08);
}

.badge.cert:hover {
    border-color: rgba(255, 60, 0, .35);
    color: var(--orange);
}

.badge-empty {
    opacity: .5;
    font-style: italic;
}

/* 分组标题 */
.badge-group-title {
    flex: 0 0 100%;
    margin: 12px 0 4px;
    font-family: 'Helvetica Neue', 'Inter', 'Arial', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-faint);
    position: relative;
    padding-left: 12px;
}

.badge-group-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: var(--orange);
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2px 0 14px;
}

.badge-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

/* ====== Archive Cabinet ====== */
.archive-cabinet {
    padding: 6px 0 0;
}

/* Single shelf row: stacked completed → expanded current */
.archive-shelf {
    display: flex;
    align-items: flex-end;
    gap: 0;
    position: relative;
    padding-top: 16px;
}

/* ====== File Card — A4 Portrait ====== */
.file-card {
    position: relative;
    width: 200px;
    height: 283px;
    background: rgba(255, 255, 255, .65);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid rgba(184, 184, 184, .4);
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 380ms cubic-bezier(.25, .1, .25, 1),
                box-shadow 380ms ease,
                border-color 250ms ease;
}

/* ---- Expanded (current) cards: show full, spaced ---- */
.file-card.file-stacked {
    margin-left: -152px;
    z-index: 1;
}

.file-card.file-stacked:first-child {
    margin-left: 0;
}

/* Hover: pull card UP by 1/4 to simulate pulling from cabinet */
.file-card.file-stacked:hover {
    transform: translateY(-70px);
    z-index: 20;
    box-shadow: 0 16px 48px -8px rgba(0, 0, 0, .22);
    border-color: rgba(255, 60, 0, .4);
}

/* ====== File Face — A4 internal layout ====== */
.file-face {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 16px 14px;
    box-sizing: border-box;
    gap: 0;
}

/* Classification stripe */
.file-stripe {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    padding-right: 30px;
    border-bottom: 1px solid rgba(184, 184, 184, .3);
    position: relative;
}

.stripe-type {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.stripe-type.file-type-project { color: var(--orange); }
.stripe-type.file-type-experiment { color: var(--blue); }
.stripe-type.file-type-classified { color: #B71C1C; }

.stripe-version {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-faint);
    padding: 1px 6px;
    background: rgba(0, 0, 0, .05);
    margin-left: 8px;
}

/* Featured pin (orange tab sticking up) */
.stripe-pin {
    position: absolute;
    top: -16px;
    right: 8px;
    width: 16px;
    height: 24px;
    background: var(--orange);
    border-radius: 0 0 1px 1px;
    opacity: .85;
}

/* Title */
.file-title-block {
    margin-bottom: 8px;
}

.file-title {
    font-family: 'Helvetica Neue', 'Inter', 'Arial', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Description */
.file-desc {
    margin: 0 0 auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    line-height: 1.6;
    color: var(--text-dim);
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Progress */
.file-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.file-pct {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--orange);
    min-width: 30px;
}

.file-bar {
    flex: 1;
    height: 4px;
    border-radius: 0;
    background: rgba(0, 0, 0, .06);
    overflow: hidden;
}

.file-fill {
    display: block;
    height: 100%;
    border-radius: 0;
    transition: width .8s cubic-bezier(.25, .1, .25, 1);
}

.file-fill.done { background: var(--blue); }

.file-fill.progress {
    background: linear-gradient(90deg, var(--orange), rgba(255, 60, 0, .7));
    position: relative;
}

.file-fill.progress::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .3) 50%, transparent 100%);
    opacity: .65;
}

.file-card:hover .file-fill.progress::after,
.file-card:focus-visible .file-fill.progress::after {
    animation: progressSweep 2.8s ease-in-out 1;
}

@keyframes progressSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* Completed stamp */
.file-stamp-block {
    margin-top: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--blue);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stamp-check {
    font-size: 13px;
}

/* Footer */
.file-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(184, 184, 184, .2);
    min-height: 22px;
}

.file-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: .8px;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid rgba(184, 184, 184, .4);
    transition: color 200ms ease, border-color 200ms ease;
}

.file-link:hover {
    color: var(--orange);
    border-color: var(--orange);
}

.file-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8px;
    letter-spacing: 1px;
    color: var(--text-faint);
    font-weight: 500;
}

/* ====== Classified Card ====== */
.file-classified {
    background: rgba(245, 240, 235, .7);
    border-color: rgba(183, 28, 28, .25);
}

.file-classified .file-stripe {
    border-bottom-color: rgba(183, 28, 28, .2);
}

/* Redacted text */
.file-desc.redacted {
    position: relative;
    color: transparent;
    user-select: none;
}

.file-desc.redacted::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(40, 40, 40, .75) 0px,
        rgba(40, 40, 40, .75) 2px,
        transparent 2px,
        transparent 6px
    );
    pointer-events: none;
}

/* Classified progress: redacted */
.classified-progress .file-pct {
    color: #B71C1C;
    letter-spacing: 0;
}

.file-bar.redacted-bar {
    position: relative;
    background: none;
    overflow: visible;
}

.file-bar.redacted-bar::before {
    content: "";
    position: absolute;
    inset: -1px 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        rgba(40, 40, 40, .7) 0px,
        rgba(40, 40, 40, .7) 8px,
        rgba(40, 40, 40, .35) 8px,
        rgba(40, 40, 40, .35) 12px
    );
    pointer-events: none;
}

/* Classified: diagonal watermark */
.file-classified::after {
    content: "CLASSIFIED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 6px;
    color: rgba(183, 28, 28, .06);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

.file-classified:hover {
    border-color: rgba(183, 28, 28, .4) !important;
}

.file-classified.file-stacked:hover {
    box-shadow: 0 16px 48px -8px rgba(183, 28, 28, .18);
}

/* Dark mode: archive */
[data-theme="dark"] .file-card {
    background: rgba(50, 50, 50, .6);
    border-color: rgba(100, 100, 100, .4);
}

[data-theme="dark"] .file-card.file-stacked:hover {
    border-color: rgba(255, 60, 0, .5);
}

[data-theme="dark"] .file-classified {
    background: rgba(60, 40, 40, .6);
    border-color: rgba(183, 28, 28, .3);
}

[data-theme="dark"] .file-classified:hover {
    border-color: rgba(183, 28, 28, .5) !important;
}

[data-theme="dark"] .file-bar.redacted-bar::before {
    background: repeating-linear-gradient(
        90deg,
        rgba(200, 200, 200, .5) 0px,
        rgba(200, 200, 200, .5) 8px,
        rgba(200, 200, 200, .25) 8px,
        rgba(200, 200, 200, .25) 12px
    );
}

[data-theme="dark"] .file-classified::after {
    color: rgba(183, 28, 28, .08);
}

/* ====== 时间线 ====== */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 24px;
    border-left: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.timeline li {
    position: relative;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 1px;
    background: var(--orange);
}

.timeline h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text);
}

.timeline p {
    margin: 0;
    font-size: 12px;
    color: var(--text-dim);
    max-width: 60ch;
    line-height: 1.6;
}

/* ====== 联系方式 ====== */
.contact {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.contact-card {
    background: var(--bg-alt);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 22px 24px 26px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--trans), transform var(--trans);
}

.contact-card:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.contact-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.contact-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.contact-card a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.contact-card a:hover {
    color: var(--orange);
}

/* ====== Footer — 工程报告 ====== */
footer {
    margin: 60px 0 20px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-faint);
}

footer a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    color: var(--orange);
}

/* ====== 返回顶部 ====== */
#backToTop {
    position: fixed;
    right: 24px;
    bottom: 32px;
    z-index: 100;
    background: var(--panel);
    border: 1px solid var(--divider-bold);
    color: var(--text-dim);
    padding: 10px 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    border-radius: 0;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all var(--trans);
}

#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

#backToTop:hover {
    color: var(--orange);
    border-color: var(--orange);
}

/* ====== Canvas 背景容器 ====== */
#canvas-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    contain: strict;
}

/* ====== 暗色主题 ====== */
[data-theme="dark"] {
    --bg: #2A2A2A;
    --bg-alt: #252525;
    --panel: #333;
    --panel-alt: #2E2E2E;
    --panel-deep: #222;
    --divider: #4A4A4A;
    --divider-bold: #5A5A5A;
    --divider-soft: rgba(100, 100, 100, .5);
    --divider-strong: rgba(140, 140, 140, .6);
    --text: #E8E8E8;
    --text-dim: #AAA;
    --text-faint: #777;
    --accent: #E8E8E8;
    --accent-warm: #FF5722;
    --blue: #5B8DEF;
    color-scheme: dark;
}

[data-theme="dark"] body {
    background: var(--bg);
}

[data-theme="dark"] .project-card,
[data-theme="dark"] .badge {
    background: rgba(50, 50, 50, .6);
    border-color: rgba(100, 100, 100, .4);
}

[data-theme="dark"] .project-card:hover,
[data-theme="dark"] .badge:hover {
    border-color: rgba(255, 60, 0, .5);
}

[data-theme="dark"] .nasa-document {
    background: #2A2A28;
    color: #DDD;
}

[data-theme="dark"] .nasa-doc-body {
    color: #CCC;
}

[data-theme="dark"] .masthead-label {
    color: #DDD;
}

[data-theme="dark"] .nasa-doc-org {
    color: var(--text-dim);
}

[data-theme="dark"] .nasa-doc-rule {
    background: var(--text-dim);
}

[data-theme="dark"] .nasa-doc-meta,
[data-theme="dark"] .nasa-doc-release-no {
    color: var(--text-dim);
}

[data-theme="dark"] .nasa-doc-title {
    color: var(--text);
}

[data-theme="dark"] .nasa-doc-body h3 {
    color: var(--text);
}

[data-theme="dark"] .nasa-doc-signature {
    color: var(--text-dim);
}

[data-theme="dark"] .nasa-doc-signature .sig-handwriting {
    color: #DDD;
}

[data-theme="dark"] .nasa-doc-signature .sig-line {
    background: var(--text-dim);
}

[data-theme="dark"] .nasa-doc-signature .sig-title {
    color: var(--text-faint);
}

[data-theme="dark"] .nasa-doc-end {
    color: var(--text-faint);
}

[data-theme="dark"] .nasa-doc-telemetry {
    color: rgba(200, 200, 200, .35);
}

[data-theme="dark"] .nasa-doc-body a {
    color: var(--accent-warm);
}

[data-theme="dark"] .nasa-doc-body code {
    background: rgba(255, 255, 255, .08);
    color: #EEE;
}

[data-theme="dark"] .nasa-doc-body .code-block {
    background: rgba(255, 255, 255, .04);
    color: #CCC;
    border-color: rgba(255, 255, 255, .1);
    border-left-color: var(--divider);
}

[data-theme="dark"] .nasa-doc-body .code-block code {
    background: none;
    color: inherit;
}

[data-theme="dark"] .nasa-doc-body th {
    color: #AAA;
    border-bottom-color: #666;
}

[data-theme="dark"] .nasa-doc-body td {
    color: #CCC;
    border-bottom-color: rgba(255, 255, 255, .08);
}

[data-theme="dark"] .nasa-doc-body tbody tr:hover {
    background: rgba(255, 255, 255, .03);
}

[data-theme="dark"] .nasa-doc-body blockquote {
    border-left-color: var(--accent-warm);
    background: rgba(255, 60, 0, .05);
    color: #BBB;
}

[data-theme="dark"] .nasa-doc-body hr {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .1) 20%, rgba(255, 255, 255, .1) 80%, transparent);
}

[data-theme="dark"] .nasa-doc-body .check-box {
    border-color: rgba(255, 255, 255, .25);
}

[data-theme="dark"] .nasa-doc-body .check-item.checked .check-box {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
}

[data-theme="dark"] .nasa-doc-body h2 {
    color: #E8E8E8;
    border-bottom-color: rgba(255, 255, 255, .1);
}

[data-theme="dark"] .nasa-doc-body h3,
[data-theme="dark"] .nasa-doc-body h4 {
    color: #DDD;
}

[data-theme="dark"] .nasa-doc-body h5,
[data-theme="dark"] .nasa-doc-body h6 {
    color: #AAA;
}

[data-theme="dark"] .nasa-doc-body strong {
    color: #EEE;
}

[data-theme="dark"] .nasa-doc-logo svg {
    filter: invert(1);
}

/* ====== 响应式 ====== */
@media (max-width: 780px) {
    .container {
        padding: 24px 18px 36px;
        margin: 16px auto 40px;
    }

    header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .mission-info {
        flex-direction: row;
        gap: 12px;
        margin-left: 0;
        flex-basis: 100%;
    }

    .hero {
        padding: 32px 0 20px;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 5vw, 2.4rem);
    }

    .nasa-document {
        padding: 28px 24px 28px;
        width: 96vw;
        max-height: 94vh;
    }

    .archive-shelf {
        flex-wrap: wrap;
        row-gap: 18px;
    }

    .projects-grid {
        --project-card-width: 300px;
        --project-card-height: 212px;
        --project-gap: 18px;
        --project-stack-overlap: 214px;
    }

    .file-card {
        width: 160px;
        height: 227px;
    }

    .file-card.file-stacked {
        margin-left: -112px;
    }

    .timeline {
        gap: 24px;
    }
}

/* ====== 手机窄屏适配 ====== */
@media (max-width: 480px) {
    .container {
        padding: 18px 10px 28px;
        margin: 8px auto 28px;
    }

    /* 文章弹窗 */
    .nasa-document {
        padding: 20px 14px 22px;
        width: 98vw;
        max-height: 96vh;
    }

    /* 文档内元素自适应 */
    .nasa-doc-masthead {
        flex-wrap: wrap;
        gap: 8px;
    }

    .masthead-label {
        font-size: 26px;
    }

    .nasa-doc-meta {
        flex-direction: column;
        gap: 2px;
    }

    .nasa-doc-meta .meta-row {
        flex-direction: column;
        gap: 0;
    }

    .nasa-doc-body {
        font-size: 12px;
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .nasa-doc-body h3 {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .nasa-doc-body .code-block {
        padding: 14px 12px;
        font-size: 11px;
    }

    .nasa-doc-body table {
        font-size: 10px;
    }

    .nasa-doc-body th,
    .nasa-doc-body td {
        padding: 5px 8px;
    }

    .nasa-doc-title {
        font-size: 12px;
        letter-spacing: .5px;
    }

    .nasa-doc-signature {
        margin-left: 0;
    }

    .nasa-doc-signature .sig-handwriting {
        font-size: 24px;
    }

    .nasa-doc-signature .sig-line {
        width: 140px;
    }

    .nasa-doc-classified::before {
        font-size: 40px;
        letter-spacing: 8px;
    }

    .nasa-doc-actions {
        top: 8px;
        right: 8px;
        gap: 6px;
    }

    .nasa-doc-action {
        padding: 5px 10px;
        font-size: 9px;
    }

    /* 档案库卡片 */
    .archive-shelf {
        row-gap: 14px;
    }

    .projects-grid {
        --project-card-width: 240px;
        --project-card-height: 170px;
        --project-gap: 14px;
        --project-stack-overlap: 170px;
        padding-top: 12px;
    }

    .file-card {
        width: 140px;
        height: 198px;
    }

    .file-card.file-stacked {
        margin-left: -96px;
    }

    .file-face {
        padding: 10px 10px 8px;
    }

    .file-title {
        font-size: 11px;
    }

    .file-desc {
        font-size: 9px;
    }

    /* 徽章信封弹窗 */
    .badge-envelope {
        width: 96vw;
    }

    .envelope-header {
        padding: 16px 14px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .envelope-stamp {
        margin-right: 24px;
    }

    .envelope-body {
        padding: 16px 14px 20px;
    }

    .envelope-title {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .envelope-cert-info {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* 联系方式自动换行 */
    #contact p {
        word-break: break-all;
    }

    /* hero */
    .hero {
        grid-template-columns: 1fr;
    }
}

/* ====== 无障碍：减弱动效 ====== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #canvas-bg,
    .noise-overlay {
        display: none !important;
    }

    .project-overlay .nasa-document {
        transition: none !important;
    }
}

/* 面板 & 导航兼容 */
.panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 28px 30px 32px;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, 0) 65%);
    opacity: .3;
}

.panel h3 {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-faint);
}

nav {
    display: flex;
    gap: 0;
}

nav a {
    position: relative;
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-alt);
    border: 1px solid var(--divider);
    border-radius: 0;
    line-height: 1;
    transition: color var(--trans), background var(--trans), border-color var(--trans);
}

nav a + a {
    border-left: none;
}

nav a:hover {
    color: var(--text);
    background: var(--panel);
}

nav a.active {
    color: var(--orange);
    border-color: var(--orange);
    background: var(--panel);
}

.badge-label {
    white-space: nowrap;
}
