/* ============================================================
   Small Moss — 个人站样式 v2
   主题：纯黑 + 数据流 · 蓝紫黑 · 精简现代
   ============================================================ */

/* ===== 字体 ===== */
/* ★ 免费替代：Bebas Neue（粗黑 + 力量感，接近汉仪力量简黑） */
@font-face {
    font-family: 'Bebas Neue';
    src: url('assets/fonts/BebasNeue-Regular.ttf') format('truetype');
    font-display: swap;
}

:root {
    --bg-dark: #050508;          /* 近纯黑，带一丝蓝紫底色 */
    --bg-panel: rgba(12, 14, 22, 0.55);
    --text-main: #c9d1d9;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --accent-alt: #a855f7;
    --border: #262a35;
    --glow: rgba(88, 166, 255, 0.35);
    --nav-h: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

::selection {
    background: rgba(88, 166, 255, 0.3);
    color: #fff;
}

/* ---------- 顶部导航栏 ---------- */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 100;
    background: rgba(5, 5, 8, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1100px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
}

.nav-links { display: flex; gap: 6px; align-items: center; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.3);
    text-shadow: 0 0 8px var(--glow);
}

.nav-icon { color: var(--accent); font-size: 0.95em; opacity: 0.8; }

.nav-link-disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

/* ---------- 右上角语言切换按钮 ---------- */
#lang-switcher .lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(12, 14, 22, 0.55);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#lang-switcher .lang-btn:hover {
    border-color: rgba(88, 166, 255, 0.3);
    color: var(--accent);
    background: rgba(88, 166, 255, 0.08);
}

#lang-switcher .lang-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(88, 166, 255, 0.15);
    box-shadow: 0 0 10px var(--glow);
}

body.alert-mode #lang-switcher .lang-btn {
    border-color: rgba(255, 82, 82, 0.35);
    color: #ffc9c9;
}

body.alert-mode #lang-switcher .lang-btn:hover {
    border-color: rgba(255, 82, 82, 0.7);
    color: #ff6b6b;
    background: rgba(255, 82, 82, 0.08);
}

body.alert-mode #lang-switcher .lang-btn.active {
    border-color: #ff5252;
    color: #ff5252;
    background: rgba(255, 82, 82, 0.15);
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

/* ---------- 背景层：数据流画布 + 扫描线 ---------- */
.background-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-dark);
}

/* 数据流画布（JS 绘制，透明底叠在黑底上） */
#data-stream {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;               /* ★ 整体压暗，不抢内容 */
}

/* 静态 CRT 扫描纹理：极淡的横向细线 */
.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.022) 0px,
        rgba(255, 255, 255, 0.022) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
}

/* ---------- 扫描线（扫过的高亮带，颜色调淡） ---------- */
.scanline-sweep {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 12%;
    pointer-events: none;
    opacity: 0;
    /* 总周期 10s，每条线只用前半段活动 */
    animation: scanSweep 10s linear infinite;
}

/* 蓝色扫描线 - 从 0s 开始 */
.scanline-sweep-blue {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(88, 166, 255, 0.05) 30%,
        rgba(88, 166, 255, 0.18) 50%,
        rgba(88, 166, 255, 0.05) 70%,
        transparent 100%
    );
    box-shadow: 0 0 24px rgba(88, 166, 255, 0.18);
    animation-delay: 0s;
}

/* 紫色扫描线 - 延迟半个周期 */
.scanline-sweep-purple {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(168, 85, 247, 0.05) 30%,
        rgba(168, 85, 247, 0.18) 50%,
        rgba(168, 85, 247, 0.05) 70%,
        transparent 100%
    );
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.18);
    animation-delay: 5s;
}

/* 0-50% 完成一次扫描，50-100% 藏起来 */
@keyframes scanSweep {
    0%   { top: -10%; opacity: 0; }
    8%   { opacity: 1; }
    42%  { opacity: 1; }
    50%  { top: 110%; opacity: 0; }
    100% { top: 110%; opacity: 0; }
}

/* ---------- 点击粒子画布 ---------- */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

