/* pages.css - 页面级/复杂内容样式 */

/* --- 导航内容切换样式 --- */

/* 默认隐藏内容区域，使用 opacity 和 visibility 实现淡入淡出效果 */
.content-section {
    max-width: 600px;
    /* 增加100px，从500px改为600px */
    display: none;
    padding-bottom: 20px;
    /* 添加底部间距 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    /* 添加轻微的上移效果 */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out, transform 0.4s ease-in-out;
    /* 添加过渡动画 */
}

/* 激活的内容区域才显示 */
.content-section.active-content {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 使用 active 类的平滑过渡 */
.content-section.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Now Section 样式 */
.now-section {
    margin-top: 15px;
}

.now-list {
    max-width: 500px;
    list-style: none;
    /* 移除默认的列表点 */
    padding: 0;
    margin-top: 20px;
}

.now-section h4 {
    font-size: 1.1em;
    font-weight: 600;
}

.now-list li {
    margin-bottom: 10px;
    /* 略微减小间距，与 list-detail li 保持一致 */
    font-size: 1.1em;
    line-height: 1.6;
    /* ⭐ 修正行高，与 About 列表统一 ⭐ */
    color: var(--text-color);
}

.now-list strong {
    color: var(--accent-color);
    font-weight: 400;
    /* 强制去掉加粗 */
}

/* 详细列表样式 */
.list-detail {
    list-style: none;
    padding-left: 15px;
    margin-top: 15px;
}

.list-detail li {
    font-size: 1.1em;
    margin-bottom: 8px;
    position: relative;
    padding-left: 15px;
}

.list-detail li::before {
    content: '•';
    /* 使用小圆点 */
    color: var(--gray-text);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}


/* Done Section 样式与 Now Section 类似 */
.done-section {
    padding-bottom: 20px;
    margin-top: 20px;
    /* 与 NowSection 拉开距离 */
}

.done-section h4 {
    font-size: 1.1em;
    font-weight: 600;
}

.done-list {
    /* 样式与 .now-list 相同 */
    max-width: 500px;
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.done-list li {
    margin-bottom: 10px;
    /* 略微减小间距 */
    font-size: 1.1em;
    line-height: 1.6;
    /* ⭐ 修正行高 ⭐ */
    color: var(--gray-text);
    /* 保持颜色稍淡 */
}



/* 统一去除 About, Now, Done 区域内的所有粗体 */
.about-long-section strong,
.about-long-section b,
.now-section strong,
.now-section b,
.done-section strong,
.done-section b {
    font-weight: 400 !important;
}

/* --- 长篇 About 区域样式优化 --- */

#about {
    max-width: 600px;
    /* 增加100px，从500px改为600px */
    margin-top: 15px;
    padding-left: 0;
    /* 确保左边距一致 */
}

/* 优化副标题（h4 标签） */
.about-long-section .detail-subtitle {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);

    /* ⭐ 关键调整 1: 统一并增大顶部间距，区分板块 ⭐ */
    margin-top: 40px;
    /* 20px * 2 = 40px */

    /* ⭐ 关键调整 2: 统一底部间距，让内容紧随其后 ⭐ */
    margin-bottom: 20px;
    /* 20px */
}

/* 优化 About 块级结构间距 */
.about-item-block {
    margin-bottom: 30px;
    /* 每个经历块之间的距离 */
}

.about-item-block:last-child {
    margin-bottom: 0;
}

.item-subtitle {
    margin-bottom: 5px !important;
    /* 标题和描述贴近 */
    margin-top: 0 !important;
    color: var(--text-color);
}

.item-desc {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    /* 描述与列表之间的距离 */
}

/* 简单的无标题列表（如奖项） */
.simple-list {
    margin-top: 0 !important;
    margin-bottom: 30px !important;
}

