:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --bg-color: #f5f6fa;
    --timeline-color: #1c689b;
    --event-left-color: #e74c3c;
    --event-right-color: #27ae60;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7ec 100%);
    min-height: 100vh;
    padding-bottom: 3rem;
}

header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

.period-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.8rem 2rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
}

.nav-btn:hover {
    background: var(--secondary-color);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.period-section {
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.period-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--secondary-color), #3498db80);
}

.period-title {
    cursor: pointer;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
    position: relative;
}

.period-title h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-title h2::before {
    content: "▶";
    color: var(--secondary-color);
    transition: transform 0.3s;
}

.period-title.active h2::before {
    transform: rotate(90deg);
}

.period-intro {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding: 0 1rem;
    line-height: 1.8;
    color: #666;
    border-left: 3px solid var(--secondary-color);
    margin-top: 1rem;
    margin-left: 1.5rem;
}

.period-intro.show {
    max-height: 500px;
    padding: 1rem;
}

.timeline {
    position: relative;
    padding: 3rem 0;
    min-height: 400px;
}

/* 时间轴线（调整高度避免覆盖圆点） */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 100%; /* 缩短时间轴线高度为90% */
    top: 0%; /* 顶部留出5%空间 */
    background: linear-gradient(180deg, var(--timeline-color) 0%, #1c689b);
    z-index: 1;
    border-radius: 3px;
}

.event {
    position: relative;
    min-height: 100px;
    margin: 4rem 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.event.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 时间轴圆点（强化层级和视觉） */
.timeline-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; /* 稍微增大圆点尺寸 */
    height: 20px;
    background: white;
    border: 4px solid var(--timeline-color); /* 加粗边框 */
    border-radius: 50%;
    z-index: 3; /* 保持高于时间轴线 */
    box-shadow: 0 0 0 3px white; /* 增加白色外阴影 */
    transition: all 0.3s ease;
}

.event:hover .timeline-dot {
    transform: translate(-50%, -50%) scale(1.3); /* 悬停放大更多 */
    background:#54a5db;
}

/* 事件组容器（包含连接器和卡片） */
.event-group {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 短水平线（连接器） */
.timeline-connector {
    height: 2.5px;
    width: 200px;
    background:#54a5db;
    position: relative;
}

/* 时间标签 */
.time-label {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255,255,255,0.95);
    padding: 4px 12px;
    border-radius: 15px;
    box-shadow: 0 2px 6px rgba(20, 55, 119, 0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

/* === 左侧事件（国外）=== */
.event.left .event-group {
    right: 50%;
    margin-right: 20px;
    flex-direction: row-reverse;
}

.event.left .event-content {
    background: linear-gradient(315deg, #fef7f7 0%, #fff 100%);
    border-right: 3px solid var(--event-left-color);
    text-align: right;
}

/* === 右侧事件（国内）=== */
.event.right .event-group {
    left: 50%;
    margin-left: 20px;
    flex-direction: row;
}

.event.right .event-content {
    background: linear-gradient(135deg, #f7fcf8 0%, #fff 100%);
    border-left: 3px solid var(--event-right-color);
    text-align: left;
}

/* 事件卡片 */
.event-content {
    min-width: 320px;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.event-content h3 {
    margin: 0 0 0.8rem;
    font-size: 1.25rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.event.right .event-content h3 {
    justify-content: flex-start;
}

.event-content p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.event-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.15);
}

.event-tag {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.8rem;
}

.event.left .event-tag {
    background: rgba(231, 76, 60, 0.15);
    color: var(--event-left-color);
}

.event.right .event-tag {
    background: rgba(39, 174, 96, 0.15);
    color: var(--event-right-color);
}

/* 详情页样式 */
.detail-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.detail-item {
    margin: 1.5rem 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.detail-item strong {
    color: var(--primary-color);
}

.detail-container h1 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #f0f0f0;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 25px;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--secondary-color);
    color: white;
}

.deepseek-link {
    display: block;
    text-align: center;
    color: var(--secondary-color);
    font-weight: 500;
    text-decoration: none;
    margin-top: 2rem;
    padding: 1rem;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    transition: all 0.3s;
}

.deepseek-link:hover {
    background: var(--secondary-color);
    color: white;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 0.9rem;
    margin-top: 3rem;
}

/* 响应式调整 - 桌面端 */
@media (max-width: 900px) {
    .event-content {
        min-width: 280px;
        padding: 1.5rem;
    }
    .timeline-connector {
        width: 120px;
    }
}

/* 响应式调整 - 平板和手机 */
@media (max-width: 768px) {
    header {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .period-nav {
        gap: 0.8rem;
        padding: 0 1rem;
    }
    
    .nav-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .period-section {
        margin: 2.5rem 0;
        padding: 1.5rem;
    }
    
    .timeline::before {
        left: 30px;
        height: 95%; /* 调整时间轴线高度适配移动端 */
        top: 2.5%; /* 顶部留出2.5%空间 */
    }

    .timeline-dot {
        left: 30px;
    }

    .event-group {
        left: 60px !important;
        right: auto !important;
        flex-direction: row !important;
        width: calc(100% - 80px);
        gap: 30px; /* 调整移动端事件组间距 */
    }

    .event.left .event-content {
        text-align: left;
    }

    .event.left .event-content h3 {
        justify-content: flex-start;
    }

    .time-label {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-connector {
        width: 100px; /* 平板端缩短短水平线长度 */
    }
}

/* 响应式调整 - 小屏幕手机 */
@media (max-width: 480px) {
    .period-title h2 {
        font-size: 1.5rem;
    }
    
    .event {
        margin: 3rem 0; /* 减少事件上下间距 */
    }

    .event-group {
        gap: 25px; /* 小屏幕进一步缩小间距 */
    }

    .timeline-connector {
        width: 80px; /* 小屏幕缩短短水平线 */
    }

    .event-content {
        min-width: auto; /* 取消最小宽度限制 */
        padding: 1.2rem; /* 减少卡片内边距 */
    }
}