/* ---------- 内容层 ---------- */
.content {
    position: relative;
    z-index: 10;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    padding-top: var(--nav-h);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* ---------- Section ---------- */
.section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    position: relative;
    /* ★ 白字 + 蓝紫渐变下划线，黑底上更干净 */
    color: #f0f3f8;
    letter-spacing: 0.02em;
}

.section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 64px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-alt));
    box-shadow: 0 0 8px var(--glow);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: #79c0ff; text-shadow: 0 0 8px var(--glow); }

/* ---------- 关于我 ---------- */
.about-intro {
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 32px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.about-card {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel);
    transition: all 0.3s ease;
}

.about-card:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.15);
}

.about-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 600;
}

.about-value {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
}

.about-games { margin-top: 8px; }

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.game-tag {
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--accent);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: default;
}

.game-tag:hover {
    background: rgba(88, 166, 255, 0.2);
    box-shadow: 0 0 12px var(--glow);
    transform: translateY(-2px);
}

/* ---------- 项目卡片 ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.project-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s;
    color: inherit;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--glow);
    transform: translateY(-4px);
    color: inherit;
}

.project-card h3 { color: #fff; margin-bottom: 8px; font-size: 1.15rem; }
.project-card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- 联系卡片 ---------- */
.join-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.join-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-panel);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    text-align: center;
}

.join-card:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 0 20px var(--glow);
    color: inherit;
}

.join-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.join-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.join-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* 手机端 */
@media (max-width: 700px) {
    .join-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .join-card {
        padding: 18px 12px;
    }
}

@media (max-width: 400px) {
    .join-links {
        grid-template-columns: 1fr;
    }
}

/* ---------- 页脚 ---------- */
footer {
    padding: 60px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.footer-line {
    font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
    letter-spacing: 0.45em;
    font-size: 0.95rem;
    color: var(--text-dim);
    opacity: 0.6;
    margin-bottom: 8px;
}

/* ---------- 标题（渐变横幅） ---------- */
.title-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 24px;
    gap: 0;
}

.pixel-title-wrap {
    width: 100%;
    max-width: 900px;
    padding: 0 8px;
    position: relative;
    z-index: 2;
}

.pixel-title {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
}

/* SVG 内文字用 CSS 控制字体 */
.pixel-title-text {
    font-family: 'Bebas Neue', Impact, 'Arial Black', 'Courier New', monospace;
    font-weight: 900;
}

/* ---------- 滚动显现 ---------- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
}

.fade-in-up:nth-child(2) { animation-delay: 0.3s; }
.fade-in-up:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .section { padding: 60px 0; }
}

/* ---------- 作品列表 ---------- */
.section-subtitle {
    color: var(--text-dim);
    margin-bottom: 24px;
    margin-top: -12px;
}

.works-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 24px;
}

.work-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #0a0c12;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.work-card:hover {
    background: #11141d;
    color: inherit;
}

.work-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #1a1e28;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.work-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.icon-placeholder {
    font-size: 24px;
    opacity: 0.5;
}

.work-info {
    flex-grow: 1;
    min-width: 0;
}

.work-info h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.work-info p {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-right: 12px;
}

