/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background-color: #0f172a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(30, 41, 59, 0.3);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo a {
    text-decoration: none;
}

.nav-logo h2 {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 1.5rem;
    min-width: 200px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    transition: all 0.3s ease;
}

.nav-link {
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    color: #60a5fa;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #60a5fa;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.language-switcher {
    display: flex;
    align-items: center;
}

.lang-btn {
    background: transparent;
    border: 2px solid #60a5fa;
    color: #60a5fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: #60a5fa;
    color: #0f172a;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #e2e8f0;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.greeting {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.name {
    display: block;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background-color: #60a5fa;
    color: #0f172a;
}

.btn-primary:hover {
    background-color: transparent;
    color: #60a5fa;
    border-color: #60a5fa;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #e2e8f0;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    transform: translateY(-2px);
}

.profile-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-image {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-info p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Section Styles */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #e2e8f0;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(45deg, #60a5fa, #3b82f6);
    border-radius: 2px;
}

/* About Section */
.about {
    background-color: #1e293b;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.highlight {
    text-align: center;
    padding: 2rem;
    background: #334155;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    border: 1px solid #475569;
}

.highlight:hover {
    transform: translateY(-5px);
    background: #475569;
}

.highlight i {
    font-size: 2.5rem;
    color: #60a5fa;
    margin-bottom: 1rem;
}

.highlight h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.highlight p {
    color: #cbd5e1;
    font-size: 0.95rem;
}

/* Education Section */

/* 甘特圖式時間軸：水平軸 = 時間，重疊項目分軌上下堆疊 */
.timeline-gantt {
    max-width: 900px;
    margin: 0 auto 3rem;
    padding: 0 0.5rem;
}

.gantt-axis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #475569;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

.gantt-tracks {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gantt-track {
    position: relative;
    height: 2.25rem;
    min-height: 2.25rem;
}

.gantt-bar {
    position: absolute;
    top: 0;
    height: 100%;
    left: calc(var(--start) * 1%);
    width: calc(var(--width) * 1%);
    min-width: 2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #0f172a;
    box-sizing: border-box;
    padding: 0 0.35rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gantt-bar-current {
    background: #10b981;
    box-shadow: 0 0 0 2px #0f172a;
}

.gantt-bar-overlap {
    background: #60a5fa;
    box-shadow: 0 0 0 2px #0f172a;
}

.gantt-bar-completed {
    background: #6b7280;
    box-shadow: 0 0 0 2px #0f172a;
}

.gantt-bar-short {
    min-width: 3.5rem;
}

.gantt-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-details-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0 auto 1.5rem;
    max-width: 800px;
    padding: 0 1rem;
}

/* 依時間垂直對齊的時間軸：中央軸線 + 年份，卡片依 --top 定位，左右分側 */
/* 年份位置：至今=0%, 2025=20%, 2024=40%, 2023=60%, 2022=80%, 2020=100% */
.timeline-by-date {
    max-width: 900px;
    margin: 0 auto;
    min-height: 1100px;
    position: relative;
    padding: 0 0.5rem 3rem;
    overflow: visible;
}

.timeline-by-date::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #60a5fa, #3b82f6);
    transform: translateX(-50%);
    z-index: 0;
}

.timeline-axis-vertical {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem 0;
    pointer-events: none;
}

.timeline-axis-vertical .timeline-year {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    background: #1e293b;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #475569;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* 卡片定位：top 對齊開始年份 */
.timeline-card {
    position: absolute;
    width: 45%;
    min-height: 120px;
    top: var(--top);
    height: auto;
    display: flex;
    align-items: flex-start;
    z-index: 2;
    overflow: visible;
}

/* 有時間跨度的卡片：高度對應年份區間，內容過長時可滾動 */
.timeline-card-span {
    height: var(--height);
    overflow: hidden;
}

.timeline-by-date .timeline-card-span .timeline-content {
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 2.75rem;
    min-width: 0;
}

/* 截斷時：漸層遮罩 + 閱讀更多按鈕（原有形式）；line-clamp 避免半字截斷 */
.timeline-by-date .timeline-content-truncated .timeline-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 1 auto;
    min-height: 0;
}

.timeline-by-date .timeline-content-truncated .timeline-cert {
    display: none;
}

.timeline-by-date .timeline-content-truncated::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2.4rem;
    height: 2.8rem;
    background: linear-gradient(to bottom, rgba(51, 65, 85, 0), rgba(51, 65, 85, 0.98));
    pointer-events: none;
    z-index: 2;
}

