/* ========================================================
   Slim 主题专属相册样式 (Slim Photo Gallery)
   极致留白、骨架防抖 (CLS=0)、纯净深浅色无缝自适应
   ======================================================== */

.album-container {
    max-width: var(--page-max-width, 840px);
    margin: 0 auto;
    padding: 0 var(--section-gap-x, 1.25rem);
    box-sizing: border-box;
}

/* 1. 头部区域 (Hero) */
.album-hero {
    text-align: center;
    padding: 3.5rem 0 2.5rem;
}
.album-main-title {
    font-size: var(--text-3xl, 1.75rem);
    font-weight: 700;
    color: var(--text-primary, #1f2328);
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}
.album-subtitle {
    font-size: var(--text-md, 1rem);
    color: var(--text-secondary, #4d5761);
    max-width: 540px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

/* 2. 即时搜索栏 */
.album-search-bar {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
}
.album-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted, #6e7781);
    pointer-events: none;
}
.album-search-bar input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 42px;
    font-size: var(--text-sm, 0.875rem);
    font-family: inherit;
    color: var(--text-primary, #1f2328);
    background: var(--background-elevated, #f6f8fa);
    border: 1px solid var(--gray-light, #eaeef2);
    border-radius: 22px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.album-search-bar input:focus {
    background: var(--background-body, #fff);
    border-color: var(--accent, #0969da);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}
#album-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted, #6e7781);
    cursor: pointer;
    line-height: 1;
}

/* 3. 第一层：专题画册卡片网格 */
.album-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
    padding-bottom: 4rem;
}
.topic-card-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: var(--background-body, #fff);
    border: 1px solid var(--gray-light, #eaeef2);
    border-radius: var(--radius-ui, 8px);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.topic-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(9, 105, 218, 0.3);
}
html.dark .topic-card-item {
    border-color: rgba(255, 255, 255, 0.08);
}
html.dark .topic-card-item:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(57, 211, 83, 0.35);
}

.topic-cover-wrap {
    position: relative;
    width: 100%;
    height: 190px;
    background: var(--background-elevated, #f6f8fa);
    overflow: hidden;
}
.topic-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.topic-card-item:hover .topic-cover-wrap img {
    transform: scale(1.04);
}
.topic-photo-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    backdrop-filter: blur(6px);
}
.topic-top-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent, #0969da);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.topic-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.topic-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1f2328);
    margin: 0 0 0.5rem;
    line-height: 1.35;
}
.topic-desc {
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-secondary, #4d5761);
    margin: 0 0 1rem;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted, #6e7781);
}

/* 4. 第二层：专题详情头部 */
.album-breadcrumb {
    padding: 1.5rem 0 0.5rem;
}
.album-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-muted, #6e7781);
    text-decoration: none;
    transition: color 0.15s;
}
.album-back-link:hover {
    color: var(--accent, #0969da);
}
.album-detail-header {
    padding: 1.5rem 0 2.5rem;
    border-bottom: 1px solid var(--gray-light, #eaeef2);
    margin-bottom: 2rem;
}
html.dark .album-detail-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
.album-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1f2328);
    margin: 0 0 0.75rem;
}
.album-detail-desc {
    font-size: var(--text-md, 1rem);
    color: var(--text-secondary, #4d5761);
    line-height: 1.7;
    margin: 0 0 1.25rem;
}
.album-detail-meta {
    display: flex;
    gap: 16px;
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-muted, #6e7781);
}

/* 5. 留白瀑布流照片墙 (CSS Columns) */
.album-masonry {
    column-count: 3;
    column-gap: 1.25rem;
    padding-bottom: 4rem;
}
@media (max-width: 768px) {
    .album-masonry {
        column-count: 2;
        column-gap: 0.75rem;
    }
}
@media (max-width: 480px) {
    .album-masonry {
        column-count: 1;
    }
}

.album-item {
    break-inside: avoid;
    margin-bottom: 1.25rem;
}

/* 6. 骨架屏 / 毛玻璃防抖占位 (CLS = 0 核心) */
.photo-skeleton-box {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--background-elevated, #f6f8fa);
    border-radius: var(--radius-ui, 6px);
}
/* 微光扫过动画 (Shimmer) */
.photo-skeleton-box::before {
    content: "";
    position: absolute;
    top: 0; left: -150%; width: 150%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-shimmer 1.6s infinite;
    z-index: 1;
}
html.dark .photo-skeleton-box::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}
.photo-skeleton-box.loaded::before {
    display: none;
}

.photo-skeleton-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease;
}
.photo-skeleton-box.loaded img {
    opacity: 1;
}
.album-item:hover .photo-skeleton-box img {
    transform: scale(1.02);
}

/* 7. 照片悬浮微信息遮罩 */
.photo-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, transparent 40%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    z-index: 2;
    pointer-events: none;
}
.album-item:hover .photo-overlay {
    opacity: 1;
    pointer-events: none;
}
.photo-loc-badge {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}
.photo-overlay-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}
.photo-text-info {
    color: #fff;
    flex: 1;
    overflow: hidden;
    padding-right: 8px;
    pointer-events: none;
}
.photo-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-exif {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

/* 8. 交互按钮 (点赞与留言抽屉唤起) */
.album-like-btn,
.album-comment-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 4px 9px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
    line-height: 1;
    font-family: inherit;
    text-decoration: none;
}
.album-like-btn:hover,
.album-comment-btn:hover {
    background: rgba(255, 255, 255, 0.38);
    transform: translateY(-1px);
    color: #fff;
}
.album-like-btn.liked {
    color: #ff4757;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}
.album-like-btn.liked .heart-icon {
    fill: #ff4757;
    stroke: #ff4757;
}
.album-like-btn.animating .heart-icon {
    animation: heart-bounce 0.45s ease;
}
.heart-icon,
.comment-icon {
    width: 13px;
    height: 13px;
    display: inline-block;
    vertical-align: middle;
}
.album-icon {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
    stroke-width: 2;
}
.photo-comment-badge {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(200%); }
}

@keyframes heart-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.4); }
    70% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

