html, body {
    overflow-x: hidden; /* 強制隱藏水平滾動條 */
    width: 100%;
    margin: 0;
    padding: 0;
}

.timeline-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    font-family: "Microsoft JhengHei", sans-serif;
}

/* 「關於南聯」超連結樣式 */
.parent-category {
    color: #999;
    font-size: 24px;
    text-decoration: none;
    /* 移除預設下劃線 */
    transition: color 0.3s;
    display: inline-block;
}

.parent-category:hover {
    color: #666;
    /* 滑鼠懸停時顏色加深 */
    text-decoration: underline;
}

/* 紅色 > 符號 */
.separator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-top: 2px solid #ff3b3b;
    border-right: 2px solid #ff3b3b;
    margin: 0 15px;
}

/* 「南聯大事記要」深色且粗體 */
.current-page {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 900;
    /* 使用最粗的字體重量 */
    padding-bottom: 2px;
    /* border-bottom: 1px solid #1a1a1a; 底部細線同步加深 */
    text-decoration: none;
    /* 移除預設下劃線 */
    line-height: 1.2;
}

/* 外層容器：負責讓整個區塊置中 */
.timeline-wrapper {
    display: flex;
    justify-content: center;
    /* 水平置中 */
    align-items: center;
    /* 垂直置中 (若有給定高度) */
    min-height: 100vh;
    /* 讓容器至少跟螢幕一樣高 */
    padding: 40px 20px;
}

/* 時間軸主體 */
.nanlien-timeline {
    position: relative;
    width: 100%;
    max-width: 1000px;
    /* 限制最大寬度，避免在寬螢幕太散 */
    padding: 30px;
    background: #fff;
}

/* 標題樣式 */
.timeline-header {
    color: #add8e6;
    font-weight: bold;
    margin-bottom: 30px;
    font-size: 1.1rem;
    padding: 40px 20px;
}

.timeline-header span {
    color: #333;
    margin-left: 5px;
}

/* 延續之前的垂直線與圓點設定... */
.timeline-item {
    display: flex;
    position: relative;
    padding-bottom: 80px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 95px;
    top: 14px;
    /* 從第一個點中心點開始 */

    /* 修正關鍵：讓線條高度直接等於容器的 100% 加上間距 */
    height: 100%;

    width: 1px;
    background-color: #d1d1d1;
    z-index: 0;
}

/* --- 3. 最後一項因為下方沒有 padding 延伸的迫切需求，直接把線藏掉 --- */
.timeline-item:last-of-type::before {
    height: 0 !important;
}

.timeline-item.extend-line::before {
    /* 這裡的 105px 可以根據灰點的實際位置手動調整灰線長度 */
    height: calc(100% - 105px) !important; 
}

.timeline-item::after {
    content: "";
    position: absolute;
    left: 91.5px;
    /* 圓點居中於線條 */
    top: 10px;
    width: 8px;
    height: 8px;
    background-color: #E60012;
    border-radius: 50%;
    z-index: 1;
}

.year {
    width: 80px;
    color: #E60012;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
    font-size: 24px;
    text-align: right;
    flex-shrink: 0;
}
.content {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    padding-left: 40px;
    flex: 1;
}

/* 統一管理所有 P 標籤 */
.content p {
    position: static;
    margin: 0;           /* 先重設所有邊距為 0 */
    line-height: 1.4;    /* 稍微縮緊文字行高，預設通常是 1.6 */
    padding: 0;
}

/* 針對「非第一句」的段落設定間距與小圓點 */
.content p:not(:first-child) {
    position: relative;
    margin-top: 3px;     /* 【關鍵】調整這個數值即可縮短或拉大段落間距 */
}

/* 小圓點的樣式 */
.content p:not(:first-child)::before {
    content: "";
    position: absolute;
    left: -28.5px;
    top: 0.6em;          /* 隨 line-height 微調，確保對齊文字中心 */
    width: 8px;
    height: 8px;
    background-color: #d1d1d1;
    border-radius: 50%;
    z-index: 2;
}

/* 移除 Bootstrap 預設樣式並自訂圓圈 */
.custom-pagination .page-item {
    margin: 0 8px;
    /* 圓圈之間的間距 */
}

.custom-pagination .page-link {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    /* 1. 強制設定相等寬高 */
    width: 36px !important;
    height: 36px !important;
    
    /* 2. 確保是圓形 */
    border-radius: 50% !important;
    
    /* 3. 移除所有內距，防止內容撐開寬度 */
    padding: 0 !important;
    
    /* 4. 使用 Flexbox 讓數字在圓心 */
    display: flex !important;
    align-items: center;
    justify-content: center;
    
    /* 5. 確保沒有設定 min-width */
    min-width: 36px;
    
    /* 其他樣式 */
    border: 3px solid #b5b5b5;
    background-color: transparent;
    transition: all 0.2s;
}

/* 非選中狀態 (數字 2)：灰色圓圈 */
.custom-pagination .page-item .page-link {
    color: #b5b5b5;
    /* 灰色數字 */
    border: 3px solid #b5b5b5;
    /* 灰色外圈 */
    background-color: transparent !important;
}

/* 選中狀態 (數字 1)：紅色圓圈 */
.custom-pagination .page-item.active .page-link {
    color: #ff3b3b;
    /* 紅色數字 */
    background-color: transparent;
    /* 背景透明 */
    border: 3px solid #ff3b3b;
    /* 紅色外圈 */
}

/* 滑鼠懸停效果 */
.custom-pagination .page-link:hover {
    color: #ff3b3b;
    border-color: #ff3b3b;
    background-color: rgba(255, 59, 59, 0.05);
    /* 淡淡的紅色背景 */
}

/* 移除點擊時的藍色陰影 (Bootstrap 預設) */
.custom-pagination .page-link:focus {
    box-shadow: none;
}
/* 底部酒類警語 */
.alcohol-warning-bar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 9999;
    /* 移除 background-color 和 padding，讓圖片完全貼齊邊緣 */
    padding: 0;
    margin: 0;
}

/* 圖片本身設定 */
.alcohol-warning-img {
    display: block;
    width: 100%; /* 強制圖片寬度與螢幕同寬 */
    height: auto; /* 高度自動等比例縮放，避免圖片變形 */
}

@media (max-width: 576px) {
    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .alcohol-warning-bar {
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    }

    .alcohol-warning-img {
        width: 100%;
        height: auto;
    }
}

@media (min-width: 1200px) {
    body {
        /* 因為現在圖片會無限制跟著螢幕放大，大螢幕時圖片高度會變高 */
        /* 建議底部空間稍微加大，避免蓋住頁碼 */
        padding-bottom: 120px;
    }

    .alcohol-warning-img {
        width: 100%; /* ✅ 強制 100% 滿版，不限制寬度 */
        height: auto;
    }
}