.timeline-read-more-btn {
    position: absolute;
    left: 1.25rem;
    bottom: 0.75rem;
    border: 1px solid #60a5fa;
    color: #60a5fa;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
}

.timeline-read-more-btn:hover {
    background: #60a5fa;
    color: #0f172a;
}

.timeline-card-span.timeline-card-expanded {
    height: auto;
    overflow: visible;
    z-index: 4;
}

.timeline-card-span.timeline-card-expanded .timeline-content {
    height: auto;
    overflow: visible;
    padding-bottom: 2.75rem;
}

@media (min-width: 769px) {
    /* 右側連續時段卡片保留小縫隙，維持視覺層次 */
    .timeline-card-span.timeline-card-gap-bottom:not(.timeline-card-expanded) .timeline-content {
        height: calc(100% - 12px);
    }
}

.timeline-card-left {
    left: 0;
    flex-direction: row;
}

.timeline-card-left .timeline-content {
    margin-left: 0;
    margin-right: auto;
}

.timeline-card-right {
    right: 0;
    flex-direction: row-reverse;
}

.timeline-card-right .timeline-content {
    margin-right: 0;
    margin-left: auto;
}

.timeline-by-date .timeline-marker {
    flex-shrink: 0;
    position: relative;
    left: auto;
    top: 0.5rem;
    transform: none;
}

.timeline-card-left .timeline-marker {
    margin-right: 0.5rem;
    left: 0;
}

.timeline-card-right .timeline-marker {
    margin-left: 0.5rem;
    left: auto;
    right: 0;
}

