/* 悬浮卡片灯箱样式 */

#custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#custom-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 悬浮卡片容器 - 增大尺寸 */
.lightbox-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 关闭按钮 */
.lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #666;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
}

/* 卡片头部 */
.lightbox-header {
    padding: 18px 54px 18px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
    position: relative;
}

.lightbox-time {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lightbox-time .full-time {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    font-family: 'Noto Serif SC', serif;
}

.lightbox-time .short-time {
    font-size: 13px;
    color: #999;
}

/* 天气地址居中显示 */
.lightbox-meta-center {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lightbox-weather {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #444;
}

.lightbox-location {
    font-size: 12px;
    color: #999;
}

/* 图片区域 - 在 popup 模式下 */
.lightbox-images-area {
    position: relative;
    flex-shrink: 0;
}

.popup-images-grid img {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.popup-images-grid img:hover {
    transform: scale(1.02);
}

/* 单图模式 */
.lightbox-single-view {
    display: none;
    position: relative;
}

.lightbox-single-view.active {
    display: block;
}

.lightbox-single-view .single-image {
    width: 100%;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 10px;
    cursor: default;
}

/* 单图模式导航按钮 */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.lightbox-nav-btn:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-nav-btn.prev {
    left: 10px;
}

.lightbox-nav-btn.next {
    right: 10px;
}

/* 返回按钮 */
.lightbox-back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 7px 14px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    font-size: 13px;
    cursor: pointer;
    border-radius: 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lightbox-back-btn:hover {
    background: #fff;
    color: #333;
}

/* 图片计数器 */
.lightbox-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 13px;
    border-radius: 14px;
}

/* 文案区域 */
.lightbox-content {
    padding: 14px 18px;
    flex-shrink: 0;
}

.lightbox-text {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    font-family: 'Noto Serif SC', serif;
    margin: 0;
}

/* 底部操作区 */
.lightbox-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lightbox-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.lightbox-gender {
    font-size: 14px;
}

.lightbox-gender.male {
    color: #5DADE2;
}

.lightbox-gender.female {
    color: #F8BBD9;
}

.lightbox-like-btn,
.lightbox-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: transparent;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-like-btn:hover {
    background: rgba(248, 187, 217, 0.15);
    border-color: rgba(248, 187, 217, 0.3);
    color: #E91E63;
}

.lightbox-comment-btn:hover {
    background: rgba(200, 200, 200, 0.15);
    color: #666;
}

/* 评论区 */
.lightbox-comments {
    padding: 14px 18px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
}

.lightbox-comments-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* 单条评论 */
.comment-item {
    margin-bottom: 16px;
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.comment-name.male {
    color: #5DADE2;
}

.comment-name.female {
    color: #F8BBD9;
}

.comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-left: 36px;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 36px;
}

.comment-action {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.comment-action:hover {
    color: #666;
}

.comment-action.liked {
    color: #E91E63;
}

/* 回复 - 显示在父评论下一行，错开位置 */
.comment-replies {
    margin-left: 36px;
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid rgba(188, 19, 254, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reply-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reply-item:last-child {
    margin-bottom: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.reply-name {
    font-size: 12px;
    font-weight: 500;
}

.reply-name.male {
    color: #5DADE2;
}

.reply-name.female {
    color: #F8BBD9;
}

.reply-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-left: 26px;
}

/* ============ 评论弹窗样式 ============ */
#comment-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#comment-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 评论弹窗卡片 - 增大尺寸 */
.popup-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #666;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
}

.popup-header {
    padding: 18px 54px 18px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
    position: relative;
}

.popup-time {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.popup-time .full-time {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    font-family: 'Noto Serif SC', serif;
}

.popup-time .short-time {
    font-size: 13px;
    color: #999;
}

/* 天气地址居中显示 */
.popup-meta-center {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.popup-weather {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #444;
}

.popup-location {
    font-size: 12px;
    color: #999;
}

.popup-weather {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #444;
}

.popup-location {
    font-size: 12px;
    color: #999;
}

.popup-images {
    padding: 14px 18px;
    background: #f8f8f8;
    flex-shrink: 0;
}

.popup-images-grid {
    display: grid;
    gap: 6px;
}

.popup-images-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
}

.popup-content {
    padding: 14px 18px;
    flex-shrink: 0;
}

.popup-text {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    font-family: 'Noto Serif SC', serif;
    margin: 0;
}

/* 评论区 */
.popup-comments-section {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    background: #fff;
    max-height: 300px;
}

.popup-comments-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 14px;
}

.popup-comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popup-comment-item {
    display: flex;
    gap: 12px;
}

.popup-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.popup-comment-content {
    flex: 1;
    min-width: 0;
}

.popup-comment-name {
    font-size: 14px;
    font-weight: 500;
}

.popup-comment-name.male {
    color: #5DADE2;
}

.popup-comment-name.female {
    color: #F8BBD9;
}

.popup-comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin: 4px 0 8px;
}

.popup-comment-actions {
    display: flex;
    gap: 16px;
}

.popup-comment-action {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.popup-comment-action:hover {
    color: #666;
}

.popup-comment-action.liked {
    color: #E91E63;
}

/* 回复列表 */
.popup-replies {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-reply-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.popup-reply-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.popup-reply-action {
    font-size: 11px;
    color: #999;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s;
}

.popup-reply-action:hover {
    color: #666;
}

.popup-reply-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.popup-reply-name {
    font-size: 13px;
    font-weight: 500;
}

.popup-reply-name.male {
    color: #5DADE2;
}

.popup-reply-name.female {
    color: #F8BBD9;
}

.popup-reply-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* 输入区 */
.popup-input-area {
    padding: 14px 18px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafafa;
    flex-shrink: 0;
}

.popup-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.popup-input:focus {
    border-color: rgba(248, 187, 217, 0.5);
}

.popup-send-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0ff0fc, #bc13fe);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.popup-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 240, 252, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    #custom-lightbox,
    #comment-popup {
        padding: 10px;
    }

    .lightbox-card,
    .popup-card {
        max-height: 95vh;
        max-width: 100%;
        border-radius: 16px;
    }

    .lightbox-close,
    .popup-close {
        width: 30px;
        height: 30px;
        font-size: 20px;
        top: 12px;
        right: 12px;
    }

    .lightbox-header,
    .popup-header {
        padding: 14px 46px 14px 14px;
    }

    .lightbox-images,
    .popup-images {
        padding: 12px 14px;
    }

    .lightbox-content,
    .popup-content {
        padding: 12px 14px;
    }

    .lightbox-comments,
    .popup-comments-section {
        padding: 12px 14px;
        max-height: 200px;
    }

    .lightbox-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .lightbox-single-view .single-image {
        max-height: 45vh;
    }

    .popup-input-area {
        padding: 12px 14px;
    }

    .popup-comment-avatar {
        width: 32px;
        height: 32px;
    }
}
