:root {
    /* 核心配色 - 浅色低饱和绿 & 鸭子主题 & 酷+可爱 */
    --bg-color: #F2F5F3;
    --text-primary: #2C3E36;
    --text-secondary: #5D7A6E;
    --accent-color: #7BA896; /* 浅鸭绿 */
    --accent-warm: #E6C2BF; /* 增加一点暖色点缀 */
    --grid-line: rgba(93, 122, 110, 0.1);
    --border-color: #A3BDB1;
    
    /* 系统颜色 */
    --loader-bg: #1A2622;
    --loader-bar: #7BA896;
    
    /* 样式变量 */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 30px rgba(93, 122, 110, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* 隐藏默认光标，使用自定义JS光标 */
}

body {
    font-family: 'M PLUS Rounded 1c', 'Noto Sans SC', 'JetBrains Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* 防止滚动条出现，完全自定义滚动 */
    height: 100vh;
    width: 100vw;
    font-size: 16px; /* 增大基础字号 */
}

/* 加载动画 */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--bg-color);
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    width: 300px;
}

.loader-text {
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-size: 12px;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.1);
    position: relative;
}

.progress {
    width: 0%;
    height: 100%;
    background: var(--loader-bar);
    transition: width 0.2s;
}

/* 背景 Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* UI 层 */
#ui-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 允许穿透点击到Canvas交互 */
}

/* 允许UI元素接收点击 */
header, aside, main, .scroll-indicator {
    pointer-events: auto;
}

/* 顶部导航 */
.header-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid var(--grid-line);
    background: rgba(242, 245, 243, 0.8);
    backdrop-filter: blur(5px);
}

.logo {
    font-weight: 700;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.symbol {
    color: var(--accent-color);
}

.deco-lines {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--grid-line) 0, var(--grid-line) 5px, transparent 5px, transparent 10px);
    margin: 0 40px;
}

.system-status {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    margin-right: 50px; /* 避开右上角装饰边框 */
}

.status-indicator {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-color);
}

/* 侧边栏 */
.sidebar-left {
    position: absolute;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px; /* 加宽侧边栏 */
    border-right: 1px solid var(--grid-line);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(242, 245, 243, 0.5);
    backdrop-filter: blur(5px);
}

