/* ==========================================
   PROJECT PAGE LAYOUT (左右分栏布局)
   ========================================== */

/* 1. 整体容器 */
/* ==========================================
   PROJECT PAGE LAYOUT (全页滚动优化)
   ========================================== */

.project-container {
    display: flex;
    padding-top: 100px; 
    /* --- 核心修改：取消高度锁定 --- */
    height: auto; 
    min-height: 100vh;
    width: 100%;
    overflow: visible; /* 允许整体页面滚动 */
    
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* 2. 侧边栏：从“独立滚动”变为“粘性跟随” */
.project-sidebar {
    width: 320px;
    /* 修改点：改为 sticky */
    position: sticky;
    top: 100px; /* 距离顶部导航栏的间距 */
    height: fit-content;
    max-height: calc(100vh - 120px);
    
    padding: 60px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto; /* 仅当侧边列表超出一屏时内部滚动 */
    background-color: transparent;
}

/* 3. 右侧展示区：跟随页面主体滚动 */
.project-display {
    flex: 1;
    height: auto; 
    padding: 60px 80px;
    overflow: visible; /* 取消内部滚动条 */
    background-color: transparent;
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 40px;
}

/* project.css */

.detail-img-item {
    /* 将最大宽度缩小到 600px，这通常是作品集展示最舒适的宽度 */
    max-width: 1024px; 
    
    width: 100%; 
    display: block;
    margin: 0 auto 30px; /* 居中，并留出下边距 */
    
    border-radius: 4px;
    border: 1px solid #222;
    object-fit: contain; /* 确保图片比例不失真 */
}

/* 视频也同步缩小 */
.video-container {
    max-width: 1024px;
    width: 100%;
    margin: 40px auto 80px;
    aspect-ratio: 16 / 9; /* 强制保持 16:9 比例 */
}

.video-container iframe {
    width: 100%;
    height: 100%; /* 填满由 aspect-ratio 撑开的高度 */
    border: none;
}

/* --- 手机端响应式优化 --- */
@media (max-width: 900px) {
    /* 1. 视频比例：继续保持 16:9，就像图片一样自动缩小 */
    .video-container {
        margin: 20px 0 30px;
        aspect-ratio: 16 / 9; 
    }
}

/* 分类主按钮 (UI/UX, Film 等) */
.category-btn {
    background: none;
    border: none;
    color: #555; /* 默认灰暗 */
    font-family: 'SFPro-Medium', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    display: block;
    text-align: left;
}

.category-btn:hover {
    color: #fff;
    letter-spacing: 3px; /* 悬停时稍微拉开，增加动感 */
}

.category-btn.active {
    color: #fff;
}

/* 点击分类后弹出的具体项目名字列表 */
.project-titles {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
    display: none; /* JS 会控制显示 */
    border-left: 1px solid #333; /* 侧边的垂直装饰线 */
    padding-left: 20px;
}

.project-titles li {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 300;
}

.project-titles li:hover {
    color: #7a7adb; /* 亮色点缀 */
    transform: translateX(5px);
}

/* 3. 右侧内容展示区 (Display Area) */
.project-display {
    flex: 1;
    height: 100%;
    padding: 60px 80px;
    overflow-y: auto; /* 内容长时在此滚动 */
    background-color: #000;
}

/* 项目内容的显示/隐藏状态 */
.project-content {
    display: none;
    animation: fadeIn 0.6s ease-out;
}

.project-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 4. RECENT WORK 网格布局 */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 两列布局 */
    gap: 40px;
    margin-top: 40px;
}

.work-item {
    cursor: pointer;
    transition: transform 0.4s ease;
}

.work-item:hover {
    transform: translateY(-5px);
}

.work-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    font-size: 0.8rem;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #222;
}

