/* 分支相册页专用样式 */
.branch-album-header { margin-bottom: 20px; }
.branch-album-header .page-title { margin: 8px 0 4px 0; }
.branch-album-header .page-sub { color: var(--text-light); font-size: 13px; margin: 0; }

/* 照片分类徽章 */
.photo-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 6px;
    background: rgba(158, 32, 32, 0.1);
    color: #9E2020;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

/* 栏目栏右侧按钮组 */
.feed-cat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 上传弹窗尺寸 */
.feed-modal-box-upload { max-width: 520px; }

/* 文件选择 + 缩略图预览区域 */
.upload-preview-wrap {
    position: relative;
    width: 100%;
    min-height: 180px;
    border: 2px dashed var(--border, #d9d2c5);
    border-radius: 8px;
    background: var(--bg-hover, #faf8f3);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s, background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-preview-wrap:hover {
    border-color: var(--primary, #9E2020);
    background: rgba(158, 32, 32, 0.03);
}
.upload-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: var(--text-light, #999);
}
.upload-preview-icon {
    font-size: 40px;
    margin-bottom: 8px;
    line-height: 1;
}
.upload-preview-text {
    font-size: 15px;
    color: var(--primary, #9E2020);
    font-weight: 600;
    margin-bottom: 4px;
}
.upload-preview-hint {
    font-size: 12px;
    color: var(--text-light, #999);
}
.upload-preview-img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    display: block;
}
.upload-preview-wrap.has-image .upload-preview-placeholder { display: none; }

/* 上传成功缩略图区域 */
.upload-success-area {
    margin: 12px 0;
    padding: 16px;
    background: #f0f9f0;
    border: 1px solid #c8e6c8;
    border-radius: 8px;
    text-align: center;
}
.upload-success-thumb {
    display: inline-block;
    max-width: 200px;
    max-height: 200px;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 8px;
}
.upload-success-thumb img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}
.upload-success-msg {
    color: #2e7d32;
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 0 0;
}

/* 照片卡删除按钮 */
.photo-card { position: relative; cursor: pointer; }
.photo-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(192, 57, 43, 0.9);
    color: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: opacity .2s;
}
.photo-card:hover .photo-delete-btn { opacity: 1; }
.photo-delete-btn:hover { background: #c0392b; transform: scale(1.1); }

/* 目录管理弹窗样式（复用 feed-modal + cat-mgr-list 样式） */
.feed-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.feed-modal-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.feed-modal-box {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.feed-modal-box-sm { max-width: 480px; }
.feed-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.feed-modal-head h3 { margin: 0; font-size: 18px; }
.feed-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}
.feed-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* 目录添加行 */
.cat-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.cat-add-row input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}
.cat-add-row input[type="number"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

/* 目录管理列表 */
.cat-mgr-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cat-mgr-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
    background: var(--bg-card);
}
.cat-mgr-list li.cat-empty {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}
.cat-mgr-name { font-weight: 500; }
.cat-mgr-count {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 10px;
}
.cat-mgr-ops { display: flex; gap: 6px; align-items: center; }
.cat-mgr-locked {
    font-size: 12px;
    color: var(--text-light);
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: help;
}
.cat-edit-input {
    width: 160px;
    padding: 4px 8px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--serif);
    margin-right: 6px;
}
.cat-edit-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 3px rgba(158, 32, 32, 0.3);
}
.cat-mgr-tip {
    margin-top: 12px;
    padding: 10px;
    background: #FFF9E6;
    border: 1px solid #FFE58F;
    border-radius: 4px;
    font-size: 12px;
    color: #8B6914;
}

