.profile-container {
    position: relative; /* 讓按鈕可以相對定位 */
    display: inline-block; /* 確保容器只包裹內容 */
}

.profile-pic {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%; /* 圓形照片 */
    border: 2px solid #CCC; /* 邊框 */
    margin-right: 1rem; /* 與文字間距 */
}

.profile-button {
    position: absolute; /* 相對於容器定位 */
    bottom: 5px; /* 距離照片底部 */
    right: 10px; /* 距離照片右邊 */
    width: 36px; /* 按鈕大小 */
    height: 36px; /* 按鈕大小 */
    border-radius: 50%; /* 圓形按鈕 */
    background-color: #84beb7; /* 按鈕背景色，可以根據需要調整 */
    color: white; /* 圖標顏色 */
    border: #2e4d49 1px dashed; /* 移除邊框 */
    cursor: pointer; /* 鼠標懸停時顯示手型 */
    font-size: 24px; /* 調整 👋 的大小 */
    display: flex; /* 讓圖標居中 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    padding: 0; /* 移除內邊距 */
}

.profile-button:hover {
    background-color: #2e4d49; /* 鼠標懸停時的背景色 */
}

body {
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    padding: 20px;
}
.a4-container {
    width: 794px; /* A4 寬度 210mm ≈ 794px */
    background-color: white;
    border: 1px solid #ddd;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}
header {
    background-color: #4A8079;
    color: #ccc;
    padding: 20px;
    padding-left: 2rem;
    display: flex;
    justify-content: space-between; /* 左邊文字，右邊照片 */
    align-items: center;
}
.header-info {
    font-size: 0.8rem;
    font-family: Consolas;
    color: #eee;
}

.header-info a {
    color: #eee;
    text-decoration: none;
}

.header-info a:hover {
    text-decoration: underline;
}

.header-info a:active {
    color: #eee;
}

.content {
    padding: 20px;
}
footer {
    text-align: center;
    vertical-align: middle;
    padding-top: 1em;
    font-size: 0.6em;
    color: #4A8079;
    background-color: #fff;
    border-top: 1px solid #eee;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}
h2, h3, h4, h5 {
    color: #4A8079;
    font-weight: bold;
}
h1 {
    margin: 0; /* 移除 h1 預設邊距 */
}
.social-icons a {
    text-decoration: none; /* 移除底線 */
    margin-right: 10px; /* 圖示之間的間距 */
}
.social-icons img {
    width: 20px;
    vertical-align: middle; /* 圖示垂直對齊 */
    border-radius: 50%; /* 圓形圖示 */
}
.sidemenu {
    border-left: #4A8079 1px dashed;
}
.presentation-item {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}
.project-item {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}
.mybadge {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 5px;
    overflow: hidden; /* 隱藏超出容器部分 */
    width: 100%; /* 或設置特定寬度 */
}

.mybadge-wrapper {
    display: flex;
    gap: 10px; /* 確保每個圖示之間有間距 */
    animation: scroll 30s linear infinite;
    white-space: nowrap; /* 防止換行 */
}
.mybadge-wrapper:hover {
    animation-play-state: paused; /* 懸停時暫停 */
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-30%); }
}

a {
    color: #4A8079;
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}

a:active {
    color: #4A8079;
}

.fs-06, .fs-07, .fs-08, .fs-09 {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.fs-06 {
    font-size: 0.6rem;
}
.fs-07 {
    font-size: 0.7rem;
}
.fs-08 {
    font-size: 0.8rem;
}
.fs-09 {
    font-size: 0.9rem;
}

/* 調整時間軸容器 */
.timeline {
    position: relative;
    width: 100%;
    margin: 0;
    /* padding: 20px 0; */
}

/* 垂直輔助線 */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #4A8079;
    left: 30px; /* 固定垂直線在左側，適應狹窄空間 */
    margin-left: 0;
    z-index: 0;
}

/* 時間軸項目 */
.timeline-item {
    position: relative;
    margin-bottom: 30px;
    margin-left: 60px; /* 留出空間給年份圓點和垂直線 */
}

/* 調整內容區塊 */
.timeline-item .timeline-content {
    width: 90%; /* 增加寬度以適應單列，減少溢出 */
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    position: relative;
    float: none; /* 移除浮動，改為單列 */
    text-align: left; /* 統一左對齊 */
}

/* 移除左右交錯的浮動邏輯 */
.timeline-item:nth-child(odd) .timeline-content,
.timeline-item:nth-child(even) .timeline-content {
    float: none;
    text-align: left;
}

/* 年份圓點 */
.timeline-item .timeline-year {
    position: absolute;
    top: 15px;
    width: 40px; /* 進一步縮小圓點 */
    height: 40px;
    background: #4A8079;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: bold;
    left: -50px; /* 將圓點移到左側，與垂直線對齊 */
    margin-left: 0;
    z-index: 1;
    font-size: 0.8rem;
}

/* 移除響應式媒體查詢，因為我們已經採用單列設計 */
@media (max-width: 794px) {
    .timeline::before {
        left: 25px;
    }

    .timeline-item {
        margin-left: 60px;
    }

    .timeline-item .timeline-content {
        width: 90%;
        float: none;
        text-align: left;
    }

    .timeline-item .timeline-year {
        left: -50px;
    }
    .education-container {
        flex-direction: column; /* 在小螢幕上堆疊 */
        align-items: flex-start; /* 左對齊 */
    }

    .education-image {
        height: 30px; /* 縮小圖片高度在小螢幕上 */
        margin-bottom: 0.5rem; /* 圖片與文字之間的間距 */
    }
}

.education-container {
    display: flex; /* 使用 Flexbox 佈局 */
    align-items: center; /* 垂直置中對齊 */
    gap: 1rem; /* 圖片與文字之間的間距 */
    margin-bottom: 1rem; /* 可選：與其他內容的間距 */
}

.education-image {
    width: auto; /* 保持圖片寬度比例 */
    height: 40px; /* 設置圖片高度，根據文字高度調整 */
    object-fit: cover; /* 確保圖片不失真 */
    border-radius: 50%; /* 可選：如果圖片需要圓形 */
    border: 2px solid #CCC; /* 可選：添加邊框 */
}

.education-text {
    flex: 1; /* 讓文字佔用剩餘空間 */
}