/* 时间线样式 */
.time-control {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.time-buttons {
    margin-bottom: 15px;
}

.preset-years {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.year-btn {
    font-size: 12px;
    padding: 5px 8px;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.year-btn:hover {
    background-color: #d0d0d0;
}

.year-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.year-navigation button {
    padding: 5px 10px;
    background-color: #4a89dc;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.year-navigation button:hover {
    background-color: #3a79cc;
}

#year-display {
    font-size: 16px;
    font-weight: bold;
    padding: 1px 10px;
    /* background-color: #f0f0f0; */
    border-radius: 3px;
}

.timeline {
    position: relative;
    height: 40px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin: 10px 0;
}

.timeline-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background-color: #666;
    transform: translateX(-50%);
    cursor: pointer;
}

.marker-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    color: #333;
    padding: 2px 4px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    display: none;
}

.timeline-marker:hover .marker-text {
    display: block;
}

.timeline-slider {
    position: absolute;
    top: 0; /* 对齐到容器顶部 */
    width: 100%;
    z-index: 10;
    -webkit-appearance: none;
    appearance: none;
    height: 100%; /* 使高度等于容器高度 */
    background: transparent; /* 完全透明，隐藏轨道 */
    outline: none;
    border-radius: 0;
    opacity: 0; /* 完全隐藏，但保留功能 */
}

/* 滑块样式 */
.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 30px; /* 增加高度，使其更容易拖动 */
    border-radius: 4px; /* 改为稍微圆角的矩形 */
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    margin-top: -15px; /* 调整垂直位置 */
}

