/**
 * 新聞時間軸進階樣式
 * 路徑: css/timeline-advanced.css
 */

/* ===================================
   CSS 變數
   =================================== */
:root {
--timeline-primary: #d32f2f;
--timeline-secondary: #1976d2;
--timeline-text: #333;
--timeline-light: #666;
--timeline-border: #ddd;
--timeline-bg: #f5f5f5;
--timeline-white: #fff;
--timeline-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
--timeline-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
--timeline-radius: 12px;
--timeline-radius: 12px;
--timeline-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
--timeline-card-bg: #fff;
--timeline-date-bg: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}

/* ===================================
   基礎容器
   =================================== */
.news-timeline-advanced {
width: 100%;
max-width: 1200px;
margin: 20px auto;
padding: 0px;
box-sizing: border-box;
}

.timeline-items-wrapper {
position: relative;
}

/* ===================================
   區塊標題樣式
   =================================== */
.timeline-block-title {
font-size: 24px;
font-weight: 700;
color: var(--timeline-text); /* 跟隨設定的文字顏色 */
margin: 20px 0 12px 0; /* 減少間距 */
padding-bottom: 8px; /* 減少內距 */
position: relative;
line-height: 1.4;
}

/* 裝飾線 (可選，讓標題更有質感) */
.timeline-block-title::after {
content: '';
display: block;
width: 60px;
height: 4px;
background: var(--timeline-primary); /* 跟隨設定的主色調 */
margin-top: 8px; /* 減少間距 */
border-radius: 2px;
}

/* 針對清單模式的微調 */
.timeline-mode-list .timeline-block-title {
padding-left: 10px; /* 對齊清單內容 */
margin-bottom: 8px; /* 減少間距以保持一致 */
}

/* 如果是置中佈局 (例如某些 Magazine 模式)，標題也可以置中 */
/* .timeline-layout-magazine .timeline-block-title {
text-align: center;
}
.timeline-layout-magazine .timeline-block-title::after {
margin: 10px auto 0 auto;
} */

/* ===================================
   通用時間軸項目
   =================================== */
.timeline-item {
position: relative;
margin-bottom: 40px;
opacity: 0;
transform: translateY(20px);
overflow: visible !important;
}

.timeline-item.timeline-item-hidden {
display: none;
}

/* Animation visibility - JS adds .animated class when item is in viewport */
.timeline-item.animated {
opacity: 1;
transform: translateY(0);
transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 修改 .timeline-content：啟用 Flexbox 以支援排序 */
.timeline-content {
background: var(--timeline-card-bg);
border-radius: var(--timeline-radius);
box-shadow: var(--timeline-shadow);
transition: var(--timeline-transition);
overflow: hidden;

/* [新增] 關鍵修改：使用 Flex column 讓內部元素可以排序 */
display: flex;
flex-direction: column;
}


.timeline-item:hover .timeline-content {
box-shadow: var(--timeline-shadow-hover);
transform: translateY(-2px);
}

/* 預設：日期在內容 (Body) 之上 */
.timeline-date {
order: 1; /* 預設順序 */
padding: 15px 20px;
background: var(--timeline-date-bg);
border-bottom: 1px solid var(--timeline-border); /* 預設有底線 */
border-top: none;
font-size: 14px;
font-weight: 600;
color: var(--timeline-primary);
}


.timeline-body {
order: 2; /* 預設順序 */
padding: 25px;
}

/* 針對 Step 模式的修正 (避免被上面的 order 影響導致跑版) */
.timeline-mode-step .timeline-date {
order: unset !important; /* Step 模式通常自己控制位置 */
border-bottom: 1px solid var(--timeline-border) !important;
border-top: none !important;
}


/* [新增] 當日期位置設定為 Bottom 時的樣式覆寫 */
.news-timeline-advanced.timeline-date-pos-bottom .timeline-date {
order: 3; /* 改為比 body (2) 更大的數字，排在下面 */

/* 邊框樣式反轉：移除底線，改為頂線 */
border-bottom: none; 
border-top: 1px solid var(--timeline-border);

/* 背景色調整 (可選，視視覺需求保留或移除) */
background: rgba(0,0,0,0.02); 
}

.timeline-title {
margin: 0 0 12px 0;
font-size: 20px;
line-height: 1.4;
}

.timeline-title a {
color: var(--timeline-text);
text-decoration: none;
transition: color 0.3s;
}

.timeline-title a:hover {
color: var(--timeline-primary);
}

.timeline-excerpt {
font-size: 14px;
color: #666;
line-height: 1.6;
margin-bottom: 15px;
}

.timeline-excerpt.line-clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
}