.work-item h3 {
    font-size: 0.9rem;
    font-family: 'SFPro-Medium';
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 5. 具体项目详情样式 */
.back-btn {
    background: none;
    border: 1px solid #333;
    color: #888;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-bottom: 40px;
    transition: 0.3s;
    text-transform: uppercase;
}

.back-btn:hover {
    border-color: #fff;
    color: #fff;
}

.detail-body h2 {
    font-family: "SFPro-Medium";
    font-style: italic;
    font-size: 3rem;
    margin-bottom: 20px;
}

.detail-description {
    max-width: 600px;
    line-height: 1.6;
    color: #aaa;
    margin-bottom: 40px;
}

.demo-link-container {
    text-align: center;
    margin: 30px 0 50px;
}

.visit-btn {
    display: inline-block;
    padding: 12px 35px;
    border: 1px solid #fff;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.visit-btn:hover {
    background: #fff;
    color: #000;
}
.project-role {
    text-align: center;
    /* 1. 调小字号：0.75rem 或 0.8rem 看起来会更精致 */
    font-size: 0.75rem; 
    color: #bbb; /* 稍微调暗一点点，视觉上会显得更瘦更轻 */
    
    /* 2. 调瘦字体：前提是你的字体库支持 300(Light) 或 200(Extra Light) */
    font-weight: 300; 
    
    /* 3. 增加间距：控制与下方 Description 的距离 */
    margin-top: 15px; 
    margin-bottom: 40px; 
    
    font-family: 'SFPro-Medium', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-role strong {
    /* 让 "Role:" 标签比后面的内容稍微亮一点，形成对比 */
    color: #888;
    font-weight: 500;
    margin-right: 8px;
}

/* ==========================================
   MOBILE RESPONSIVE (手机端深度优化)
   ========================================== */

/* ==========================================
   PROJECT PAGE MOBILE (彻底左对齐版)
   ========================================== */
@media (max-width: 900px) {
    .serif-title {
        /* 将字号从桌面端的超大尺寸降至 2rem 或 2.2rem */
        font-size: 2.2rem !important; 
        
        /* 保持 Y2K 的张扬感，但缩小体积 */
        letter-spacing: -1px; 
        margin-top: 20px;
        margin-bottom: 30px;
        
        /* 确保它是左对齐，符合你的整站逻辑 */
        text-align: left;
        
        /* 使用较轻的字重可以增加高级感 */
        font-weight: 400; 
        font-style: italic; /* 延续你 About 页面的斜体风格 */
    }

    /* 压缩展示区的内边距，让作品图更靠上 */
    .project-display {
        padding: 20px !important;
    }



    /* 1. 容器调整 */
    .project-container {
        flex-direction: column;
        height: auto; 
        overflow: visible;
        padding-top: 60px;
    }

    /* 2. 侧边栏转为吸顶栏 */
    .project-sidebar {
        width: 100%;
        height: auto;
        padding: 10px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        background-color: #000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* 3. 分类列表：等宽且左对齐 */
    .category-list {
        display: flex;
        flex-direction: row;
        width: 100%;
        padding: 0 20px; /* 给左右留点呼吸空间 */
        box-sizing: border-box;
    }

    .category-item {
        flex: 1; /* 保持四个分类宽度完全一致 */
        margin-bottom: 0;
        text-align: left; /* 强制左对齐，解决你说的居中问题 */
    }

    .category-btn {
        font-size: 0.7rem;
        letter-spacing: 1px;
        text-align: left; /* 确保按钮文字靠左 */
        width: 100%;
    }

    /* 4. 项目列表：强制从屏幕最左侧开始 */
    .project-titles.active {
        display: block;
        position: fixed; /* 使用 fixed 彻底脱离父元素按钮的定位 */
        left: 0;
        top: 105px; /* 根据导航栏高度微调，确保紧贴分类栏下方 */
        width: 100vw;
        background: #000;
        padding: 20px 20px 30px 20px; /* 这里的 20px 与上面 category-list 的 padding 对齐 */
        z-index: 1001;
        border-bottom: 1px solid #222;
        border-left: none !important; /* 去掉桌面端的垂直线 */
        text-align: left;
    }

    .project-titles li {
        margin-bottom: 15px;
        padding-left: 0; /* 确保不缩进 */
    }

    /* 5. 展示区压缩 */
    .project-display {
        padding: 20px;
        width: 100%;
    }
}

/* 核心修复：给导航目标预留偏移量 */
hero-section, 
.project-container {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* 给 About 区域单独定义，不加 scroll-snap-align */
.about-section {
    min-height: 100vh;
    padding: 150px 10% 100px;
    background: #000;
    /* 不要在这里写 scroll-snap-align */
}