.nav-items {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn 0.6s ease forwards;
    animation-delay: 0.3s;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-item {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding-left: 15px;
    border-left: 4px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item:hover, .nav-item.active {
    opacity: 1;
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
    padding-left: 25px;
    background: rgba(123, 168, 150, 0.05);
}

.bottom-info {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 主内容区 */
.content-area {
    position: absolute;
    top: 60px;
    left: 280px;
    right: 0;
    bottom: 0;
    padding: 60px 100px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
}

.content-area::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.section {
    display: none;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 80vh;
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 首页样式 */
.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
}

.hero-title h1 {
    font-size: 120px;
    line-height: 0.9;
    letter-spacing: -3px;
    margin-bottom: 30px;
    position: relative;
    font-weight: 800;
}

.cn-title {
    font-size: 40px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 50px;
    line-height: 1.2;
    opacity: 0.9;
}

.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    color: rgba(255,0,0,0.1);
    z-index: -1;
    transform: translate(-2px, 2px);
}

.glitch-text::after {
    color: rgba(0,255,0,0.1);
    z-index: -2;
    transform: translate(2px, -2px);
}

.subtitle {
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 40px;
    color: var(--accent-color);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.hero-desc {
    font-size: 18px;
    max-width: 600px;
    line-height: 1.8;
    color: var(--text-secondary);
    border-left: 4px solid var(--accent-color);
    padding-left: 25px;
    font-weight: 500;
    margin-bottom: 30px;
}

/* 桌面端右侧面板 */
.hero-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
}

.hero-side.desktop-only {
    display: flex;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
}

.data-box {
    width: 100%;
    border: none;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.box-header {
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 12px 20px;
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 700;
}

.box-content {
    padding: 30px;
}

.metric {
    margin-bottom: 20px;
}

.metric:last-child {
    margin-bottom: 0;
}

.metric .label {
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.bar-container {
    height: 12px;
    background: #e0e0e0;
    width: 100%;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 6px;
    transition: width 1s ease;
}

.bar-fill.duck-energy {
    background: #FFD700;
}

.metric .value {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* 作品样式 */
.gallery-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 40px;
}

.flip-card {
    background-color: transparent;
    width: 28%;
    aspect-ratio: 9 / 16;
    perspective: 1000px;
    cursor: none;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1);
    border-radius: var(--radius-lg);
    will-change: transform; /* 优化渲染性能 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--border-color);
}

/* 正面 - 文字展示 (塔罗牌/扑克牌风格) */
.flip-card-front {
    display: flex;
    flex-direction: column;
}

.flip-card-front.text-front {
    background-color: var(--text-primary);
    background-image:
        radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.2) 100%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 10px);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    border: 8px solid var(--text-primary);
    box-shadow:
        inset 0 0 0 2px var(--accent-color),
        inset 0 0 20px rgba(0,0,0,0.3);
}

/* 装饰性边角 (模拟卡牌花纹) */
.flip-card-front.text-front::before {
    content: '';
    position: absolute;
    top: 15px; left: 15px; right: 15px; bottom: 15px;
    border: 1px dashed rgba(123, 168, 150, 0.3);
    border-radius: var(--radius-md);
    pointer-events: none;
    -webkit-backface-visibility: hidden; /* 修复翻转残留 */
    backface-visibility: hidden;
}

.flip-card-front.text-front *, .flip-card-back * {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-front.text-front h3 {
    font-size: 32px;
    margin-bottom: 25px;
    color: var(--accent-color);
    font-family: 'Cinzel', serif; /* 如果字体不支持则回退 */
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 1;
}

.flip-card-front.text-front p {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
    margin-bottom: 30px;
    z-index: 1;
}

.flip-card-front.text-front .hint {
    font-size: 12px;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    margin-top: auto;
    z-index: 1;
}

.card-img-container {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.flip-card:hover .cover-img {
    transform: scale(1.1);
}

.card-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 25px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    line-height: 1.5;
}

/* 卡片背面信息覆盖层 - 左对齐+黑色渐变 */
.card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 25px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    color: #fff;
    text-align: left;
}

.card-info-overlay h4 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.card-info-overlay p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
}

.card-info-overlay .status {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

/* 背面 - 图片展示 */
.flip-card-back {
    background-color: var(--text-primary);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
}

.flip-card-back.img-back {
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flip-card-back.img-back .cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 鸭子拼贴背面 */
.flip-card-back.collage-back {
    background: #A3BDB1;
    position: absolute; /* 修复定位问题，确保翻转后能覆盖正面 */
    top: 0;
    left: 0;
    overflow: hidden;
}

/* 鸭子网格展示 (高级感) - 改为垂直滚动流 */
.duck-grid-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: #2C3E36;
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); /* 顶部底部虚化遮罩 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    position: relative;
    perspective: 800px; /* 开启3D透视 */
}

.duck-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70%; /* 限制宽度，居中 */
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

.scatter-duck {
    position: relative; /* 改为相对定位，自然堆叠 */
    width: 100%; /* 占满父容器宽度 */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.4));
    margin-bottom: 20px; /* 鸭子间距 */
    /* 移除之前的 transition 和 will-change，统一在父容器控制或单独控制 */
    will-change: auto;
}

/* 移除旧的grid样式干扰 */
.duck-grid img {
    aspect-ratio: auto;
    border-radius: 0;
    background: transparent;
    border: none;
    animation: none; /* 交给JS控制或重新定义 */
}

/* 翻转卡片残留修复加强 */
.flip-card-front, .flip-card-back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    background-color: var(--text-primary); /* 确保背景不透明 */
    z-index: 2; /* 默认层级 */
}