.timeline-slider::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.timeline-slider::-moz-range-thumb {
    width: 16px;
    height: 30px;
    border-radius: 4px;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.timeline-slider::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* 时间轴刻度 */
.timeline-ticks {
    position: absolute;
    top: 20px; /* 调整位置与滑块对齐 */
    width: 100%;
    height: 3px;
    background-color: rgba(203, 213, 225, 0.7); /* 给刻度线添加背景 */
    z-index: 5;
    pointer-events: none;
}

/* 控制面板样式 */
.control-panel {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.control-panel h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

/* 时间轴样式 */

/* 时间轴容器 */
.timeline-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #e2e8f0;
    padding: 10px 40px 20px; /* 增加底部内边距确保文字显示 */
    margin-bottom: 5px; /* 距离屏幕底部的外边距 */
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 当侧边栏折叠时调整时间轴位置 */
#events-list.collapsed ~ .map-container .timeline-container,
#events-list.collapsed + .map-container .timeline-container,
body:has(#events-list.collapsed) .timeline-container,
body:has(#events-list.-translate-x-full) .timeline-container {
    width: 100% !important;
    margin-left: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* 全屏模式下时间轴样式 */
body:fullscreen .timeline-container,
body:-webkit-full-screen .timeline-container,
body:-ms-fullscreen .timeline-container,
.fullscreen .timeline-container,
[data-fullscreen="true"] .timeline-container {
    width: 100% !important;
    margin-left: 0 !important;
}

/* 桌面端时间轴宽度匹配地图 */
@media (min-width: 1025px) {
    .timeline-container {
        width: calc(100% - 300px);
        margin-left: 300px;
    }
}

/* 移动端和平板端时间轴样式 */
@media (max-width: 1024px) {
    .timeline-container {
        width: 100%;
        padding: 8px 10px 20px;
    }
}

/* 全屏模式样式 */
@media (display-mode: fullscreen) {
    .timeline-container {
        padding-bottom: 25px;
        bottom: env(safe-area-inset-bottom, 5px);
    }
}

/* 深色模式 */
.dark .timeline-container {
    background-color: rgba(15, 23, 42, 0.85);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    border-color: rgba(51, 65, 85, 0.8);
}

/* 完全隐藏滑块按钮，但保留滑块功能 */
.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 1px !important;
    height: 1px !important;
    background: transparent !important;
    border: none !important;
    opacity: 0 !important;
}

.timeline-slider::-moz-range-thumb {
    width: 1px !important;
    height: 1px !important;
    background: transparent !important;
    border: none !important;
    opacity: 0 !important;
}

/* 强化指示器 */
.slider-indicator {
    width: 4px;
    background-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

/* 调整时期标签位置 */
.period-label {
    bottom: -15px !important;
    position: absolute;
    transform: translateX(-50%);
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
}

/* 当前年份显示 */
.current-year-display {
    position: absolute;
    top: -40px; /* 移到时间轴上方 */
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: #3b82f6;
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1010;
}

.dark .current-year-display {
    background-color: #2563eb;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 时间轴滑块容器 */
.timeline-slider-container {
    position: relative;
    height: 35px;
    padding-bottom: 14px; /* 增加底部内边距，确保标签显示 */
}

/* 时期标记容器 */
.timeline-period-markers {
    position: relative;
    width: 100%;
    height: 20px;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* 时间轴刻度容器 */
.timeline-ticks-container {
    position: relative;
    width: 100%;
    height: 30px;
    margin: 0 60px;
}

.timeline-tick {
    position: absolute;
    top: -3px;
    width: 1px;
    height: 8px;
    background-color: rgba(100, 116, 139, 0.4);
    transform: translateX(-50%);
}

.timeline-tick.major {
    height: 12px;
    width: 1px;
    background-color: rgba(71, 85, 105, 0.7);
    top: -5px;
}

.timeline-tick-label {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    color: #64748b;
    font-weight: 600;
}

.dark .timeline-tick {
    background-color: rgba(148, 163, 184, 0.5);
}

.dark .timeline-tick.major {
    background-color: rgba(203, 213, 225, 0.7);
}

.dark .timeline-tick-label {
    color: #94a3b8;
}

/* 刻度标记 */
.timeline-tick {
    position: absolute;
    height: 8px;
    width: 1px;
    background-color: rgba(100, 116, 139, 0.5);
    bottom: 0;
    transform: translateX(-50%);
}

.timeline-tick.major {
    height: 12px;
    width: 2px;
    background-color: rgba(71, 85, 105, 0.7);
}

.timeline-tick.special {
    height: 16px;
    width: 2.5px;
    background-color: rgba(59, 130, 246, 0.8);
}

.dark .timeline-tick {
    background-color: rgba(148, 163, 184, 0.5);
}

.dark .timeline-tick.major {
    background-color: rgba(203, 213, 225, 0.7);
}

.dark .timeline-tick.special {
    background-color: rgba(96, 165, 250, 0.8);
}

/* 刻度标签 */
.tick-label {
    position: absolute;
    bottom: -22px; /* 将标签移至下方 */
    transform: translateX(-50%);
    font-family: 'Noto Serif SC', 'Times New Roman', serif;
    font-size: 11px;
    color: #334155;
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

.tick-label.small {
    font-size: 9px;
    opacity: 0.7;
    bottom: -18px;
}

.tick-label.bc-label {
    color: #64748b;
}

.tick-label.modern-label {
    color: #0f172a;
    font-weight: 600;
}

.dark .tick-label {
    color: #e2e8f0;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.dark .tick-label.bc-label {
    color: #cbd5e1;
}

.dark .tick-label.modern-label {
    color: #f8fafc;
}

/* 滑块指示器 */
.slider-indicator {
    position: absolute;
    height: 16px;
    width: 4px;
    background-color: #3b82f6;
    border-radius: 2px;
    bottom: 8px; /* 向上移动指示器 */
    transform: translateX(-50%);
    z-index: 3;
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

.dark .slider-indicator {
    background-color: #60a5fa;
    box-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
}

/* 时期标记样式在timeline-manager.js中动态添加 */

/* 时间轴控制按钮 */
.timeline-controls {
    display: none !important;
}

/* 播放按钮特殊样式 */
#play-btn {
    width: 48px;
    height: 48px;
    background-color: #3b82f6;
    border: none;
}

#play-btn:hover {
    background-color: #2563eb;
}

#play-btn i {
    color: white;
    font-size: 24px;
}

.dark #play-btn {
    background-color: #3b82f6;
}

.dark #play-btn:hover {
    background-color: #2563eb;
}

.dark #play-btn i {
    color: white;
}

/* 重要历史年份标记 */
.timeline-year-marker {
    position: absolute;
    height: 10px;
    width: 2px;
    background-color: rgba(234, 88, 12, 0.7);
    bottom: 0px;
    transform: translateX(-50%);
    z-index: 1;
    cursor: pointer;
}

.timeline-year-marker::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #fb923c;
    border-radius: 50%;
    top: -3px;
    left: -2px;
}

.timeline-year-marker:hover::after {
    transform: scale(1.5);
    background-color: #f97316;
}

.dark .timeline-year-marker {
    background-color: rgba(251, 146, 60, 0.5);
}

.dark .timeline-year-marker::after {
    background-color: #fb923c;
}

.dark .timeline-year-marker:hover::after {
    background-color: #f97316;
}

/* 时间轴遮罩层 - 用于防止地图事件干扰 */
.timeline-overlay {
    position: absolute;
    bottom: 0;
    left: auto;
    right: 0;
    width: calc(100% - 300px); /* 考虑侧边栏宽度 */
    height: 100px; /* 调整高度以包含上移的年份显示 */
    z-index: 400;
    pointer-events: auto; /* 确保可以捕获事件 */
}

/* 当侧边栏折叠时调整遮罩层 */
#events-list.collapsed ~ .map-container .timeline-overlay,
body:has(#events-list.collapsed) .timeline-overlay {
    width: 100%;
    left: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .timeline-container {
        padding: 10px 15px 5px;
        height: 70px;
    }
    
    .current-year-display {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .timeline-control-btn {
        width: 32px;
        height: 32px;
    }
    
    #play-btn {
        width: 42px;
        height: 42px;
    }
    
    .timeline-control-btn i {
        font-size: 18px;
    }
    
    #play-btn i {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .timeline-container {
        padding: 8px 10px;
        bottom: 15px;
    }
    
    .current-year-display {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .timeline-slider-container {
        height: 30px;
        margin: 8px 0 12px;
    }
    
    .timeline-control-btn {
        width: 28px;
        height: 28px;
    }
    
    #play-btn {
        width: 36px;
        height: 36px;
    }
    
    .timeline-control-btn i {
        font-size: 18px;
    }
}

