/* pages.css - 页面级/复杂内容样式 */

/* --- 导航内容切换样式 --- */

/* 默认隐藏内容区域，使用 opacity 和 visibility 实现淡入淡出效果 */
.content-section {
    max-width: 700px;
    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);
    /* 强调关键词 */
}

/* 详细列表样式 */
.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 区域样式优化 --- */

#about{
    max-width: 700px;
    /* 与详情页保持一致的最大宽度 */
    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: calc(var(--padding-unit) * 2);
        /* 20px * 2 = 40px */

        /* ⭐ 关键调整 2: 统一底部间距，让内容紧随其后 ⭐ */
        margin-bottom: var(--padding-unit);
        /* 20px */
    }

/* 优化 About 页面的通用段落，尤其是工作经历和策略描述 */
.about-long-section p {
    font-size: 1.1em;
    /* 保持字体大小 */
    line-height: 1.6;
    /* ⭐ 调整：从 1.8 降到 1.6 或 1.5，更专业紧凑 ⭐ */
    max-width: 700px;
    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;
    /* 强制统一底部间距 */
}


/* 优化列表（list-detail）的行高和间距 */
.list-detail {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
    /* ⭐ 调整：将行高设为 1.6，清晰且不松散 ⭐ */
    line-height: 1.6;
}

.list-detail li {
    margin-bottom: 5px;
    /* ⭐ 调整：减小列表项的底部间距，让列表项更紧凑 ⭐ */
    position: relative;
    padding-left: 15px;
    font-size: 1.1em;
}

/* 优化列表中的强调文字 */
.list-detail li strong {
    font-weight: 400;
    /* 列表中的关键词使用更明显的粗体 */
    color: var(--accent-color);
    /* 保持与主色调一致 */
}

/* 确保自定义小圆点正常工作 */
.list-detail li::before {
    content: '•';
    color: var(--gray-text);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* --- 单个项目详情样式 --- */

#project-content-body h4 {
    font-size: 1.1em;
}


#project-detail {
    display: none;
    /* 默认隐藏 */
    max-width: 1000px;
    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 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.visual-showcase {
    margin-top: 20px;
    display: grid;
    /* 使用两列布局，适应屏幕大小 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* ❗ 关键：图片占位符和等比调整 ❗ */
.visual-showcase {
    position: relative;
}

.visual-showcase .content-block {
    position: relative;
    overflow: hidden;
    /* 确保放大时不溢出 */
    border-radius: 4px;
}

.visual-showcase img {
    max-width: 100%;
    /* 确保图片不会超出容器 */
    width: 100%;
    /* 宽度适应 Grid 列宽 */
    height: auto;
    /* 高度自动调整，保持等比 */
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    /* 增加一点阴影 */
    display: block;
    /* 确保图片作为块级元素 */
    transition: transform 0.4s ease, scale 0.4s ease;
    /* 添加平滑的缩放过渡效果 */
    transform-origin: center center;
    cursor: pointer;
    /* 显示手型光标，提示可点击 */
}

/* PC端：鼠标悬停时放大详情页图片 */
@media (min-width: 769px) {
    .visual-showcase img:hover {
        transform: scale(1.05);
        /* 放大5%，详情页放大更温和 */
        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: -30px;

    /* ❗ 修正 1: 对齐左侧 - Project Detail 应该从侧边栏结束处开始，与 #main-content 的 margin-left 一致 ❗ */
    /* #main-content 的 margin-left: 260px，所以这里也从 260px 开始 */
    left: 260px;

    /* ❗ 修正 2: 扩大回退区域到整个右侧视口 ❗ */
    /* 宽度占满侧边栏右侧所有空间 */
    width: calc(100% - 260px);

    height: 100vh;
    background-color: var(--bg-color);
    overflow-y: auto;
    z-index: 1000;

    /* 与 #main-content 的 padding-left 保持一致，确保文字与about/now对齐 */
    /* #main-content padding-left: calc(var(--padding-unit) * 2) = 40px */
    padding: calc(var(--padding-unit) * 2);
    padding-left: calc(var(--padding-unit) * 2);
}

/* Webkit browsers (Chrome, Safari, Opera) */
#project-detail::-webkit-scrollbar {
    display: none;
}

/* Modal 内部的内容容器 */
#project-content-wrapper {
    max-width: 700px;
    /* 与about和now的max-width保持一致 */
    margin: 0;
    /* 不自动居中，而是左对齐，与about/now的文字左边距一致 */
    padding: 0;
    width: 100%;
    /* 确保与about/now的文字对齐 - 与 #main-content 的 padding-left 一致 */
}


/* ---------------------------------- */
/* 样式调整：详情页内容排版 */
/* ---------------------------------- */

.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: 700px;
    /* 限制正文宽度，提升阅读舒适度 */
    margin-bottom: 30px;
    word-wrap: break-word;
    /* 允许长单词换行 */
    overflow-wrap: break-word;
    /* 现代浏览器支持 */
    box-sizing: border-box;
}

/* 图像占位符和图文混排 */
.visual-showcase {
    /* 移除 Grid 布局，改为流式布局 */
    margin-top: 0px;
    margin-bottom: 0px;
}

.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;
    /* 正方形 */
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
    /* 经典横屏 */
}

#portfolio h3 {
    margin-top: 0;
    /* 强制移除浏览器给 h3 标签的默认顶部外边距 */
}