.flip-card-front {
    z-index: 5;
    transform: rotateY(0deg);
}

.flip-card-back {
    transform: rotateY(180deg);
    /* z-index: 1;  移除手动层级控制，完全依赖 3D 空间关系 */
}

/* 翻转时层级控制在JS中可能更好，但纯CSS可以用 */
/* 移除 z-index hover 切换，防止闪烁 */
/*
.flip-card:hover .flip-card-front {
    z-index: 1;
}

.flip-card:hover .flip-card-back {
    z-index: 5;
}
*/

.flip-card-back h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.flip-card-back p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tags-mini span {
    display: inline-block;
    padding: 5px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    font-size: 12px;
    margin: 5px;
}

/* 鸭子拼贴动效 */
.collage-container {
    background-color: #A3BDB1;
    position: relative;
}

.floating-duck {
    position: absolute;
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
    animation: floatDuck 6s ease-in-out infinite;
    z-index: 1;
}

.d1 { top: 10%; left: 10%; animation-delay: 0s; width: 120px; height: 120px; }
.d2 { top: 30%; right: 5%; animation-delay: 1s; width: 140px; height: 140px; }
.d3 { bottom: 15%; left: 25%; animation-delay: 2s; width: 100px; height: 100px; }

@keyframes floatDuck {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.duck-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(93, 122, 110, 0.2));
}

