/* ===================================
   时间轴 & 列表 - Q萌卡通风格 (完全重构)
   =================================== */

/* ===== 公用区域 ===== */
.timeline-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 16px 80px;
    position: relative;
}

.timeline-title {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5a3e6f;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 2;
    background: #fff5fb;
    display: inline-block;
    padding: 5px 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50px;
    border: 2px solid rgba(255, 142, 199, 0.12);
    box-shadow: 0 2px 8px rgba(255, 142, 199, 0.06);
}

.tl-empty {
    text-align: center;
    padding: 30px 20px;
    color: #d5b3ff;
    font-size: 0.95rem;
}

/* 加载和结束 */
.timeline-loader,
.timeline-end,
.timeline-empty {
    text-align: center;
    padding: 20px;
    color: #d5b3ff;
}

.timeline-end {
    font-style: italic;
    font-size: 0.85rem;
}

/* ========================================
   精选时间轴 - 桌面端双侧 / 移动端左侧
   ======================================== */
.featured-grid {
    position: relative;
    padding-left: 0;
}

/* 竖线：居中 */
.featured-grid::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: linear-gradient(180deg, transparent, #ffc2e2 40px, #ddc6ff, #a0d2ff calc(100% - 40px), transparent);
    border-radius: 3px;
    transform: translateX(-50%);
}

/* ===== 时间轴端点标记 ===== */
.tl-endpoint {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px 0;
    width: 50%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tl-endpoint.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 顶端（未完待续）在右侧，圆点靠左边缘对齐中轴 */
.tl-endpoint-end {
    margin-left: auto;
    padding-left: 36px;
}

/* 底端（故事开始）在左侧，圆点靠右边缘对齐中轴 */
.tl-endpoint-start {
    margin-right: auto;
    padding-right: 36px;
    flex-direction: row-reverse;
}

.tl-endpoint-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--dot-color, #ff8ec7);
    position: absolute;
    z-index: 2;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--dot-glow, rgba(255, 142, 199, 0.1));
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 圆点对齐到中轴线上 — 用 transform 精准居中，与轴线同方式 */
.tl-endpoint-end .tl-endpoint-dot {
    left: 0;
    transform: translateX(-50%);
}

.tl-endpoint-start .tl-endpoint-dot {
    right: 0;
    transform: translateX(50%);
}

