:root {
    --tl-primary: #3b82f6;
    --tl-primary-soft: #eff6ff;
    --tl-line: #cbd5e1;
    --tl-text: #1f2937;
    --tl-muted: #6b7280;
}

* {
    box-sizing: border-box;
}

body#timeline-page {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--tl-text);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    min-height: 100vh;
}

.tl-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 16px 80px;
}

.tl-header {
    text-align: center;
    margin-bottom: 36px;
}

.tl-header h1 {
    font-size: 28px;
    margin: 0 0 8px;
    color: var(--tl-primary);
    letter-spacing: 1px;
}

/* 标题下方渐变装饰线 */
.tl-header h1::after {
    content: "";
    display: block;
    width: 52px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--tl-primary), transparent);
}

.tl-desc {
    margin: 0;
    color: var(--tl-muted);
    font-size: 14px;
}

.tl-page.is-horizontal {
    max-width: 100%;
    padding: 32px 0 80px;
}

.tl-page.is-horizontal .tl-header {
    padding: 0 16px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== 垂直布局（默认）===== */
.tl-axis {
    position: relative;
    padding-left: 28px;
}

.tl-line {
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: linear-gradient(180deg, var(--tl-primary) 0%, var(--tl-line) 100%);
    border-radius: 3px;
}

.tl-node {
    position: relative;
    margin-bottom: 22px;
    cursor: pointer;
    animation: tl-fade-in .4s ease both;
}

.tl-node-dot {
    position: absolute;
    left: -28px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--tl-primary);
    box-shadow: 0 0 0 4px var(--tl-primary-soft);
    transition: transform .2s ease;
}

.tl-node:hover .tl-node-dot {
    transform: scale(1.25);
}

.tl-node-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    transition: box-shadow .2s ease, transform .2s ease;
}

.tl-node:hover .tl-node-card {
    box-shadow: 0 6px 18px rgba(59, 130, 246, .15);
    transform: translateY(-2px);
}

/* ===== 水平布局：全宽、居中、节点为截图样式卡片（标题/描述/图 + 下方圆点）===== */
.tl-horizontal {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: max(420px, calc(100vh - 200px));
    display: flex;
    align-items: center;
    cursor: grab;
    padding-bottom: 8px;
    padding-left: 25px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tl-horizontal:active {
    cursor: grabbing;
}

.tl-horizontal::-webkit-scrollbar {
    display: none;
}

.tl-axis-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 0;
    /* 宽度跟随内容（横向滚动时轴线可覆盖全部内容），至少占满视口 */
    width: max-content;
    min-width: 100%;
    position: relative;
}

.tl-axis-h .tl-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 334px;
    width: auto;
    height: 3px;
    background: linear-gradient(90deg, var(--tl-line) 0%, var(--tl-primary) 55%, #1e3a8a 100%);
    /* 只左侧 28px 渐隐；右侧实色保留完整深蓝渐变到 future 边界 */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 100%);
}

.tl-axis-h .tl-node {
    margin-bottom: 0;
    margin-right: 0;
    flex: 0 0 auto;
    width: 258px;
    max-width: none;
    padding: 0 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    user-select: none;
}

/* 卡片：纵向布局，顶部居中标题 → 描述 → 底部图片；图片高 1.6 倍、卡片宽 0.7 倍；整体上移 10px */
.tl-axis-h .tl-node-card {
    order: -1;
    width: 100%;
    max-width: 238px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
    padding: 14px;
    margin-top: -11px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-height: 322px;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.tl-axis-h .tl-node-card:hover {
    box-shadow: 0 8px 26px rgba(59, 130, 246, .18);
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, .35);
}

.tl-axis-h .tl-node-body {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tl-axis-h .tl-node-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tl-text);
    margin: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

.tl-axis-h .tl-node-title.is-link {
    cursor: pointer;
    color: var(--tl-primary);
}

.tl-axis-h .tl-node-title.is-link:hover {
    text-decoration: underline;
}