.stat-downloads {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.3s ease;
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.work-arrow {
    color: var(--text-dim);
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.work-card:hover .work-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

/* 手机端调整 */
@media (max-width: 600px) {
    .work-card {
        padding: 12px 16px;
        gap: 12px;
    }
    .work-icon {
        width: 40px;
        height: 40px;
    }
    .work-info h3 {
        font-size: 0.9rem;
    }
}

/* ---------- 左侧内容导航 ---------- */
.side-nav {
    position: fixed;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 12px;
    border-radius: 40px;
    background: rgba(5, 5, 8, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    transition: opacity 0.3s;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
}

.side-link:hover {
    color: var(--accent);
}

/* 圆点 */
.side-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.side-link:hover .side-dot {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transform: scale(1.4);
}

.side-link.active {
    color: var(--accent);
}

.side-link.active .side-dot {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent), 0 0 4px var(--accent);
    transform: scale(1.5);
}

.side-link.active .side-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0.5;
    animation: dotPulse 2s ease-out infinite;
}

@keyframes dotPulse {
    0%   { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.side-label {
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.side-nav:hover .side-label,
.side-link.active .side-label {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- Hero 问候语 ---------- */
.hero-greeting {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-dim);
    letter-spacing: 0.4em;
    margin-bottom: 8px;
    animation: greetingFade 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

@keyframes greetingFade {
    to { opacity: 0.85; }
}

/* ---------- 名字来历 ---------- */
.name-origin {
    margin-top: 40px;
    padding: 24px 28px;
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg,
        rgba(88, 166, 255, 0.08) 0%,
        rgba(168, 85, 247, 0.04) 60%,
        transparent 100%);
    border-radius: 0 8px 8px 0;
    position: relative;
    transition: all 0.4s ease;
}

.name-origin:hover {
    border-left-color: var(--accent-alt);
    background: linear-gradient(90deg,
        rgba(88, 166, 255, 0.12) 0%,
        rgba(168, 85, 247, 0.08) 60%,
        transparent 100%);
}

.name-origin-quote {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-main);
    font-style: italic;
    letter-spacing: 0.02em;
    position: relative;
}

.name-origin-quote b {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
    text-shadow: 0 0 8px var(--glow);
}

/* 引号装饰 */
.quote-mark {
    color: var(--accent);
    font-size: 1.6em;
    font-style: normal;
    opacity: 0.6;
    line-height: 0;
    vertical-align: -0.2em;
}

.name-origin-source {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: right;
    letter-spacing: 0.05em;
}

.name-origin-note {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 0.95rem;
    color: var(--text-dim);
}

.name-origin-note b {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #58a6ff, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.name-origin::after {
    content: '◉';
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.3;
    animation: mossEye 3s ease-in-out infinite;
}

@keyframes mossEye {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(1.15); }
}

/* ---------- Hero 技能标签 ---------- */
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    max-width: 600px;
    padding: 0 16px;
}

.hero-tag {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.28);
    color: #b9d4ff;
    transition: all 0.25s ease;
    cursor: default;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hero-tag:hover {
    background: rgba(88, 166, 255, 0.18);
    border-color: rgba(88, 166, 255, 0.7);
    color: #fff;
    transform: translateY(-2px);
    box-shadow:
        0 0 16px rgba(88, 166, 255, 0.4),
        0 0 6px rgba(168, 85, 247, 0.3);
}

/* ---------- Tooltip（通用：悬停 或 .tooltip-visible） ---------- */
.hero-tag,
.game-tag,
.about-card {
    position: relative;
}

.hero-tag::after,
.game-tag::after,
.about-card::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 140px;
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(8, 9, 14, 0.96);
    border: 1px solid rgba(88, 166, 255, 0.4);
    color: #d0e2ff;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: normal;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(88, 166, 255, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100;
}

.hero-tag::before,
.game-tag::before,
.about-card::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(88, 166, 255, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100;
}

/* 桌面：悬停显示 */
.hero-tag:hover::after,
.hero-tag:hover::before,
.game-tag:hover::after,
.game-tag:hover::before,
.about-card:hover::after,
.about-card:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 手机：JS 点按后加 .tooltip-visible */
.hero-tag.tooltip-visible::after,
.hero-tag.tooltip-visible::before,
.game-tag.tooltip-visible::after,
.game-tag.tooltip-visible::before,
.about-card.tooltip-visible::after,
.about-card.tooltip-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- GitHub 活跃度 ---------- */
.github-stats {
    margin-top: 40px;
}

.github-chart {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel);
    overflow-x: auto;
}

.github-chart img {
    width: 100%;
    height: auto;
    display: block;
}

.github-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.github-cards img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.github-cards img:hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--glow);
    transform: translateY(-2px);
}

/* ---------- 最近提交 ---------- */
.recent-commits {
    margin-top: 40px;
}

.commit-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.commit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #0a0c12;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    font-size: 0.85rem;
}

.commit-item:hover {
    background: #11141d;
    color: inherit;
}