.recommended-badge {
position: absolute;
top: 10px;
right: 10px;
background: #ff4757;
color: #fff;
font-size: 12px;
padding: 4px 8px;
border-radius: 4px;
z-index: 10;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.timeline-read-more {
display: inline-block;
align-items: center;
color: var(--timeline-secondary);
text-decoration: none;
font-weight: 500;
font-size: 14px;
margin-top: 15px;
transition: var(--timeline-transition);
}

.timeline-read-more:hover {
color: #0d47a1;
transform: translateX(3px);
}

/* ===================================
   整個卡片可點擊樣式
   =================================== */
.timeline-item-clickable {
cursor: pointer;
}

.timeline-card-link {
display: block;
text-decoration: none;
color: inherit;
width: 100%;
}

/* 當整個卡片可點擊時，移除內部連結的樣式 */
.timeline-item-clickable .timeline-title {
color: inherit;
}

.timeline-item-clickable .timeline-title a {
color: inherit;
text-decoration: none;
pointer-events: none;
}

/* 整個卡片的 hover 效果 */
.timeline-item-clickable:hover .timeline-content {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.timeline-item-clickable:hover .timeline-title {
color: var(--timeline-primary);
}

/* ===================================
   布局 1: 標準時間軸（圖片右側）
   =================================== */
.timeline-layout-default .timeline-items-wrapper {
padding-left: 60px;
}

.timeline-layout-default .timeline-items-wrapper::before {
content: '';
position: absolute;
left: 20px;
top: 0;
bottom: 0;
width: 2px;
background: linear-gradient(to bottom, 
transparent 0%, 
var(--timeline-border) 5%, 
var(--timeline-border) 95%, 
transparent 100%);
}

.timeline-layout-default .timeline-dot {
position: absolute;
left: -48px;
top: 20px;
width: 16px;
height: 16px;
background: var(--timeline-primary);
border: 4px solid var(--timeline-white);
border-radius: 50%;
box-shadow: 0 0 0 4px var(--timeline-border);
z-index: 2;
transition: var(--timeline-transition);
}

.timeline-layout-default .timeline-item:hover .timeline-dot {
transform: scale(1.3);
box-shadow: 0 0 0 6px rgba(211, 47, 47, 0.2);
}

.timeline-layout-default .timeline-body {
display: grid;
grid-template-columns: 1fr 300px;
gap: 25px;
align-items: start;
}

.timeline-layout-default .timeline-image {
order: 2;
}

.timeline-layout-default .timeline-text {
order: 1;
}

/* ===================================
   布局 2: 左圖右文
   =================================== */
.timeline-layout-left-image .timeline-items-wrapper {
padding-left: 60px;
}

.timeline-layout-left-image .timeline-items-wrapper::before {
content: '';
position: absolute;
left: 20px;
top: 0;
bottom: 0;
width: 2px;
background: linear-gradient(to bottom, 
transparent 0%, 
var(--timeline-border) 5%, 
var(--timeline-border) 95%, 
transparent 100%);
}

.timeline-layout-left-image .timeline-dot {
position: absolute;
left: -48px;
top: 20px;
width: 16px;
height: 16px;
background: var(--timeline-primary);
border: 4px solid var(--timeline-white);
border-radius: 50%;
box-shadow: 0 0 0 4px var(--timeline-border);
z-index: 2;
transition: var(--timeline-transition);
}

.timeline-layout-left-image .timeline-body {
display: grid;
grid-template-columns: 300px 1fr;
gap: 25px;
align-items: start;
}

.timeline-layout-left-image .timeline-image {
order: 1;
}

.timeline-layout-left-image .timeline-text {
order: 2;
}

/* ===================================
   布局 3: 上圖下文
   =================================== */
.timeline-layout-top-image .timeline-items-wrapper {
padding-left: 60px;
}

.timeline-layout-top-image .timeline-items-wrapper::before {
content: '';
position: absolute;
left: 20px;
top: 0;
bottom: 0;
width: 2px;
background: linear-gradient(to bottom, 
transparent 0%, 
var(--timeline-border) 5%, 
var(--timeline-border) 95%, 
transparent 100%);
}

.timeline-layout-top-image .timeline-dot {
position: absolute;
left: -48px;
top: 20px;
width: 16px;
height: 16px;
background: var(--timeline-primary);
border: 4px solid var(--timeline-white);
border-radius: 50%;
box-shadow: 0 0 0 4px var(--timeline-border);
z-index: 2;
}

.timeline-layout-top-image .timeline-image {
margin: -25px -25px 20px -25px;
border-radius: var(--timeline-radius) var(--timeline-radius) 0 0;
}

/* ===================================
   布局 4: 下圖上文
   =================================== */
.timeline-layout-bottom-image .timeline-items-wrapper {
padding-left: 60px;
}

.timeline-layout-bottom-image .timeline-items-wrapper::before {
content: '';
position: absolute;
left: 20px;
top: 0;
bottom: 0;
width: 2px;
background: linear-gradient(to bottom, 
transparent 0%, 
var(--timeline-border) 5%, 
var(--timeline-border) 95%, 
transparent 100%);
}

.timeline-layout-bottom-image .timeline-dot {
position: absolute;
left: -48px;
top: 20px;
width: 16px;
height: 16px;
background: var(--timeline-primary);
border: 4px solid var(--timeline-white);
border-radius: 50%;
box-shadow: 0 0 0 4px var(--timeline-border);
z-index: 2;
}

.timeline-layout-bottom-image .timeline-image {
margin: 20px -25px -25px -25px;
border-radius: 0 0 var(--timeline-radius) var(--timeline-radius);
order: 2; /* Move image to bottom */
}

.timeline-layout-bottom-image .timeline-body {
display: flex;
flex-direction: column;
}

.timeline-layout-bottom-image .timeline-text {
order: 1; /* Move text to top */
}

/* ===================================
   布局 5: 卡片網格
   =================================== */
.timeline-layout-card-grid .timeline-items-wrapper {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 25px;
}

.timeline-layout-card-grid .timeline-item {
margin-bottom: 0;
}

.timeline-layout-card-grid .timeline-image {
margin: -25px -25px 15px -25px;
border-radius: var(--timeline-radius) var(--timeline-radius) 0 0;
}

/* ===================================
   布局 6: 雜誌式
   =================================== */
.timeline-layout-magazine .timeline-items-wrapper {
padding-left: 60px;
}

.timeline-layout-magazine .timeline-items-wrapper::before {
content: '';
position: absolute;
left: 20px;
top: 0;
bottom: 0;
width: 2px;
background: linear-gradient(to bottom, 
transparent 0%, 
var(--timeline-border) 5%, 
var(--timeline-border) 95%, 
transparent 100%);
}

.timeline-layout-magazine .timeline-dot {
position: absolute;
left: -48px;
top: 20px;
width: 16px;
height: 16px;
background: var(--timeline-primary);
border: 4px solid var(--timeline-white);
border-radius: 50%;
box-shadow: 0 0 0 4px var(--timeline-border);
z-index: 2;
}

/* Dot Shapes */
.timeline-dot-shape-square .timeline-dot {
border-radius: 0;
}

.timeline-dot-shape-diamond .timeline-dot {
border-radius: 0;
transform: rotate(45deg);
}

/* ===================================
   [修改] Highlight 高亮模式修復
   =================================== */
/* 預設狀態：所有項目不透明 */
.timeline-item {
opacity: 1!important;
transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 當容器開啟高亮模式時，先將「所有」項目變暗 */
.news-timeline-advanced.timeline-highlight-first .timeline-item,
.news-timeline-advanced.timeline-highlight-manual .timeline-item {
opacity: 0.3!important; /* 降低透明度使效果更明顯 */
transform: scale(0.98);
}

/* 再將「被選中」的項目恢復不透明並放大 */
.news-timeline-advanced.timeline-highlight-first .timeline-item.highlight,
.news-timeline-advanced.timeline-highlight-manual .timeline-item.highlight,
.news-timeline-advanced.timeline-highlight-first .timeline-item:hover,
.news-timeline-advanced.timeline-highlight-manual .timeline-item:hover {
opacity: 1 !important;
transform: scale(1) !important;
z-index: 5;
box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* 增加陰影突顯 */
}

/* 讓高亮項目的卡片陰影更明顯 */
.timeline-item.highlight .timeline-content {
box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
border-left: 5px solid var(--timeline-primary); /* 左側加強邊框 */
}

/* ===================================
   [修改] Step 模式修正
   =================================== */
/* 重置 Step 模式的氣泡，強制跟時間軸日期氣泡一模一樣 */
.timeline-mode-step .timeline-date {
background: var(--timeline-date-bg) !important;
width: auto !important; /* 跟隨內容寬度 */
min-width: unset !important;
height: auto !important;
padding: 15px 20px !important; /* 跟原本時間軸一樣的 padding */
border-radius: 0 !important;   /* 移除圓形強制設定，跟隨原本設計 */
border-bottom: 1px solid var(--timeline-border);
position: static !important;
display: block !important;
text-align: left !important;
font-weight: 600;
color: var(--timeline-primary);
aspect-ratio: auto !important; /* 移除強制正方形 */
}

/* 隱藏 Step 模式下原本可能出現的舊標籤樣式 */
.timeline-mode-step .step-label {
display: none; 
}

/* [新] 獨立的步驟標題樣式 */
.timeline-step-heading {
font-size: 14px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--timeline-secondary, #1976d2); /* 使用次要顏色 */
margin-bottom: 5px;
display: inline-block;
padding: 2px 8px;
/*background: rgba(0,0,0,0.05);*/
border-radius: 4px;
}


/* Recommended Badge - Refined */
.recommended-badge {
display: block !important;
position: absolute;
top: -10px;
right: -10px;
background: #ff4757;
color: #fff;
font-size: 12px;
font-weight: bold;
padding: 5px 10px;
border-radius: 4px;
z-index: 20;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
transform: rotate(5deg);
}

.timeline-layout-magazine .timeline-item:first-child {
margin-bottom: 60px;
}

.timeline-layout-magazine .timeline-item:first-child .timeline-content {
padding: 0;
}

.timeline-layout-magazine .timeline-item:first-child .timeline-image {
margin: 0;
height: 400px;
border-radius: var(--timeline-radius) var(--timeline-radius) 0 0;
}

.timeline-layout-magazine .timeline-item:first-child .timeline-image img {
width: 100%;
height: 100%;
object-fit: cover;
}

.timeline-layout-magazine .timeline-item:first-child .timeline-body {
padding: 30px;
}

.timeline-layout-magazine .timeline-item:first-child .timeline-title {
font-size: 28px;
}

/* ===================================
   第一則大圖樣式
   =================================== */
.timeline-item-large .timeline-content {
background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.timeline-item-large .timeline-image {
height: 350px;
margin: -25px -25px 20px -25px;
border-radius: var(--timeline-radius) var(--timeline-radius) 0 0;
overflow: hidden;
}

.timeline-item-large .timeline-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s;
}

.timeline-item-large:hover .timeline-image img {
transform: scale(1.05);
}

.timeline-item-large .timeline-title {
font-size: 26px;
margin-bottom: 15px;
}

.timeline-item-large .timeline-excerpt {
font-size: 16px;
}

/* ===================================
   圖片樣式
   =================================== */
.timeline-image {
overflow: hidden;
border-radius: 8px;
}

.timeline-image a {
display: block;
position: relative;
overflow: hidden;
}

.timeline-image img {
width: 100%;
height: auto;
display: block;
transition: transform 0.5s ease;
}

.timeline-item:hover .timeline-image img {
transform: scale(1.05);
}

/* ===================================
   展開按鈕
   =================================== */
.timeline-expand-section {
text-align: center;
padding: 30px 0;
}

.timeline-expand-btn {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 10px 30px;
background: var(--timeline-white);
border: 2px solid var(--timeline-border);
border-radius: 30px;
font-size: 16px;
font-weight: 600;
color: var(--timeline-text);
cursor: pointer;
transition: var(--timeline-transition);
box-shadow: var(--timeline-shadow);
}

/*.timeline-expand-btn:hover {
background: var(--timeline-primary);
color: var(--timeline-white);
border-color: var(--timeline-primary);
transform: translateY(-2px);
box-shadow: var(--timeline-shadow-hover);
}*/

.timeline-expand-btn .expand-icon {
transition: transform 0.3s;
}

.timeline-expand-btn.expanded .expand-icon {
transform: rotate(180deg);
}

.timeline-expand-count {
background: var(--timeline-bg);
padding: 2px 8px;
border-radius: 12px;
font-size: 13px;
}

/* ===================================
   動畫效果
   =================================== */
/* 淡入 */
.timeline-animation-fade .timeline-item {
animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

/* 滑入 */
.timeline-animation-slide .timeline-item {
animation: slideIn 0.6s ease forwards;
}

@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-30px);
}
to {
opacity: 1;
transform: translateX(0);
}
}

/* 縮放 */
.timeline-animation-zoom .timeline-item {
animation: zoomIn 0.6s ease forwards;
}

@keyframes zoomIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}