/* ============ 照片查看器 ============ */
.photo-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 56px;
    padding-bottom: 12px;
    box-sizing: border-box;
}
.photo-viewer-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1;
}
.photo-viewer-close {
    position: absolute;
    top: 16px; right: 24px;
    z-index: 5;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.photo-viewer-close:hover { background: rgba(192,57,43,0.85); }
.photo-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 56px;
    height: 80px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 44px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.photo-viewer-nav:hover { background: rgba(158,32,32,0.9); }
.photo-viewer-prev { left: 20px; }
.photo-viewer-next { right: 20px; }
.photo-viewer-main {
    position: relative;
    z-index: 2;
    max-width: 90%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.photo-viewer-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}
.photo-viewer-caption {
    color: #fff;
    font-size: 14px;
    margin: 10px 0 0 0;
    text-align: center;
    font-family: var(--serif);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    flex-shrink: 0;
}
.photo-viewer-thumbs {
    position: relative;
    z-index: 2;
    margin-top: 10px;
    max-width: 90%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 10px;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.photo-viewer-thumbs::-webkit-scrollbar { height: 6px; }
.photo-viewer-thumbs::-webkit-scrollbar-track { background: transparent; }
.photo-viewer-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }
.photo-viewer-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: border-color .2s, opacity .2s, transform .2s;
}
.photo-viewer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-viewer-thumb:hover { opacity: 0.9; border-color: rgba(255,255,255,0.5); }
.photo-viewer-thumb.active {
    opacity: 1;
    border-color: var(--primary, #9E2020);
    transform: scale(1.05);
}

/* 移动端适配 */
@media (max-width: 560px) {
    .photo-viewer { padding-top: 48px; }
    .photo-viewer-close { top: 8px; right: 10px; width: 36px; height: 36px; font-size: 22px; }
    .photo-viewer-nav { width: 40px; height: 56px; font-size: 32px; }
    .photo-viewer-prev { left: 6px; }
    .photo-viewer-next { right: 6px; }
    .photo-viewer-thumb { width: 48px; height: 48px; }

    /* ===== 分支相册页头部 ===== */
    .branch-album-header { margin-bottom: 12px; }
    .branch-album-header .page-title { font-size: 16px; margin: 4px 0 2px; line-height: 1.3; }
    .branch-album-header .page-sub { font-size: 12px; }

    /* ===== 分类目录筛选条 - 手机端重排 ===== */
    .photo-cat-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 14px;
    }
    .photo-cat-bar .feed-cat-tabs {
        flex: 1 1 auto;
        flex-wrap: wrap;
        gap: 6px;
    }
    .photo-cat-bar .feed-cat-tab {
        padding: 7px 12px;
        font-size: 13px;
        border-radius: 14px;
        min-height: 36px;
        flex: 0 0 auto;
    }
    .photo-cat-bar .feed-cat-count {
        font-size: 11px;
        padding: 0 7px;
    }
    /* 操作按钮行：手机端全宽堆叠 */
    .photo-cat-bar .feed-cat-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
        width: 100%;
    }
    .photo-cat-bar .feed-cat-actions .btn {
        flex: 1;
        min-height: 40px;
        font-size: 14px;
        padding: 0 12px;
        white-space: nowrap;
    }

    /* ===== 照片网格 ===== */
    .photo-grid-full {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .photo-grid-full .photo-thumb { aspect-ratio: 1/1; }
    .photo-grid-full .photo-overlay {
        padding: 10px 8px 6px;
        background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
    }
    .photo-grid-full .overlay-title {
        font-size: 12px;
        line-height: 1.3;
        max-height: 2.6em;
        overflow: hidden;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }
    .photo-grid-full .overlay-stats { font-size: 11px; gap: 4px; }
    .photo-grid-full .stat-item { padding: 2px 6px; }
    .photo-grid-full .photo-delete-btn {
        top: 6px; right: 6px;
        width: 28px; height: 28px;
        font-size: 13px;
        opacity: 1;
    }
}

/* ============ 手机端灯箱布局 ============ */
.pv-lightbox-mobile {
    display: none;
    width: 100%;
    flex-direction: column;
    background: #fff;
    position: fixed;
    top: var(--header-height, 70px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    overflow: hidden;
}
.pv-lightbox-mobile.show { display: flex; }

/* 手机端关闭按钮 */
.pv-mobile-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pv-mobile-close:active { background: rgba(0, 0, 0, 0.7); }

/* 滚动容器 */
.pv-mobile-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 70px;
    background: #fff;
}

