/* ================================
   Life 生活记录模块样式 - 小红书风格
   ================================ */

/* Life 容器 */
.life-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 12px;
    background: #fff;
}

/* 添加按钮 - 圆形+号，居中显示，放大 */
.life-add-button {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #ff2442 0%, #ff6f61 100%);
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(255, 36, 66, 0.35);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 50px;
    font-weight: 700;
    line-height: 1;
}

.life-add-button:hover {
    transform: translateX(-50%) translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 36, 66, 0.45);
}

.life-add-button:active {
    transform: translateX(-50%) translateY(-2px) scale(0.95);
}

/* 瀑布流网格 - 小红书风格 */
.life-masonry-grid {
    column-count: 2;
    column-gap: 8px;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .life-masonry-grid {
        column-count: 3;
        column-gap: 12px;
    }
}

@media (min-width: 1024px) {
    .life-masonry-grid {
        column-count: 4;
        column-gap: 12px;
    }
}

@media (min-width: 1440px) {
    .life-masonry-grid {
        column-count: 5;
        column-gap: 16px;
    }
}

/* Life 卡片 - 小红书风格 */
.life-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.2s ease;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
    width: 100%;
    border: 1px solid #f0f0f0;
}

.life-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.life-card:active {
    transform: scale(0.98);
}

.life-card.life-card-menu-active {
    z-index: 100;
}

@media (min-width: 768px) {
    .life-masonry-grid {
        column-gap: 12px;
    }

    .life-card {
        border-radius: 16px;
        margin-bottom: 12px;
    }
}

/* 媒体容器 - 保持原图比例 */
.life-card-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f7fa;
    min-height: 200px; /* 确保有最小高度 */
}

.life-card-media img,
.life-card-media video {
    width: 100%;
    height: auto;
    min-height: 200px;
    display: block;
    object-fit: cover; /* 改为cover以填充容器 */
}

/* 图片加载失败时显示占位内容 */
.life-card-media img[src=""],
.life-card-media img:not([src]) {
    min-height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.life-card-media img[src=""]:after,
.life-card-media img:not([src]):after {
    content: '📷';
    font-size: 48px;
    opacity: 0.3;
}

/* 视频播放图标 - 小号透明样式，放在右上角 */
.life-card-play-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

.life-card:hover .life-card-play-icon {
    background: rgba(0, 0, 0, 0.6);
}

/* 多图指示器 - 白色进度条样式，显示在卡片底部 */
.life-card-image-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 3;
}

.life-card-image-indicator-dot {
    width: 24px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 当只有2个资源时 */
.life-card-image-indicators[data-count="2"] .life-card-image-indicator-dot {
    width: 32px;
}

/* 当资源很多时（超过5个），显示为圆点 */
.life-card-image-indicators[data-count-more="true"] .life-card-image-indicator-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

/* 纯文本卡片样式 - 小红书想法风格 */
.life-card-text-content {
    background: linear-gradient(135deg, #FFB6C1 0%, #FFC0CB 50%, #FFD1DC 100%);
    min-height: 180px;
    padding: 20px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
}

.life-card-text-description {
    color: #5a3146;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    width: 100%;
    -webkit-box-align: start;
    align-self: flex-start;
}

.life-card-text-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
}

.life-card-text-date {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}


/* 卡片内容 - 小红书风格 */
.life-card-content {
    padding: 12px;
    background: white;
}

.life-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.life-card-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.life-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    gap: 8px;
}

.life-card-date {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    flex-shrink: 0;
}

