/* 专辑弹窗样式 - 独立 CSS 文件 */

/* PDF阅读器样式的图片展示区域 */
#albumModal .pdf-viewer-container {
    background: #f3f4f6;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 0 2rem;
}

/* 移动端：减少内边距 */
@media (max-width: 1023px) {
    #albumModal .pdf-viewer-container {
        padding: 0 1rem;
    }
}

#albumModal .pdf-viewer-container::-webkit-scrollbar {
    width: 12px;
}

#albumModal .pdf-viewer-container::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 6px;
}

#albumModal .pdf-viewer-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 6px;
}

#albumModal .pdf-viewer-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

#albumModal .pdf-viewer-content {
    display: grid;
    grid-template-columns: repeat(2, 300px);
    gap: 1rem;
    padding: 0;
    align-content: start;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

/* 移动端：保持双栏布局，但自适应宽度 */
@media (max-width: 1023px) {
    #albumModal .pdf-viewer-content {
        grid-template-columns: repeat(2, 1fr);
        justify-content: stretch;
        gap: 0.5rem;
    }
}

#albumModal .pdf-viewer-page {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    border-radius: 4px;
    overflow: hidden;
    width: 300px;
    max-width: 300px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: none !important;
    transform: none !important;
    will-change: auto !important;
}

/* 移动端：页面自适应宽度（双栏布局） */
@media (max-width: 1023px) {
    #albumModal .pdf-viewer-page {
        width: 100%;
        max-width: 100%;
    }
}

#albumModal .pdf-viewer-page:hover,
#albumModal .pdf-viewer-page:focus,
#albumModal .pdf-viewer-page:active {
    transform: none !important;
    scale: 1 !important;
    transition: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

#albumModal .pdf-viewer-page * {
    transition: none !important;
    transform: none !important;
}

#albumModal .pdf-viewer-page img {
    width: 300px !important;
    max-width: 300px !important;
    height: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: none !important;
    transform: none !important;
    scale: 1 !important;
    will-change: auto !important;
}

/* 移动端：图片自适应宽度 */
@media (max-width: 1023px) {
    #albumModal .pdf-viewer-page img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

#albumModal .pdf-viewer-page img:hover,
#albumModal .pdf-viewer-page img:focus,
#albumModal .pdf-viewer-page img:active {
    transform: none !important;
    scale: 1 !important;
    transition: none !important;
}

/* 强制覆盖所有可能的hover效果 - 放在最后确保最高优先级 */
#albumModal .pdf-viewer-page:hover *,
#albumModal .pdf-viewer-page:hover img,
#albumModal .pdf-viewer-page:hover::before,
#albumModal .pdf-viewer-page:hover::after {
    transform: none !important;
    scale: 1 !important;
    transition: none !important;
    animation: none !important;
}

#albumModal .pdf-viewer-page-number {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    z-index: 1;
}

/* 占位符页面样式（用于补齐总页数但还没有图片的页面） */
#albumModal .pdf-viewer-page-placeholder {
    height: 300px; /* 固定高度 */
    min-height: 300px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default; /* 占位符不可点击 */
    position: relative;
    overflow: hidden; /* 确保模糊背景不会溢出 */
    background-color: #f3f4f6; /* 默认背景色，当没有图片时使用 */
}

/* 移动端：占位符高度自适应 */
@media (max-width: 1023px) {
    #albumModal .pdf-viewer-page-placeholder {
        height: auto;
        min-height: 200px;
        max-height: 400px;
        aspect-ratio: 1 / 1.414; /* A4纸比例 */
    }
}

/* 使用伪元素创建模糊背景层 */
#albumModal .pdf-viewer-page-placeholder::before {
    content: '';
    position: absolute;
    top: -20px; /* 扩大模糊区域，避免边缘清晰 */
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: var(--placeholder-bg, none); /* 使用CSS变量获取背景图片 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(20px); /* 模糊效果 */
    z-index: 0;
    opacity: 0.7; /* 稍微降低透明度，让模糊效果更明显 */
}

/* 添加一个半透明的遮罩层，让前景内容更清晰 */
#albumModal .pdf-viewer-page-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3); /* 半透明白色遮罩 */
    z-index: 1;
}

#albumModal .pdf-viewer-page-placeholder:hover {
    cursor: default; /* 占位符hover时也不显示手型光标 */
}

#albumModal .pdf-viewer-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding: 2rem;
    position: relative; /* 确保内容在遮罩层之上 */
    z-index: 2; /* 让内容显示在模糊背景和遮罩层之上 */
}

/* 移动端：占位符内容高度自适应 */
@media (max-width: 1023px) {
    #albumModal .pdf-viewer-placeholder-content {
        min-height: 200px;
        padding: 1rem;
    }
}