/* 無動畫 */
.timeline-animation-none .timeline-item {
opacity: 1;
transform: none;
}

/* 漸進延遲 */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }
.timeline-item:nth-child(9) { animation-delay: 0.9s; }
.timeline-item:nth-child(10) { animation-delay: 1s; }

/* ===================================
   響應式設計 - 平板
   =================================== */
@media (max-width: 992px) {
.timeline-layout-default .timeline-body,
.timeline-layout-left-image .timeline-body {
grid-template-columns: 1fr;
}

.timeline-layout-default .timeline-image,
.timeline-layout-left-image .timeline-image {
order: 1;
max-width: 100%;
}

.timeline-layout-default .timeline-text,
.timeline-layout-left-image .timeline-text {
order: 2;
}

.timeline-layout-card-grid .timeline-items-wrapper {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
}

/* ===================================
   響應式設計 - 手機
   =================================== */
@media (max-width: 768px) {
.news-timeline-advanced {
margin: 20px auto;
padding: 0 15px;
}

.timeline-layout-default .timeline-items-wrapper,
.timeline-layout-left-image .timeline-items-wrapper,
.timeline-layout-top-image .timeline-items-wrapper,
.timeline-layout-bottom-image .timeline-items-wrapper,
.timeline-layout-magazine .timeline-items-wrapper {
padding-left: 40px;
}

.timeline-layout-default .timeline-items-wrapper::before,
.timeline-layout-left-image .timeline-items-wrapper::before,
.timeline-layout-top-image .timeline-items-wrapper::before,
.timeline-layout-bottom-image .timeline-items-wrapper::before,
.timeline-layout-magazine .timeline-items-wrapper::before {
left: 10px;
}

.timeline-dot {
left: -35px !important;
width: 12px !important;
height: 12px !important;
border-width: 3px !important;
}

.timeline-body {
padding: 20px !important;
}

.timeline-title {
font-size: 18px !important;
}

.timeline-item-large .timeline-title {
font-size: 22px !important;
}

.timeline-excerpt {
font-size: 14px;
}

.timeline-layout-card-grid .timeline-items-wrapper {
grid-template-columns: 1fr;
}

.timeline-layout-magazine .timeline-item:first-child .timeline-image {
height: 250px;
}

.timeline-expand-btn {
padding: 12px 30px;
font-size: 14px;
}
}

/* ===================================
   列印樣式
   =================================== */
@media print {
.timeline-expand-section {
display: none;
}

.timeline-item-hidden {
display: block !important;
}

.timeline-content {
box-shadow: none;
border: 1px solid var(--timeline-border);
page-break-inside: avoid;
}
}

/* ===================================
   Step Mode Styles
   =================================== */
.timeline-mode-step .timeline-date {
background: transparent;
padding: 0;
width: auto;
height: auto;
border-radius: 0;
text-align: left;
margin-bottom: 10px;
position: relative;
left: auto;
top: auto;
transform: none;
}

.timeline-mode-step .step-label {
display: inline-block;
padding: 5px 12px;
background-color: var(--timeline-primary);
color: #fff;
border-radius: 20px;
font-weight: bold;
font-size: 14px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/*.timeline-mode-step .timeline-content {
padding-top: 15px;
}*/

/* Adjust dot position for step mode if needed */
.timeline-mode-step .timeline-dot {
top: 25px;
}

/* Responsive adjustments for Step Mode */
@media (max-width: 768px) {
.timeline-mode-step .timeline-date {
margin-bottom: 10px;
text-align: left;
}
}

/* ===================================
   個別項目布局覆寫 (Per-item Layouts)
   =================================== */

/* 左圖右文 */
.timeline-item.item-layout-left-image .timeline-body {
display: grid;
grid-template-columns: 300px 1fr;
gap: 25px;
align-items: start;
}
.timeline-item.item-layout-left-image .timeline-image {
order: 1;
margin: 0;
border-radius: 8px;
}
.timeline-item.item-layout-left-image .timeline-text {
order: 2;
}

/* 右圖左文 */
.timeline-item.item-layout-right-image .timeline-body {
display: grid;
grid-template-columns: 1fr 300px;
gap: 25px;
align-items: start;
}
.timeline-item.item-layout-right-image .timeline-image {
order: 2;
margin: 0;
border-radius: 8px;
}
.timeline-item.item-layout-right-image .timeline-text {
order: 1;
}

/* 上圖下文 */
.timeline-item.item-layout-top-image .timeline-body {
display: block;
}
.timeline-item.item-layout-top-image .timeline-image {
margin: -25px -25px 20px -25px;
border-radius: var(--timeline-radius) var(--timeline-radius) 0 0;
order: unset;
}
.timeline-item.item-layout-top-image .timeline-image img {
border-radius: var(--timeline-radius) var(--timeline-radius) 0 0;
}

/* 純文字 (無圖) */
.timeline-item.item-layout-text-only .timeline-image {
display: none !important;
}
.timeline-item.item-layout-text-only .timeline-body {
display: block;
}

/* 響應式調整 */
@media (max-width: 992px) {
.timeline-item.item-layout-left-image .timeline-body,
.timeline-item.item-layout-right-image .timeline-body {
grid-template-columns: 1fr;
}
.timeline-item.item-layout-left-image .timeline-image,
.timeline-item.item-layout-right-image .timeline-image {
order: 1;
margin-bottom: 20px;
}
.timeline-item.item-layout-left-image .timeline-text,
.timeline-item.item-layout-right-image .timeline-text {
order: 2;
}
}

/* ==========================================================================
   List Mode (清單模式) - 完美置中 + 連線修復版
   ========================================================================== */

/* 0. 主容器 - 確保不裁切 */
.news-timeline-advanced.timeline-mode-list {
overflow: visible !important;
}

/* 1. 容器設定 */
.news-timeline-advanced.timeline-mode-list .timeline-items-wrapper {
max-height: var(--timeline-list-height, 400px) !important;
overflow-y: auto !important;
overflow-x: clip !important; /* clip allows pseudo-elements in padding area but prevents scrollbar */ 
/* 左側留白 60px */
padding: 40px 40px 40px 60px !important; 
position: relative !important;
background: #fff;
border: 1px solid #eee;
}

/* 隱藏容器長線 */
.news-timeline-advanced.timeline-mode-list .timeline-items-wrapper::before {
display: none !important;
}

/* 2. 項目卡片 */
.news-timeline-advanced.timeline-mode-list .timeline-item {
display: block !important;
margin: 0 !important; /* 移除外距，改用 padding 撐開，方便畫線 */
padding: 0px 0 20px 0 !important; /* 底部間距 */
background: transparent !important;
width: 100% !important;
position: relative !important;
border-bottom: 1px solid #f0f0f0 !important;
opacity: 1 !important;
transform: none !important;
overflow: visible !important; /* 確保 ::before 和 .timeline-dot 不被裁切 */
}
.news-timeline-advanced.timeline-mode-list .timeline-item:last-child {
border-bottom: none !important;
padding-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   3. 精準置中線條 (Line)
   -------------------------------------------------------------------------- */
.news-timeline-advanced.timeline-mode-list .timeline-item::before {
content: '' !important;
display: block !important;
position: absolute !important;

/* [數學置中] Padding 60px -> 中心 30px -> 線寬 2px -> Left 29px */
left: -31px !important; 

/* 線條從最頂端畫到最底端 (貫穿整個 Item) */
top: 0 !important;
height: 100% !important; 

width: 2px !important;
background: #e0e0e0 !important;
z-index: 1 !important;
}

/* 第一個項目：線條從圓點開始往下畫 (避免凸出頂部) */
.news-timeline-advanced.timeline-mode-list .timeline-item:first-child::before {
top: 20px !important; /* 對齊圓點中心 */
height: calc(100% - 20px) !important;
}

/* 最後一個項目：線條從頂部畫到圓點為止 (避免凸出底部) */
.news-timeline-advanced.timeline-mode-list .timeline-item:last-child::before {
top: 0 !important;
height: 20px !important; /* 只畫到圓點中心 */
}

/* --------------------------------------------------------------------------
   4. 精準置中圓點 (Dot)
   -------------------------------------------------------------------------- */
.news-timeline-advanced.timeline-mode-list .timeline-dot {
display: block !important;
opacity: 1 !important;
position: absolute !important;

/* [數學置中] Padding 60px -> 中心 30px -> 點寬 12px (半徑6) -> Left 24px */
/* 相對定位 (-60 + 24 = -36) */
left: -36px !important; 

top: 15px !important; /* 固定垂直高度 */

width: 10px !important; /* 內圓大小 */
height: 10px !important;

background: var(--timeline-primary, #d32f2f) !important;
border: 2px solid #fff !important; /* 白邊 */
border-radius: 50% !important;

/* 陰影環 (視覺大小約 14px) */
box-shadow: 0 0 0 1px #ccc !important;

transform: none !important;
z-index: 5 !important;
}

/* 第一則高亮圓點 */
.news-timeline-advanced.timeline-mode-list .timeline-item[data-index="1"] .timeline-dot {
background: #1976d2 !important;
/* 藍色光暈 */
box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2) !important; 
transform: scale(1.2) !important; /* 微微放大 */
}

/* 第一則藍色背景 */
.news-timeline-advanced.timeline-mode-list .timeline-item[data-index="1"] .timeline-content {
background-color: #e3f2fd !important;
}

/* --------------------------------------------------------------------------
   5. 內容與佈局
   -------------------------------------------------------------------------- */
.news-timeline-advanced.timeline-mode-list .timeline-content {
display: flex !important;
flex-direction: column !important;
padding: 10px !important;
border: none !important;
border-radius: 4px !important;
position: relative !important;
width: 100% !important;
box-sizing: border-box !important;
}

.news-timeline-advanced.timeline-mode-list .timeline-body {
order: 0 !important;
width: 100% !important;
margin: 0 !important;
}

/* 隱藏元素 */
.news-timeline-advanced.timeline-mode-list .timeline-excerpt,
.news-timeline-advanced.timeline-mode-list .timeline-read-more,
.news-timeline-advanced.timeline-mode-list .recommended-badge {
display: none !important;
}

/* ==========================================================================
   (修改) List Mode 日期樣式 - 恢復成時間軸風格
   ========================================================================== */
.news-timeline-advanced.timeline-mode-list .timeline-date {
display: block !important;
position: static !important;
width: auto !important;
height: auto !important;

/* [恢復] 背景色與邊框 (跟標準時間軸一致) */
background: var(--timeline-date-bg) !important;
border-bottom: 1px solid var(--timeline-border) !important;

/* [恢復] 內距 */
padding: 10px 15px !important;

/* [關鍵技巧] 使用負 Margin */
/* 因為 List 模式的 Content 有 10px padding，我們要用負值把日期條「撐」出去到邊緣 */
margin: -10px -10px 10px -10px !important;

/* [恢復] 字體樣式 */
font-size: 14px !important;
color: var(--timeline-primary) !important; /* 使用主色調 */
font-weight: 600 !important;
text-align: left !important;

/* [設定] 圓角 (上方有圓角) */
border-radius: 4px 4px 0 0 !important;

/* 確保順序變數有效 (支援上/下切換) */
order: var(--timeline-date-order, -1) !important;
}

/* [新增] 針對「日期在下方」時的特殊處理 */
.news-timeline-advanced.timeline-mode-list.timeline-date-pos-bottom .timeline-date {
/* 邊框與圓角反轉 */
border-bottom: none !important;
border-top: 1px solid var(--timeline-border) !important;
border-radius: 0 0 4px 4px !important;

/* Margin 方向調整 */
margin: 10px -10px -10px -10px !important;
}

/* --------------------------------------------------------------------------
   6. 萬能佈局支援
   -------------------------------------------------------------------------- */

/* (A) 左圖右文 */
.news-timeline-advanced.timeline-mode-list.timeline-layout-left-image .timeline-body {
display: flex !important;
flex-direction: row !important;
gap: 15px !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-left-image .timeline-image {
order: 1 !important;
width: 100px !important;
flex: 0 0 100px !important;
margin: 0 !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-left-image .timeline-text {
order: 2 !important;
flex: 1 !important;
}

/* (B) 標準 / 右圖左文 */
.news-timeline-advanced.timeline-mode-list.timeline-layout-default .timeline-body,
.news-timeline-advanced.timeline-mode-list.timeline-layout-right-image .timeline-body {
display: flex !important;
flex-direction: row !important;
gap: 15px !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-default .timeline-image,
.news-timeline-advanced.timeline-mode-list.timeline-layout-right-image .timeline-image {
order: 2 !important;
width: 100px !important;
flex: 0 0 100px !important;
margin: 0 !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-default .timeline-text,
.news-timeline-advanced.timeline-mode-list.timeline-layout-right-image .timeline-text {
order: 1 !important;
flex: 1 !important;
}

/* (C) 上圖 / 雜誌 */
.news-timeline-advanced.timeline-mode-list.timeline-layout-top-image .timeline-body,
.news-timeline-advanced.timeline-mode-list.timeline-layout-magazine .timeline-body {
display: block !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-top-image .timeline-image,
.news-timeline-advanced.timeline-mode-list.timeline-layout-magazine .timeline-image {
width: 100% !important;
margin: 0 0 10px 0 !important;
flex: none !important;
}

/* (D) 下圖 */
.news-timeline-advanced.timeline-mode-list.timeline-layout-bottom-image .timeline-body {
display: flex !important;
flex-direction: column !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-bottom-image .timeline-image {
order: 2 !important;
width: 100% !important;
margin: 10px 0 0 0 !important;
flex: none !important;
}
.news-timeline-advanced.timeline-mode-list.timeline-layout-bottom-image .timeline-text {
order: 1 !important;
}

/* (E) 純文字 */
.news-timeline-advanced.timeline-mode-list.timeline-layout-text-only .timeline-image {
display: none !important;
}

/* 圖片與標題樣式 */
.news-timeline-advanced.timeline-mode-list .timeline-image img {
width: 100% !important;
height: 100% !important;
object-fit: cover !important;
transform: none !important;
border-radius: 4px !important;
}
.news-timeline-advanced.timeline-mode-list .timeline-title {
font-size: 15px !important;
font-weight: 500 !important;
line-height: 1.5 !important;
margin: 0 !important;
}
.news-timeline-advanced.timeline-mode-list .timeline-item[data-index="1"] .timeline-title {
font-weight: bold !important;
color: #000 !important;
}
.news-timeline-advanced.timeline-mode-list .timeline-title a {
color: #333 !important;
text-decoration: none !important;
}
.news-timeline-advanced.timeline-mode-list .timeline-title a:hover {
color: var(--timeline-primary) !important;
text-decoration: none !important;
}

/* ===================================
   橫向時間軸 (Horizontal Timeline)
   =================================== */

/* Main container */
html body .news-timeline-advanced.timeline-horizontal {
position: relative;
width: 100%;
max-width: 100%;
box-sizing: border-box;
padding: 0;
}

/* Hide container pseudo */
html body .news-timeline-advanced.timeline-horizontal::before,
html body .news-timeline-advanced.timeline-horizontal::after {
display: none !important;
}

/* Hide vertical line */
html body .news-timeline-advanced.timeline-horizontal .timeline-line {
display: none !important;
}

/* Items wrapper - Standard horizontal scroll */
html body .news-timeline-advanced.timeline-horizontal .timeline-items-wrapper {
display: block !important;
padding: 60px 20px 20px 20px !important;
overflow-x: auto !important;
overflow-y: visible !important;
white-space: nowrap !important;
-webkit-overflow-scrolling: touch;
counter-reset: timeline-step;
position: relative !important;
}

/* Elevated Timeline Track */
html body .news-timeline-advanced.timeline-horizontal .timeline-items-wrapper::before {
content: '';
position: absolute;
top: 30px;
left: 30px;
right: 30px;
height: 4px;
background: linear-gradient(90deg, 
#d32f2f 0%, 
#e57373 20%, 
#e0e0e0 40%, 
#e0e0e0 60%, 
#e57373 80%, 
#d32f2f 100%);
border-radius: 2px;
z-index: 1;
}

/* WebKit Scrollbar - persistent */
html body .news-timeline-advanced.timeline-horizontal .timeline-items-wrapper::-webkit-scrollbar {
-webkit-appearance: none;
display: block;
height: 10px;
background: #e0e0e0;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-items-wrapper::-webkit-scrollbar-track {
background: #e8e8e8;
border-radius: 5px;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-items-wrapper::-webkit-scrollbar-thumb {
background: linear-gradient(90deg, #d32f2f 0%, #ff5252 50%, #d32f2f 100%);
border-radius: 5px;
border: 2px solid #e8e8e8;
}

/* Timeline item - inline-block for horizontal */
html body .news-timeline-advanced.timeline-horizontal .timeline-item {
display: inline-block !important;
vertical-align: top !important;
white-space: normal !important;
width: 280px !important;
margin: 0 15px !important;
padding-left: 0 !important;
padding-top: 0 !important;
position: relative !important;
counter-increment: timeline-step;
}

/* Connector stem from track to card */
html body .news-timeline-advanced.timeline-horizontal .timeline-item::after {
content: '';
position: absolute;
top: -28px;
left: 50%;
transform: translateX(-50%);
width: 2px;
height: 28px;
background: #d32f2f;
z-index: 2;
}

/* Hide vertical line pseudo */
html body .news-timeline-advanced.timeline-horizontal .timeline-item::before {
display: none !important;
}

/* Timeline marker - Diamond on track */
html body .news-timeline-advanced.timeline-horizontal .timeline-dot {
position: absolute !important;
left: 50% !important;
top: -38px !important;
transform: translateX(-50%) rotate(45deg) !important;
width: 16px !important;
height: 16px !important;
background: #d32f2f !important;
border: 3px solid #fff !important;
border-radius: 3px !important;
box-shadow: 0 2px 8px rgba(211,47,47,0.4) !important;
z-index: 10 !important;
}

/* Content card - Clear separation */
html body .news-timeline-advanced.timeline-horizontal .timeline-content {
background: #fff;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
overflow: hidden;
border-left: 4px solid #d32f2f;
transition: transform 0.2s, box-shadow 0.2s;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-content:hover {
transform: translateY(-4px);
box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Date header */
html body .news-timeline-advanced.timeline-horizontal .timeline-date {
padding: 10px 15px;
font-size: 12px;
font-weight: 700;
color: #d32f2f;
background: #fff5f5;
text-align: left;
border-bottom: 1px solid #ffebee;
}

/* First item special styling - Blue highlight */
html body .news-timeline-advanced.timeline-horizontal .timeline-item:first-child .timeline-dot,
html body .news-timeline-advanced.timeline-horizontal .timeline-item[data-index="1"] .timeline-dot {
background: #1976d2 !important;
box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.3), 0 2px 8px rgba(25, 118, 210, 0.4) !important;
transform: translateX(-50%) rotate(45deg) scale(1.2) !important;
border-color: #fff !important;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-item:first-child::after,
html body .news-timeline-advanced.timeline-horizontal .timeline-item[data-index="1"]::after {
background: #1976d2 !important;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-item:first-child .timeline-content,
html body .news-timeline-advanced.timeline-horizontal .timeline-item[data-index="1"] .timeline-content {
border-left-color: #1976d2 !important;
}

/* Mobile */
@media (max-width: 768px) {
html body .news-timeline-advanced.timeline-horizontal .timeline-item {
width: 240px !important;
margin: 0 10px !important;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-dot {
width: 14px !important;
height: 14px !important;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-item:first-child .timeline-dot,
html body .news-timeline-advanced.timeline-horizontal .timeline-item[data-index="1"] .timeline-dot {
transform: translateX(-50%) rotate(45deg) scale(1.15) !important;
}
}


/* ===================================
   橫向時間軸 - 標記形狀選項
   =================================== */

/* CSS Variables for theming */
.news-timeline-advanced.timeline-horizontal {
--marker-size: 16px;
--marker-color: #d32f2f;
--marker-color-first: #1976d2;
--marker-border: 3px solid #fff;
}

/* 形狀選項: 圓形 (Circle) */
html body .news-timeline-advanced.timeline-horizontal.marker-style-circle .timeline-dot {
transform: translateX(-50%) !important;
border-radius: 50% !important;
width: var(--marker-size) !important;
height: var(--marker-size) !important;
}

html body .news-timeline-advanced.timeline-horizontal.marker-style-circle .timeline-item:first-child .timeline-dot {
transform: translateX(-50%) scale(1.2) !important;
}

/* 形狀選項: 菱形 (Diamond) - 預設 */
html body .news-timeline-advanced.timeline-horizontal.marker-style-diamond .timeline-dot {
transform: translateX(-50%) rotate(45deg) !important;
border-radius: 3px !important;
width: var(--marker-size) !important;
height: var(--marker-size) !important;
}

html body .news-timeline-advanced.timeline-horizontal.marker-style-diamond .timeline-item:first-child .timeline-dot {
transform: translateX(-50%) rotate(45deg) scale(1.2) !important;
}

/* 形狀選項: 圓環 (Ring) */
html body .news-timeline-advanced.timeline-horizontal.marker-style-ring .timeline-dot {
transform: translateX(-50%) !important;
border-radius: 50% !important;
width: calc(var(--marker-size) + 4px) !important;
height: calc(var(--marker-size) + 4px) !important;
background: #fff !important;
border: 4px solid var(--marker-color) !important;
box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

html body .news-timeline-advanced.timeline-horizontal.marker-style-ring .timeline-item:first-child .timeline-dot {
border-color: var(--marker-color-first) !important;
transform: translateX(-50%) scale(1.15) !important;
}

/* 形狀選項: 正方形 (Square) */
html body .news-timeline-advanced.timeline-horizontal.marker-style-square .timeline-dot {
transform: translateX(-50%) !important;
border-radius: 4px !important;
width: var(--marker-size) !important;
height: var(--marker-size) !important;
}

html body .news-timeline-advanced.timeline-horizontal.marker-style-square .timeline-item:first-child .timeline-dot {
transform: translateX(-50%) scale(1.2) !important;
}

/* ===================================
   橫向時間軸 - 標記內容類型
   =================================== */

/* 基礎: 確保 counter-reset 存在 */
html body .news-timeline-advanced.timeline-horizontal .timeline-items-wrapper {
counter-reset: timeline-step !important;
}

html body .news-timeline-advanced.timeline-horizontal .timeline-item {
counter-increment: timeline-step !important;
}

/* 內容: 步驟數字 (Step Number) - 需要更大尺寸 */
html body .news-timeline-advanced.timeline-horizontal.marker-content-step .timeline-dot {
display: flex !important;
align-items: center !important;
justify-content: center !important;
font-size: 11px !important;
font-weight: 700 !important;
color: #fff !important;
width: 26px !important;
height: 26px !important;
min-width: 26px !important;
min-height: 26px !important;
border-radius: 50% !important;
top: -42px !important;
}

html body .news-timeline-advanced.timeline-horizontal.marker-content-step .timeline-dot::before {
content: counter(timeline-step) !important;
display: block !important;
}

/* 圓形 + 步驟數字組合 */
html body .news-timeline-advanced.timeline-horizontal.marker-style-circle.marker-content-step .timeline-dot {
transform: translateX(-50%) !important;
}

/* 菱形 + 步驟數字 - 不旋轉數字 */
html body .news-timeline-advanced.timeline-horizontal.marker-style-diamond.marker-content-step .timeline-dot {
transform: translateX(-50%) !important;
border-radius: 50% !important;
}

/* 內容: Icon (Dashicons) */
html body .news-timeline-advanced.timeline-horizontal.marker-content-icon .timeline-dot {
display: flex !important;
align-items: center !important;
justify-content: center !important;
width: 28px !important;
height: 28px !important;
border-radius: 50% !important;
top: -42px !important;
}

html body .news-timeline-advanced.timeline-horizontal.marker-content-icon .timeline-dot::before {
font-family: 'dashicons' !important;
content: '\f147' !important; /* checkmark */
font-size: 16px !important;
color: #fff !important;
display: block !important;
}

/* 內容: 圖片 (Image) */
html body .news-timeline-advanced.timeline-horizontal.marker-content-image .timeline-dot {
width: 32px !important;
height: 32px !important;
background-size: cover !important;
background-position: center !important;
border: 3px solid #fff !important;
border-radius: 50% !important;
top: -44px !important;
}

/* 內容: 文字 (Text/Label) */
html body .news-timeline-advanced.timeline-horizontal.marker-content-text .timeline-dot {
display: flex !important;
align-items: center !important;
justify-content: center !important;
width: 28px !important;
height: 28px !important;
font-size: 11px !important;
font-weight: 700 !important;
color: #fff !important;
border-radius: 50% !important;
top: -42px !important;
}

/* ===================================
   橫向時間軸 + 滑動模式 (Swiper)
   =================================== */
.news-timeline-advanced.timeline-horizontal-slider {
overflow: hidden;
padding: 20px 50px 60px 50px;
position: relative;
}

.news-timeline-advanced.timeline-horizontal-slider .timeline-items-wrapper {
overflow: visible;
}

.news-timeline-advanced.timeline-horizontal-slider .timeline-item {
height: auto;
}

/* Swiper Navigation for Horizontal Timeline */
.news-timeline-advanced.timeline-horizontal-slider .swiper-button-prev,
.news-timeline-advanced.timeline-horizontal-slider .swiper-button-next {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.95);
border-radius: 50%;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
color: var(--timeline-primary);
z-index: 10;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}

.news-timeline-advanced.timeline-horizontal-slider .swiper-button-prev {
left: 5px;
}

.news-timeline-advanced.timeline-horizontal-slider .swiper-button-next {
right: 5px;
}

.news-timeline-advanced.timeline-horizontal-slider .swiper-button-prev:hover,
.news-timeline-advanced.timeline-horizontal-slider .swiper-button-next:hover {
background: var(--timeline-primary);
color: #fff;
transform: translateY(-50%) scale(1.1);
}

.news-timeline-advanced.timeline-horizontal-slider .swiper-button-prev::after,
.news-timeline-advanced.timeline-horizontal-slider .swiper-button-next::after {
font-size: 14px;
font-weight: bold;
}

/* Swiper Pagination */
.news-timeline-advanced.timeline-horizontal-slider .swiper-pagination {
position: absolute;
bottom: 10px;
left: 0;
right: 0;
text-align: center;
}

.news-timeline-advanced.timeline-horizontal-slider .swiper-pagination-bullet-active {
background: var(--timeline-primary);
}

/* Mobile adjustments */
@media (max-width: 768px) {
.news-timeline-advanced.timeline-horizontal-slider {
padding: 20px 35px 50px 35px;
}

.news-timeline-advanced.timeline-horizontal-slider .swiper-button-prev,
.news-timeline-advanced.timeline-horizontal-slider .swiper-button-next {
width: 32px;
height: 32px;
}
}

/* ===================================
   所有模式 - 標記形狀與內容 (通用)
   =================================== */

/* Counter reset for all modes */
.news-timeline-advanced .timeline-items-wrapper {
counter-reset: timeline-step;
}

.news-timeline-advanced .timeline-item {
counter-increment: timeline-step;
}

/* ===== 標記形狀 - 所有模式 ===== */

/* 圓形 (Circle) - 所有模式 */
.news-timeline-advanced.marker-style-circle .timeline-dot {
border-radius: 50% !important;
}

/* 圓環 (Ring) - 所有模式 */
.news-timeline-advanced.marker-style-ring .timeline-dot {
border-radius: 50% !important;
background: #fff !important;
border: 3px solid var(--timeline-primary, #d32f2f) !important;
}

/* 正方形 (Square) - 所有模式 */
.news-timeline-advanced.marker-style-square .timeline-dot {
border-radius: 4px !important;
}

/* 菱形 (Diamond) - 除橫向外需特殊處理 */
.news-timeline-advanced.marker-style-diamond:not(.timeline-horizontal) .timeline-dot {
transform: rotate(45deg) !important;
}

.news-timeline-advanced.marker-style-diamond:not(.timeline-horizontal) .timeline-dot::before {
transform: rotate(-45deg) !important;
display: block !important;
}

/* ===== 標記內容 - 所有模式 ===== */

/* 步驟數字 - 所有模式通用 */
.news-timeline-advanced.marker-content-step .timeline-dot {
display: flex !important;
align-items: center !important;
justify-content: center !important;
font-size: 10px !important;
font-weight: 700 !important;
color: #fff !important;
}

.news-timeline-advanced.marker-content-step .timeline-dot::before {
content: counter(timeline-step) !important;
display: block !important;
}

/* 自訂內容 - 需要 data-marker 屬性 */
.news-timeline-advanced.marker-content-custom .timeline-dot {
display: flex !important;
align-items: center !important;
justify-content: center !important;
font-size: 11px !important;
font-weight: 700 !important;
color: #fff !important;
}

.news-timeline-advanced.marker-content-custom .timeline-dot::before {
content: attr(data-marker) !important;
display: block !important;
}

/* Icon 內容 - 所有模式 */
.news-timeline-advanced.marker-content-icon .timeline-dot {
display: flex !important;
align-items: center !important;
justify-content: center !important;
}

.news-timeline-advanced.marker-content-icon .timeline-dot::before {
font-family: 'dashicons' !important;
content: '\f147' !important;
font-size: 12px !important;
color: #fff !important;
display: block !important;
}

/* 圓環樣式時 icon 顏色 */
.news-timeline-advanced.marker-style-ring.marker-content-icon .timeline-dot::before {
color: var(--timeline-primary, #d32f2f) !important;
}

/* List Mode - 圓點位置調整 (22px dot, center at line position) */
.news-timeline-advanced.timeline-mode-list.marker-content-step .timeline-dot,
.news-timeline-advanced.timeline-mode-list.marker-content-custom .timeline-dot,
.news-timeline-advanced.timeline-mode-list.marker-content-icon .timeline-dot {
width: 22px !important;
height: 22px !important;
left: -41px !important;  /* 調整使圓點中心對齊時間軸線 */
top: 12px !important;
}

/* ===== Alternating Mode 特殊調整 ===== */
.news-timeline-advanced.timeline-layout-alternating.marker-content-step .timeline-dot,
.news-timeline-advanced.timeline-layout-alternating.marker-content-custom .timeline-dot,
.news-timeline-advanced.timeline-layout-alternating.marker-content-icon .timeline-dot {
width: 24px !important;
height: 24px !important;
}

/* ===== Default Mode 特殊調整 ===== */
.news-timeline-advanced:not(.timeline-horizontal):not(.timeline-mode-list):not(.timeline-layout-alternating).marker-content-step .timeline-dot,
.news-timeline-advanced:not(.timeline-horizontal):not(.timeline-mode-list):not(.timeline-layout-alternating).marker-content-custom .timeline-dot,
.news-timeline-advanced:not(.timeline-horizontal):not(.timeline-mode-list):not(.timeline-layout-alternating).marker-content-icon .timeline-dot {
width: 24px !important;
height: 24px !important;
left: -52px !important;  /* 原 -48px，圓點變大 8px，左移 4px 使中心對齊 */
top: 16px !important;
}



/* ===================================
   大圓內容卡片佈局 (Circle Content Card)
   圓形本身就是內容容器，顯示圖片+標題
   =================================== */
.news-timeline-advanced.timeline-layout-circle-card {
text-align: center;
}

.news-timeline-advanced.timeline-layout-circle-card .timeline-items-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
}

.news-timeline-advanced.timeline-layout-circle-card .timeline-item {
display: inline-block;
vertical-align: top;
width: 180px;
text-align: center;
margin: 10px;
}

/* 隱藏原有的 timeline-dot */
.news-timeline-advanced.timeline-layout-circle-card .timeline-dot {
display: none !important;
}

/* 圓形內容容器 - 顯示圖片 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-content {
width: 150px !important;
height: 150px !important;
border-radius: 50% !important;
overflow: hidden !important;
margin: 0 auto !important;
padding: 0 !important;
position: relative !important;
box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
border: 4px solid #fff !important;
background-size: cover !important;
background-position: center !important;
display: flex !important;
flex-direction: column !important;
justify-content: flex-end !important;
}

/* 漸層遮罩 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-content::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 60%;
background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
border-radius: 0 0 50% 50%;
}

/* 標題在圓形底部 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-title {
position: absolute !important;
bottom: 15px !important;
left: 10px !important;
right: 10px !important;
font-size: 12px !important;
font-weight: 600 !important;
color: #fff !important;
text-align: center !important;
z-index: 2 !important;
line-height: 1.3 !important;
display: -webkit-box !important;
-webkit-line-clamp: 2 !important;
-webkit-box-orient: vertical !important;
overflow: hidden !important;
}

/* 日期徽章 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-date {
position: absolute !important;
top: 10px !important;
left: 50% !important;
transform: translateX(-50%) !important;
font-size: 10px !important;
padding: 3px 8px !important;
background: rgba(211,47,47,0.9) !important;
color: #fff !important;
border-radius: 12px !important;
z-index: 3 !important;
white-space: nowrap !important;
}

/* 隱藏其他元素 - 不隱藏 timeline-body 因為圖片在裡面 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-excerpt,
.news-timeline-advanced.timeline-layout-circle-card .timeline-text,
.news-timeline-advanced.timeline-layout-circle-card .timeline-read-more {
display: none !important;
}

/* timeline-body 填滿圓形 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-body {
position: absolute !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
}

/* 圖片容器 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-image {
position: absolute !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
border-radius: 50% !important;
}

.news-timeline-advanced.timeline-layout-circle-card .timeline-image img {
width: 100% !important;
height: 100% !important;
object-fit: cover !important;
border-radius: 50% !important;
}

/* 第一項更大（需勾選「第一則使用大尺寸」） */
.news-timeline-advanced.timeline-layout-circle-card .timeline-item-large .timeline-content {
width: 180px !important;
height: 180px !important;
border-color: #1976d2 !important;
box-shadow: 0 10px 40px rgba(25,118,210,0.3) !important;
}

/* Hover 效果 */
.news-timeline-advanced.timeline-layout-circle-card .timeline-content:hover {
transform: scale(1.05);
box-shadow: 0 12px 40px rgba(0,0,0,0.2) !important;
}

/* ===================================
   圓環內容卡片佈局 (Ring Content Card)
   空心圓環作為內容容器
   =================================== */
.news-timeline-advanced.timeline-layout-ring-card {
text-align: center;
}

.news-timeline-advanced.timeline-layout-ring-card .timeline-items-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
}

.news-timeline-advanced.timeline-layout-ring-card .timeline-item {
display: inline-block;
vertical-align: top;
width: 160px;
text-align: center;
margin: 10px;
}

/* 隱藏原有的 timeline-dot */
.news-timeline-advanced.timeline-layout-ring-card .timeline-dot {
display: none !important;
}

/* 圓環內容容器 */
.news-timeline-advanced.timeline-layout-ring-card .timeline-content {
width: 120px !important;
height: 120px !important;
border-radius: 50% !important;
overflow: hidden !important;
margin: 0 auto 10px auto !important;
padding: 0 !important;
position: relative !important;
background: #fff !important;
border: 5px solid #d32f2f !important;
box-shadow: 0 6px 25px rgba(0,0,0,0.1) !important;
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
}

/* 圓環內的圖片 */
.news-timeline-advanced.timeline-layout-ring-card .timeline-image {
position: absolute !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
}

.news-timeline-advanced.timeline-layout-ring-card .timeline-image img {
width: 100% !important;
height: 100% !important;
object-fit: cover !important;
border-radius: 50% !important;
}

/* 標題在圓環下方 */
.news-timeline-advanced.timeline-layout-ring-card .timeline-title {
display: block !important;
margin-top: 10px !important;
font-size: 12px !important;
font-weight: 600 !important;
color: #333 !important;
text-align: center !important;
line-height: 1.4 !important;
display: -webkit-box !important;
-webkit-line-clamp: 2 !important;
-webkit-box-orient: vertical !important;
overflow: hidden !important;
}

/* 日期 */
.news-timeline-advanced.timeline-layout-ring-card .timeline-date {
font-size: 10px !important;
color: #d32f2f !important;
margin-bottom: 5px !important;
}

/* 隱藏其他元素 - 不隱藏 timeline-body */
.news-timeline-advanced.timeline-layout-ring-card .timeline-excerpt,
.news-timeline-advanced.timeline-layout-ring-card .timeline-text,
.news-timeline-advanced.timeline-layout-ring-card .timeline-read-more {
display: none !important;
}

/* timeline-body 填滿圓環 */
.news-timeline-advanced.timeline-layout-ring-card .timeline-body {
position: absolute !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
}

/* 第一項特殊樣式（需勾選「第一則使用大尺寸」） */
.news-timeline-advanced.timeline-layout-ring-card .timeline-item-large .timeline-content {
width: 140px !important;
height: 140px !important;
border-color: #1976d2 !important;
box-shadow: 0 8px 30px rgba(25,118,210,0.2) !important;
}

/* Hover 效果 */
.news-timeline-advanced.timeline-layout-ring-card .timeline-content:hover {
transform: scale(1.05);
border-color: #ff5252 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
.news-timeline-advanced.timeline-layout-circle-card .timeline-item,
.news-timeline-advanced.timeline-layout-ring-card .timeline-item {
width: 140px;
margin: 8px;
}

.news-timeline-advanced.timeline-layout-circle-card .timeline-content {
width: 120px !important;
height: 120px !important;
}

.news-timeline-advanced.timeline-layout-ring-card .timeline-content {
width: 100px !important;
height: 100px !important;
}

.news-timeline-advanced.timeline-layout-circle-card .timeline-title,
.news-timeline-advanced.timeline-layout-ring-card .timeline-title {
font-size: 11px !important;
}
}

/* ===================================
   手機版標記內容對齊修正
   線歸 0，圓點對齊線
   =================================== */
@media (max-width: 768px) {
/* 時間軸線歸 0 */
html body .news-timeline-advanced.marker-content-step .timeline-items-wrapper::before,
html body .news-timeline-advanced.marker-content-custom .timeline-items-wrapper::before,
html body .news-timeline-advanced.marker-content-icon .timeline-items-wrapper::before {
left: 0 !important;
}

/* 手機版：圓點對齊 left:0 的線 */
/* padding: 40px, 線在 0, 圓點 18px 寬，中心在 0，左邊緣在 -9px */
/* left: -(40 - (-9)) = -49px ... 不對 */
/* 圓點相對於 timeline-item 定位，item 有 padding-left */
/* 線在 wrapper 的 left: 0 = 距離 wrapper 左邊 0px */
/* 圓點相對於 item 的 content box，item 在 wrapper padding 內 */
/* 所以圓點 left: -40px 會讓圓點左邊緣在 wrapper:0 */
/* 18px 圓點要中心在 0：左邊緣 -9px，所以 left: -40 + (-9) = -49px */
html body .news-timeline-advanced.marker-content-step .timeline-dot,
html body .news-timeline-advanced.marker-content-custom .timeline-dot,
html body .news-timeline-advanced.marker-content-icon .timeline-dot {
width: 18px !important;
height: 18px !important;
left: -49px !important;
font-size: 9px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}

/* 列表模式手機版調整 */
html body .news-timeline-advanced.timeline-mode-list.marker-content-step .timeline-dot,
html body .news-timeline-advanced.timeline-mode-list.marker-content-custom .timeline-dot,
html body .news-timeline-advanced.timeline-mode-list.marker-content-icon .timeline-dot {
width: 18px !important;
height: 18px !important;
left: -49px !important;
top: 10px !important;
}
}