.tl-axis-h .tl-node-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--tl-muted);
    margin: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 图片置于卡片最底部：单张时全宽，多张时前两张并列 */
.tl-axis-h .tl-node-thumb {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    height: 147px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #f3f4f6;
    background: #f8fafc;
    cursor: pointer;
    transition: transform .2s ease;
}

.tl-axis-h .tl-node-thumb:hover {
    transform: scale(1.05);
}

/* 双图并列容器：前两张图片各占 50% */
.tl-axis-h .tl-node-thumb-pair {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    display: flex;
    gap: 6px;
}

.tl-axis-h .tl-node-thumb-pair .tl-node-thumb {
    width: 50%;
    height: 147px;
    margin-top: 0;
}

.tl-axis-h .tl-node-dot {
    position: absolute;
    left: 50%;
    top: 330px;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.tl-axis-h .tl-node:hover .tl-node-dot {
    transform: translate(-50%, -50%) scale(1.25);
}

.tl-axis-h .tl-node-meta {
    margin-top: 43px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    z-index: 2;
}

.tl-axis-h .tl-node-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
    font-size: 13px;
}

.tl-axis-h .tl-node-badge {
    font-size: 12px;
}

/* ===== 水平布局：未来箭头（精致圆形 + 光晕，右侧标注胶囊）===== */
.tl-future {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px 0 20px;
    height: 100%;
    position: relative;
    z-index: 3;
}

.tl-future-arrow {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1e3a8a 130%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 22px rgba(37, 99, 235, .45),
        0 2px 6px rgba(15, 23, 42, .25),
        inset 0 1px 0 rgba(255, 255, 255, .4);
    animation: tl-future-breathe 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tl-future-arrow:hover {
    transform: scale(1.08);
    box-shadow:
        0 8px 28px rgba(37, 99, 235, .55),
        0 2px 8px rgba(15, 23, 42, .3),
        inset 0 1px 0 rgba(255, 255, 255, .45);
}

/* 外圈脉冲光晕 */
.tl-future-arrow::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, .4);
    animation: tl-future-ring 3s ease-out infinite;
}

@keyframes tl-future-ring {
    0% { transform: scale(.85); opacity: .9; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.tl-future-arrow svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .35));
}

.tl-future-marker {
    margin-left: 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    white-space: nowrap;
    background: linear-gradient(135deg, rgba(59, 130, 246, .92), rgba(30, 58, 138, .95));
    padding: 7px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, .28);
    border: 1px solid rgba(255, 255, 255, .22);
    pointer-events: auto;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tl-future-marker:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, .38);
}

@keyframes tl-future-breathe {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .86; transform: scale(.96); }
}

/* ===== 通用节点样式 ===== */
.tl-node-date {
    font-size: 12px;
    color: var(--tl-primary);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tl-node-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    padding: 1px 8px;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(59, 130, 246, .35);
}

.tl-node-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tl-node-title.is-link {
    cursor: pointer;
    color: var(--tl-primary);
    transition: color .2s ease;
}

.tl-node-title.is-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.tl-node-thumb {
    margin-top: 8px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform .2s ease;
}

.tl-node-thumb:hover {
    transform: scale(1.1);
}

.tl-empty {
    text-align: center;
    color: var(--tl-muted);
    padding: 40px 0;
}

@keyframes tl-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 弹窗气泡 ===== */
.tl-bubble-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 9998;
}

.tl-bubble-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.tl-bubble {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.96);
    width: min(420px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 22px 22px 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.tl-bubble.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.tl-bubble-close {
    position: absolute;
    right: 12px;
    top: 10px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--tl-muted);
    cursor: pointer;
}

.tl-bubble-title {
    margin: 0 24px 4px 0;
    font-size: 19px;
}

.tl-bubble-title.is-link {
    cursor: pointer;
    color: var(--tl-primary);
}