.commit-icon {
    color: var(--accent);
    opacity: 0.8;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.commit-message {
    flex-grow: 1;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.commit-repo {
    color: var(--text-dim);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.commit-hash {
    color: var(--accent);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 2px 8px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.commit-item:hover .commit-hash {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.6);
}

.commit-loading,
.commit-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    background: #0a0c12;
}

@media (max-width: 600px) {
    .commit-repo { display: none; }
    .commit-hash { font-size: 0.7rem; padding: 2px 6px; }
}

/* ============================================================
   手机端适配
   ============================================================ */

/* 平板 / 窄屏：侧边导航改为底部横向 */
@media (max-width: 900px) {
    .side-nav {
        left: 50%;
        top: auto;
        bottom: 16px;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 14px;
        padding: 10px 18px;
        border-radius: 999px;
        background: rgba(5, 5, 8, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .side-label {
        display: none;
    }

    .side-dot {
        width: 10px;
        height: 10px;
    }
}

/* 手机：顶部导航栏图标居中放大 */
@media (max-width: 700px) {
    :root {
        --nav-h: 48px;
    }

    .top-nav {
        height: var(--nav-h);
    }

    .nav-inner {
        padding: 0 8px;
        justify-content: center;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 1.2rem;
        gap: 0;
    }

    .nav-text {
        display: none;
    }

    .nav-icon {
        font-size: 1.3rem;
    }

    /* Hero 内容适配 */
    .hero {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-greeting {
        font-size: 1rem;
        letter-spacing: 0.25em;
    }

    .pixel-title-wrap {
        padding: 0;
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 12px;
        line-height: 1.6;
    }

    /* 标签 */
    .hero-tags {
        gap: 6px;
        margin-top: 20px;
        padding: 0 8px;
    }

    .hero-tag {
        font-size: 0.72rem;
        padding: 5px 12px;
    }

    /* About */
    .about-intro {
        font-size: 0.95rem;
        line-height: 1.8;
    }

    .about-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .about-card {
        padding: 12px 14px;
    }

    .about-value {
        font-size: 0.9rem;
    }

    .game-tag {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    /* 名字来历 */
    .name-origin {
        padding: 18px 20px;
    }

    .name-origin-quote {
        font-size: 0.95rem;
        line-height: 1.8;
    }

    /* 作品卡片 */
    .work-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .work-icon {
        width: 40px;
        height: 40px;
    }

    .work-info h3 {
        font-size: 0.95rem;
    }

    .work-info p {
        font-size: 0.78rem;
    }

    .stat-downloads {
        font-size: 0.85rem;
    }

    /* GitHub */
    .github-chart {
        padding: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 提交列表 */
    .commit-item {
        padding: 8px 12px;
        font-size: 0.78rem;
        gap: 8px;
    }

    .commit-repo {
        display: none;
    }

    .commit-hash {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .commit-message {
        font-size: 0.78rem;
    }

    /* 页面通用 */
    .section {
        padding: 60px 0;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .content {
        padding: 0 16px;
    }

    /* 底部导航占位，避免挡住页脚 */
    footer {
        padding-bottom: 80px;
    }

    /* 手机端降低背景视觉强度 */
    #data-stream { opacity: 0.4; }
}

/* 超窄屏：更紧凑 */
@media (max-width: 400px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero-tag {
        font-size: 0.68rem;
        padding: 4px 10px;
    }
}

/* ---------- 无障碍：尊重减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    .scanline-sweep,
    .name-origin::after {
        animation: none;
        opacity: 0;
    }

    .side-link.active .side-dot::after {
        animation: none;
    }

    html { scroll-behavior: auto; }
}

/* ============================================================
   危险模式（红橙警报）：body.alert-mode 期间全站换色
   黑色背景不变，数据流由 JS 切换为红色调
   ============================================================ */

/* SVG 标题渐变的可控化：默认蓝紫，警报时红橙 */
.pixel-title .grad-a { stop-color: #58a6ff; }
.pixel-title .grad-b { stop-color: #a855f7; }

body.alert-mode .pixel-title .grad-a { stop-color: #ff4d4d; }
body.alert-mode .pixel-title .grad-b { stop-color: #ff9f43; }

/* ---- 链接与文本强调 ---- */
body.alert-mode a { color: #ff6b6b; }
body.alert-mode a:hover { color: #ff8f8f; text-shadow: 0 0 8px rgba(255, 82, 82, 0.45); }

body.alert-mode ::selection { background: rgba(255, 77, 77, 0.35); }

/* ---- 顶部导航 ---- */
body.alert-mode .nav-link:hover {
    color: #ff6b6b;
    background: rgba(255, 82, 82, 0.08);
    border-color: rgba(255, 82, 82, 0.35);
    text-shadow: 0 0 8px rgba(255, 82, 82, 0.45);
}
body.alert-mode .nav-icon { color: #ff5252; }

/* ---- Section 标题 ---- */
body.alert-mode .section h2::after {
    background: linear-gradient(90deg, #ff4d4d, #ff9f43);
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.45);
}

/* ---- 标签（Hero / 游戏） ---- */
body.alert-mode .hero-tag {
    background: rgba(255, 82, 82, 0.08);
    border-color: rgba(255, 82, 82, 0.32);
    color: #ffc9c9;
}
body.alert-mode .hero-tag:hover {
    background: rgba(255, 82, 82, 0.18);
    border-color: rgba(255, 82, 82, 0.7);
    box-shadow:
        0 0 16px rgba(255, 77, 77, 0.4),
        0 0 6px rgba(255, 159, 67, 0.3);
}
body.alert-mode .game-tag {
    background: rgba(255, 82, 82, 0.08);
    border-color: rgba(255, 82, 82, 0.32);
    color: #ff8f8f;
}
body.alert-mode .game-tag:hover {
    background: rgba(255, 82, 82, 0.2);
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.4);
}

/* ---- Tooltip ---- */
body.alert-mode .hero-tag::after,
body.alert-mode .game-tag::after,
body.alert-mode .about-card::after {
    border-color: rgba(255, 82, 82, 0.45);
    color: #ffd6d6;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 77, 77, 0.28);
}
body.alert-mode .hero-tag::before,
body.alert-mode .game-tag::before,
body.alert-mode .about-card::before {
    border-top-color: rgba(255, 82, 82, 0.45);
}

/* ---- 卡片 ---- */
body.alert-mode .about-card:hover {
    border-color: #ff5252;
    background: rgba(255, 82, 82, 0.05);
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.18);
}
body.alert-mode .join-card:hover {
    border-color: #ff5252;
    background: rgba(255, 82, 82, 0.05);
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.3);
}
body.alert-mode .project-card:hover {
    border-color: #ff5252;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.3);
}
body.alert-mode .join-icon,
body.alert-mode .commit-icon { color: #ff5252; }

body.alert-mode .github-cards img:hover {
    border-color: #ff5252;
    box-shadow: 0 0 16px rgba(255, 77, 77, 0.3);
}

/* ---- 名字来历 ---- */
body.alert-mode .name-origin {
    border-left-color: #ff4d4d;
    background: linear-gradient(90deg,
        rgba(255, 77, 77, 0.08) 0%,
        rgba(255, 159, 67, 0.04) 60%,
        transparent 100%);
}
body.alert-mode .name-origin:hover {
    border-left-color: #ff9f43;
    background: linear-gradient(90deg,
        rgba(255, 77, 77, 0.12) 0%,
        rgba(255, 159, 67, 0.08) 60%,
        transparent 100%);
}
body.alert-mode .name-origin-quote b {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 82, 82, 0.45);
}
body.alert-mode .name-origin-note b {
    background: linear-gradient(90deg, #ff4d4d, #ff9f43);
    -webkit-background-clip: text;
    background-clip: text;
}
body.alert-mode .quote-mark { color: #ff5252; }
body.alert-mode .name-origin::after { color: #ff5252; }

/* ---- 提交列表 ---- */
body.alert-mode .commit-hash {
    color: #ff6b6b;
    border-color: rgba(255, 82, 82, 0.35);
}
body.alert-mode .commit-item:hover .commit-hash {
    background: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.65);
}

/* ---- 侧边导航 ---- */
body.alert-mode .side-link:hover { color: #ff6b6b; }
body.alert-mode .side-link:hover .side-dot {
    background: #ff5252;
    box-shadow: 0 0 10px #ff5252;
}
body.alert-mode .side-link.active { color: #ff6b6b; }
body.alert-mode .side-link.active .side-dot {
    background: #ff5252;
    box-shadow: 0 0 12px #ff5252, 0 0 4px #ff5252;
}
body.alert-mode .side-link.active .side-dot::after {
    border-color: #ff5252;
}

/* ---- 作品列表 ---- */
body.alert-mode .work-card:hover .work-arrow { color: #ff5252; }

/* ---- 扫描线同步变红橙 ---- */
body.alert-mode .scanline-sweep-blue {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 77, 77, 0.05) 30%,
        rgba(255, 77, 77, 0.2) 50%,
        rgba(255, 77, 77, 0.05) 70%,
        transparent 100%
    );
    box-shadow: 0 0 24px rgba(255, 77, 77, 0.2);
}
body.alert-mode .scanline-sweep-purple {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 159, 67, 0.05) 30%,
        rgba(255, 159, 67, 0.2) 50%,
        rgba(255, 159, 67, 0.05) 70%,
        transparent 100%
    );
    box-shadow: 0 0 24px rgba(255, 159, 67, 0.2);
}

/* ---- 警报横幅 ---- */
.alert-banner {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 99;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    color: #ffb3b3;
    background: rgba(60, 8, 8, 0.78);
    border-bottom: 1px solid rgba(255, 77, 77, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    pointer-events: none;
}

body.alert-mode .alert-banner {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: alertBlink 1.2s ease-in-out infinite;
}

@keyframes alertBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* ---- 触发瞬间：整个画面闪烁一下 ---- */
body.alert-flash {
    animation: alertFlicker 0.6s steps(2, jump-none);
}

@keyframes alertFlicker {
    0%   { opacity: 1; }
    25%  { opacity: 0.72; }
    50%  { opacity: 1; }
    75%  { opacity: 0.85; }
    100% { opacity: 1; }
}

/* ---- 手机端：横幅字号收一点 ---- */
@media (max-width: 700px) {
    .alert-banner {
        font-size: 0.62rem;
        letter-spacing: 0.2em;
    }
}

/* ---- 警报内容接管样式 ---- */
body.alert-mode .hero-greeting {
    color: #ff6b6b;
    text-shadow: 0 0 14px rgba(255, 77, 77, 0.5);
    letter-spacing: 0.3em;
}

body.alert-mode .subtitle {
    color: #ffb3b3;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.35);
}

/* 像素标题：警报期间每 5 秒眨一次 */
body.alert-mode .pixel-title {
    animation: titleBlink 5s steps(1, jump-none) infinite;
}

@keyframes titleBlink {
    0%, 86%, 92%, 100% { opacity: 1; }
    88%, 90%           { opacity: 0; }
}

/* 被腐蚀的文字（乱码块） */
.alert-corrupt {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #ff8f8f;
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.4);
}

/* 入侵警告文案 */
.alert-intrusion {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #ff6b6b;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 2;
    text-shadow: 0 0 10px rgba(255, 77, 77, 0.45);
    padding: 18px 0;
    animation: alertBlink 1.2s ease-in-out infinite;
}

/* 通讯终端风格接管块 */
.alert-terminal {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #ff8f8f;
    background: rgba(60, 8, 8, 0.4);
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-radius: 8px;
    padding: 18px 22px;
    line-height: 2;
    font-size: 0.92rem;
    letter-spacing: 0.05em;
}

.alert-terminal .ok {
    color: #ffb347;
    text-shadow: 0 0 8px rgba(255, 159, 67, 0.5);
}

/* 减少动效：不闪烁、不呼吸 */
@media (prefers-reduced-motion: reduce) {
    body.alert-mode .alert-banner { animation: none; }
    body.alert-flash { animation: none; }
    body.alert-mode .pixel-title { animation: none; }
    body.alert-mode .alert-intrusion { animation: none; }
}

/* ---- 作品卡：无图标资源时的字母占位 ---- */
.work-icon-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: 'Bebas Neue', 'Consolas', sans-serif;
    font-size: 2rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--glow);
}
