/* ============================================================
   更新日志页 changelog.css
   结构：页头统计 + 时间线（日期 / 节点 / 版本卡片）
   说明：仅 page_tpl=changelog 加载；通用类依赖 base.css
   ============================================================ */

/* ---------- 页头统计 ---------- */
.changelog-stat {
    margin-top: 18px;
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, .78);
    letter-spacing: .3px;
}
.changelog-stat strong {
    font-family: var(--font-display);
    font-size: 22px;
    color: #fff;
    margin: 0 4px;
    font-weight: 700;
}

/* ---------- 时间线主体 ---------- */
.changelog-section {
    padding: var(--sp-12) 0 var(--sp-20);
    background: var(--bg);
}

.changelog-timeline {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
}

.cl-item {
    display: grid;
    grid-template-columns: 132px 32px minmax(0, 1fr);
    /* 拉伸：使中间节点列与右侧卡片同高，时间线竖线得以贯穿卡片 */
    align-items: stretch;
    margin-bottom: 28px;
}
.cl-item:last-child {
    margin-bottom: 0;
}

/* 左侧日期 */
.cl-aside {
    padding-top: 18px;
    text-align: right;
}
.cl-date {
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--brand-700);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 中间节点与连接线（位于卡片外的 32px 沟槽中；高度随 grid 拉伸至与卡片同高） */
.cl-dot {
    position: relative;
    display: block;
    width: 32px;
    /* 不设 height：由 .cl-item 的 align-items:stretch 拉伸到卡片同高 */
}
.cl-dot::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    width: 13px;
    height: 13px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--brand-500);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--brand-200);
    z-index: 1;
}
.cl-dot::after {
    content: "";
    position: absolute;
    /* 自圆点中心起，贯穿整张卡片，并向下跨越条目间距连接到下一个圆点中心 */
    top: 19px;
    bottom: -47px;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: var(--line-strong);
}
/* 最后一条：竖线止于卡片底部，不再向下延伸 */
.cl-item:last-child .cl-dot::after {
    bottom: 0;
}

/* 右侧版本卡片 */
.cl-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px 28px 18px;
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.cl-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-200);
    transform: translateY(-2px);
}

.cl-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px dashed var(--line);
}
.cl-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.4;
}
a.cl-title:hover {
    color: var(--brand-600);
}
.cl-cat {
    margin-left: auto;
    flex: none;
    font-size: var(--fs-xs);
    color: var(--ink-500);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 3px 10px;
    border-radius: var(--r-pill);
}

/* ---------- 正文排版（与详情页正文同构） ---------- */
.cl-body {
    /* 固定最大高度：内容超出时区域内滚动，各版本卡片高度保持统一 */
    max-height: 300px;
    overflow-y: auto;
    padding-right: 12px;
    color: var(--ink-700);
    font-size: var(--fs-base);
    line-height: 1.85;
    word-break: break-word;
    /* Firefox 细滚动条 */
    scrollbar-width: thin;
    scrollbar-color: var(--brand-300) transparent;
}
/* WebKit 细滚动条（参考 MetInfo 更新日志样式） */
.cl-body::-webkit-scrollbar {
    width: 6px;
}
.cl-body::-webkit-scrollbar-track {
    background: transparent;
}
.cl-body::-webkit-scrollbar-thumb {
    background: var(--brand-300);
    border-radius: 3px;
}
.cl-body::-webkit-scrollbar-thumb:hover {
    background: var(--brand-500);
}
.cl-body > :first-child {
    margin-top: 0;
}
.cl-body > :last-child {
    margin-bottom: 0;
}
.cl-body p {
    margin: 5px 0;
}
.cl-body h3 {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--ink-900);
    margin: 20px 0 8px;
    padding-left: 10px;
    border-left: 3px solid var(--brand-500);
    line-height: 1.5;
}
.cl-body h4 {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--ink-800);
    margin: 16px 0 6px;
}
.cl-body ul,
.cl-body ol {
    margin: 10px 0;
    padding-left: 22px;
}
.cl-body li {
    margin: 6px 0;
}
.cl-body ul li::marker {
    color: var(--brand-500);
}
.cl-body ol li::marker {
    color: var(--brand-600);
    font-weight: 600;
}
.cl-body a {
    color: var(--brand-600);
    border-bottom: 1px solid var(--brand-200);
}
.cl-body a:hover {
    color: var(--brand-700);
    border-bottom-color: var(--brand-500);
}
.cl-body strong {
    color: var(--ink-900);
    font-weight: 600;
}
.cl-body code {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--brand-700);
}
.cl-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--r-sm);
    margin: 10px 0;
}
.cl-body blockquote {
    margin: 12px 0;
    padding: 8px 16px;
    border-left: 3px solid var(--brand-200);
    background: var(--brand-50);
    color: var(--ink-600);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ---------- 卡片底部 ---------- */
.cl-foot {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: var(--fs-xs);
    color: var(--ink-400);
}
.cl-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.cl-foot .icon {
    width: 15px;
    height: 15px;
}
.cl-more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--brand-600);
    font-weight: 500;
}
.cl-more .icon {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
}
.cl-more:hover .icon {
    transform: translateX(3px);
}
.cl-date-foot {
    display: none;
    font-variant-numeric: tabular-nums;
}

/* ---------- 空状态（inner.css 未加载时自包含） ---------- */
.list-empty {
    text-align: center;
    padding: 72px 24px;
}
.list-empty .e-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand-500);
}
.list-empty h3 {
    font-size: var(--fs-lg);
    color: var(--ink-800);
    margin-bottom: 8px;
}
.list-empty p {
    color: var(--ink-500);
    font-size: var(--fs-sm);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .changelog-section {
        padding: var(--sp-8) 0 var(--sp-12);
    }
    .cl-item {
        grid-template-columns: 24px minmax(0, 1fr);
        column-gap: 12px;
        margin-bottom: 22px;
    }
    /* 左侧日期列并入卡片底部 */
    .cl-aside {
        display: none;
    }
    .cl-dot {
        width: 24px;
    }
    .cl-dot::before {
        top: 14px;
        width: 11px;
        height: 11px;
    }
    .cl-dot::after {
        top: 20px;
        bottom: -42px;
    }
    .cl-item:last-child .cl-dot::after {
        bottom: 0;
    }
    .cl-card {
        padding: 18px 18px 14px;
        border-radius: var(--r-md);
    }
    .cl-head {
        align-items: flex-start;
    }
    .cl-title {
        font-size: var(--fs-lg);
        flex-basis: 100%;
    }
    .cl-cat {
        margin-left: 0;
    }
    .cl-body {
        font-size: 14.5px;
        line-height: 1.8;
        padding-right: 10px;
    }
    .cl-date-foot {
        display: inline-flex;
        align-items: center;
    }
}