/* 弹窗外壳固定宽度：左638 + 右400 = 1038px */
#albumModal .album-modal-wrapper {
    box-sizing: border-box;
    overflow: hidden;
}

@media (min-width: 1024px) {
    #albumModal .album-modal-wrapper {
        width: 1038px;
        max-width: calc(100vw - 2rem);
    }
}

@media (max-width: 1023px) {
    #albumModal .album-modal-wrapper {
        width: 100%;
        max-width: 100%;
    }
}

/* 弹窗左右布局 */
#albumModal .album-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

@media (min-width: 1024px) {
    #albumModal .album-modal-content {
        flex-direction: row;
        align-items: stretch;
        width: 100%;
    }
}

/* 移动端：阅读器占据主体，自适应宽度 */
#albumModal .album-modal-left {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    padding: 1rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* 桌面端：固定宽度，高度随弹窗约束并在内部滚动 */
@media (min-width: 1024px) {
    #albumModal .album-modal-left {
        width: 638px;
        min-width: 638px;
        max-width: 638px;
        flex: 1 1 auto;
        min-height: 0;
        max-height: 100%;
        padding: 1rem;
        box-sizing: border-box;
        overflow: hidden;
    }

    #albumModal .pdf-viewer-container {
        flex: 1 1 auto;
        min-height: 0;
        max-height: 100%;
        padding: 0 1rem;
    }

    #albumModal .pdf-viewer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    #albumModal .pdf-viewer-page {
        width: 100%;
        max-width: 100%;
    }

    #albumModal .pdf-viewer-page img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 移动端：右侧信息区域自适应宽度 */
#albumModal .album-modal-right {
    padding: 0;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    flex: 0 0 auto;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    min-height: 0;
}

/* 桌面端：右侧固定宽度 */
@media (min-width: 1024px) {
    #albumModal .album-modal-right {
        width: 400px;
        min-width: 400px;
        max-width: 400px;
        border-top: none;
        border-left: 1px solid #e5e7eb;
        flex: 0 0 400px;
        min-height: 0;
        max-height: 100%;
        overflow: hidden;
    }

    #albumModal .album-modal-right > .overflow-y-auto {
        flex: 1 1 auto;
        min-height: 0;
    }
}


/* 移动端全屏样式 */
@media (max-width: 767px) {
    #albumModal {
        padding: 0 !important;
        background: white !important;
    }
    
    #albumModal .album-modal-wrapper {
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    /* 移动端隐藏右侧信息区域 */
    #albumModal .album-modal-right {
        display: none !important;
    }
    
    /* 移动端PDF阅读器占据全屏 */
    #albumModal .album-modal-left {
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
    }
    
    #albumModal .pdf-viewer-container {
        border-radius: 0 !important;
        padding: 0 0.5rem !important;
        padding-top: 64px !important; /* 顶部留出空间避免被顶部栏挡住 */
        padding-bottom: 64px !important; /* 底部留出空间避免被底部栏挡住 */
        height: calc(100vh - 112px); /* 减去顶部栏56px和底部栏56px */
        box-sizing: border-box;
    }
}

/* 移动端顶部栏样式 */
.mobile-modal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(to right, #dbeafe, #e9d5ff, #fee2e2, #fef3c7, #d1fae5);
    border-bottom: 1px solid #e5e7eb;
    z-index: 101;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-header-back-btn,
.mobile-header-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    color: #111827;
}

.mobile-header-back-btn:hover,
.mobile-header-close-btn:hover {
    background: rgba(255, 255, 255, 0.8);
}

.mobile-header-back-btn {
    margin-right: 12px;
}

.mobile-header-close-btn {
    margin-left: auto;
}

.mobile-header-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-right: 8px;
    overflow: hidden;
}

.mobile-header-title h2 {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.mobile-header-title p {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 2px;
}

/* 移动端底部栏样式 */
.mobile-modal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 101;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-modal-footer button {
    height: 100%;
}

/* 标签和描述展开/收起样式 */
/* 标签容器：默认显示12个标签 */
.tags-container-collapsed {
    display: flex;
    flex-wrap: wrap;
    position: relative;
}

/* 限制显示12个标签，隐藏多余的 */
.tags-container-collapsed > span:nth-child(n+13) {
    display: none;
}

.tags-container-expanded {
    display: flex;
    flex-wrap: wrap;
}

/* 展开状态下显示所有标签 */
.tags-container-expanded > span {
    display: inline-flex !important;
}

/* 描述文本：默认显示3行 */
.description-text-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 3;
}

.description-text-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}