/* 优化 About 页面的通用段落，尤其是工作经历和策略描述 */
.about-long-section p {
    font-size: 1.1em;
    /* 保持字体大小 */
    line-height: 1.6;
    /* ⭐ 调整：从 1.8 降到 1.6 或 1.5，更专业紧凑 ⭐ */
    max-width: 600px;
    /* 增加100px */
    margin-bottom: 10px;
    /* 减少段落间距 */
    word-wrap: break-word;
    /* 允许长单词换行 */
    overflow-wrap: break-word;
    /* 现代浏览器支持 */
    box-sizing: border-box;
}

/* 针对主要的“关于我”标题进行调整 */
about-long-section p.section-title {
    margin-top: 0;
    /* 如果它在段落开头，移除顶部默认 margin */
    margin-bottom: 30px;
    /* 强制统一底部间距 */
}

/* 16:9 比例容器 */
.ratio-16-9 {
    position: relative;
    width: 90%;
    /* 高度是宽度的 9/16 ≈ 56.25% */
    padding-top: 56.25%;
    overflow: hidden;
    margin-bottom: 30px;
    /* 留出与正文的间距 */
    border-radius: 8px;
    /* 增加圆角，更美观 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.about-banner-img {
    /* 图片绝对定位，覆盖整个容器 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 确保图片裁剪以适应容器，而不是变形 */
    object-fit: cover;
    transition: opacity 0.3s ease;
}


/* 优化列表（list-detail）的行高和间距 */
.list-detail {
    list-style: none;
    padding-left: 0;
    margin-top: 22px;
    line-height: 1.7;
    /* 与正文一致的紧凑行高 */
}

.list-detail li {
    margin-bottom: 10px;
    /* 紧凑的列表项间距 */
    position: relative;
    padding-left: 24px;
    /* 更明显的缩进 */
    font-size: 1.1em;
    /* 调整为 1.1em，与项目详情页一致 */
    letter-spacing: 0.01em;
    /* 轻微字间距 */
    /* 轻微字间距 */
    color: var(--text-color);
    /* 与首页一致的深黑色 */
}

/* 优化列表中的强调文字 */
.list-detail li strong {
    font-weight: 400;
    /* 强制去掉加粗 */
    color: var(--text-color);
}

/* 确保自定义小圆点正常工作 */
.list-detail li::before {
    content: '•';
    color: var(--light-gray);
    /* 小圆点改为浅灰色，更优雅 */
    font-weight: 400;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* 针对项目详情页的 Metrics 列表进行更紧凑的调整 */
#project-metrics li {
    margin-bottom: 5px;
    /* 从 10px 减少到 5px */
    font-size: 1.1em;
    /* 调整为与正文一致 */
    line-height: 1.2;
    /* 更加紧凑的行高 */
}

/* --- 单个项目详情样式 --- */

#project-content-body h4 {
    font-size: 1.15em;
    /* 稍大的小标题 */
    font-weight: 450;
    /* 介于标准和中等，建立层级 */
    letter-spacing: 0.01em;
    /* 增加字间距，提升精致感 */
    /* 增加字间距，提升精致感 */
    color: var(--text-color);
    /* 统一深黑色 */
    margin-top: 35px;
    /* 减小上边距，使版块更紧凑 */
    margin-bottom: 12px;
    /* 减小下边距 */
    line-height: 1.4;
}

/* 强制去掉正文中所有加粗效果 */
#project-content-body b,
#project-content-body strong {
    font-weight: 400 !important;
}

.project-detail-text {
    font-size: 1.0em;
    /* 标准正文字号 */
    line-height: 1.6;
    /* 更紧凑的行高 */
    letter-spacing: 0.015em;
    /* 轻微字间距，提升可读性 */
    /* 轻微字间距，提升可读性 */
    color: var(--text-color);
    /* 统一深黑色，提升清晰度 */
    margin-bottom: 20px;
    /* 减小段落间距 */
    font-weight: 400;
}