.tl-bubble-title.is-link:hover {
    text-decoration: underline;
}

.tl-bubble-date {
    font-size: 13px;
    color: var(--tl-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.tl-bubble-content {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    margin: 0 0 14px;
}

/* ===== 层叠照片 ===== */
.tl-photos {
    position: relative;
    width: 100%;
    height: 230px;
    margin-bottom: 8px;
    user-select: none;
}

.tl-photo {
    position: absolute;
    top: 0;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-left: -100px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
    cursor: pointer;
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease;
    background: #f1f5f9;
}

.tl-photo.is-front {
    cursor: pointer;
}

.tl-photo-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    z-index: 999;
    pointer-events: none;
}

.tl-bubble-hint {
    font-size: 12px;
    color: var(--tl-muted);
    text-align: center;
    margin-top: 4px;
}

.tl-bubble-hint a {
    color: var(--tl-primary);
}

/* ===== 水平布局浮层气泡（固定宽度，位于节点上方并用短线连接）===== */
.tl-popover {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    max-width: 92vw;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

.tl-popover.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.tl-popover-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--tl-muted);
    cursor: pointer;
}

.tl-popover-title {
    margin: 0 22px 4px 0;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tl-popover-title.is-link {
    cursor: pointer;
    color: var(--tl-primary);
}

.tl-popover-title.is-link:hover {
    text-decoration: underline;
}

.tl-popover-date {
    font-size: 11px;
    color: var(--tl-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

/* 气泡主体：左文右图，与节点卡片一致 */
.tl-popover-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tl-popover-text {
    flex: 1 1 auto;
    min-width: 0;
}

.tl-popover-content {
    font-size: 13px;
    line-height: 1.65;
    color: #4b5563;
    white-space: pre-wrap;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.tl-popover-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #f3f4f6;
    background: #f8fafc;
    cursor: pointer;
    transition: transform .2s ease;
}

.tl-popover-thumb:hover {
    transform: scale(1.05);
}

/* 多图网格 */
.tl-popover-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.tl-popover-gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #f3f4f6;
    transition: transform .2s ease;
}

.tl-popover-gallery img:hover {
    transform: scale(1.04);
}

.tl-popover-hint {
    font-size: 11px;
    color: var(--tl-muted);
    text-align: center;
    margin-top: 8px;
}

.tl-popover-line {
    position: fixed;
    left: 0;
    top: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--tl-primary), rgba(59, 130, 246, .25));
    border-radius: 1px;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.tl-popover-line.show {
    opacity: 1;
}

/* ===== 图片灯箱 ===== */
.tl-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    cursor: pointer;
}

.tl-lightbox.show {
    opacity: 1;
    pointer-events: auto;
}

.tl-lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
    object-fit: contain;
}

.tl-lightbox-close {
    position: absolute;
    right: 20px;
    top: 16px;
    border: none;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

.tl-lightbox-close:hover {
    background: rgba(255, 255, 255, .3);
}

/* ===== 新增时间点：右下角向右箭头浮动按钮 ===== */
.tl-add-fab {
    position: fixed;
    right: 24px;
    bottom: 28px;
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1e3a8a 130%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(37, 99, 235, .45),
        0 2px 6px rgba(15, 23, 42, .25),
        inset 0 1px 0 rgba(255, 255, 255, .4);
    z-index: 9990;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: tl-add-pulse 3s ease-in-out infinite;
}

.tl-add-fab:hover {
    transform: scale(1.08);
    box-shadow:
        0 10px 30px rgba(37, 99, 235, .55),
        0 2px 8px rgba(15, 23, 42, .3),
        inset 0 1px 0 rgba(255, 255, 255, .45);
}

.tl-add-fab svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .35));
}

