/* 
    Design System: Cyber Premium
    Colors: Deep Purple, Ocean Blue, Neon Glow
*/

:root {
    --bg-dark: #05070a;
    --bg-card: rgba(15, 18, 25, 0.7);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #f43f5e;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

body {
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    width: 100%;
}

#app-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 5;
    /* 内容层 */
}

#page-slider {
    display: flex;
    width: 200vw;
    height: 100vh;
    transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
    background: transparent;
    will-change: transform;
    /* 开启 GPU 加速 */
}

.page {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: transparent;
}

/* 隐藏滚动条但保留功能 (Chrome/Safari) */
.page::-webkit-scrollbar {
    width: 6px;
}

.page::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

/* Slide Buttons */
.slide-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;
    cursor: pointer;
    transition: var(--transition);
    width: fit-content;
    /* 核心修复：防止容器撑满全屏遮挡交互 */
}

#slide-arrow-right {
    right: 2rem;
}

#slide-arrow-left {
    left: 2rem;
}

.btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-main);
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
    overflow: hidden;
    position: relative;
    padding: 0;
}

.slide-btn:hover .btn-inner {
    width: 140px;
    border-radius: 100px;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.slide-btn .hint {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    position: absolute;
    white-space: nowrap;
    transition: var(--transition);
    pointer-events: none;
}

#slide-arrow-right .hint {
    right: 45px;
}

#slide-arrow-left .hint {
    left: 45px;
}

.slide-btn:hover .hint {
    opacity: 1;
}

.slide-btn i {
    font-size: 1.5rem;
}

.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

/* Showcase Page Styling */
#showcase-page {
    display: flex;
    align-items: flex-start;
    /* 关键修复：从 center 改为 flex-start，防止内容在手机端被推离视口 */
    justify-content: center;
    background: radial-gradient(circle at 70% 30%, #1e1b4b 0%, #05070a 100%);
}

#trail-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* 位于 wrapper 内容之下，背景之上 */
}

.coming-soon {
    text-align: center;
}

.coming-soon h2 {
    font-size: 4rem;
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem auto;
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress {
    width: 60%;
    height: 100%;
    background: var(--primary);
    animation: loading 2s ease-in-out infinite alternate;
}

@keyframes loading {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* Cursor Glow Effect */
#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    will-change: transform;
    transition: width 0.3s, height 0.3s;
}

#cursor-glow.glow-expand {
    width: 800px;
    height: 800px;
}

/* Background Magic */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #05070a 100%);
    z-index: 1;
    /* 最底层 */
}

.bg-gradient::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite alternate;
    /* 改为呼吸动画 */
    z-index: -1;
    will-change: transform;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