/* 头像优化 */
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 备案 Footer */
.beian-footer {
    position: fixed; /* Desktop: Fixed at bottom of screen */
    bottom: 0;
    left: 280px; /* 避开侧边栏 */
    right: 0;
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
    pointer-events: auto;
    background: rgba(242, 245, 243, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.beian-footer a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.beian-footer a:hover {
    color: var(--accent-color);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* 移动端导航遮罩 */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(242, 245, 243, 0.98); /* 增加不透明度以弥补移除模糊 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

.nav-item-mobile {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-nav-overlay.active .nav-item-mobile {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-overlay.active .nav-item-mobile:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav-overlay.active .nav-item-mobile:nth-child(2) { transition-delay: 0.2s; }
.mobile-nav-overlay.active .nav-item-mobile:nth-child(3) { transition-delay: 0.3s; }

/* 菜单打开时的按钮动画 */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 1024px) {
    body {
        cursor: auto; /* 移动端恢复默认光标 */
        overflow-y: auto; /* 允许body滚动 */
        overflow-x: hidden;
    }
    
    #ui-layer {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .header-bar {
        padding: 0 20px;
        justify-content: space-between;
        position: fixed; /* 移动端固定头部 */
        z-index: 100;
    }

    .logo .text {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .deco-lines, .system-status {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* 侧边栏隐藏 */
    .sidebar-left {
        display: none;
    }

    /* 内容区调整 - 全屏滚动容器 */
    .content-area {
        position: relative;
        top: 0;
        left: 0;
        width: 100vw;
        height: auto;
        padding: 0;
        overflow: visible;
        z-index: 50;
    }
    
    /* 修正顶部导航遮挡问题，移动端导航背景透明度调整或悬浮 */
    .header-bar {
        background: transparent; /* 透明背景让位于全屏展示 */
        border-bottom: none;
        pointer-events: none; /* 让点击穿透，除了按钮 */
    }
    
    .mobile-menu-btn {
        pointer-events: auto;
        background: rgba(242, 245, 243, 0.8);
        padding: 10px;
        border-radius: 50%;
        width: 44px; /* 增大点击区域 */
        height: 44px;
        align-items: center;
        justify-content: center;
        gap: 5px; /* 调整间距 */
    }
    
    .mobile-menu-btn span {
        width: 24px; 
    }
    
    .logo {
        pointer-events: auto;
        background: rgba(242, 245, 243, 0.8);
        padding: 5px 10px;
        border-radius: 20px;
        backdrop-filter: blur(5px);
    }

    /* 通用块样式 - 高度自适应内容 */
    .section {
        min-height: auto;
        height: auto;
        margin: 0;
        opacity: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transform: none;
        padding: 80px 20px 40px 20px;
        box-sizing: border-box;
    }
    
    /* 首页特殊处理 - 占满一屏 */
    #home {
        min-height: 100vh;
        min-height: 100dvh;
        justify-content: center;
    }
    
    .section:not(.active) {
        display: flex; /* 强制显示所有 section 以便滚动 */
    }
    
    /* 首页调整 */
    .hero-container {
        width: 100%;
        height: 100%;
        justify-content: center;
        gap: 20px;
    }
    
    .hero-title h1 {
        font-size: 42px;
    }
    
    /* 移动端隐藏桌面端专属元素 */
    .desktop-only {
        display: none !important;
    }
    
    /* 移动端显示技术栈和能量条 */
    .data-box, .tech-stack {
        display: block;
        width: 100%;
        max-width: 100%;
    }
    
    /* 移动端显示Skills Section */
    .skills-section {
        display: flex !important;
        min-height: auto;
        padding: 40px 20px;
        background: rgba(242, 245, 243, 0.9);
    }
    
    .skills-container {
        width: 100%;
        max-width: 100%;
        padding: 0 20px;
    }
    
    .hero-desc {
        font-size: 13px;
        max-width: 80%;
    }

    /* 作品集容器调整 - 允许内部元素 snap */
    #works {
        height: auto; /* 让父级自适应，内部卡片撑开 */
        min-height: auto;
        padding: 0;
        display: block; /* 恢复块级以便放置 header 和 grid */
    }
    
    .section-header {
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        scroll-snap-align: start;
        background: rgba(242, 245, 243, 0.5);
    }

    .gallery-grid {
        display: block; /* 取消flex，让卡片自然堆叠 */
        margin: 0;
        height: auto;
    }

    /* 翻转卡片 - 竖屏 9:16 全屏样式 */
    .flip-card {
        width: 100vw;
        height: 100vh;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 30px; /* 四周留白作为“边框”效果 */
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent; /* 背景透明，利用边距透出底色 */
        margin: 0;
        border: none;
        aspect-ratio: auto; /* 重置 */
    }
    
    .flip-card-inner {
        width: 100%;
        /* 计算高度以符合 9:16 比例，同时不超过屏幕高度 */
        height: auto;
        aspect-ratio: 9 / 16;
        max-height: 100%;
        max-width: 56.25vh; /* 9/16 * 100vh */
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    }
    
    /* 移动端点击交互提示 */
    .flip-card-front.text-front .hint {
        content: "TAP TO FLIP"; /* CSS替换不了文本，但在移动端可以理解 */
    }

    /* 关于我调整 */
    #about {
        scroll-snap-align: start;
    }
    
    .about-container {
        flex-direction: column;
        gap: 20px;
        justify-content: center;
        height: 100%;
        width: 100%;
    }
    
    .profile-block, .social-links {
        width: 100%;
        background: rgba(255,255,255,0.6);
        padding: 20px;
        flex: initial; /* 取消伸缩 */
    }
    
    .avatar-placeholder {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }

    /* 底部调整 */
    .beian-footer {
        scroll-snap-align: start; /* 页脚也作为一屏，或者合并在About里 */
        height: auto;
        min-height: 100px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: var(--bg-color);
        padding: 40px 20px;
        margin: 0;
    }
    
    /* 滚动提示常驻 */
    .scroll-indicator {
        display: flex !important; /* 强制显示 */
        position: fixed;
        bottom: 30px;
        right: 50%;
        transform: translateX(50%) rotate(0deg); /* 居中且不旋转 */
        z-index: 100;
        font-size: 12px;
        color: var(--text-secondary);
        opacity: 0.6;
        animation: bounce 2s infinite;
    }
    
    .scroll-indicator .line {
        display: none; /* 移动端不需要横线 */
    }
    
    .scroll-indicator::after {
        content: '↓';
        display: block;
        font-size: 16px;
        margin-left: 5px;
    }
    
    @keyframes bounce {
        0%, 20%, 50%, 80%, 100% {transform: translateX(50%) translateY(0);}
        40% {transform: translateX(50%) translateY(-10px);}
        60% {transform: translateX(50%) translateY(-5px);}
    }

    /* 隐藏自定义光标 */
    .custom-cursor, .custom-cursor-dot {
        display: none !important;
    }
    
    /* 首页文字居中 */
    .hero-title {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-desc {
        border-left: none;
        border-top: 4px solid var(--accent-color);
        padding-left: 0;
        padding-top: 20px;
        text-align: center;
    }
}

.about-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.profile-block {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
}

.avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    /* 从上(白)到下(绿)的渐变背景 */
    background: linear-gradient(to bottom, #ffffff 0%, #7BA896 100%);
    padding: 2px; /* 模拟边框宽度 */
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* 保持圆形外轮廓 */
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent; /* 内部透明或根据需要设置背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 1像素内圈效果 - 可以用伪元素或border实现 */
.avatar-inner::after {
    content: '';
    position: absolute;
    top: 1px; left: 1px; right: 1px; bottom: 1px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.5); /* 淡淡的内圈线 */
    pointer-events: none;
}

.avatar-inner img {
    /* 方形图片，四角显示完全 -> 不设置border-radius: 50% */
    /* 大小控制在圆形内部，内接正方形边长约为圆直径的70.7% */
    width: 70%; 
    height: 70%;
    object-fit: contain; /* 保持比例 */
    border-radius: 0; /* 纯方形，直角 */
    transform: none;
    background: transparent !important; /* 移除白色背景，透明显示 */
    box-shadow: none !important; /* 移除阴影，防止出现方形边框 */
    border: none !important;
    outline: none !important;
}

.profile-text h3 {
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.big-text {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
}

.profile-text p {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.badge-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.badge {
    padding: 8px 16px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.tech-stack {
    flex: 1;
    background: rgba(255,255,255,0.5);
    padding: 40px;
    border-radius: var(--radius-lg);
}

.tech-stack.home-tech {
    width: 100%;
}

/* Skills Section - 桌面端隐藏 */
.skills-section {
    display: none;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.tech-stack h3 {
    margin-bottom: 30px;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--accent-color);
}

/* 社交链接 */
.social-links {
    flex: 1;
    background: rgba(255,255,255,0.5);
    padding: 40px;
    border-radius: var(--radius-lg);
}

.social-links h3 {
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 30px;
    color: var(--accent-color);
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-item:hover {
    border-color: var(--accent-color);
    transform: translateX(10px);
}

.social-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.social-name {
    font-size: 18px;
    font-weight: 700;
}

/* 唤声样式 */
.quack {
    font-size: 48px !important;
    font-weight: 900;
    color: var(--accent-color) !important;
    margin-top: 20px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tags span {
    padding: 10px 20px;
    background: #fff;
    border: 2px solid var(--accent-color);
    color: var(--text-primary);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
}

.tags span:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1) rotate(-2deg);
}


/* 装饰元素 */
.corner-deco {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
}

.top-right {
    top: 30px;
    right: 30px;
    border-left: none;
    border-bottom: none;
}

.bottom-right {
    bottom: 30px;
    right: 30px;
    border-left: none;
    border-top: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    right: 100px;
    transform: rotate(90deg);
    transform-origin: right bottom;
    font-size: 10px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.scroll-indicator .line {
    width: 50px;
    height: 1px;
    background: var(--text-secondary);
}

/* 自定义光标 (JS实现圆圈跟随，这里先保留基础CSS) */
body {
    cursor: default; /* 回退 */
}

@media (max-width: 1024px) {
    /* 全局强制重置光标和触摸行为 */
    * {
        cursor: auto !important;
        touch-action: manipulation; /* 优化触摸响应，防止双击缩放延迟 */
        -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    }

    /* 基础重置 - 移动端普通滚动（移除scroll-snap） */
    html {
        overflow-y: auto; 
        height: auto;
        scroll-behavior: smooth; 
        -webkit-overflow-scrolling: touch;
    }

    body {
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        height: auto;
        min-height: 100%;
        background: transparent;
    }

    #bg-canvas {
        display: block; /* 移动端显示canvas粒子背景 */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
        pointer-events: none;
    }

    #ui-layer {
        height: auto; /* 让 UI 层跟随内容 */
        position: static; /* 移除 fixed/absolute */
        overflow: visible;
        pointer-events: auto; /* 恢复交互 */
    }
    
    .sidebar-left, .deco-lines, .system-status {
        display: none;
    }
    
    /* 移动端菜单 */
    .mobile-menu-btn {
        display: flex;
        background: rgba(242, 245, 243, 0.95); 
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-bar {
        position: fixed;
        top: 0;
        left: 0;
        background: transparent;
        border: none;
        pointer-events: none;
        z-index: 100;
        width: 100%;
        height: auto;
    }
    
    .header-bar > * {
        pointer-events: auto;
    }
    
    .logo {
        background: rgba(242, 245, 243, 0.95);
        padding: 5px 12px;
        border-radius: 20px;
        backdrop-filter: none; 
        -webkit-backdrop-filter: none;
        margin-top: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .logo .text {
        font-size: 12px;
    }

    /* 核心滚动容器 - 改回普通流 */
    .content-area {
        position: relative;
        top: 0; left: 0;
        width: 100%;
        height: auto;
        padding: 0;
        overflow: visible;
        z-index: 10;
        /* 移除 touch-action 限制，让浏览器自动处理 */
    }
    
    /* 通用块 - 高度自适应 */
    .section {
        min-height: auto;
        height: auto;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 60px 20px 40px 20px;
        box-sizing: border-box;
        margin: 0;
        transform: none !important;
        opacity: 1 !important;
        position: relative;
        background: rgba(242, 245, 243, 0.85);
    }
    
    /* 首页占满一屏 */
    #home {
        min-height: 100vh;
        min-height: 100dvh;
        justify-content: center;
        padding-top: 80px;
    }

    /* 优化作品集卡片 */
    .flip-card {
        width: 100%;
        min-height: 80vh;
        height: auto;
        padding: 20px; 
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        background: rgba(242, 245, 243, 0.85);
        aspect-ratio: auto;
    }
    
    .flip-card-inner {
        width: 100%;
        aspect-ratio: 9 / 16;
        height: auto; 
        /* 留出更多空间给上下UI */
        max-height: calc(100dvh - 100px); 
        max-width: calc((100dvh - 100px) * 9 / 16);
        
        box-shadow: 0 10px 25px rgba(0,0,0,0.15); /* 降低阴影复杂度 */
        border-radius: 20px;
        border: 2px solid rgba(123, 168, 150, 0.5);
        /* 性能优化 */
        will-change: transform;
        transform: translateZ(0);
    }

    /* 页脚 */
    .beian-footer {
        position: relative;
        left: 0;
        width: 100%;
        min-height: 120px;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: var(--bg-color);
        margin: 0;
        padding: 30px 20px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    /* 优化滚动提示动画 */
    @keyframes floatArrow {
        0%, 100% { transform: translateY(0); opacity: 0.6; }
        50% { transform: translateY(5px); opacity: 1; }
    }
    
    /* 滚动提示 - 固定定位 */
    .scroll-indicator {
        display: flex !important;
        position: fixed;
        bottom: 30px;
        right: 50%; /* 居中 */
        transform: translateX(50%);
        flex-direction: column;
        z-index: 200;
        color: var(--text-secondary);
        font-size: 12px;
        opacity: 0.6;
        pointer-events: none;
    }
    
    .scroll-indicator .line { display: none; }
    
    /* 添加动态箭头 */
    .scroll-indicator::after {
        content: "↓";
        font-size: 24px;
        display: block;
        text-align: center;
        margin-top: 5px;
        animation: floatArrow 1.5s infinite ease-in-out;
    }
    
    /* 隐藏不需要的元素 */
    .corner-deco, .custom-cursor, .custom-cursor-dot {
        display: none !important;
    }
    
    /* 首页调整 */
    .hero-container {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 30px;
    }
    
    .hero-title {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-title h1 { font-size: 48px; text-align: center; line-height: 1.1; }
    .cn-title { font-size: 24px; margin-bottom: 20px; }
    .hero-desc { 
        text-align: center; 
        border-left: none; 
        border-top: 3px solid var(--accent-color); 
        padding-top: 20px; 
        padding-left: 0; 
        font-size: 14px;
        margin-top: 10px;
    }
    /* 移动端显示右侧面板（技术栈+能量条） */
    .right-panel { 
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 20px;
        margin-top: 30px;
    }
    
    .data-box {
        border-radius: 16px;
    }
    
    .box-content {
        padding: 20px;
    }
    
    .tech-stack {
        padding: 20px;
        border-radius: 16px;
    }
    
    .tech-stack h3 {
        margin-bottom: 15px;
        font-size: 12px;
    }
    
    .tags {
        gap: 10px;
    }
    
    .tags span {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* 作品集容器特殊处理 */
    #works {
        height: auto; /* 让父级自适应，不限制高度 */
        min-height: 0;
        padding: 0;
        display: block;
    }
    
    /* 作品集标题页 */
    .section-header {
        height: auto;
        min-height: 150px;
        padding: 40px 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(242, 245, 243, 0.5);
    }
    
    .gallery-grid {
        display: block;
        margin: 0;
        height: auto;
    }
    
    /* 移动端点击提示 */
    .flip-card-front.text-front .hint {
        content: "TAP TO FLIP";
    }

    #about {
        min-height: auto; /* 允许内容自适应 */
        padding-bottom: 40px;
    }
    
    .about-container {
        flex-direction: column;
        justify-content: flex-start;
        gap: 20px;
        width: 100%;
        max-width: 100%;
    }
    .profile-block, .social-links { 
        width: 100%; 
        background: rgba(255,255,255,0.9); 
        padding: 20px; 
        border-radius: 16px; 
        flex: initial;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }
    
    .social-links {
        margin-bottom: 20px;
    }
    
    .link-list {
        gap: 15px;
    }
    
    .social-item {
        padding: 15px;
    }

    /* 滚动提示 - 固定定位，只在第一页显示 */
    .scroll-indicator {
        display: flex !important;
        position: fixed;
        bottom: 30px;
        left: 50%; /* 居中 */
        transform: translateX(-50%);
        flex-direction: column;
        align-items: center;
        z-index: 200;
        color: var(--text-secondary);
        font-size: 12px;
        opacity: 0.6;
        pointer-events: none;
        transition: opacity 0.3s ease; /* 平滑过渡 */
        background: rgba(242, 245, 243, 0.8);
        padding: 8px 16px;
        border-radius: 20px;
    }
    
    .scroll-indicator .line { display: none; }
    
    /* 添加动态箭头 */
    .scroll-indicator::after {
        content: "↓";
        font-size: 20px;
        display: block;
        text-align: center;
        margin-top: 3px;
        animation: floatArrow 1.5s infinite ease-in-out;
    }
    
    @keyframes floatArrow {
        0%, 100% { transform: translateY(0); opacity: 0.6; }
        50% { transform: translateY(5px); opacity: 1; }
    }
    
    /* 隐藏不需要的元素 */
    .corner-deco, .custom-cursor, .custom-cursor-dot {
        display: none !important;
    }
}