@keyframes tl-add-pulse {
    0%, 100% {
        box-shadow:
            0 8px 24px rgba(37, 99, 235, .45),
            0 2px 6px rgba(15, 23, 42, .25),
            inset 0 1px 0 rgba(255, 255, 255, .4);
    }
    50% {
        box-shadow:
            0 8px 30px rgba(37, 99, 235, .72),
            0 2px 6px rgba(15, 23, 42, .25),
            inset 0 1px 0 rgba(255, 255, 255, .4);
    }
}

/* ===== 新增时间点弹窗 ===== */
.tl-add-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tl-add-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.tl-add-modal {
    width: min(440px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px 22px 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
    transform: translateY(8px) scale(.98);
    transition: transform .2s ease;
    position: relative;
}

.tl-add-mask.show .tl-add-modal {
    transform: translateY(0) scale(1);
}

.tl-add-close {
    position: absolute;
    right: 12px;
    top: 10px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--tl-muted);
    cursor: pointer;
}

.tl-add-title {
    margin: 0 24px 16px 0;
    font-size: 19px;
    color: var(--tl-text);
}

.tl-add-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tl-add-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.tl-req {
    color: #ef4444;
}

.tl-add-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--tl-text);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.tl-add-input:focus {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 3px var(--tl-primary-soft);
}

textarea.tl-add-input {
    resize: vertical;
    line-height: 1.5;
}

.tl-add-error {
    color: #ef4444;
    font-size: 13px;
    min-height: 18px;
}

.tl-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 2px;
}

.tl-add-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
}

.tl-add-cancel {
    background: #f1f5f9;
    color: #475569;
}

.tl-add-cancel:hover {
    background: #e2e8f0;
}

.tl-add-submit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.tl-add-submit:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.tl-add-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ===== 新增时间点：照片操作按钮（从附件库选择 / 本地上传）===== */
.tl-add-photos-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.tl-add-mini-btn {
    border: 1px solid #d1d5db;
    background: #f8fafc;
    color: #334155;
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.tl-add-mini-btn:hover {
    background: #eef2ff;
    border-color: #93c5fd;
}

.tl-add-mini-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ===== 附件选择器弹窗 ===== */
.tl-attach-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tl-attach-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.tl-attach-modal {
    width: min(680px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
    position: relative;
}

.tl-attach-close {
    position: absolute;
    right: 12px;
    top: 10px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--tl-muted);
    cursor: pointer;
}

.tl-attach-title {
    margin: 0 24px 14px 0;
    font-size: 18px;
    color: var(--tl-text);
}

.tl-attach-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.tl-attach-search {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.tl-attach-search:focus {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 3px var(--tl-primary-soft);
}

.tl-attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 4px;
    min-height: 160px;
    max-height: 46vh;
}

.tl-attach-item {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color .15s ease, transform .15s ease;
    display: flex;
    flex-direction: column;
}

.tl-attach-item:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
}

.tl-attach-item.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.tl-attach-thumb {
    width: 100%;
    height: 84px;
    object-fit: cover;
    display: block;
    background: #eef2f7;
}

.tl-attach-ph {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 12px;
}

.tl-attach-name {
    padding: 6px 8px;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-attach-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--tl-muted);
    padding: 30px 0;
    font-size: 14px;
}

.tl-attach-err {
    color: #ef4444;
}

.tl-attach-empty {
    text-align: center;
    color: var(--tl-muted);
    padding: 30px 0;
    font-size: 14px;
}

.tl-attach-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 12px 0 6px;
}

.tl-attach-page {
    font-size: 13px;
    color: #475569;
}

.tl-attach-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.tl-attach-hint {
    font-size: 13px;
    color: #64748b;
}

.tl-attach-actions > div {
    display: flex;
    gap: 10px;
}

/* ===== 新增时间点：已选照片缩略图（多行展示，每张可移除）===== */
.tl-add-photos-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}

.tl-add-photos-preview[hidden] {
    display: none;
}

.tl-add-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f1f5f9;
}

.tl-add-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tl-add-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tl-add-photo-remove:hover {
    background: rgba(239, 68, 68, .85);
}