/* Glassmorphism Utility - 性能优化版 */
.glass {
    background: rgba(15, 18, 25, 0.95);
    /* 提高不透明度，移除模糊，彻底解放 GPU */
    border: 1px solid var(--glass-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 仅在导航栏保留毛玻璃效果，作为视觉核心 */
#navbar.glass {
    background: rgba(15, 18, 25, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Navbar */
nav {
    position: sticky;
    /* 关键：相对于 .page 滚动容器固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition);
    margin-bottom: -80px;
    /* 让出高度，不占位 */
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    /* 增加顶部间距给导航栏 */
    position: relative;
}

.hero .container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 10px 20px -10px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 30px -10px var(--primary-glow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-main);
}

/* Hero Visual Card */
.visual-card {
    position: relative;
    padding: 2.5rem;
    border-radius: 24px;
    transform: rotate3d(1, 1, 1, 5deg);
    transition: var(--transition);
}

.visual-card:hover {
    transform: rotate3d(0, 0, 0, 0deg) scale(1.05);
}

.visual-card code {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Terminal Styles */
.terminal-card {
    width: 100%;
    max-width: 500px;
    height: 320px;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    font-family: 'Fira Code', 'Courier New', monospace;
    position: relative;
    backdrop-filter: blur(10px);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.terminal-title {
    flex-grow: 1;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 30px;
}

.terminal-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #e0e0e0;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.terminal-body::-webkit-scrollbar {
    display: none;
}

.terminal-line {
    margin-bottom: 6px;
    line-height: 1.5;
    word-break: break-all;
}

.command-output {
    color: #61afef;
    opacity: 0.9;
    margin-left: 5px;
}

.error {
    color: #e06c75;
    margin-left: 5px;
}

.input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.prompt {
    color: #98c379;
    font-weight: bold;
}

.terminal-input {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-family: inherit;
    font-size: inherit;
    outline: none !important;
    flex-grow: 1;
    padding: 0;
}

.c-1 {
    color: #c678dd;
}

/* const */
.c-2 {
    color: #e5c07b;
}

/* var name */
.c-3 {
    color: #61afef;
}

/* property */
.c-4 {
    color: #98c379;
}

/* string */

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 10;
}

.scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}

/* Sections */
.section {
    padding: 100px 0;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
}

.section-title span {
    color: var(--primary);
}

.section-title .line {
    width: 80px;
    height: 4px;
    background: var(--primary);
    margin-top: 1rem;
    border-radius: 2px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.personal-info {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.info-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stat-card {
    padding: 2rem;
    text-align: center;
    border-radius: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.skill-group {
    padding: 2.5rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.skill-group:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.1);
}

.skill-group h3 {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.skill-items {
    display: grid;
    gap: 1.5rem;
}

.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.project-card {
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img {
    height: 220px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tags span {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary);
}

.project-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary);
    gap: 0.8rem;
}

/* Contact Section */
.contact-card {
    padding: 4rem;
    border-radius: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

.contact-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-text p {
    color: var(--text-muted);
    max-width: 500px;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
}

.contact-item {
    padding: 1.2rem 2rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.contact-item:hover {
    background: var(--primary);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.contact-item i {
    font-size: 1.8rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
        max-width: 400px;
        margin: 0 auto;
    }

    h1 {
        font-size: 3rem;
    }

    .lead {
        margin: 0 auto 2.5rem;
    }

    .nav-links {
        display: none;
    }

    .about-grid,
    .skills-grid,
    .about-stats {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-card {
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }

    .contact-links {
        width: 100%;
        justify-content: center;
    }
}

/* Animations - Reveal on Scroll */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay for Hero Content */
#home .hero-content {
    transition-delay: 0.2s;
}

#home .hero-visual {
    transition-delay: 0.4s;
}

/* ============================================================
   Showcase Page (我的空间) - 实验室风格
   ============================================================ */

.showcase-wrapper {
    padding: 120px 5% 60px;
    min-height: 100vh;
}

.showcase-header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    width: 100%;
}

.showcase-header h2 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    letter-spacing: -2px;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.showcase-header .subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: 2px;
}

/* 地球英雄区 - 炫技页的门面 */
.galaxy-container {
    position: relative;
    width: 100%;
    height: 100vh;
    /* 占满首屏 */
    overflow: hidden;
    background: transparent;
    /* 彻底透明 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 120px;
    /* 增加底部留白，防止遮挡下方内容 */
}

.galaxy-container canvas {
    display: block;
}

/* 炫技页包裹层 */
.showcase-wrapper {
    position: relative;
    width: 100%;
}

/* 展厅布局 */
.showcase-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem;
    perspective: 1200px;
}

/* 实验室卡片 (3D 悬浮效果) */
.lab-card {
    position: relative;
    height: 450px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, border-color 0.3s;
}

.lab-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.lab-card .card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: transform 0.5s, opacity 0.5s;
    z-index: 0;
}

.lab-card:hover .card-image {
    opacity: 0.8;
    transform: scale(1.1);
}

.lab-card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #05070a 10%, transparent 60%);
    z-index: 1;
}

.lab-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    z-index: 2;
    transform: translateZ(50px);
    /* 关键：文字悬浮在卡片上方 */
}

