/* 时间轴筛选样式 - 心跳涟漪风格 */

/* ===== 动画 ===== */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.18); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
    60% { transform: scale(1); }
}

@keyframes heartRipple {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 139, 0.35);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(255, 107, 139, 0);
    }
}

@keyframes linePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.55; }
}

/* ===== 容器 ===== */
.album-timeline {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    border: 1px solid rgba(255, 107, 139, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    overflow: visible;
}

/* ===== 头部 ===== */
.timeline-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 12px;
}

.timeline-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    font-weight: 600;
    color: #FF6B8B;
    letter-spacing: 1px;
    white-space: nowrap;
    justify-self: start;
}

.timeline-year-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: center;
}

.year-arrow {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 107, 139, 0.25);
    border-radius: 50%;
    background: none;
    color: #FF6B8B;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    line-height: 1;
    padding: 0;
}

.year-arrow:hover:not(.disabled) {
    background: rgba(255, 107, 139, 0.1);
    border-color: rgba(255, 107, 139, 0.5);
    transform: scale(1.08);
}

.year-arrow.disabled {
    color: #ccc;
    border-color: #e0e0e0;
    cursor: default;
}

.timeline-year-text {
    font-family: 'Montserrat', 'Noto Sans SC', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #FF6B8B;
    min-width: 50px;
    text-align: center;
}

/* ===== 轨道容器 ===== */
.timeline-track-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 16px 0 32px;
}

.timeline-track-wrapper::-webkit-scrollbar {
    display: none;
}

/* ===== 轨道 ===== */
.timeline-track {
    display: flex;
    align-items: center;
    position: relative;
    min-width: 100%;
    padding: 0 12px;
    justify-content: center;
}

/* 底线 - 虚线 + 爱心装饰 */
.timeline-line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 0;
    border-top: 2.5px dashed rgba(255, 107, 139, 0.25);
    transform: translateY(-50%);
}

.timeline-line::before,
.timeline-line::after {
    content: '♥';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    color: rgba(255, 107, 139, 0.35);
    animation: linePulse 3s ease-in-out infinite;
}

.timeline-line::before {
    left: 15%;
}

.timeline-line::after {
    right: 15%;
    animation-delay: 1.5s;
}

/* ===== 月份节点 ===== */
.timeline-node {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
    padding: 0 6px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-node:hover {
    transform: translateY(-3px) scale(1.05);
}

/* ===== 圆点 ===== */
.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #FFB7C5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.timeline-node:hover .timeline-dot {
    border-color: #FF6B8B;
    box-shadow: 0 0 8px rgba(255, 107, 139, 0.3);
}

/* ===== 有数据的圆点 ===== */
.timeline-dot.has-count {
    width: 20px;
    height: 20px;
    border-color: #FF6B8B;
    background: linear-gradient(135deg, #FF6B8B, #FF9EB5);
    box-shadow: 0 2px 8px rgba(255, 107, 139, 0.3);
}

.timeline-node:hover .timeline-dot.has-count {
    box-shadow: 0 2px 12px rgba(255, 107, 139, 0.5);
    transform: scale(1.08);
}

/* ===== 心形状态（选中时 JS 添加 .heart 类） ===== */
.timeline-dot.heart {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    box-shadow: none;
    animation: heartRipple 1.5s ease-out infinite;
}

.timeline-dot.heart .timeline-count {
    font-size: 22px;
    color: #FF6B8B;
    animation: heartbeat 1.5s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 107, 139, 0.45);
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

/* ===== 计数数字 ===== */
.timeline-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ===== 月份标签（绝对定位，不影响 dot 对齐） ===== */
.timeline-label {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #999;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    pointer-events: none;
}

.timeline-label-emoji {
    font-size: 10px;
    line-height: 1;
}

.timeline-node:hover .timeline-label {
    color: #FF6B8B;
}

.timeline-node.active .timeline-label {
    color: #FF6B8B;
    font-weight: 600;
}

/* ===== "全部"节点 ===== */
.timeline-node.all-node .timeline-dot {
    border-color: #FF6B8B;
}

.timeline-node.all-node .timeline-dot.has-count {
    width: 22px;
    height: 22px;
}

.timeline-node.all-node .timeline-count {
    font-size: 11px;
}

/* 全部节点选中心形 - 与普通节点一致 */
.timeline-node.all-node .timeline-dot.heart {
    width: 28px;
    height: 28px;
}

.timeline-node.all-node .timeline-dot.heart .timeline-count {
    font-size: 22px;
}

/* ===== 无数据节点 ===== */
.timeline-node.empty {
    cursor: default;
}

.timeline-node.empty .timeline-dot {
    background: #f8f8f8;
    border-color: #e0e0e0;
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.timeline-node.empty .timeline-label {
    color: #ccc;
}

.timeline-node.empty:hover {
    transform: none;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .album-timeline {
        margin: 0 16px 20px;
        width: auto;
        padding: 12px 16px;
        border-radius: 16px;
    }

    .timeline-title { font-size: 13px; }
    .timeline-year-nav { gap: 10px; }
    .timeline-year-text { font-size: 16px; }
    .timeline-node { padding: 0 5px; }

    .timeline-dot.has-count { width: 20px; height: 20px; }
    .timeline-dot.heart { width: 26px; height: 26px; }
    .timeline-dot.heart .timeline-count { font-size: 20px; }

    .timeline-node.all-node .timeline-dot.has-count { width: 22px; height: 22px; }
    .timeline-node.all-node .timeline-dot.heart { width: 26px; height: 26px; }
    .timeline-node.all-node .timeline-dot.heart .timeline-count { font-size: 20px; }

    .timeline-count { font-size: 9px; }
    .timeline-label { font-size: 10px; }
    .timeline-label-emoji { font-size: 9px; }
}

@media (max-width: 480px) {
    .album-timeline {
        margin: 0 12px 16px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .timeline-header { margin-bottom: 10px; }
    .timeline-title { font-size: 12px; }
    .timeline-year-nav { gap: 8px; }
    .year-arrow { width: 24px; height: 24px; font-size: 14px; }
    .timeline-year-text { font-size: 14px; }
    .timeline-node { padding: 0 4px; }

    .timeline-dot.has-count { width: 18px; height: 18px; }
    .timeline-dot.heart { width: 24px; height: 24px; }
    .timeline-dot.heart .timeline-count { font-size: 18px; }

    .timeline-node.all-node .timeline-dot.has-count { width: 20px; height: 20px; }
    .timeline-node.all-node .timeline-dot.heart { width: 24px; height: 24px; }
    .timeline-node.all-node .timeline-dot.heart .timeline-count { font-size: 18px; }

    .timeline-count { font-size: 8px; }
    .timeline-label { font-size: 9px; top: calc(100% + 4px); }
    .timeline-label-emoji { font-size: 8px; }
    .timeline-line::before, .timeline-line::after { font-size: 7px; }
}

@media (max-width: 360px) {
    .album-timeline {
        margin: 0 10px 14px;
        padding: 8px 10px;
    }

    .timeline-title { font-size: 11px; }
    .timeline-node { padding: 0 3px; }

    .timeline-dot.has-count { width: 17px; height: 17px; }
    .timeline-dot.heart { width: 22px; height: 22px; }
    .timeline-dot.heart .timeline-count { font-size: 16px; }

    .timeline-count { font-size: 7px; }
    .timeline-label { font-size: 8px; }
    .timeline-label-emoji { font-size: 7px; }
}
