/* Still Image 页面样式 */

/* 字体引入 */
@font-face {
    font-family: 'FZLTHJW';
    src: url('../../resources/fonts/FZLTHJW-subset.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 页面背景 */
.still-image-page {
    background-color: #D4D4D4;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 标题区域 */
.still-image-header {
    width: 100%;
    height: clamp(50px, 5.56vw, 80px);
    flex-shrink: 0;
    background-color: #D4D4D4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: clamp(50px, 7.15vw, 103px);
}

.header-content {
    flex: 1;
    display: flex;
    align-items: left;
    justify-content: left;
    padding: 20px 0 0 clamp(15px, 2.08vw, 30px);
    border-bottom: 2px solid #000000;
    border-top: 2px solid #000000;
    z-index: 9;
}

.header-text {
    font-family: 'FZLTHJW', sans-serif;
    font-size: 16px;
    font-weight: normal;
    color: #000000;
    text-align: left;
    line-height: 168%;
    letter-spacing: 0.06em;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 主内容区域 */
.still-image-main {
    flex: 1;
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* 标题区域 - 点击返回效果 */

.header-content.clickable:hover .header-text {
    color: #8E66A2;
}

/* 左侧目录侧边栏 - 作为主内容区域背景层，全宽显示 */
.directory-sidebar {
    position: absolute;
    top: 0;
    left: clamp(15px, 2.08vw, 30px);
    right: 0;
    bottom: 0;
    z-index: 1;
    background-color: #D4D4D4;
    padding: 0;
    border-left: 2px solid #000000;
    display: flex;
    flex-direction: column;
}

/* 布局占位：维持原侧边栏空间，将视频推到右侧 */
.sidebar-spacer {
    width: clamp(300px, 43.82vw, 631px);
    margin-left: clamp(15px, 2.08vw, 30px);
    flex-shrink: 0;
}

.directory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.directory-item {
    font-family: 'FZChaoCuHei-M10S', sans-serif;
    font-size: clamp(28px, 3.33vw, 48px);
    font-weight: 400;
    line-height: 139%;
    letter-spacing: 0.06em;
    color: #666666;
    padding: 0 clamp(20px, 2.78vw, 40px) 0 14px;
    flex: 1;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    transition: color 0.3s ease;
    border-bottom: 1px solid #000000;
    min-height: clamp(21px, 2.847vw, 41px);
}

.directory-item.last-item {
    flex: 0 0 clamp(21px, 2.847vw, 41px);
    padding: 0 clamp(20px, 2.78vw, 40px) 0 14px;
    display: flex;
    align-items: center;
    border-bottom: none;
}

.directory-item:hover,
.directory-item.active {
    color: #000000;
}

/* 右侧视频区域 */
.video-section {
    flex: 1;
    height: 100%;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.7s ease-in-out;
}

.main-video.fade-out {
    opacity: 0;
}

/* 子目录区域 */
.subdirectory-footer {
    width: 100%;
    height: clamp(40px, 4.444vw, 64px);
    flex-shrink: 0;
    background-color: #D4D4D4;
    border-top: 2px solid #000000;
    padding: 0 clamp(15px, 2.08vw, 30px);
    display: flex;
    align-items: center;
}

.subdirectory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    width: 100%;
}

.subdirectory-item {
    flex: 1;
    height: clamp(40px, 4.31vw, 62px);
    font-family: 'Inter', sans-serif;
    font-size: clamp(13px, 1.25vw, 18px);
    font-weight: 800;
    line-height: 150%;
    letter-spacing: 0.06em;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    /* border-top: 2px solid #000000; */
    border-left: 2px solid #000000;
    border-bottom: none;
}

.subdirectory-item:last-child {
    border-right: 2px solid #000000;
}

.subdirectory-item:hover {
    color: #8E66A2;
}


.subdirectory-item.active {
    color: #8E66A2;
}

/* ================================================================
   响应式设计 - 全设备适配
   断点：>1920 大显示器 | 1440 笔记本 | 1024 平板横 | 768 平板竖 | 480 手机
   ================================================================ */

/* ================================================================
   详情覆盖层样式（叠加在列表内容上方）
   ================================================================ */

/* 详情覆盖层 - 绝对定位，叠加在列表内容上方 */
#detailView {
    display: none;
    position: absolute;
    top: 0;
    left: clamp(15px, 2.08vw, 30px);
    right: 0;
    bottom: 0;
    background: #D4D4D4;
    z-index: 10;
    transform: translateY(110%) translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    contain: layout style;
}

/* 显示状态（用 flex 布局排版内部元素） */
#detailView.detail-showing {
    display: flex;
}

/* 进入动画：从下方滑入 */
#detailView.viewer-open {
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 退出动画：向下方滑出（露出底层列表内容） */
#detailView.page-exit {
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 左侧目录标题（绝对定位，浮动于侧边栏上方） --- */
.detail-title {
    display: flex;
    flex-direction: column;
    padding-left: 15px;
    padding-top: 15px;
    z-index: 1001;
    position: absolute;
    /* top: 0; */
    /* left: 44px; */
    width: clamp(200px, 29.1vw, 419px);
    height: clamp(100px, 13.89vw, 200px);
    pointer-events: none;
    background-color: transparent;
}

.detail-title .title-main,
.detail-title .title-sub {
    pointer-events: auto;
    transition: color 0.3s ease;
}

.title-main {
    font-family: 'FZChaoCuHei-M10S', sans-serif;
    font-size: clamp(28px, 3.33vw, 48px);
    font-weight: 400;
    line-height: 139%;
    letter-spacing: 0.06em;
    color: #000000;
}

.title-sub {
    font-family: 'Inter', sans-serif;
    font-size: clamp(13px, 1.25vw, 18px);
    font-weight: 800;
    line-height: 150%;
    letter-spacing: 0.06em;
    color: #000000;
}

.title-main:hover,
.title-sub:hover,
.title-main:focus,
.title-sub:focus,
.title-main:active,
.title-sub:active {
    color: #8E66A2;
}

/* --- 左侧目录侧边栏（视觉占位） --- */
.detail-sidebar {
    width: clamp(200px, 29.1vw, 419px);
    flex-shrink: 0;
    background-color: #D4D4D4;
    border-left: 2px solid #000000;
    border-right: 2px solid #000000;
    display: flex;
    align-items: flex-start;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    transition: background-color 0.3s ease;
}

/* --- 右侧图片展示区域 --- */
.image-grid-section {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    margin-right: clamp(15px, 2.08vw, 30px);
    overflow: hidden;
    border-right: 2px solid #000000;
    position: relative;
    z-index: 5;
    background-color: #D4D4D4;
    min-width: 0;
}

.image-grid-wrapper {
    width: calc(100% - clamp(15px, 2.08vw, 30px));
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.image-grid-wrapper::-webkit-scrollbar {
    display: none;
}

/* 自定义滚动条轨道 */
.custom-scrollbar-track {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: clamp(15px, 2.08vw, 30px);
    z-index: 6;
    border-left: 2px solid #000000;
}

/* 自定义滚动条滑块 */
.custom-scrollbar-thumb {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    background: #000000;
    border-radius: 70px;
    min-height: clamp(30px, 3.47vw, 50px);
    transition: opacity 0.15s ease;
    opacity: 0.8;
}

.custom-scrollbar-thumb:hover,
.custom-scrollbar-thumb:active {
    opacity: 1;
}

.image-grid {
    display: flex;
    flex-direction: column;
    height: 200%;
}

.screen {
    height: 50%;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: calc(33.333% + 10px) calc(33.333% - 20px) calc(33.333% + 10px);
    grid-template-rows: repeat(2, 1fr);
    scroll-snap-align: start;
}

.grid-item {
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 0px;
    padding-right: 0px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.grid-item:active,
.grid-item:focus {
    outline: none;
    background-color: transparent;
}

/* 第3列方格无右边框（方格区域右侧开放） */
.screen .grid-item:nth-child(3n) {
    border-right: none;
}

/* 最后一屏最后一行方格无下边框（由子目录区域上边框提供） */
.screen:last-child .grid-item:nth-child(n+4) {
    border-bottom: none;
}

/* 第一列方格图片距离左侧边框线45 */
.screen .grid-item:nth-child(3n+1) {
    padding-left: clamp(18px, 2.43vw, 35px);
}

/* 第三列方格图片距离右侧边框线45 */
.screen .grid-item:nth-child(3n) {
    padding-right: clamp(18px, 2.43vw, 35px);
}

.grid-item picture {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

/* 中间列方格左右各缩小10px */
.grid-item:nth-child(3n+2) {
    padding-left: 0px !important;
    padding-right: 0px !important;
}

/* ================================================================
   全屏图片查看器（lightbox，内嵌于详情覆盖层中）
   ================================================================ */

.image-viewer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    pointer-events: none;
}

/* 查看器动画层（背景+内容合并在同一元素，确保同步动画） */
.viewer-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, 
        #000000 0px, 
        #000000 calc(100% - 30px), 
        transparent calc(100% - 30px), 
        transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-viewer.active {
    pointer-events: auto;
}

.image-viewer.active .viewer-wrapper {
    transform: translateY(0);
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(50px, 6.94vw, 100px);
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: clamp(13px, 1.25vw, 18px);
    font-weight: 800;
    letter-spacing: 0.06em;
    transition: color 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-nav:hover {
    color: #8E66A2;
}

.viewer-nav.prev {
    left: 10px;
}

.viewer-nav.next {
    right: clamp(20px, 2.778vw, 40px);
}

.viewer-image-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image-container picture {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image {
    max-width: 739px;
    max-height: 739px;
    object-fit: contain;
}

/* 查看器激活时目录文字变白 */
.image-viewer.active ~ .detail-title .title-main,
.image-viewer.active ~ .detail-title .title-sub {
    color: #FFFFFF !important;
}

/* 查看器激活时目录标题hover效果保留 */
.image-viewer.active ~ .detail-title .title-main:hover,
.image-viewer.active ~ .detail-title .title-sub:hover,
.image-viewer.active ~ .detail-title .title-main:focus,
.image-viewer.active ~ .detail-title .title-sub:focus,
.image-viewer.active ~ .detail-title .title-main:active,
.image-viewer.active ~ .detail-title .title-sub:active {
    color: #8E66A2 !important;
}