/* 主图区 */
.pv-mobile-photo-area {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    max-height: 65vh;
    overflow: hidden;
    flex-shrink: 0;
}
.pv-mobile-photo-area img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 右侧操作栏 */
.pv-mobile-actions {
    position: absolute;
    right: 10px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 5;
}
.pv-m-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.pv-m-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.15s, background 0.15s;
}
.pv-m-action:active .pv-m-icon {
    transform: scale(0.9);
    background: rgba(192, 57, 43, 0.7);
}
.pv-m-count {
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.pv-m-action.active .pv-m-icon {
    background: rgba(231, 76, 60, 0.85);
    border-color: rgba(231, 76, 60, 1);
}

/* 照片计数 */
.pv-mobile-index {
    position: absolute;
    top: 14px;
    left: 14px;
    color: #fff;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 14px;
    z-index: 5;
}

/* 左右切换按钮 */
.pv-mobile-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 0;
    cursor: pointer;
}
.pv-mobile-arrow.left { left: 8px; }
.pv-mobile-arrow.right { right: 64px; }
.pv-mobile-arrow:disabled { opacity: 0.25; cursor: not-allowed; }

/* 信息区 */
.pv-mobile-info {
    padding: 14px 16px 10px;
    background: #fff;
    border-bottom: 1px solid #f0ebe0;
    flex-shrink: 0;
}
.pv-mobile-user-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.pv-mobile-username {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark, #8B0000);
}
.pv-mobile-time {
    font-size: 12px;
    color: #999;
}
.pv-mobile-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 评论区 */
.pv-mobile-comments-area {
    background: #fff;
    padding: 0 16px;
    flex-shrink: 0;
}
.pv-mobile-comments-head {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark, #8B0000);
    padding: 12px 0 8px;
    border-bottom: 1px solid #f0ebe0;
}
.pv-mobile-comments {
    padding: 4px 0;
}
.pv-mobile-comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f0e5;
}
.pv-mobile-comment:last-child { border-bottom: none; }
.pv-mobile-comment .mc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8D5B7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.pv-mobile-comment .mc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pv-mobile-comment .mc-body {
    flex: 1;
    min-width: 0;
}
.pv-mobile-comment .mc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.pv-mobile-comment .mc-user {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.pv-mobile-comment .mc-time {
    font-size: 11px;
    color: #aaa;
}
.pv-mobile-comment .mc-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.pv-mobile-comment .mc-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}
.pv-mobile-comment .mc-btn {
    font-size: 12px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.pv-mobile-comment .mc-btn:hover { color: var(--primary, #8B0000); }
.pv-mobile-empty {
    text-align: center;
    color: #bbb;
    font-size: 13px;
    padding: 30px 0;
}

/* 底部占位 */
.pv-mobile-bottom-spacer {
    height: 70px;
    background: #fff;
    flex-shrink: 0;
}

/* 固定底部输入栏 */
.pv-mobile-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #f0ebe0;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 10;
}
.pv-mobile-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pv-mobile-input-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0d5c0;
    border-radius: 22px;
    font-size: 16px;
    box-sizing: border-box;
    background: #f7f5f0;
    color: #333;
}
.pv-mobile-input-bar input:focus {
    outline: none;
    border-color: var(--primary, #8B0000);
    background: #fff;
}
.pv-mobile-send {
    padding: 10px 18px;
    background: var(--primary, #8B0000);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.pv-mobile-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.pv-mobile-login-tip {
    padding: 10px;
    background: #FDF6E8;
    color: #9E2020;
    font-size: 13px;
    text-align: center;
    border-radius: 6px;
}

/* 手机端媒体查询：显示手机布局，隐藏PC布局 */
@media (max-width: 900px) {
    .pv-lightbox-content { display: none !important; }
    .pv-photo-index { display: none !important; }
    .pv-lightbox-mask { display: none !important; }

    .pv-lightbox-mobile { display: flex; }

    .pv-lightbox.show {
        width: 0;
        height: 0;
        overflow: visible;
    }

    .pv-lightbox-close {
        top: env(safe-area-inset-top, 12px);
        right: 14px;
        font-size: 30px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);
        border-radius: 50%;
        z-index: 10002;
    }
}

/* ============ 内联评论样式 ============ */
.inline-comments {
    border-top: 1px solid #f0ebe0;
    background: #fafaf7;
    padding: 12px 14px;
}

.photo-card.comments-open {
    border-color: var(--primary, #9E2020) !important;
}

.inline-comments .ic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0ebe0;
}

.inline-comments .ic-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #333);
}

.inline-comments .ic-count {
    color: var(--primary, #9E2020);
    font-weight: 700;
}

.inline-comments .ic-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.inline-comments .ic-loading,
.inline-comments .ic-empty {
    text-align: center;
    color: #999;
    padding: 16px;
    font-size: 13px;
}

.inline-comments .ic-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f0e5;
}

.inline-comments .ic-item:last-child {
    border-bottom: none;
}

.inline-comments .ic-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.inline-comments .ic-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #333);
}