.life-card-location {
    font-size: 11px;
    color: #666;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* 空状态 */
.life-empty {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.life-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.life-empty-text {
    font-size: 18px;
    color: #8e8e93;
    margin-bottom: 24px;
}

/* 分页控件 */
.life-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding: 20px;
}

.life-pagination-btn {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.life-pagination-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: #f0f4ff;
}

.life-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.life-pagination-info {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* ================================
   详情页模态框 - 小红书全屏沉浸式风格
   ================================ */

.life-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.life-detail-modal.show {
    display: block;
}

.life-detail-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 详情页头部 - 小红书风格 */
.life-detail-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.life-detail-header.content-expanded {
    opacity: 0;
    pointer-events: none;
}

.life-detail-date {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.life-detail-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.life-detail-action-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.life-detail-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.life-detail-action-btn:active {
    transform: scale(0.95);
}

.life-detail-close {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.life-detail-close:hover {
    background: rgba(255, 255, 255, 1);
}

.life-detail-close:active {
    transform: scale(0.9);
}

/* 媒体区域 */
.life-detail-media-container {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    margin-top: 60px;
    width: 100%;
    max-height: 70vh;
}

.life-detail-media-container.content-expanded {
    transform: translateY(-120px);
}

.life-detail-video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 纯文本详情页样式 - 全屏粉色背景 */
.life-detail-modal.text-mode {
    background: linear-gradient(135deg, #FFB6C1 0%, #FFC0CB 50%, #FFD1DC 100%);
}

.life-detail-modal.text-mode .life-detail-content {
    overflow-y: auto;
    overflow-x: hidden;
}

.life-detail-modal.text-mode .life-detail-header {
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.life-detail-modal.text-mode .life-detail-date,
.life-detail-modal.text-mode .life-detail-action-btn,
.life-detail-modal.text-mode .life-detail-close {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    color: #5a3146;
}

.life-detail-modal.text-mode .life-detail-action-btn:hover,
.life-detail-modal.text-mode .life-detail-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

.life-detail-modal.text-mode .life-detail-media-container {
    position: relative;
    height: auto;
    min-height: 100%;
    overflow: visible;
    display: block;
    flex: none;
}

.life-detail-text-card {
    width: 100%;
    display: block;
    padding: 80px 40px 60px;
    box-sizing: border-box;
}

.life-detail-text-card .life-detail-text-description {
    color: #5a3146;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.8;
    margin: 0 auto;
    max-width: 700px;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 自定义滚动条样式（仅文本模式） */
.life-detail-modal.text-mode .life-detail-content::-webkit-scrollbar {
    width: 8px;
}

.life-detail-modal.text-mode .life-detail-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.life-detail-modal.text-mode .life-detail-content::-webkit-scrollbar-thumb {
    background: rgba(90, 49, 70, 0.3);
    border-radius: 4px;
}

.life-detail-modal.text-mode .life-detail-content::-webkit-scrollbar-thumb:hover {
    background: rgba(90, 49, 70, 0.5);
}

@media (max-width: 768px) {
    .life-detail-text-card {
        padding: 60px 20px 60px;
    }

    .life-detail-text-card .life-detail-text-description {
        font-size: 18px;
        line-height: 1.7;
        max-width: 100%;
    }
}

/* 图片轮播 */
.life-detail-carousel {
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    touch-action: pan-x;
    overflow: hidden;
}

.life-detail-carousel-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: flex-start;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    width: 100%;
}

.life-detail-carousel-item {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
}

.life-detail-carousel-item img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* 支持双指缩放的图片 */
.life-detail-carousel-img {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.3s ease;
    transform-origin: center;
}

/* 轮播导航 */
.life-detail-carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
}

.life-detail-carousel-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: all;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.life-detail-carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.life-detail-carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 轮播指示器 */
.life-detail-carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

.life-detail-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.life-detail-carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #333;
}

/* 信息区域 - 小红书风格 */
.life-detail-info {
    background: #fff;
    padding: 16px 20px 24px;
    flex-shrink: 0;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-height: none;
}

.life-detail-info.expanded {
    flex: 1;
    overflow-y: auto;
    max-height: 80vh;
}

.life-detail-info::-webkit-scrollbar {
    width: 3px;
}

.life-detail-info::-webkit-scrollbar-track {
    background: transparent;
}

.life-detail-info::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.life-detail-info::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.life-detail-description {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

/* 详情页文字描述 */
.life-detail-text {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 16px;
}

/* 详情页元数据区域 */
.life-detail-metadata {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.life-detail-metadata-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.life-detail-metadata-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.life-detail-metadata-text {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 加载状态 */
.life-loading {
    text-align: center;
    padding: 48px 20px;
}

.life-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.life-loading-text {
    font-size: 15px;
    color: #8e8e93;
}

/* ================================
   响应式设计
   ================================ */

@media (max-width: 768px) {
    .life-container {
        padding: 16px;
    }

    .life-masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        grid-gap: 12px;
    }

    .life-empty {
        min-height: 50vh;
        width: 100%;
    }

    .life-add-button {
        width: 56px;
        height: 56px;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 46px;
        font-weight: 700;
    }

    .life-card-content {
        padding: 12px;
    }

    .life-card-title {
        font-size: 14px;
    }

    .life-card-description {
        font-size: 13px;
    }

    .life-card-footer {
        padding: 10px 12px;
    }

    .life-detail-header {
        padding: 16px 16px;
    }

    .life-detail-info {
        padding: 12px 16px 20px;
    }

    /* .life-detail-title {
        font-size: 18px;
    } */

    .life-detail-description {
        font-size: 14px;
    }

    .life-detail-carousel-nav {
        padding: 0 12px;
    }

    .life-detail-carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .life-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .life-card:hover {
        transform: none;
    }

    .life-card:active {
        transform: scale(0.98);
    }
}

/* ========== 类型选择模态框样式 - 小红书风格 ========== */
.life-type-select-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.life-type-select-modal.show {
    display: flex;
}

.life-type-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.25s ease;
}

.life-type-select-content {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px 32px;
    width: 100%;
    max-width: 500px;
    animation: slideUpSmooth 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpSmooth {
    from {
        transform: translateY(100%);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.life-type-select-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.life-type-select-option:hover {
    background: #fafafa;
    border-color: #ff2442;
}

.life-type-select-option:active {
    transform: scale(0.97);
    background: #f5f5f5;
}

.life-type-select-icon {
    font-size: 26px;
}

.life-type-select-cancel {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #f7f7f7;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 8px;
}

.life-type-select-cancel:hover {
    background: #eee;
}

.life-type-select-cancel:active {
    transform: scale(0.97);
    background: #e5e5e5;
}

/* ========== 新的编辑页面样式 - 小红书风格 ========== */
.life-edit-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: #fafafa;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.life-edit-page.show {
    display: flex;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.life-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    flex-shrink: 0;
}

.life-edit-back {
    padding: 6px 12px;
    border: none;
    background: none;
    color: #333;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.life-edit-back:hover {
    opacity: 0.7;
}

.life-edit-back:active {
    opacity: 0.5;
}

.life-edit-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.life-edit-publish {
    padding: 6px 20px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff2442 0%, #ff6f61 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.life-edit-publish:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
}

.life-edit-publish:active:not(:disabled) {
    transform: scale(0.95);
}

.life-edit-publish:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.life-edit-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 媒体预览区 */
.life-edit-media-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.life-edit-media-preview {
    position: relative;
    width: 100%;
    flex: 1;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.life-edit-media-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

/* 单张图片时填满整个预览区 */
.life-edit-media-preview.single-item .life-edit-media-item {
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

.life-edit-media-item img,
.life-edit-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 单张图片时使用contain保持比例，确保完整显示 */
.life-edit-media-preview.single-item .life-edit-media-item img,
.life-edit-media-preview.single-item .life-edit-media-item video {
    object-fit: contain;
    max-height: 100%;
    max-width: 100%;
}

/* ========== 新的相册/拍摄模式样式 ========== */
.life-edit-photo-mode {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* 上传区域 - 调整为五五开 */
.life-edit-upload-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 0;
    max-height: 50vh;
}

.life-edit-upload-area:hover {
    background: #f5f5f5;
}

.life-edit-upload-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.life-edit-upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.life-edit-upload-text {
    font-size: 17px;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.life-edit-upload-hint {
    font-size: 14px;
    color: #999;
}

/* 媒体预览容器 */
.life-edit-media-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    overflow: auto;
    min-height: 0;
    max-height: none;
}

.life-edit-media-preview {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    padding: 12px;
    background: #f5f5f5;
    align-content: start;
    min-height: 0;
}

/* 单张图片时居中显示 */
.life-edit-media-preview.single-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100%;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .life-edit-media-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 8px;
    }
}

/* 描述输入区 */
.life-edit-description-section {
    padding: 16px;
    background: white;
    border-top: 1px solid #f0f0f0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.life-edit-description-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    flex: 1;
    min-height: 100px;
}

.life-edit-description-input:focus {
    outline: none;
    border-color: #ff2442;
}

.life-edit-description-input::placeholder {
    color: #bbb;
}

.life-edit-media-video-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.life-edit-media-uploading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.life-edit-media-progress {
    width: 80%;
    max-width: 300px;
}

.life-edit-media-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.life-edit-media-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.life-edit-media-progress-text {
    text-align: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.life-edit-media-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.life-edit-media-remove:hover {
    background: rgba(255, 59, 48, 0.8);
    transform: scale(1.1);
}

/* 视频播放图标 - 编辑页面 */
.life-edit-media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.life-edit-media-item:hover .life-edit-media-play-icon {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 视频播放器模态框 */
.video-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.video-player-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
}

.video-player-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-player-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-player-video {
    width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

/* 纯文本模式的默认背景 */
.life-edit-text-bg {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: visible; /* 改为 visible 让背景选择器不被裁剪 */
    flex-shrink: 0;
    display: none;
}

.life-edit-text-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* 背景选择器 */
.life-edit-bg-selector {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* 提高 z-index 确保在最上层 */
}

.life-edit-bg-options {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.life-edit-bg-option {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.life-edit-bg-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.life-edit-bg-option:hover {
    transform: scale(1.1);
    border-color: rgba(102, 126, 234, 0.5);
}

.life-edit-bg-option.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.life-edit-bg-option:active {
    transform: scale(0.95);
}

/* 输入区 - 小红书风格 */
.life-edit-input-section {
    padding: 16px;
    flex: 1;
    background: white;
    margin: 0;
}

.life-edit-title-input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: transparent;
}

.life-edit-title-input:focus {
    outline: none;
    border-bottom-color: #ff2442;
}

.life-edit-title-input::placeholder {
    color: #bbb;
}

.life-edit-description-input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    resize: none;
    min-height: 200px;
    transition: border-color 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
    background: transparent;
}

.life-edit-description-input:focus {
    outline: none;
}

.life-edit-description-input::placeholder {
    color: #bbb;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 移动端适配 - 小红书风格 */
@media (max-width: 768px) {
    .life-container {
        padding: 8px 6px;
    }

    .life-add-button {
        bottom: 60px;
        padding: 12px 28px;
        font-size: 15px;
    }

    .life-add-button::before {
        font-size: 20px;
    }

    .life-masonry-grid {
        column-gap: 6px;
        margin-top: 4px;
    }

    .life-card {
        margin-bottom: 6px;
        border-radius: 10px;
    }

    .life-card-content {
        padding: 10px;
    }

    .life-card-description {
        font-size: 12px;
    }

    .life-card-footer {
        padding: 6px 10px;
    }

    .life-card-date {
        font-size: 10px;
    }

    .life-card-text-content {
        min-height: 150px;
        padding: 16px 12px;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .life-card-text-description {
        font-size: 14px;
        -webkit-line-clamp: 5;
        -webkit-box-align: start;
        align-self: flex-start;
    }

    .life-card-text-footer {
        padding: 8px 10px;
    }

    .life-card-text-date {
        font-size: 10px;
    }

    .life-detail-info {
        padding: 12px 16px 20px;
    }

    .life-detail-description {
        font-size: 14px;
    }

    .life-edit-media-description-input {
        font-size: 14px;
        padding: 10px 12px;
        min-height: 80px;
    }

    .life-edit-text-bg {
        aspect-ratio: 1 / 1;
    }

    .life-edit-input-section {
        padding: 16px;
    }

    .life-edit-title-input {
        font-size: 16px;
        padding: 12px 14px;
    }

    .life-edit-description-input {
        font-size: 14px;
        padding: 12px 14px;
        min-height: 150px;
    }

    .life-type-select-content {
        padding: 16px 12px 28px;
    }

    .life-type-select-option {
        padding: 14px 16px;
        font-size: 15px;
    }

    .life-type-select-icon {
        font-size: 24px;
    }
}

/* ========== 新的纯文本编辑模式样式 ========== */
.life-edit-text-mode {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.life-edit-text-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.life-edit-text-preview {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 300px;
}

.life-edit-text-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.life-edit-text-textarea {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 700px;
    min-height: 300px;
    max-height: 80%;
    padding: 24px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    font-size: 17px;
    line-height: 1.8;
    color: #5a3146;
    resize: none;
    font-family: inherit;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.life-edit-text-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.95);
}

.life-edit-text-textarea::placeholder {
    color: #999;
}

/* 背景选择器 - 底部样式 */
.life-edit-bg-selector-bottom {
    padding: 16px;
    background: white;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.life-edit-bg-selector-bottom .life-edit-bg-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 8px 0;
}

.life-edit-bg-selector-bottom .life-edit-bg-option {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.life-edit-bg-selector-bottom .life-edit-bg-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.life-edit-bg-selector-bottom .life-edit-bg-option:hover {
    transform: scale(1.08);
}

.life-edit-bg-selector-bottom .life-edit-bg-option.active {
    border-color: #ff2442;
    box-shadow: 0 0 0 2px rgba(255, 36, 66, 0.2);
}

/* ========== 详情页返回按钮和更多按钮 ========== */
.life-detail-back {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #333;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.life-detail-back:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.life-detail-back:active {
    transform: scale(0.95);
}

.life-detail-back-icon {
    font-weight: bold;
    line-height: 1;
}

.life-detail-more {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.life-detail-more:hover {
    background: rgba(255, 255, 255, 1);
}

.life-detail-more:active {
    transform: scale(0.9);
}

.life-detail-more-dots {
    font-size: 14px;
    letter-spacing: 1px;
    font-weight: bold;
}

/* 纯文本模式下的按钮样式 */
.life-detail-modal.text-mode .life-detail-back,
.life-detail-modal.text-mode .life-detail-more {
    background: rgba(255, 255, 255, 0.3);
    color: #5a3146;
}

.life-detail-modal.text-mode .life-detail-back:hover,
.life-detail-modal.text-mode .life-detail-more:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========== 操作菜单弹窗 - 居中显示 ========== */
.life-action-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}

.life-action-modal.show {
    display: flex;
}

.life-action-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.life-action-modal-content {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 280px;
    max-width: 90%;
    animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.life-action-modal-header {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
}

.life-action-modal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border: none;
    background: white;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.life-action-modal-item:hover {
    background: #f8f8f8;
}

.life-action-modal-item:active {
    background: #f0f0f0;
}

.life-action-modal-item.life-action-danger {
    color: #ff3b30;
}

.life-action-modal-item.life-action-danger:hover {
    background: #fff5f5;
}

.life-action-icon {
    font-size: 18px;
}

.life-action-modal-cancel {
    width: 100%;
    padding: 16px;
    border: none;
    background: #f7f7f7;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.life-action-modal-cancel:hover {
    background: #eee;
}

.life-action-modal-cancel:active {
    background: #e5e5e5;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .life-edit-text-preview {
        min-height: 250px;
    }

    .life-edit-text-textarea {
        width: 92%;
        min-height: 220px;
        font-size: 16px;
        padding: 20px;
    }

    .life-edit-bg-selector-bottom .life-edit-bg-option {
        width: 42px;
        height: 42px;
    }

    .life-detail-back,
    .life-detail-more {
        width: 38px;
        height: 38px;
    }

    .life-detail-back-icon {
        font-size: 26px;
    }

    .life-detail-more-dots {
        font-size: 12px;
    }

    .life-action-modal-content {
        width: 260px;
    }
}