#project-detail {
    display: none;
    /* 默认隐藏 */
    /* 移除max-width限制，让padding-bottom生效 */
    max-width: none;
    /* ⭐ 关键修正：覆盖 .content-section 的 600px 限制 ⭐ */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    /* 添加轻微的上移效果 */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out, transform 0.4s ease-in-out;
    /* 添加淡入淡出动画 */
}

/* 项目详情页显示时的动画 */
#project-detail[style*="display: block"],
#project-detail.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-portfolio {
    display: none;
    /* PC端默认隐藏 */
    margin-bottom: 30px;
    font-size: 0.9em;
    color: var(--gray-text);
    text-decoration: none;
    transition: color 0.2s;
}

.back-to-portfolio:hover {
    color: var(--accent-color);
}

/* 主标题 - 专业排版优化 */
#project-title,
.project-title {
    font-size: 1.6em;
    /* 适中的标题字号，建立清晰层级 */
    font-weight: 450;
    /* 介于标准和中等之间，既清晰又不过重 */
    letter-spacing: -0.02em;
    /* 轻微负字间距，使标题更紧凑专业 */
    line-height: 1.3;
    /* 标题行高 */
    color: #1a1a1a;
    margin-bottom: 8px;
    margin-top: 0;
}

/* 图片容器样式 */
.visual-showcase {
    margin-top: 40px;
    display: block;
    /* 详情页改为块级显示 */
    width: 100%;
}

/* 新版元数据网格布局 */
.project-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    /* 列之间的大间距 */
    margin-top: 25px;
    /* 缩减与标题的距离 */
    margin-bottom: 25px;
    /* 调整为40px总距离（25px + h4的margin-top部分） */
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.85em;
    /* 稍小的标签字号 */
    color: #999999;
    /* 中灰色，更柔和的层次 */
    letter-spacing: 0.02em;
    /* 轻微增加字间距，提升精致感 */
    text-transform: none;
    margin-bottom: 6px;
    font-weight: 400;
}

.meta-value {
    font-size: 0.95em;
    /* 略小于正文，保持层级 */
    /* 略小于正文，保持层级 */
    color: var(--text-color);
    /* 统一深黑色 */
    letter-spacing: 0.01em;
    /* 轻微字间距 */
    font-weight: 400;
    /* 标准字重 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .project-meta-grid {
        gap: 30px;
        margin-bottom: 40px;
    }
}

/* ❗ 关键：图片占位符和等比调整 ❗ */
.visual-showcase {
    position: relative;
}

.visual-showcase .content-block {
    position: relative;
    overflow: hidden;
    /* 确保放大时不溢出 */
    border-radius: 16px;
    /* 增加圆角 (原8px -> 16px) */
}

.visual-showcase img {
    max-width: 100%;
    /* 确保图片不会超出容器 */
    width: 100%;
    /* 宽度适应 Grid 列宽 */
    height: auto;
    /* 高度自动调整，保持等比 */
    border-radius: 16px;
    /* 增加圆角 (原8px -> 16px) */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    /* 增加一点阴影 */
    display: block;
    /* 确保图片作为块级元素 */
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    /* 添加平滑的缩放过渡效果 */
    transform-origin: center center;
    cursor: pointer;
    /* 显示手型光标，提示可点击 */
    opacity: 1;
}

.visual-showcase img.lazy {
    opacity: 0;
}

.visual-showcase img.is-loaded {
    opacity: 1;
}

/* PC端：鼠标悬停时放大详情页图片 */
@media (min-width: 769px) {
    .visual-showcase img:hover {
        transform: scale(1.12);
        /* 放大12%，更适中的放大效果 */
        cursor: zoom-in;
        /* 悬停时显示放大镜图标 */
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .visual-showcase {
        grid-template-columns: 1fr;
        /* 手机上变为单列 */
    }

    .visual-showcase img {
        width: 100% !important;
        max-width: 100% !important;
        /* 确保移动端图片完全适应屏幕 */
    }
}

@media (max-width: 768px) {
    #project-detail {
        left: 0;
        width: 100%;
        padding: var(--padding-unit);
    }
}

/* Project Detail Overlay 定位和滚动 */
#project-detail {
    display: none;
    position: fixed;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    top: 0;
    /* 修改为0，与侧边栏对齐 */

    /* ❗ 修正 1: 对齐左侧 - Project Detail 应该从侧边栏结束处开始，与 #main-content 的 margin-left 一致 ❗ */
    /* #main-content 的 margin-left: 280px，所以这里也从 280px 开始 */
    left: 280px;

    /* ❗ 修正 2: 扩大回退区域到整个右侧视口 ❗ */
    /* 宽度占满侧边栏右侧所有空间 */
    width: calc(100% - 280px);

    height: 100vh;
    box-sizing: border-box;
    background-color: var(--bg-color);
    overflow-y: auto;
    z-index: 1000;

    /* 与侧边栏顶部对齐，距离页面顶部40px */
    padding-top: 40px;
    padding-right: calc(var(--padding-unit) * 2);
    padding-bottom: 40px !important;
    /* 底部留白40px - 强制优先级 */
    padding-left: calc(var(--padding-unit) * 2);
}