/* 9. 灯箱内抽屉式评论样式 (Fancybox Drawer) */
.fancybox__container .album-drawer-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    max-width: 85%;
    background: rgba(18, 18, 18, 0.88);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.drawer-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.drawer-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
}
.drawer-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.drawer-comment-item {
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.drawer-comment-author {
    font-weight: 600;
    font-size: 12px;
    color: #8be9fd;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.drawer-comment-time {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}
.drawer-comment-body {
    color: rgba(255,255,255,0.85);
}
.drawer-form-wrap {
    padding: 18px 18px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 18, 23, 0.75);
    backdrop-filter: blur(16px);
}
.drawer-inputs-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}
.drawer-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.drawer-label {
    display: block !important;
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 4px 2px;
    line-height: 1.4;
}
.drawer-label .required-mark {
    color: #ff7b72;
    font-weight: bold;
}
.drawer-label-hint {
    font-size: 10.5px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.45);
}
.drawer-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f0f6fc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.drawer-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.drawer-input:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.24);
}
.drawer-input:focus {
    border-color: var(--accent, #0969da);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.22);
}
.drawer-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f0f6fc;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    outline: none;
    resize: vertical;
    min-height: 68px;
    line-height: 1.6;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.drawer-textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.drawer-textarea:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.24);
}
.drawer-textarea:focus {
    border-color: var(--accent, #0969da);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.22);
}
.drawer-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.drawer-form-tip {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}
.drawer-submit-btn {
    background: var(--accent, #0969da);
    border: none;
    color: #fff;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.drawer-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(9, 105, 218, 0.4);
    filter: brightness(1.08);
}
.drawer-submit-btn:active {
    transform: translateY(0);
}

.album-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted, #6e7781);
}

/* 媒体类型微章 (视频 / 实况照片) */
.media-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(8px);
    z-index: 2;
    pointer-events: none;
    line-height: 1.2;
}
.media-badge.badge-video {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.media-badge.badge-live {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.media-badge svg {
    display: block;
}

/* 实况照片伴随短视频 */
.live-companion-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1;
}
.photo-link.media-type-live:hover .live-companion-video,
.photo-link.media-type-live.playing .live-companion-video {
    opacity: 1;
}

/* Fancybox 实况微动控制按钮 */
.f-live-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.f-live-btn.active {
    color: #3fb950 !important;
}

/* 抽屉回复横幅与回复交互 */
.drawer-reply-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(9, 105, 218, 0.2);
    border: 1px solid rgba(9, 105, 218, 0.4);
    padding: 7px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 11.5px;
    color: #79c0ff;
}
.drawer-reply-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.drawer-cancel-reply {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s ease;
}
.drawer-cancel-reply:hover {
    color: #ff7b72;
}
.drawer-reply-to {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    margin-left: 6px;
}
.drawer-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.drawer-reply-btn {
    background: none;
    border: none;
    padding: 0;
    color: #58a6ff;
    font-size: 11px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
}
.drawer-reply-btn:hover {
    opacity: 1;
    color: #79c0ff;
    text-decoration: underline;
}