.lab-card .card-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #fff;
}

.lab-card .card-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 加载状态指示器 */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .showcase-wrapper {
        padding: 80px 20px;
    }

    .showcase-header h2 {
        font-size: 2.5rem;
    }
}

/* --- 炫技页专用样式 (已隔离) --- */
/* --- 炫技页专用样式 (优化响应式) --- */
body .galaxy-container .showcase-header {
    position: absolute;
    top: 5%;
    /* 从 25% 调优至 15%，提升视觉重心 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    color: white;
    pointer-events: none;
    width: 90%;
    /* 手机端宽度适配 */
}

body .galaxy-container .showcase-header h2 {
    font-size: clamp(2rem, 10vw, 4.5rem);
    /* 使用响应式字号 */
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #ffffff, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 50px rgba(99, 102, 241, 0.3);
    white-space: normal;
    /* 手机端允许换行 */
}

body .galaxy-container .showcase-header .subtitle {
    font-size: clamp(0.9rem, 4vw, 1.4rem);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: clamp(4px, 2vw, 12px);
    font-weight: 300;
    display: block;
    margin-top: 10px;
    white-space: normal;
    /* 手机端允许换行 */
}

/* --- Game Section: Starship Defender --- */
.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: rgba(10, 12, 18, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    margin-top: 40px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

@keyframes shake {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(5px, 5px);
    }

    50% {
        transform: translate(-5px, -5px);
    }

    75% {
        transform: translate(5px, -5px);
    }

    100% {
        transform: translate(0, 0);
    }
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #05070a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
}