/* Webkit browsers (Chrome, Safari, Opera) */
#project-detail::-webkit-scrollbar {
    display: none;
}

/* Modal 内部的内容容器 */
/* Modal 内部的内容容器 */
#project-content-wrapper {
    max-width: 700px;
    /* 缩小为700px以容纳图片 */
    margin: 0;
    /* 不自动居中，而是左对齐，与about/now的文字左边距一致 */
    padding: 0;
    width: 100%;
    /* 确保与about/now的文字对齐 - 与 #main-content 的 padding-left 一致 */
}

/* 限制正文内容的宽度为 600px */
#project-content-wrapper>#project-title,
#project-content-wrapper>.project-meta-grid,
#project-content-wrapper>#project-content-body {
    max-width: 600px;
    width: 100%;
}

/* 图片容器 - 宽屏模式 */
#project-content-wrapper .visual-showcase {
    max-width: 700px;
    /* 设置为700px - 比正文宽100px */
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 30px;
    /* 图片间距 */
}


/* ---------------------------------- */
/* 样式调整：详情页内容排版 */
/* ---------------------------------- */

.project-title {
    font-size: 2em;
    /* 标题更大 */
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
}

.project-info-header {
    display: flex;
    width: 360px;
    justify-content: space-between;
    font-size: 1em;
    color: var(--gray-text);
    /* 浅灰色文字 */
    margin-bottom: 40px;
    padding-bottom: 10px;
}

.project-info-header span {
    display: block;
}

.project-detail-text {
    font-size: 1.1em;
    /* 正文略大，提升阅读性 */
    line-height: 1.8;
    max-width: 600px;
    /* 限制正文宽度，提升阅读舒适度 */
    margin-bottom: 30px;
    word-wrap: break-word;
    /* 允许长单词换行 */
    overflow-wrap: break-word;
    /* 现代浏览器支持 */
    box-sizing: border-box;
}

/* 图像占位符和图文混排 */
/* .visual-showcase 样式已在上方定义 */

.visual-showcase .content-block {
    margin-bottom: 20px;
}

.visual-showcase img,
.visual-showcase .placeholder-image {
    aspect-ratio: 16 / 9;
    /* 统一比例 */
    object-fit: cover;
    background-color: #333;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
    /* 正方形 */
}

.visual-showcase img.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
    /* 经典横屏 */
}

.visual-showcase img.aspect-ratio-3-4 {
    aspect-ratio: 3 / 4;
    /* 竖屏 */
}

.visual-showcase img.aspect-ratio-9-16 {
    aspect-ratio: 9 / 16;
    /* 手机竖屏 */
}

.visual-showcase img.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
    /* 宽屏 */
}

#portfolio h3 {
    margin-top: 0;
    /* 强制移除浏览器给 h3 标签的默认顶部外边距 */
}