/* 暗色模式滑块 */
.dark .timeline-slider::-webkit-slider-thumb {
    background: #3b82f6;
    border-color: #1e293b;
}

.dark .timeline-slider::-webkit-slider-thumb:hover {
    background: #60a5fa;
}

.dark .timeline-slider::-moz-range-thumb {
    background: #3b82f6;
    border-color: #1e293b;
}

.dark .timeline-slider::-moz-range-thumb:hover {
    background: #60a5fa;
}

/* 深色模式刻度线 */
.dark .timeline-ticks {
    background-color: rgba(71, 85, 105, 0.7);
}

/* 滑块指示器样式 */
.slider-indicator {
    position: absolute;
    width: 4px;
    height: 100%;
    background-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
    top: 0;
    z-index: 20;
    border-radius: 2px;
    pointer-events: none;
    transform: translateX(-50%);
}

.dark .slider-indicator {
    background-color: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
}

/* 当前年份刻度线 */
.current-year-marker {
    height: 20px !important;
    width: 3px !important;
    background-color: #f43f5e !important; /* 使用明亮的红色 */
    z-index: 10;
    box-shadow: 0 0 5px rgba(244, 63, 94, 0.5);
    animation: pulse-marker 2s infinite;
}

.dark .current-year-marker {
    background-color: #fb7185 !important; /* 暗色模式下更亮的红色 */
    box-shadow: 0 0 8px rgba(251, 113, 133, 0.7);
}

@keyframes pulse-marker {
    0% {
        opacity: 0.7;
        height: 20px;
    }
    50% {
        opacity: 1;
        height: 24px;
    }
    100% {
        opacity: 0.7;
        height: 20px;
    }
} 