.btn-quit {
    background: rgba(255, 45, 85, 0.1);
    border: 1px solid rgba(255, 45, 85, 0.4);
    color: #ff2d55;
    padding: 2px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.btn-quit:hover {
    background: #ff2d55;
    color: #fff;
    box-shadow: 0 0 15px #ff2d55;
}

.btn-fullscreen {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #6366f1;
    padding: 2px 8px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    margin-right: 5px;
}

.btn-fullscreen:hover {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 0 15px #6366f1;
}

.btn-settings {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    padding: 2px 8px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    margin-right: 5px;
}

.btn-settings:hover {
    color: #00f0ff;
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    transform: rotate(45deg); /* 悬浮时齿轮微旋 */
}

/* 赛博游戏设置面板 */
.game-settings-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30; /* 高于 overlay */
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-settings-menu.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-content {
    background: rgba(15, 20, 30, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.settings-title {
    font-family: 'Space Grotesk', sans-serif;
    color: #00f0ff;
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.setting-label {
    font-size: 14px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-label i {
    color: #00f0ff;
}

/* 霓虹极客 Switch 开关 */
.cyber-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 22px;
}

.cyber-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #94a3b8;
    transition: .3s;
    border-radius: 50%;
}

.cyber-switch input:checked + .switch-slider {
    background-color: rgba(0, 240, 255, 0.1);
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.cyber-switch input:checked + .switch-slider:before {
    transform: translateX(24px);
    background-color: #00f0ff;
    box-shadow: 0 0 8px #00f0ff;
}

.btn-settings-confirm {
    background: transparent;
    border: 1px solid #00f0ff;
    color: #00f0ff;
    padding: 10px 30px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-settings-confirm:hover {
    background: #00f0ff;
    color: #05070a;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

/* 全屏状态样式 */
.game-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important; /* 提到最高 */
    margin: 0 !important;
    border-radius: 0 !important;
    background: #05070a !important;
    display: flex !important;
    flex-direction: column !important;
}

.game-container.fullscreen #game-canvas {
    flex: 1 !important;
    height: auto !important;
    width: 100% !important;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.5s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
}

.overlay-content h2 {
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: 10px;
    color: #ff2d55;
    text-shadow: 0 0 20px rgba(255, 45, 85, 0.5);
    font-weight: 800;
}

.overlay-content p {
    color: #94a3b8;
    margin-bottom: 30px;
}

.btn-game {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-game:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 30px var(--primary-color);
}

.controls-hint {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
    color: #64748b;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 42px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 78px, 0);
    }

    60% {
        clip: rect(85px, 9999px, 13px, 0);
    }

    80% {
        clip: rect(54px, 9999px, 22px, 0);
    }

    100% {
        clip: rect(91px, 9999px, 3px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(12px, 9999px, 55px, 0);
    }

    40% {
        clip: rect(78px, 9999px, 21px, 0);
    }

    60% {
        clip: rect(33px, 9999px, 89px, 0);
    }

    80% {
        clip: rect(5px, 9999px, 47px, 0);
    }

    100% {
        clip: rect(98px, 9999px, 14px, 0);
    }
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #0a0c12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.game-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(5, 7, 10, 0.8), transparent);
    z-index: 10;
    pointer-events: none;
}

.game-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 25px;
    pointer-events: auto;
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#game-score {
    letter-spacing: 1px;
}

/* 游戏血条矩阵 - 独立定位到左下角 */
.health-matrix {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 11;
    pointer-events: none;
}

.shield-bars,
.hull-bars {
    display: flex;
    gap: 4px;
}

.bar {
    width: 26px;
    height: 6px;
    border-radius: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar.shield {
    background: #00fff9;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.4);
}

.bar.hull {
    background: #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.bar.depleted {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    filter: brightness(0.2);
}

.health-matrix::after {
    content: 'CORE STATUS';
    position: absolute;
    bottom: -15px;
    /* 移动到血条下方 */
    left: 0;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1.5px;
}

@media (max-width: 768px) {
    .game-container {
        height: 400px;
    }

    .game-stats {
        font-size: 14px;
        gap: 15px;
    }
}

/* ============================================
   成就系统样式 (Achievement System)
   ============================================ */
#achievement-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.achievement-card {
    min-width: 320px;
    padding: 16px 20px;
    background: rgba(15, 18, 25, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 249, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(0, 255, 249, 0.05);
    transform: translateX(130%);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: all;
    overflow: hidden;
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
}

.achievement-card.show {
    transform: translateX(0);
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-30deg);
}

.achievement-card.show::before {
    animation: achievement-shimmer 3s infinite;
}

@keyframes achievement-shimmer {
    0% {
        left: -150%;
    }

    100% {
        left: 250%;
    }
}

.achievement-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #00fff9, #6366f1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(0, 255, 249, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.achievement-content {
    flex-grow: 1;
}

.achievement-title {
    font-size: 13px;
    font-weight: 800;
    color: #00fff9;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.achievement-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    font-weight: 300;
}

.achievement-close {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
}

.achievement-close:hover {
    color: #ff2d55;
    transform: scale(1.1);
}

/* Toast & Modal System */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    opacity: 0;
    visibility: hidden;
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px var(--primary-glow);
    z-index: 10000;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-weight: 600;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* 核心修复：隐藏时禁止交互 */
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* 显示时恢复交互 */
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    max-width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.qr-image {
    width: 250px;
    height: 250px;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: white;
    object-fit: cover;
}

.close-modal {
    margin-top: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary);
}

/* --- 下拉菜单 & 成就中心 专题样式 --- */
.nav-actions {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    color: var(--text-main);
    font-size: 1.5rem;
    position: relative;
    z-index: 1001;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 200px;
    background: rgba(15, 18, 25, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 0.8rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-btn.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item i {
    font-size: 1.1rem;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0.8rem;
}

.mobile-only {
    display: none;
}

/* 成就中心 Modal 终极显形 */
.achievement-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 600px !important;
    max-width: 95% !important;
    min-height: 300px !important;
    background: #0a0c10 !important;
    border: 2px solid #6366f1 !important;
    box-shadow: 0 0 100px rgba(99, 102, 241, 0.5);
    display: flex !important;
    flex-direction: column;
    z-index: 20005 !important;
    border-radius: 20px;
    opacity: 1 !important;
    visibility: visible !important;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--primary);
    margin: 0 !important;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    max-height: 65vh;
    overflow-y: auto;
}

/* 赛博风格滚动条 */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.achievement-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: var(--transition);
    opacity: 0.3;
    filter: grayscale(1);
    position: relative;
}