/* ===== 灯箱说明：标题 + 拍摄手记 ===== */
.fancybox__caption .album-cap {
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
}
.album-cap-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}
.album-cap-desc {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.album-cap.expanded .album-cap-desc {
    display: block;
    -webkit-line-clamp: unset;
    max-height: 40vh;
    overflow-y: auto;
}
.album-cap-more {
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: #8ab4ff;
    font-size: 12.5px;
    cursor: pointer;
}

/* ===== 评论抽屉顶部：作者手记 ===== */
.drawer-story {
    margin: 12px 16px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #8ab4ff;
    max-height: 35vh;
    overflow-y: auto;
    flex-shrink: 0;
}
.drawer-story-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #8ab4ff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.drawer-story-text {
    font-size: 13px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
    word-break: break-word;
}

/* 抽屉标题在深色背景上清晰显示（覆盖主题对 h3 的颜色） */
.fancybox__container .album-drawer-panel .drawer-header h3 {
    color: #fff !important;
    opacity: 1 !important;
}
.fancybox__container .album-drawer-panel .drawer-close-btn {
    color: rgba(255, 255, 255, 0.85);
}

/* 工具栏"实况"按钮：文字横排不换行 */
.fancybox__toolbar .f-button.f-live-btn {
    width: auto !important;
    min-width: var(--f-button-width, 46px);
    padding: 0 10px;
    white-space: nowrap;
    flex-direction: row;
    gap: 4px;
}
.fancybox__toolbar .f-button.f-live-btn span {
    margin-left: 0 !important;
    white-space: nowrap;
    writing-mode: horizontal-tb;
}

.drawer-pending-tip {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(63, 185, 80, 0.12);
    color: #7ee787;
    font-size: 12.5px;
}

/* 专题头部信息（地点 / 日期 / 作品数）：整项换行，项内文字不断开 */
.album-detail-meta {
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 18px;
    align-items: center;
}
.album-detail-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.album-detail-meta .album-icon {
    flex-shrink: 0;
}

/* 专题头部信息强制单行：手机上缩小字号和间距；地点过长时末尾省略 */
.album-detail-meta {
    flex-wrap: nowrap !important;
    column-gap: 14px;
    overflow: hidden;
}
.album-detail-meta > span:first-child {
    flex-shrink: 1;
    min-width: 0;
}
.album-detail-meta > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .album-detail-meta {
        font-size: 13px;
        column-gap: 10px;
    }
    .album-detail-meta > span { gap: 3px; }
    .album-detail-meta .album-icon { width: 13px; height: 13px; }
}
/* 省略号需要块级文本容器 */
.album-detail-meta > span:first-child {
    display: block;
    white-space: nowrap;
}
.album-detail-meta > span:first-child .album-icon {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 3px;
}