.timeline-by-date .timeline-content {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 1rem 1.25rem;
    padding-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.timeline-by-date .timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.timeline-by-date .timeline-content h4 {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #94a3b8;
}

.timeline-by-date .timeline-period {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.timeline-by-date .timeline-description {
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
    min-height: 2.5em;
    overflow: hidden;
}

.timeline-card-span.timeline-card-expanded .timeline-description {
    overflow: visible;
    min-height: 0;
}

.timeline-by-date .timeline-cert {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #475569;
    font-size: 0.85rem;
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.timeline-by-date .timeline-cert .cert-link {
    margin-left: 0;
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline:not(.timeline-by-date)::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #60a5fa, #3b82f6);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

/* 重疊時段群組：兩張卡片同一側（右側）緊鄰，視覺上為同時進行 */
.timeline-overlap-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    position: relative;
}

.timeline-overlap-group .timeline-item {
    margin-bottom: 0.75rem;
}

.timeline-overlap-group .timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-overlap-group .timeline-item-current {
    flex-direction: row-reverse;
}

.timeline-overlap-group .timeline-item-overlap {
    flex-direction: row-reverse;
    margin-top: 0;
}

.timeline-overlap-group .timeline-content {
    margin-left: auto !important;
    margin-right: 0 !important;
    width: 45%;
}

/* 重疊群組靠左（如實習與成大並行） */
.timeline-overlap-group-left {
    align-items: flex-start;
}

.timeline-overlap-group-left .timeline-content {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.timeline-overlap-group-left .timeline-item-current {
    flex-direction: row;
}

.timeline-overlap-group-left .timeline-item-overlap {
    flex-direction: row;
}

.timeline-overlap-group-left .timeline-overlap-label {
    align-self: flex-start;
}

.timeline-overlap-label {
    align-self: flex-end;
    font-size: 0.8rem;
    color: #60a5fa;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Timeline item positioning (standalone items) */
.timeline-item-current {
    flex-direction: row-reverse; /* Right side */
    margin-bottom: 1rem;
}

.timeline-item-overlap {
    flex-direction: row; /* Left side */
    margin-top: -1rem; /* Overlap with current item */
    margin-bottom: 2rem;
    z-index: 1;
}

.timeline-item-completed {
    flex-direction: row-reverse; /* Right side */
    margin-bottom: 0;
}

/* Timeline content positioning */
.timeline-content-left {
    width: 45%;
    margin-right: auto;
    margin-left: 0;
}

.timeline-content-right {
    width: 45%;
    margin-left: auto;
    margin-right: 0;
}

/* Timeline markers */
.timeline-marker-current {
    background: #10b981; /* Green for current */
    border: 4px solid #0f172a;
    box-shadow: 0 0 0 4px #10b981;
}

.timeline-marker-overlap {
    background: #60a5fa; /* Blue for ongoing */
    border: 4px solid #0f172a;
    box-shadow: 0 0 0 4px #60a5fa;
}

.timeline-marker-completed {
    background: #6b7280; /* Gray for completed */
    border: 4px solid #0f172a;
    box-shadow: 0 0 0 4px #6b7280;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    background: #60a5fa;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 1;
    border: 4px solid #0f172a;
    box-shadow: 0 0 0 4px #334155;
}

.timeline-content {
    background: #334155;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    width: 45%;
    position: relative;
    border: 1px solid #475569;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
    margin-left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    margin-right: 0;
}

.timeline-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.timeline-period {
    color: #60a5fa;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-description {
    color: #cbd5e1;
    line-height: 1.6;
}

.timeline-cert {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #475569;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.timeline-cert strong {
    color: #e2e8f0;
}

.timeline-cert .cert-link {
    margin-left: 0.75rem;
    color: #60a5fa;
    text-decoration: none;
}

.timeline-cert .cert-link:hover {
    text-decoration: underline;
}

/* Skills Section */
.skills {
    background-color: #1e293b;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.skill-category h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
    text-align: center;
}

.skill-items {
    background: #334155;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid #475569;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-item span {
    display: block;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.skill-bar {
    height: 8px;
    background-color: #475569;
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(45deg, #60a5fa, #3b82f6);
    border-radius: 4px;
    width: 0;
    transition: width 1s ease-in-out;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.contact-info p {
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.contact-method:hover {
    background: #e5e7eb;
}

.contact-method i {
    font-size: 1.5rem;
    color: #2563eb;
    width: 30px;
    text-align: center;
}

.contact-method h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.contact-method p {
    color: #6b7280;
    margin: 0;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background-color: #0f172a;
    color: #e2e8f0;
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #334155;
}

.footer p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-right {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #1e293b;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        padding: 2rem 0;
        border-top: 1px solid #334155;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu.active .language-switcher {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: row !important;
        padding-left: 50px;
        margin-top: 0 !important; /* Reset margin for mobile */
        margin-bottom: 2rem !important;
    }

    .timeline-item-current,
    .timeline-item-overlap,
    .timeline-item-completed {
        flex-direction: row !important;
        margin-top: 0 !important;
    }

    .timeline-marker {
        left: 20px;
    }

    .timeline-content,
    .timeline-content-left,
    .timeline-content-right {
        width: 100%;
        margin: 0 !important;
    }

    .timeline-marker-current,
    .timeline-marker-overlap,
    .timeline-marker-completed {
        left: 20px;
        background: #60a5fa !important; /* Reset color for mobile */
        box-shadow: 0 0 0 4px #334155 !important;
    }

    .timeline-overlap-group {
        align-items: stretch;
    }

    .timeline-overlap-label {
        align-self: flex-start;
        margin-left: 0;
    }

    /* 依時間對齊時間軸：小螢幕改為由上而下堆疊 */
    .timeline-by-date {
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .timeline-by-date::before {
        display: none;
    }

    .timeline-axis-vertical {
        position: relative;
        transform: none;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 2px solid #475569;
    }

    .timeline-by-date .timeline-card {
        position: relative !important;
        width: 100%;
        top: auto !important;
        height: auto !important;
        max-height: none;
        padding-left: 50px;
    }

    .timeline-by-date .timeline-card-left,
    .timeline-by-date .timeline-card-right {
        flex-direction: row;
    }

    .timeline-by-date .timeline-marker {
        position: absolute;
        left: 20px;
        top: 0.5rem;
        margin: 0;
    }

    .timeline-by-date .timeline-content {
        width: 100%;
        margin: 0 !important;
    }

    .timeline-gantt {
        margin-bottom: 2rem;
        padding: 0 0.25rem;
    }

    .gantt-axis {
        font-size: 0.75rem;
    }

    .gantt-bar {
        font-size: 0.65rem;
        min-width: 2rem;
    }

    .gantt-bar-short {
        min-width: 2.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .about-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Page Navigation */
.page-navigation {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-nav-toggle {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.page-nav-toggle:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.page-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1rem;
    border: 1px solid rgba(30, 41, 59, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: absolute;
    bottom: 0;
    right: 0;
    transform-origin: bottom right;
}

.page-navigation.active .page-nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.page-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.page-nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    transform: translateX(-5px);
}

.page-nav-item i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.page-nav-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive adjustments for navigation */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .page-navigation {
        bottom: 80px;
        right: 20px;
    }
    
    .page-nav-toggle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .page-nav-menu {
        padding: 0.75rem;
        bottom: 0;
        right: 0;
        transform: translateY(0);
    }
    
    .page-nav-item {
        padding: 0.5rem 0.75rem;
        min-width: 100px;
    }
    
    .page-nav-item span {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .page-navigation {
        bottom: 70px;
        right: 15px;
    }
    
    .page-nav-toggle {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}