.achievement-item.unlocked {
    opacity: 1;
    filter: grayscale(0);
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
}

.achievement-item.unlocked::after {
    content: 'UNLOCKED';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 1px;
    opacity: 0.6;
}

.item-icon {
    font-size: 2rem;
    min-width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
}

.item-info h4 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

.item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.modal-footer {
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--glass-border);
}

.status-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.status-hint span {
    color: var(--primary);
    font-weight: 800;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* 适配移动端 */
/* 移动端极致性能优化 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .mobile-only {
        display: flex;
    }
    
    /* 核心性能：手机端禁用吃资源的滤镜 */
    .glass, #navbar.glass, .modal-overlay, .dropdown-menu, .game-overlay, .terminal-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(15, 18, 25, 0.98) !important; /* 提高不透明度补偿视觉 */
    }
    
    /* 减小阴影开销 */
    .achievement-modal-content {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.3) !important;
    }
}/* --- 技术栈滚动长廊 (Tech Marquee) --- */
.tech-marquee-section {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    padding: 30px 0;
    margin-top: 60px;
    margin-bottom: 60px;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    position: relative;
}

.tech-marquee-section::before,
.tech-marquee-section::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.tech-marquee-section::before {
    left: 0;
    background: linear-gradient(to right, #05070a, transparent);
}

.tech-marquee-section::after {
    right: 0;
    background: linear-gradient(to left, #05070a, transparent);
}

.tech-marquee-container {
    display: flex;
    width: max-content;
    animation: tech-marquee-scroll 80s linear infinite;
    will-change: transform;
}

@keyframes tech-marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tech-marquee-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 50px;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition);
    user-select: none;
}

.tech-marquee-item i {
    font-size: 2.2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary-glow));
    transition: var(--transition);
}

.tech-marquee-item:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

.tech-marquee-item:hover i {
    color: var(--accent);
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

.tech-marquee-section:hover .tech-marquee-container {
    animation-play-state: paused;
}

@media (max-width: 768px) {
    .tech-marquee-section {
        backdrop-filter: none;
        margin-top: 40px;
        margin-bottom: 40px;
        padding: 20px 0;
    }
    .tech-marquee-item {
        padding: 0 30px;
        font-size: 1rem;
    }
    .tech-marquee-item i {
        font-size: 1.8rem;
    }
}

/* ============================================================
   AI Assistant Widget (赛博 AI 助手)
   ============================================================ */

:root {
    --ai-primary: #00f0ff;
    --ai-primary-glow: rgba(0, 240, 255, 0.4);
    --ai-accent: #a855f7;
    --ai-accent-glow: rgba(168, 85, 247, 0.4);
}

.ai-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', 'Outfit', sans-serif;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 60px;
    height: 60px;
}

.ai-widget.open {
    width: 380px;
    height: 520px;
}

/* 悬浮圆形触发按钮 */
#ai-chat-trigger {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 12, 18, 0.7);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    color: var(--ai-primary);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#ai-chat-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--ai-primary);
    box-shadow: 0 0 30px var(--ai-primary-glow);
    color: #fff;
}

.ai-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-accent));
    color: #05070a;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* 对话面板 */
#ai-chat-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    height: 520px;
    border-radius: 20px;
    background: rgba(10, 12, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 
                0 0 40px rgba(99, 102, 241, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.075, 0.82, 0.165, 1);
}

#ai-chat-panel.hidden {
    opacity: 0;
    transform: scale(0.5) translateY(40px);
    pointer-events: none;
}

/* 面板头部 */
.ai-panel-header {
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-title i {
    font-size: 1.6rem;
    color: var(--ai-primary);
    filter: drop-shadow(0 0 5px var(--ai-primary-glow));
}

.ai-title h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #fff;
    font-weight: 600;
}

