/* ===================================================
   Timeline Page Styles
   =================================================== */

/* ===== 页面整体布局 ===== */
.tl-page {
    display: flex;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    min-height: calc(100vh - 120px);
}

/* ===== 左侧锚点导航 ===== */
.tl-nav {
    width: 88px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: none;
}
.tl-nav::-webkit-scrollbar { width: 0; }

.tl-nav-year-group { margin-bottom: 10px; }

.tl-nav-year-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #111);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 0;
    border-radius: 4px;
    transition: color 0.15s;
    letter-spacing: -0.3px;
}
.tl-nav-year-btn:hover,
.tl-nav-year-btn.active { color: var(--primary, #6366f1); }

.tl-nav-months { padding-left: 6px; }

.tl-nav-month-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary, #888);
    background: none;
    border: none;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.tl-nav-month-btn:hover { color: var(--primary, #6366f1); background: rgba(99,102,241,0.07); }
.tl-nav-month-btn.active { color: var(--primary, #6366f1); font-weight: 600; }
.tl-nav-month-btn.empty { color: var(--text-tertiary, #ccc); cursor: default; }
.tl-nav-month-btn.empty:hover { background: none; color: var(--text-tertiary, #ccc); }

.tl-nav-empty {
    font-size: 12px;
    color: var(--text-tertiary, #bbb);
    padding: 4px 0;
}

/* ===== 主时间轴区域 ===== */
.tl-main {
    flex: 1;
    min-width: 0;
    padding-left: 28px;
    position: relative;
}

/* 中轴线 */
.tl-main::before {
    content: '';
    position: absolute;
    left: 52px;
    top: 8px;
    bottom: 0;
    width: 1px;
    background: var(--border-medium, #e5e7eb);
}

/* ===== 年份分隔 ===== */
.tl-year-divider {
    display: flex;
    align-items: center;
    margin: 56px 0 20px;
    padding-left: 0;
    position: relative;
    scroll-margin-top: 24px;
}
.tl-year-divider:first-child { margin-top: 0; }

/* 年份区 - 全宽浅色分割线 */
.tl-year-divider::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-light, #ebebeb);
    z-index: 0;
}

.tl-year-label {
    position: relative;
    z-index: 1;
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary, #111);
    letter-spacing: -1px;
    padding-right: 16px;
    background: var(--bg-page, #f9fafb);
}

/* ===== 月份区块 ===== */
.tl-month-block {
    margin-bottom: 6px;
    scroll-margin-top: 24px;
}

.tl-month-header {
    display: flex;
    align-items: center;
    padding-left: 56px;
    margin-top: 4px;
    margin-bottom: 8px;
    position: relative;
}

.tl-month-header::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 2px;
    background: var(--border-medium, #d1d5db);
    border-radius: 2px;
}

.tl-month-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary, #555);
    letter-spacing: 0;
}

/* 单月空 */
.tl-month-empty {
    display: flex;
    align-items: center;
    padding-left: 60px;
    height: 36px;
    position: relative;
    scroll-margin-top: 24px;
}
.tl-month-empty::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 2px;
    background: var(--border-medium, #d1d5db);
    border-radius: 2px;
}
.tl-month-empty-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary, #aaa);
}

/* 连续空月合并 */
.tl-month-empty-range {
    display: flex;
    align-items: center;
    padding-left: 60px;
    height: 36px;
    position: relative;
}
.tl-month-empty-range::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 2px;
    background: var(--border-medium, #d1d5db);
    border-radius: 2px;
}
.tl-month-empty-range-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary, #aaa);
    font-style: italic;
}

/* ===== 事件列表 ===== */
.tl-event-list {
    padding-left: 76px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.tl-event-item {
    position: relative;
}
.tl-event-item::before {
    content: '';
    position: absolute;
    left: -52px;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 1px;
    background: var(--border-medium, #e5e7eb);
}

/* ===== 模型卡片 ===== */
.tl-card-model {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-medium, #e5e7eb);
    border-radius: 10px;
    padding: 13px 14px;
    color: inherit;
    cursor: default;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.tl-card-model:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    border-color: var(--primary-light, #a5b4fc);
}
.tl-card-model.highlight {
    border-color: #f59e0b;
    background: linear-gradient(135deg, var(--warning-bg) 0%, var(--bg-card) 100%);
}
.tl-card-model.highlight:hover {
    border-color: #d97706;
    box-shadow: 0 4px 14px rgba(245,158,11,0.12);
}
.tl-card-model.untracked { opacity: 0.8; }
.tl-card-model.untracked:hover { opacity: 1; }

/* 图标 - 方形 */
.tl-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tl-card-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

/* 字母头像 - 方形 */
.tl-card-icon-letter {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

/* 卡片内容区 */
.tl-card-body { flex: 1; min-width: 0; }

/* 标题+描述可点击区域 */
.tl-card-main-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0;
}
.tl-card-main-link:hover .tl-card-title {
    color: var(--primary, #6366f1);
}

.tl-card-title-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.tl-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111);
    line-height: 1.35;
}

/* 徽标与标题基线对齐微调 */
.tl-card-title-row .tl-badge-unscored,
.tl-card-title-row .tl-badge-no-api {
    position: relative;
    top: -1px;
}

/* 时间 + 公司同行 */
.tl-card-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.tl-card-date {
    font-size: 11px;
    color: var(--text-tertiary, #bbb);
}

.tl-card-provider {
    font-size: 11px;
    color: var(--text-tertiary, #999);
}

.tl-card-meta-row .tl-card-provider::before {
    content: "·";
    margin-right: 4px;
    color: var(--text-tertiary, #ccc);
}

.tl-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 7px;
}
.tl-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.02em;
}

.tl-card-desc {
    font-size: 12px;
    color: var(--text-secondary, #666);
    line-height: 1.55;
    margin-bottom: 8px;
}
.tl-card-desc--event { color: var(--primary, #4f46e5); }

.tl-card-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.tl-card-pricing:empty { display: none; }

/* 论文/事件卡片下方的评分+报价区 */
.tl-event-extra {
    margin-top: 8px;
    padding-left: 0;
}
.tl-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tl-meta-item {
    font-size: 11px;
    color: var(--text-tertiary, #999);
}

/* 分数区块（可点击） */
.tl-score-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-medium);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tl-score-block:hover {
    border-color: var(--success-text);
    background: var(--success-bg);
}
.tl-score-group {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}
.tl-meta-score-overall {
    font-size: 14px;
    font-weight: 700;
    color: var(--success-text);
}
.tl-meta-score-label {
    font-size: 11px;
    color: var(--text-secondary);
}
.tl-score-sep {
    display: inline-block;
    width: 1px;
    height: 10px;
    background: var(--border-medium);
    margin: 0 2px;
    vertical-align: middle;
}
.tl-meta-score-dim {
    font-size: 11px;
    color: var(--text-tertiary);
}
.tl-score-basic { color: var(--success-text); font-weight: 500; }
.tl-score-mid   { color: var(--warning-text); font-weight: 500; }
.tl-score-hard  { color: var(--error-text);   font-weight: 500; }

.tl-meta-link-icon {
    margin-left: auto;
    color: var(--text-tertiary, #ccc);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}
.tl-meta-link-icon:hover {
    color: var(--primary, #6366f1);
    background: var(--bg-subtle);
}
.tl-meta-link-icon svg { width: 13px; height: 13px; }

/* 状态徽标 */
.tl-badge-unscored,
.tl-badge-no-api {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
}
.tl-badge-unscored {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    border: 1px dashed var(--border-strong);
}
.tl-badge-no-api {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    border: 1px dashed var(--border-medium);
}
.tl-badge-unscored svg,
.tl-badge-no-api svg { width: 9px; height: 9px; }

/* ===== 事件卡片 ===== */
.tl-card-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: color-mix(in srgb, #6366f1 6%, var(--bg-card));
    border: 1px solid color-mix(in srgb, #6366f1 30%, var(--border-medium));
    border-radius: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.18s, transform 0.18s;
}
.tl-card-event:hover {
    box-shadow: 0 4px 14px rgba(99,102,241,0.10);
    transform: translateY(-1px);
}
.tl-card-event.highlight {
    background: color-mix(in srgb, #a855f7 8%, var(--bg-card));
    border-color: color-mix(in srgb, #a855f7 40%, var(--border-medium));
}

.tl-event-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, #6366f1 15%, var(--bg-subtle));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.tl-event-icon-wrap svg { width: 16px; height: 16px; color: var(--primary, #6366f1); }

/* ===== 末尾标记 ===== */
.tl-end-marker {
    padding-left: 76px;
    padding-top: 24px;
    padding-bottom: 40px;
    font-size: 12px;
    color: var(--text-tertiary, #bbb);
}

/* ===== 空状态 ===== */
.tl-empty-state {
    padding-left: 76px;
    padding-top: 60px;
    text-align: center;
    color: var(--text-tertiary, #bbb);
    font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .tl-page {
        padding: 24px 16px 60px;
    }
    .tl-nav { display: none; }
    .tl-main { padding-left: 0; }
    .tl-main::before { left: 16px; }
    .tl-year-divider { padding-left: 40px; }
    .tl-year-divider::before { left: 8px; }
    .tl-month-header,
    .tl-month-empty,
    .tl-month-empty-range { padding-left: 40px; }
    .tl-month-header::before { left: 10px; }
    .tl-event-list { padding-left: 40px; }
    .tl-end-marker { padding-left: 40px; }
    /* 时间轴卡片在移动端限制宽度 */
    .tl-card-model,
    .tl-card-news {
        max-width: 100%;
    }
}
