/**
 * Zibll 游戏时间线 - 单线时间轴样式
 * 纯净版：只有时间轴，无筛选器/标题/底部信息
 */

/* ========== 容器 ========== */
.ztl-wrap {
    --ztl-color: var(--theme-color, #1890ff);
    --ztl-bg: var(--main-bg-color, #fff);
    --ztl-border: var(--main-border-color, #e8e8e8);
    --ztl-text: var(--main-color, #333);
    --ztl-text-muted: var(--muted-color, #999);
    --ztl-radius: var(--main-radius, 6px);
    --ztl-line-color: #c0c4cc;
    position: relative;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

.ztl-wrap * {
    box-sizing: border-box;
}

/* ========== 时间轴容器 ========== */
.ztl-container {
    position: relative;
    overflow: hidden;
    padding: 0 40px;
}

/* ========== 导航按钮 ========== */
.ztl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ztl-bg);
    border: 1px solid var(--ztl-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--ztl-text-muted);
    transition: all 0.2s;
    opacity: 0.7;
}

.ztl-nav:hover {
    background: var(--ztl-color);
    color: #fff;
    border-color: var(--ztl-color);
    opacity: 1;
}

.ztl-nav-prev {
    left: 2px;
}

.ztl-nav-next {
    right: 2px;
}

/* ========== 可滚动区域 ========== */
.ztl-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: var(--ztl-border) transparent;
}

.ztl-scroll.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.ztl-scroll::-webkit-scrollbar {
    height: 4px;
}

.ztl-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ztl-scroll::-webkit-scrollbar-thumb {
    background: var(--ztl-border);
    border-radius: 2px;
}

/* ========== 轨道 - width:max-content 让线贯穿所有事件 ========== */
.ztl-track {
    position: relative;
    min-width: 100%;
    width: max-content;
}

/* ========== 那根线 - 绝对连续 ========== */
.ztl-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ztl-line-color);
    transform: translateY(-50%);
    z-index: 0;
}

/* ========== 事件容器 ========== */
.ztl-events {
    display: flex;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

/* ========== 空状态 ========== */
.ztl-empty {
    text-align: center;
    padding: 40px 80px;
    color: var(--ztl-text-muted);
    width: 100%;
}

.ztl-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ========== 单个事件 - 高度由内联style控制 ========== */
.ztl-event {
    position: relative;
    min-width: 200px;
    flex-shrink: 0;
    height: 180px;
}

/* 圆点 - 绝对定位在事件垂直中心，永远在线上 */
.ztl-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ev-color, var(--ztl-color));
    border: 3px solid var(--ztl-bg);
    box-shadow: 0 0 0 2px var(--ev-color, var(--ztl-color));
    z-index: 3;
}

/* 今天的圆点 - 脉冲动画 */
.ztl-dot-today {
    width: 16px;
    height: 16px;
    animation: ztl-pulse 2s infinite;
}

@keyframes ztl-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px var(--ev-color, #ff4d4f), 0 0 0 6px rgba(255, 77, 79, 0.25);
    }
    50% {
        box-shadow: 0 0 0 2px var(--ev-color, #ff4d4f), 0 0 0 12px rgba(255, 77, 79, 0);
    }
}

/* ========== 上方卡片 ========== */
.ztl-event.ztl-upper .ztl-card {
    position: absolute;
    bottom: calc(50% + 18px);
    left: 50%;
    transform: translateX(-50%);
}

/* 上方连接线 */
.ztl-event.ztl-upper .ztl-card::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    width: 2px;
    height: 18px;
    background: var(--ztl-line-color);
    transform: translateX(-50%);
}

/* 上方日期 */
.ztl-event.ztl-upper .ztl-date {
    position: absolute;
    top: calc(50% + 18px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* ========== 下方卡片 ========== */
.ztl-event.ztl-lower .ztl-date {
    position: absolute;
    bottom: calc(50% + 18px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* 下方连接线 */
.ztl-event.ztl-lower .ztl-card::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 50%;
    width: 2px;
    height: 18px;
    background: var(--ztl-line-color);
    transform: translateX(-50%);
}

.ztl-event.ztl-lower .ztl-card {
    position: absolute;
    top: calc(50% + 18px);
    left: 50%;
    transform: translateX(-50%);
}

/* ========== 日期 ========== */
.ztl-date {
    font-size: 13px;
    color: var(--ztl-text-muted);
    font-weight: 500;
}

.ztl-date-today {
    color: var(--ev-color, #ff4d4f);
    font-weight: 700;
}

.ztl-today-tag {
    display: inline-block;
    padding: 1px 8px;
    font-size: 10px;
    background: var(--ev-color, #ff4d4f);
    color: #fff;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ========== 事件卡片 ========== */
.ztl-card {
    position: relative;
    width: 170px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--ztl-bg);
    border: 1px solid var(--ztl-border);
    border-left: 3px solid var(--ev-color, var(--ztl-color));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s, transform 0.25s;
    cursor: pointer;
}

.ztl-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateX(-50%) translateY(-2px);
}

.ztl-event.ztl-lower .ztl-card:hover {
    transform: translateX(-50%) translateY(2px);
}

/* 展开提示 */
.ztl-expand-hint {
    display: block;
    font-size: 11px;
    color: var(--ztl-text-muted);
    margin-top: 2px;
    text-align: center;
}

.ztl-card:not(.ztl-collapsed) .ztl-expand-hint::before {
    content: '收起 ';
}

.ztl-card:not(.ztl-collapsed) .ztl-expand-hint {
    margin-top: 6px;
}

/* 卡片内容区（折叠时隐藏） */
.ztl-card-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.ztl-card.ztl-collapsed .ztl-card-body {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.ztl-card:not(.ztl-collapsed) .ztl-card-body {
    max-height: 300px;
    opacity: 1;
    margin-top: 4px;
}

.ztl-game {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.ztl-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ztl-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.ztl-desc {
    font-size: 12px;
    color: var(--ztl-text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ztl-time {
    font-size: 11px;
    color: var(--ztl-text-muted);
    margin-bottom: 8px;
}

.ztl-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.ztl-link:hover {
    text-decoration: underline;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .ztl-event {
        min-width: 170px;
    }

    .ztl-card {
        width: 150px;
        padding: 8px 12px;
    }

    .ztl-title {
        font-size: 13px;
    }

    .ztl-desc {
        font-size: 11px;
        -webkit-line-clamp: 1;
    }

    .ztl-nav {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .ztl-container {
        padding: 0 30px;
    }
}

@media (max-width: 480px) {
    .ztl-event {
        min-width: 140px;
    }

    .ztl-card {
        width: 130px;
        padding: 6px 10px;
    }

    .ztl-game {
        font-size: 11px;
    }

    .ztl-title {
        font-size: 12px;
    }

    .ztl-desc {
        display: none;
    }
}