.ai-title span {
    font-size: 0.75rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-title span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

#ai-chat-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

#ai-chat-close:hover {
    color: #ff2d55;
    background: rgba(255, 45, 85, 0.1);
}

/* 对话区域 */
.ai-panel-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    scroll-behavior: smooth;
}

/* 滚动条美化 */
.ai-panel-body::-webkit-scrollbar {
    width: 6px;
}
.ai-panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.ai-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.ai-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.3);
}

/* 气泡样式 */
.ai-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.ai-msg.bot {
    align-self: flex-start;
}

.ai-msg.user {
    align-self: flex-end;
}

.ai-msg .msg-content {
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-all;
    position: relative;
}

.ai-msg.bot .msg-content {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-top-left-radius: 4px;
}

.ai-msg.user .msg-content {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ai-msg .msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.ai-msg.user .msg-time {
    align-self: flex-end;
}

/* 错误提示气泡 */
.ai-msg.error .msg-content {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* 输入区域 */
.ai-panel-footer {
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

#ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    color: #fff;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
    overflow: hidden; /* 彻底隐藏滚动条，高度由 JS 动态撑开 */
    line-height: 1.4;
}

#ai-chat-input:focus {
    border-color: var(--ai-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

#ai-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-accent));
    border: none;
    color: #05070a;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#ai-chat-send:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

#ai-chat-send:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 打字机光标动画 */
.typing-cursor::after {
    content: '▋';
    color: var(--ai-primary);
    animation: cursor-blink 0.8s infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 加载动画气泡 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-items: center;
    height: 20px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* 适配移动端性能防爆：隐藏背景滤镜，微调大小 */
@media (max-width: 768px) {
    .ai-widget {
        bottom: 20px;
        right: 20px;
    }
    #ai-chat-panel {
        width: 320px;
        height: 450px;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(15, 18, 25, 0.98) !important;
    }
}

/* ============================================
   简历多重宇宙二级菜单手机端折叠样式
   ============================================ */
/* PC端默认全部展开，隐藏折叠箭头 */
.submenu-arrow {
    display: none;
}

.submenu-wrapper {
    display: block;
    height: auto;
    overflow: visible;
}

/* 手机端（视口宽度 <= 768px）响应式折叠逻辑 */
@media (max-width: 768px) {
    .submenu-arrow {
        display: inline-block;
    }
    
    .submenu-wrapper {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding-left: 0.5rem; /* 子菜单内缩以区分层级 */
    }
    
    /* 展开激活状态 */
    .submenu-wrapper.open {
        max-height: 400px; /* 给予足够容纳6个风格的高度阈值 */
    }
    
    .submenu-trigger.active .submenu-arrow {
        transform: rotate(180deg);
        color: var(--primary);
    }
}


/* ============================================================
   Project Detail Modal (项目详情弹窗样式)
   ============================================================ */
.project-detail-content {
    position: fixed !important; /* 脱离文档流，强行锁死在视口正中央，免疫重排与拉扯 */
    top: 50% !important;
    left: 50% !important;
    width: 900px !important;
    max-width: 95% !important;
    max-height: 85vh !important; /* 锁死最大高度不超过视口的 85% */
    background: rgba(10, 12, 18, 0.95) !important;
    border: 1px solid rgba(0, 240, 255, 0.3) !important;
    box-shadow: 0 0 100px rgba(0, 240, 255, 0.25) !important;
    border-radius: 20px;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 20005 !important;
    
    /* 配合 translate(-50%, -50%) 进行平滑缩放动画，防冲突 */
    transform: translate(-50%, -50%) scale(0.8) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

/* 显示时强制以 translate(-50%, -50%) 为基准放大 */
.modal-overlay.show .project-detail-content {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.project-detail-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-height: 75vh;
}

.project-detail-left {
    position: relative; /* 确保绝对定位的 loader 拥有稳定的居中锚点，不随子容器塌陷 */
    flex: 1.2;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0 !important; /* 彻底去除内边距，让图片无缝撑满 */
    transition: background 0.3s ease; /* 切换底色时的平滑淡入淡出 */
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
    overflow: hidden; /* 保证子元素不会溢出圆角 */
}

.project-detail-img-wrapper {
    width: 100%;
    height: 100%; /* 占满容器高度 */
    flex-grow: 1; /* 强制拉伸，确保在移动端 flex-column 下高度拉满 */
    max-height: none !important; /* 去除最大高度限制 */
    overflow: hidden;
    border-radius: 0; /* 贴合边缘，不再需要内部圆角 */
    box-shadow: none; /* 贴合边缘，不需要投影 */
    border: none; /* 不需要内部边框 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-detail-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 撑满并裁剪，保证完美比例 */
    object-position: top center; /* 优先展示小程序顶部，通常是最核心的部分 */
    display: block;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.project-detail-img-wrapper img.loading {
    opacity: 0 !important;
}

/* 科技感旋转加载器 */
.project-detail-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-detail-loader.hidden {
    opacity: 0;
}

/* 科技感呼吸小圆点 Loading 动效 */
.project-detail-loader .spinner-dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary); /* 科幻青色 */
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: dot-pulse 1.2s infinite ease-in-out both;
}

.project-detail-loader .spinner-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.project-detail-loader .spinner-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dot-pulse {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.3;
    } 
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

.project-detail-img-wrapper img:hover {
    transform: scale(1.02);
}

.project-detail-right {
    flex: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    text-align: left;
}

.project-detail-right::-webkit-scrollbar {
    width: 6px;
}

.project-detail-right::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.project-detail-right::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 10px;
}

.project-detail-right::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.4);
}