.inline-comments .ic-time {
    font-size: 12px;
    color: #999;
}

.inline-comments .ic-content {
    font-size: 14px;
    color: var(--text, #333);
    line-height: 1.5;
    margin-bottom: 6px;
    word-break: break-word;
}

.inline-comments .ic-actions {
    display: flex;
    gap: 8px;
}

.inline-comments .ic-actions button {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-light, #666);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.inline-comments .ic-actions button:hover {
    color: var(--primary, #9E2020);
    background: #fdf6e8;
}

.inline-comments .ic-actions .ic-del {
    color: #c0392b;
}

.inline-comments .ic-actions .ic-del:hover {
    color: #c0392b;
    background: #fde8e8;
}

.inline-comments .ic-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.inline-comments .ic-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e8dfcc;
    border-radius: 6px;
    font-size: 14px;
    resize: none;
    min-height: 36px;
    max-height: 80px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.inline-comments .ic-input:focus {
    border-color: var(--primary, #9E2020);
}

.inline-comments .ic-send {
    padding: 8px 16px;
    background: var(--primary, #9E2020);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.inline-comments .ic-send:hover:not(:disabled) {
    background: #801818;
}

.inline-comments .ic-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.inline-comments .ic-login-tip {
    text-align: center;
    padding: 10px;
    background: #fdf6e8;
    color: var(--primary, #9E2020);
    font-size: 13px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.inline-comments .ic-close-bar {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #f0ebe0;
}

.inline-comments .ic-close-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-light, #666);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.inline-comments .ic-close-btn:hover {
    color: var(--primary, #9E2020);
    background: #fdf6e8;
}

/* 手机端内联评论样式调整 */
@media (max-width: 900px) {
    .inline-comments {
        padding: 10px 12px;
    }
    
    .inline-comments .ic-list {
        max-height: 250px;
    }
    
    .inline-comments .ic-content {
        font-size: 13px;
    }
    
    .inline-comments .ic-input {
        font-size: 13px;
    }
    
    .inline-comments .ic-send {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .inline-comments {
        padding: 8px 10px;
    }
    
    .inline-comments .ic-list {
        max-height: 200px;
    }
    
    .inline-comments .ic-item {
        padding: 8px 0;
    }
    
    .inline-comments .ic-user-row {
        flex-wrap: wrap;
    }
    
    .inline-comments .ic-actions button {
        padding: 2px 4px;
    }
}

/* ============ 卡片样式更新（v3） ============ */

/* 移除旧的 photo-title-bar 样式 */
.photo-grid-cards .photo-title-bar {
    display: none !important;
}

/* 移除旧的 photo-stats-bar 样式 */
.photo-grid-cards .photo-stats-bar {
    display: none !important;
}

/* 移除旧的 photo-header 样式（已改为图片叠加） */
.photo-grid-cards .photo-header,
.photo-grid-cards .photo-uploader,
.photo-grid-cards .uploader-name,
.photo-grid-cards .photo-title {
    display: none !important;
}

/* 图片容器：相对定位，用于叠加 */
.photo-grid-cards .photo-thumb {
    position: relative;
    display: block;
    overflow: hidden;
}

.photo-grid-cards .photo-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

/* 左上角：标题叠加 */
.photo-grid-cards .photo-title-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    max-width: 75%;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    z-index: 2;
}

/* 右下角：成员名 + 相册目录叠加 */
.photo-grid-cards .photo-info-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}

.photo-grid-cards .photo-info-overlay .info-uploader {
    font-size: 12px;
    color: #fff;
    font-weight: 500;
}

.photo-grid-cards .photo-info-overlay .info-cat {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* 图片下方：说明 */
.photo-grid-cards .photo-description {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text, #333);
    line-height: 1.5;
    background: #fff;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 图片下方：交互图标（无边框无背景） */
.photo-grid-cards .photo-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 14px;
    background: #fff;
}

.photo-grid-cards .photo-actions .action-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-light, #888);
    cursor: pointer;
    user-select: none;
    padding: 0;
    border-radius: 0;
    transition: color .15s;
}

.photo-grid-cards .photo-actions .action-item:hover {
    color: var(--primary, #9E2020);
    background: transparent;
}

.photo-grid-cards .photo-actions .action-item.liked {
    color: #FF6B6B;
}

.photo-grid-cards .photo-actions .action-item.liked:hover {
    color: #FF6B6B;
}

.photo-grid-cards .photo-actions .action-item.view-stat {
    cursor: default;
}

.photo-grid-cards .photo-actions .action-item.view-stat:hover {
    color: var(--text-light, #888);
    background: transparent;
}

.photo-grid-cards .photo-actions .comment-btn.has-comments {
    color: var(--primary, #9E2020);
}

/* ============ 内联评论样式更新（v2） ============ */

/* 输入框置顶 */
.inline-comments {
    border-top: 1px solid #f0ebe0;
    background: #fafaf7;
    padding: 12px 14px;
}

/* 输入区域在顶部 */
.inline-comments .ic-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-top: 0;
    border-top: none;
    order: 1;
}

.inline-comments .ic-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e8dfcc;
    border-radius: 20px;
    font-size: 14px;
    height: 36px;
    line-height: 20px;
    outline: none;
    transition: border-color .15s;
    background: #fff;
}

.inline-comments .ic-input:focus {
    border-color: var(--primary, #9E2020);
}

.inline-comments .ic-send {
    padding: 0 20px;
    background: var(--primary, #9E2020);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    height: 36px;
    transition: background .15s;
}

.inline-comments .ic-send:hover:not(:disabled) {
    background: #801818;
}

.inline-comments .ic-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 登录提示在顶部 */
.inline-comments .ic-login-tip {
    text-align: center;
    padding: 10px;
    background: #fdf6e8;
    color: var(--primary, #9E2020);
    font-size: 13px;
    border-radius: 6px;
    margin-bottom: 12px;
    order: 1;
}

/* 评论列表在下方 */
.inline-comments .ic-header {
    order: 2;
    display: block;
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

.inline-comments .ic-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #333);
}

.inline-comments .ic-count {
    color: var(--primary, #9E2020);
    font-weight: 700;
}

.inline-comments .ic-list {
    order: 3;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

/* 评论项样式（支持回复功能） */
.inline-comments .ic-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f0e5;
}

.inline-comments .ic-item:last-child {
    border-bottom: none;
}

/* ============================================================
   手机端评论样式（按用户手绘图：一级评论细线框，盖楼回复在边框外 + 逐层向右退 16px，一级之间间距 1px）
   ============================================================ */
@media (max-width: 900px) {
    /* --- 1. 一级评论（根评论）：独立包细线边框，和用户红线框一致 --- */
    .inline-comments .ic-list > .ic-item {
        border: 1px solid #e8dfcc !important;   /* 细线边框（暖米色同色系） */
        border-radius: 6px;                     /* 轻微圆角 */
        padding: 10px 12px !important;          /* 内边距 10×12 */
        margin-bottom: 1px !important;          /* 一级评论之间间距 = 1px（按用户新示意） */
        background: #ffffff;                    /* 白底，框线清晰 */
    }
    /* 最后一个一级评论也保留底部边框，只是去掉下间距 */
    .inline-comments .ic-list > .ic-item:last-child {
        border-bottom: 1px solid #e8dfcc !important;
        margin-bottom: 0 !important;
    }

    /* --- 2. 盖楼容器（整体在父评论细线边框外，向右侧退 16px） --- */
    /* 容器层不再画连续竖线（由每条回复条目自己画 L 形短竖线 + 短横线） */
    .inline-comments .ic-replies {
        margin-left: 16px;   /* 整体向右侧退 16px，"以此类推"逐层叠加 */
        margin-top: 4px;     /* 和上面的父评论框留一点小间距 */
        padding-left: 0;     /* 不在这里加 padding，改在条目上为 L 形留空间 */
        border-left: none;   /* ❌ 去掉容器层的长竖线，改为每条条目自己画 L 形 */
    }

    /* --- 3. 盖楼回复条目（depth-1/2/3...）：自身画大 L 形引导线（竖 + 底横包围） --- */
    .inline-comments .ic-item.ic-reply {
        position: relative !important;  /* ✅ 启用定位，给 ::before / ::after 画大 L 形 */
        border: none !important;        /* ❌ 不包外框（大 L 由伪元素画） */
        border-radius: 0 !important;
        padding: 8px 0 !important;
        padding-left: 18px !important;  /* ✅ 左侧 18px 给 L 形竖线 + 间距留白 */
        margin: 0 !important;
        background: transparent !important;
        border-bottom: none !important; /* ❌ 原分隔线取消，改由大 L 的底横边统一承担 */
    }
    /* 盖楼容器里最后一条盖楼回复：大 L 仍然完整（不特殊处理，视觉一致） */

    /* --- 4. 大 L 形引导线（用户要求：竖线下方接横线 → 大 L 包围条目左+下） --- */
    /* 大 L 竖边：从条目顶部 0 → 底部 0，贯穿整个条目高度 */
    .inline-comments .ic-item.ic-reply::before {
        display: block !important;
        content: '' !important;
        position: absolute;
        left: 2px;
        top: 0;
        bottom: 0;                       /* ✅ 贯穿到底部（不是 10px），形成完整大 L 的竖边 */
        border-left: 1.5px solid #e8dfcc;
    }
    /* 大 L 横边：从竖线底部 left:2 → 条目右边缘 right:0，贯穿整个条目宽度（大 L 的底边） */
    .inline-comments .ic-item.ic-reply::after {
        display: block !important;
        content: '' !important;
        position: absolute;
        left: 2px;
        bottom: 0;                      /* ✅ 与竖线 bottom:0 对齐，两条线无缝衔接 */
        right: 0;                       /* ✅ 一直画到条目右边缘（不是短的 10px） → 大 L 的横边 */
        width: auto;
        border-top: 1.5px solid #e8dfcc;
    }

    /* --- 5. 清理旧版"隐藏伪元素"规则（现在要画出来） --- */
    /* （规则在下面会被另一段旧的 display:none 覆盖，因此要在这里用更高特异性重写） */
    .inline-comments .ic-replies > .ic-item::before,
    .inline-comments .ic-replies > .ic-item::after {
        /* ic-replies 直接子的非回复条目（不存在）不需要画线，由上面 .ic-item.ic-reply 统一画 */
    }

    /* --- 6. 盖楼缩进层级：由容器 .ic-replies margin-left:16px 逐层叠加，条目自身不再额外加缩进 --- */
    .inline-comments .ic-reply.ic-depth-1,
    .inline-comments .ic-reply.ic-depth-2,
    .inline-comments .ic-reply.ic-depth-3 {
        /* 只由上面的统一规则 padding-left:18px 控制 L 形留白即可，不用再加 */
    }
}

.inline-comments .ic-user-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.inline-comments .ic-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #333);
}

.inline-comments .ic-reply-to {
    font-size: 12px;
    color: var(--primary, #9E2020);
}

.inline-comments .ic-time {
    font-size: 12px;
    color: #999;
}

.inline-comments .ic-content {
    font-size: 14px;
    color: var(--text, #333);
    line-height: 1.5;
    margin-bottom: 6px;
    word-break: break-word;
}

.inline-comments .ic-actions {
    display: flex;
    gap: 12px;
}

.inline-comments .ic-actions button {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-light, #666);
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: color .15s, background .15s;
}

.inline-comments .ic-actions button:hover {
    color: var(--primary, #9E2020);
    background: transparent;
}

.inline-comments .ic-actions .ic-del {
    color: #c0392b;
}

.inline-comments .ic-actions .ic-del:hover {
    color: #c0392b;
    background: transparent;
}

/* 回复卡片样式 */
.inline-comments .ic-reply-card {
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--primary, #9E2020);
    border-radius: 8px;
}

.inline-comments .ic-reply-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e8dfcc;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 50px;
    outline: none;
    font-family: inherit;
}

.inline-comments .ic-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.inline-comments .ic-reply-cancel {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #e8dfcc;
    border-radius: 5px;
    background: #FAFAFA;
    color: var(--text, #333);
    cursor: pointer;
}

.inline-comments .ic-reply-submit {
    padding: 4px 12px;
    font-size: 12px;
    border: none;
    border-radius: 5px;
    background: var(--primary, #9E2020);
    color: #fff;
    cursor: pointer;
}

/* ============================================================
   桌面端（PC）盖楼样式：父容器 ic-replies 为直接子回复画 L 形（保留原逻辑，不影响PC）
   移动端（≤900px）在 @media 块内单独覆盖为"条目自己画 L 形"
   ============================================================ */

/* 盖楼模式 - 嵌套回复容器 */
.inline-comments .ic-replies {
    margin-top: 4px;
    padding-left: 0;
    border-left: none;
}

/* PC 端：父容器 ic-replies > .ic-item 画 L 形（父为子画） */
@media (min-width: 901px) {
    .inline-comments .ic-replies > .ic-item {
        position: relative;
        padding-left: 18px;
    }
    .inline-comments .ic-replies > .ic-item::before {
        content: '';
        position: absolute;
        left: 2px;
        top: 0;
        bottom: 10px;
        border-left: 1.5px solid #ddd;
    }
    .inline-comments .ic-replies > .ic-item.has-children::after {
        content: '';
        position: absolute;
        left: 2px;
        bottom: 10px;
        width: 10px;
        border-top: 1.5px solid #ddd;
    }
    .inline-comments .ic-item.ic-reply::before,
    .inline-comments .ic-item.ic-reply::after {
        display: none !important;
        content: none !important;
    }
    .inline-comments .ic-item.ic-reply {
        position: static;
        padding-left: 18px;
        border-left: none;
    }
    .inline-comments .ic-reply.ic-depth-1 { margin-top: 6px; padding-left: 18px; }
    .inline-comments .ic-reply.ic-depth-2 { margin-top: 4px; padding-left: 18px; }
    .inline-comments .ic-reply.ic-depth-3 { margin-top: 4px; padding-left: 18px; }
    .inline-comments .ic-reply.ic-depth-1 > .ic-replies,
    .inline-comments .ic-reply.ic-depth-2 > .ic-replies,
    .inline-comments .ic-reply.ic-depth-3 > .ic-replies {
        margin-left: 6px;
    }
}

/* 回复样式 - 统一的回复项样式 */
.inline-comments .ic-reply {
    font-size: 13px;
}

.inline-comments .ic-reply .ic-user-row,
.inline-comments .ic-reply .ic-content,
.inline-comments .ic-reply .ic-actions {
    font-size: 13px;
}

/* 收起按钮 */
.inline-comments .ic-close-bar {
    order: 4;
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #f0ebe0;
}

.inline-comments .ic-close-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-light, #666);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.inline-comments .ic-close-btn:hover {
    color: var(--primary, #9E2020);
    background: #fdf6e8;
}

/* 手机端响应式样式 */
@media (max-width: 900px) {
    .photo-grid-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .photo-grid-cards .photo-title-overlay {
        font-size: 13px;
        padding: 3px 8px;
    }

    .photo-grid-cards .photo-info-overlay {
        padding: 3px 8px;
        gap: 4px;
    }

    .photo-grid-cards .photo-info-overlay .info-uploader {
        font-size: 11px;
    }

    .photo-grid-cards .photo-info-overlay .info-cat {
        font-size: 10px;
    }

    .photo-grid-cards .photo-description {
        padding: 8px 12px;
        font-size: 13px;
    }

    .photo-grid-cards .photo-actions {
        padding: 8px 12px;
        gap: 16px;
    }

    .photo-grid-cards .photo-actions .action-item {
        font-size: 12px;
    }

    .inline-comments {
        padding: 10px 12px;
    }

    /* 手机端评论列表：全部展开，不限制高度，不显示滚动条 */
    .inline-comments .ic-list {
        max-height: none !important;
        overflow: visible !important;
        overflow-y: visible !important;
    }
}

@media (max-width: 480px) {
    .photo-grid-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .photo-grid-cards .photo-title-overlay {
        font-size: 12px;
        padding: 3px 6px;
        top: 8px;
        left: 8px;
        max-width: 70%;
    }

    .photo-grid-cards .photo-info-overlay {
        padding: 3px 6px;
        gap: 3px;
        bottom: 8px;
        right: 8px;
    }

    .photo-grid-cards .photo-info-overlay .info-uploader {
        font-size: 10px;
    }

    .photo-grid-cards .photo-info-overlay .info-cat {
        font-size: 10px;
        padding-left: 4px;
    }

    .photo-grid-cards .photo-description {
        padding: 8px 12px;
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .photo-grid-cards .photo-actions {
        padding: 8px 12px;
        gap: 12px;
    }

    .inline-comments {
        padding: 8px 10px;
    }

    /* 手机端（≤480px）评论列表：全部展开，不限制高度，不滚动 */
    .inline-comments .ic-list {
        max-height: none !important;
        overflow: visible !important;
        overflow-y: visible !important;
    }

    .inline-comments .ic-item {
        padding: 8px 0;
    }
}

/* ============ 手机端照片完整显示（不裁切高度） ============ */
/* 覆盖 branch.html 内联的 4/3 aspect-ratio + object-fit:cover，
   让手机端照片按原始比例完整显示高度；PC 端（>900px）保持原 4:3 cover 不变。 */
@media (max-width: 900px) {
    .photo-grid.photo-grid-cards .photo-thumb {
        aspect-ratio: auto !important;
        width: 100% !important;
        height: auto !important;
    }
    .photo-grid.photo-grid-cards .photo-thumb img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
}

/* ============ 手机端照片完整显示（不裁切高度） ============ */
/* 覆盖 branch.html 内联的 4/3 aspect-ratio + object-fit:cover，
   让手机端照片按原始比例完整显示高度；PC 端（>900px）保持原 4:3 cover 不变。 */
@media (max-width: 900px) {
    .photo-grid.photo-grid-cards .photo-thumb {
        aspect-ratio: auto !important;
        width: 100% !important;
        height: auto !important;
    }
    .photo-grid.photo-grid-cards .photo-thumb img {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
}