.tl-endpoint:hover .tl-endpoint-dot {
    scale: 1.45;
    background: var(--dot-color, #ff8ec7);
    box-shadow: 0 0 0 5px var(--dot-glow, rgba(255, 142, 199, 0.15)),
                0 0 12px var(--dot-glow, rgba(255, 142, 199, 0.3));
}

.tl-endpoint-label {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    opacity: 0.8;
}

.tl-endpoint-start .tl-endpoint-label {
    color: #8bbde0;
}

.tl-endpoint-end .tl-endpoint-label {
    color: #e07aae;
}

/* 时间轴节点 — 桌面端交替左右 */
.tl-node {
    position: relative;
    padding-bottom: 32px;
    width: 50%;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tl-node.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 奇数节点在左 */
.tl-node:nth-child(odd) {
    margin-right: auto;
    padding-right: 36px;
    text-align: right;
}

/* 偶数节点在右 */
.tl-node:nth-child(even) {
    margin-left: auto;
    padding-left: 36px;
    text-align: left;
}

/* 圆点容器 — 绝对定位在中轴线上 */
.tl-dot-wrap {
    position: absolute;
    top: 18px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-node:nth-child(odd) .tl-dot-wrap {
    right: -15px;
}

.tl-node:nth-child(even) .tl-dot-wrap {
    left: -15px;
}

.tl-dot {
    width: 12px;
    height: 12px;
    background: #fff;
    border: 3px solid var(--dot-color, #ff8ec7);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 0 3px var(--dot-glow, rgba(255, 142, 199, 0.1));
    flex-shrink: 0;
}

.tl-node:hover .tl-dot {
    transform: scale(1.45);
    background: var(--dot-color, #ff8ec7);
    box-shadow: 0 0 0 5px var(--dot-glow, rgba(255, 142, 199, 0.15)),
                0 0 12px var(--dot-glow, rgba(255, 142, 199, 0.3));
}

/* 日期标签 */
.tl-date-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.tl-node:nth-child(odd) .tl-date-label {
    justify-content: flex-end;
}

.tl-node:nth-child(odd) .tl-card {
    margin-left: auto;
}

.tl-node:nth-child(even) .tl-card {
    margin-right: auto;
}

.tl-date-md {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #8b6e9e;
}

.tl-date-y {
    font-size: 0.72rem;
    color: #c8b0da;
    font-weight: 600;
}

/* 卡片 */
.tl-card {
    display: flex;
    gap: 0;
    background: linear-gradient(135deg, #fffafd, #fdf5ff);
    border-radius: 16px;
    box-shadow: 0 3px 16px rgba(255, 142, 199, 0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 2px solid rgba(255, 142, 199, 0.08);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(255, 142, 199, 0.16);
    border-color: rgba(255, 142, 199, 0.18);
}

/* 卡片封面图 — 左侧缩略图 */
.tl-card-img {
    width: 110px;
    min-height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #fff0f6, #f3e5ff);
}

.tl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.tl-card:hover .tl-card-img img {
    transform: scale(1.06);
}

/* 卡片内容区 */
.tl-card-content {
    flex: 1;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tl-card-mood {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.tl-card-title {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #5a3e6f;
    line-height: 1.35;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-card-desc {
    font-size: 0.82rem;
    color: #8b6e9e;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}

.tl-card-stats {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #b8a0c8;
}

.tl-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ===== 点赞爱心 - 按身份着色 ===== */
.like-hearts {
    display: inline-flex;
    align-items: center;
    position: relative;
    line-height: 1;
}

.like-heart-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
}

.like-heart-icon.lyl {
    color: #ef4444;
    fill: #ef4444;
}

.like-heart-icon.lzh {
    color: #3b82f6;
    fill: #3b82f6;
}

/* 两颗心叠加 */
.like-hearts.both .like-heart-icon:nth-child(2) {
    margin-left: -6px;
    position: relative;
    z-index: 1;
}

.like-heart-icon.empty {
    color: #d5c0e0;
    fill: none;
    stroke: #d5c0e0;
    stroke-width: 1.5;
}

/* ========================================
   列表视图 — 简洁卡片
   ======================================== */
.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(255, 142, 199, 0.06);
    border: 2px solid rgba(255, 142, 199, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 142, 199, 0.12);
    border-color: rgba(255, 142, 199, 0.12);
}

.list-card-thumb {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fff0f6, #f3e5ff);
}

.list-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.list-card-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

/* 有缩略图时隐藏 icon */
.list-card:has(.list-card-thumb) .list-card-icon {
    display: none;
}

/* 身份卡片颜色 */
.list-card.list-card-lzh {
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    border-color: rgba(59, 130, 246, 0.08);
}

.list-card.list-card-lzh:hover {
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.08);
}

.list-card.list-card-lyl {
    background: linear-gradient(135deg, #fff5f9, #ffeef5);
    border-color: rgba(255, 105, 180, 0.08);
}

.list-card.list-card-lyl:hover {
    border-color: rgba(255, 105, 180, 0.15);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.08);
}

/* 心情 emoji 放在最右侧 */
.list-card-mood-right {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
    line-height: 1;
}

.list-card-body {
    flex: 1;
    min-width: 0;
}

.list-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #5a3e6f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.list-card-desc {
    font-size: 0.8rem;
    color: #b8a0c8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.list-card-side {
    flex-shrink: 0;
    text-align: right;
    min-width: 75px;
}

.list-card-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: #8b6e9e;
    white-space: nowrap;
}

.list-card-stats {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 3px;
    font-size: 0.72rem;
    color: #c8b0da;
}

.list-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.list-card-stats .like-hearts {
    margin-right: -2px;
}

/* ========================================
   响应式 - 移动端单侧时间轴
   ======================================== */
@media (max-width: 768px) {
    .featured-grid {
        padding-left: 32px;
    }

    .featured-grid::before {
        left: 11px;
        transform: none;
    }

    .tl-node {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
        text-align: left;
    }

    .tl-node:nth-child(odd),
    .tl-node:nth-child(even) {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        text-align: left;
    }

    .tl-node:nth-child(odd) .tl-dot-wrap,
    .tl-node:nth-child(even) .tl-dot-wrap {
        left: -32px;
        right: auto;
        width: 22px;
    }

    .tl-node:nth-child(odd) .tl-date-label {
        justify-content: flex-start;
    }

    .tl-node:nth-child(odd) .tl-card,
    .tl-node:nth-child(even) .tl-card {
        margin-left: 0;
        margin-right: 0;
    }

    .tl-dot {
        width: 10px;
        height: 10px;
        border-width: 2.5px;
    }

    .tl-endpoint {
        width: 100%;
        flex-direction: row;
        padding-left: 0;
        padding-right: 0;
    }

    .tl-endpoint-end,
    .tl-endpoint-start {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        flex-direction: row;
    }

    .tl-endpoint-dot {
        position: absolute;
        width: 10px;
        height: 10px;
        border-width: 2.5px;
        margin-left: 0;
        flex-shrink: 0;
    }

    .tl-endpoint-start .tl-endpoint-dot,
    .tl-endpoint-end .tl-endpoint-dot {
        left: -21px;
        right: auto;
        transform: translateX(-50%);
    }

    .tl-endpoint-label,
    .tl-endpoint-start .tl-endpoint-label,
    .tl-endpoint-end .tl-endpoint-label {
        margin-left: 0;
        margin-right: 0;
        font-size: 0.7rem;
    }

    .tl-card {
        flex-direction: column;
    }

    .tl-card-img {
        width: 100%;
        height: 140px;
        min-height: auto;
    }

    .tl-card-content {
        padding: 12px 14px 14px;
    }

    /* 列表卡片移动端 */
    .list-card-side {
        min-width: auto;
    }

    .list-card-desc {
        display: none;
    }
}

@media (max-width: 380px) {
    .featured-grid {
        padding-left: 26px;
    }

    .featured-grid::before {
        left: 8px;
    }

    .tl-node:nth-child(odd) .tl-dot-wrap,
    .tl-node:nth-child(even) .tl-dot-wrap {
        left: -26px;
        width: 16px;
    }

    .tl-dot {
        width: 8px;
        height: 8px;
        border-width: 2px;
    }

    .tl-endpoint-dot {
        width: 8px;
        height: 8px;
        border-width: 2px;
    }

    .tl-endpoint-start .tl-endpoint-dot,
    .tl-endpoint-end .tl-endpoint-dot {
        left: -18px;
    }

    .tl-endpoint-label,
    .tl-endpoint-start .tl-endpoint-label,
    .tl-endpoint-end .tl-endpoint-label {
        margin-left: 0;
        font-size: 0.66rem;
    }

    .tl-card-title {
        font-size: 0.9rem;
    }
}

/* ===== 视图切换按钮 ===== */
.toggle-btn.active {
    background: linear-gradient(135deg, #ff8ec7, #b794f6) !important;
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.3) !important;
    color: white !important;
}

.toggle-btn {
    background: transparent;
    box-shadow: none;
    color: #b8a0c8;
}

/* ===== 骨架屏加载占位 ===== */
.skeleton-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    margin-bottom: 10px;
    pointer-events: none;
}
.skeleton-thumb {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    flex-shrink: 0;
}
.skeleton-line {
    height: 14px;
    border-radius: 7px;
    margin-bottom: 8px;
}
.shimmer {
    background: linear-gradient(90deg, #f0e0f6 25%, #fdf5ff 50%, #f0e0f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}