#project-detail-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.project-detail-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.project-detail-highlights-wrapper h4 {
    font-size: 0.85rem;
    color: var(--primary);
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    font-weight: 800;
}

.project-detail-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.project-detail-highlights li {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-main);
    position: relative;
    padding-left: 20px;
}

.project-detail-highlights li::before {
    content: '▶';
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 0.7rem;
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

#close-project-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    font-size: 2rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

#close-project-modal:hover {
    color: #ff2d55;
    transform: rotate(90deg);
}

/* 详情弹窗手机端响应式 */
@media (max-width: 768px) {
    .project-detail-content {
        max-height: 90vh !important;
        margin: 10px !important;
        overflow-y: auto !important;
    }
    
    .project-detail-body {
        flex-direction: column;
        max-height: none;
    }

    .project-detail-left {
        padding: 0 !important;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        border-bottom-left-radius: 0;
        height: auto; /* 放弃固定高度，改为高度自适应 */
        min-height: 380px; /* 大图未就绪时的保底占位高度，确保 Loader 完美居中不塌陷 */
        display: flex; /* 确保 display */
        align-items: center;
        justify-content: center;
        flex: none; /* 彻底阻止 flex 压缩导致的图片高度塌陷 */
    }

    .project-detail-img-wrapper {
        width: 100%;
        height: auto; /* 覆盖桌面端的 100% 高度，由图片自适应撑开 */
        flex-grow: 0; /* 移除 flex 自动拉伸 */
        display: block; /* 采用块级流式排版，避免 flex 居中拉伸 */
    }

    .project-detail-img-wrapper img {
        width: 100%;
        height: auto !important; /* 强制高度自适应，按物理长宽比展现 */
        object-fit: fill; /* 完全显示整张图片不裁剪 */
    }

    .project-detail-img-wrapper img.loading {
        opacity: 0 !important;
        height: 0 !important; /* 加载时高度归零，防止 base64 占位图撑起高度，此时由 min-height 锁定 Loader 区域 */
    }

    .project-detail-right {
        padding: 1.5rem;
        overflow-y: visible;
    }
    
    #project-detail-title {
        font-size: 1.3rem;
    }
}


