/* ==================== 基礎 ==================== */
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; } /* 平滑捲動 */
body {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  background: #0a1a2e;
  color: #e0f2ff;
  line-height: 1.7;
  overflow-x: hidden;
}
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 2rem; 
  position: relative; 
  z-index: 2;
  margin-top: 60px; /* 避免內容被 Navbar 擋住 */ 
}

/* 背景粒子 */
#particles-js { 
  position: fixed; 
  top: 0; left: 0; 
  width: 100%; height: 100%; 
  z-index: 1; 
}

/* 玻璃卡片 */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==================== 導覽列 (Navbar) ==================== */
.navbar {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: 70px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(10, 26, 46, 0.85); /* 深色半透明背景 */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin: 0; /* 覆蓋 .glass 的 margin */
  border-radius: 0; /* 覆蓋 .glass 的圓角 */
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  overflow-x: auto; /* 手機版可橫向滑動 */
  white-space: nowrap;
  padding: 0 20px;
  /* 隱藏捲軸 */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nav-container::-webkit-scrollbar { display: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: 0;
  min-width: max-content;
}

.nav-link {
  color: #e0f2ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 20px;
  transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* 特別強調的連結 (AI 專區) */
.highlight-link {
  color: #00ff88;
  border: 1px solid rgba(0,255,136,0.3);
}


/* ==================== 頭貼/標題/特效 ==================== */
.avatar-container { 
  position: relative; 
  width: 160px; height: 160px; 
  margin: 0 auto 1.5rem; 
}
.avatar { 
  width: 100%; height: 100%; 
  border-radius: 50%; 
  object-fit: cover; 
  border: 4px solid #00d4ff; 
  box-shadow: 0 0 30px rgba(0,212,255,0.5); 
}
.glow { 
  position: absolute; 
  top: -10px; left: -10px; right: -10px; bottom: -10px; 
  border-radius: 50%; 
  background: radial-gradient(circle, rgba(0,212,255,0.3), transparent); 
  z-index: -1; 
  animation: pulse 2s infinite; 
}
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

h1 { 
  font-size: 3rem; 
  font-weight: 700; 
  text-align: center; 
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #00d4ff, #00ff88);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 垂直輪播特效 */
.role-wrapper {
  font-size: 1.5rem;
  font-weight: 600;
  height: 40px;
  line-height: 40px;
  overflow: hidden;
  margin-bottom: 1rem;
  color: #aaccff;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.role-slider {
  animation: slideRole 9s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.role-item {
  color: #00ff88;
  font-weight: bold;
  height: 40px;
  text-align: left;
}

@keyframes slideRole {
  0%, 30% { transform: translateY(0); }
  33%, 63% { transform: translateY(-40px); }
  66%, 96% { transform: translateY(-80px); }
  100% { transform: translateY(0); }
}

.subtitle { 
  text-align: center; 
  margin: 1rem 0; 
  font-size: 1.1rem; 
  opacity: 0.9;
}


/* ==================== 自我介紹 (圖文並排) ==================== */
.about-container {
  display: flex; gap: 2rem; align-items: center; flex-wrap: wrap;
}
.about-text { flex: 1 1 500px; }
.about-video { flex: 1 1 300px; width: 100%; }

.video-wrapper {
  position: relative; border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); border: 1px solid rgba(0, 212, 255, 0.3);
}
.video-wrapper video { width: 100%; display: block; background: #000; }
.video-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0, 212, 255, 0.9); color: #0a1a2e;
  padding: 4px 10px; border-radius: 20px; font-size: 0.8rem;
  font-weight: bold; pointer-events: none; display: flex; align-items: center; gap: 5px;
}


/* ==================== AI 特展專區 (New) ==================== */
.ai-feature-section {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.ai-feature-content {
  display: flex; gap: 3rem; align-items: center; flex-wrap: wrap;
}
.ai-text { flex: 1 1 400px; }
.ai-preview { flex: 1 1 400px; }

.feature-tag {
  display: inline-block; background: rgba(0,255,136,0.2); color: #00ff88;
  padding: 5px 12px; border-radius: 4px; font-size: 0.85rem; font-weight: bold;
  margin-bottom: 1rem; letter-spacing: 1px;
}
.ai-list { list-style: none; margin: 1.5rem 0; }
.ai-list li { margin-bottom: 0.8rem; font-size: 1rem; }
.ai-list i { color: #00d4ff; width: 25px; text-align: center; margin-right: 10px; }
.ai-btn { background: #ff0000; background: linear-gradient(45deg, #ff0000, #cc0000); box-shadow: 0 4px 15px rgba(255,0,0,0.4); }
.ai-btn:hover { box-shadow: 0 10px 30px rgba(255,0,0,0.6); }


/* ==================== 橫向滾動畫廊 ==================== */
.scroll-gallery {
  display: flex;
  overflow-x: auto;
  gap: 1.5rem;
  padding: 1rem 0 2rem 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.scroll-gallery::-webkit-scrollbar { height: 8px; }
.scroll-gallery::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.scroll-gallery::-webkit-scrollbar-thumb { background: #00d4ff; border-radius: 4px; }
.scroll-gallery::-webkit-scrollbar-thumb:hover { background: #00ff88; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.gallery-item {
  flex: 0 0 auto;
  width: 280px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, #0f2438 25%, #1a3a5a 50%, #0f2438 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  transition: transform 0.3s;
  cursor: pointer;
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: #00d4ff;
  box-shadow: 0 10px 20px rgba(0, 212, 255, 0.2);
}

.gallery-item img {
  width: 100%; height: 200px; object-fit: cover; display: block;
  position: relative; z-index: 2; background: #000;
}

.gallery-caption {
  padding: 10px; text-align: center; font-size: 0.9rem; color: #fff;
  background: rgba(0, 0, 0, 0.6); z-index: 3;
}


/* ==================== 專業技能 (儀表板佈局與邊框) ==================== */

/* 1. 整體外框設計 (應用在 #skills) */
.skill-outer-frame {
  /* 基礎設定繼承自 .glass，這裡主要加入額外效果 */
  position: relative;
  /* 增加內邊距，讓內容與外框有足夠間距 */
  padding: 3rem; 
  /* 增加圓角，讓外框更圓潤 */
  border-radius: 30px; 
  /* 基礎藍色陰影，營造漂浮感 */
  box-shadow: 0 10px 50px rgba(0, 212, 255, 0.2); 
  border: none !important; /* 移除原本的 .glass 邊框 */
  background: rgba(10, 26, 46, 0.7); /* 略深背景，凸顯內層卡片 */
  overflow: hidden; /* 確保邊框不會外溢 */
}

/* 2. 外框光暈邊框效果 (使用偽元素) */
.skill-outer-frame::before {
  content: '';
  position: absolute;
  top: -2px; right: -2px; bottom: -2px; left: -2px;
  /* 藍色和綠色漸變邊框 */
  background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%); 
  z-index: -1;
  border-radius: 32px; /* 略大於容器圓角 */
  /* 動態光暈邊框 */
  filter: blur(8px); 
  opacity: 0.6;
}
.skill-outer-frame:hover::before {
  opacity: 1;
  filter: blur(5px);
  transition: all 0.5s ease;
}



/* 3. 網格容器：核心佈局 */
.skills-dashboard {
  display: grid;
  /* 電腦版強制 3 欄，這樣 6 個類別剛好 2 列，一屏可視 */
  grid-template-columns: repeat(3, 1fr); 
  gap: 2rem;
  padding: 0;
}

/* 4. 單個類別卡片 (內層玻璃卡片) */
.skill-box {
  background: rgba(255, 255, 255, 0.05); /* 略為半透明 */
  border: 1px solid rgba(0, 212, 255, 0.2); /* 淡藍色邊框 */
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 滑鼠移過單一卡片的光暈效果 */
.skill-box:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  border-color: #00ff88;
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.15); /* 輕微綠色光暈 */
}

/* 標題樣式 */
.skill-box h3 {
  color: #00ff88;
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.8rem;
}
.skill-box h3 i { color: #00d4ff; }

/* 技能列表微調 */
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 1rem; /* 增加項目間距 */
  flex-grow: 1;
}

/* 單一技能行 */
.skill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: #e0f2ff;
}

.skill-row .percent {
  font-size: 0.85rem;
  color: #00ff88; /* 改變顏色，與進度條漸變一致 */
  font-weight: bold;
}

/* 進度條容器 */
.skill-row .bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
}

/* 進度條顏色與動畫 (修正：改用 Transition) */
.skill-row .bar > div {
  height: 100%;
  /* 移除 width: 0; */
  background: linear-gradient(90deg, #00d4ff, #00ff88);
  border-radius: 4px;
  
  /* === 關鍵修正：將 animation 替換為 transition === */
  /* 設置寬度(width)的過渡效果，持續 1.5 秒，使用平滑曲線 */
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); 
  
  /* 移除原有的 animation 屬性和 @keyframes */
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* AI 特別強調框 */
.highlight-box {
  background: linear-gradient(145deg, rgba(0, 255, 136, 0.1), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(0, 255, 136, 0.5);
}

/* RWD 響應式調整 */
@media (max-width: 992px) {
  .skills-dashboard {
    grid-template-columns: repeat(2, 1fr); /* 平板變 2 欄 */
  }
}

@media (max-width: 600px) {
  .skill-outer-frame { padding: 2rem 1rem; }
  .skills-dashboard {
    grid-template-columns: 1fr; /* 手機變 1 欄 */
    gap: 1.5rem;
  }
  .skill-box { padding: 1.2rem; }
}
/* ==================== 作品集 ==================== */
.search-bar {
  width: 100%; padding: 12px; margin: 1rem 0;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px; color: white; font-size: 1rem;
}
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters button {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
  color: white; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; white-space: nowrap;
}
.filters button.active, .filters button:hover { background: #00d4ff; border-color: #00d4ff; }

/* 修正重點：使用 auto-fill 並置中，解決卡片拉伸問題 */
.grid { 
  display: grid; gap: 2rem; margin-top: 1.5rem; 
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  justify-content: center;
}

.card { 
  background: rgba(255,255,255,0.08); border-radius: 20px; overflow: hidden; 
  transition: all 0.4s; position: relative; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.card:hover { transform: translateY(-12px); box-shadow: 0 20px 40px rgba(0,212,255,0.25); }
.card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.35), transparent 60%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none; border-radius: 20px;
}
.card:hover::before { opacity: 1; }

.card-img {
  height: 220px; overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: linear-gradient(90deg, #000 25%, #1a1a1a 50%, #000 75%);
  background-size: 200% 100%; animation: shimmer 2s infinite;
}
.card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.6s; z-index: 2;}

.card-content { padding: 1.6rem; }
.card-content h3 { color: #fff; font-size: 1.3rem; font-weight: 700; margin-bottom: 0.8rem; line-height: 1.4; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.card-content p { color: #aaccff; font-size: 0.95rem; font-weight: 400; line-height: 1.6; margin-bottom: 1rem; }

.tags { margin: 1rem 0 1.2rem 0; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.tags span {
  background: rgba(0, 255, 136, 0.18); color: #00ff88; padding: 7px 16px; border-radius: 30px; 
  font-size: 0.88rem; font-weight: 600; border: 1px solid rgba(0, 255, 136, 0.5); 
  box-shadow: 0 2px 8px rgba(0, 255, 136, 0.2);
}

.project-links { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.project-links a {
  background: rgba(0,212,255,0.2); color: #00d4ff; padding: 11px 24px; border-radius: 50px; 
  font-size: 0.95rem; text-decoration: none; border: 1px solid rgba(0,212,255,0.5); 
  transition: all 0.3s; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
}
.project-links a:hover { background: #00d4ff; color: white; transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,212,255,0.5); }
.card.hidden { display: none !important; }
.preview-btn { background: rgba(255, 71, 87, 0.18) !important; color: #ff4757 !important; border: 1px solid rgba(255, 71, 87, 0.5) !important; }
.preview-btn:hover { background: #ff4757 !important; color: white !important; box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4); }
.preview-btn::before { content: "預覽 "; }

.btn-primary {
  display: inline-block; background: linear-gradient(45deg, #00d4ff, #0077cc); color: white; 
  padding: 12px 28px; border-radius: 50px; text-decoration: none; font-weight: 600; 
  box-shadow: 0 4px 15px rgba(0,212,255,0.4); transition: all 0.3s;
}
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,212,255,0.6); }


/* ==================== 聯絡 & 社群按鈕 ==================== */
.contact-info { margin-top: 2rem; text-align: center; }
.contact-info p { font-size: 1.1rem; margin: 0.5rem 0; color: #e0f2ff; }
.contact-info i { color: #00d4ff; margin-right: 10px; width: 20px; text-align: center;}

.social-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.social-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 50px; text-decoration: none; font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s; color: white;
}
.social-btn:hover { transform: translateY(-4px); filter: brightness(1.2); }
.social-btn i { font-size: 1.2rem; }

.line-btn { background: #06C755; box-shadow: 0 4px 15px rgba(6, 199, 85, 0.4); }
.ig-btn   { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); box-shadow: 0 4px 15px rgba(220, 39, 67, 0.4); }
.fb-btn   { background: #1877F2; box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4); }
.github-btn { background: #333; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }


/* ==================== 回到頂部按鈕 ==================== */
#backToTop {
  position: fixed; bottom: 30px; right: 30px;
  background: #00d4ff; color: #0a1a2e;
  border: none; width: 50px; height: 50px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.5);
  transition: all 0.3s; opacity: 0; visibility: hidden; z-index: 999;
}
#backToTop.show { opacity: 1; visibility: visible; }
#backToTop:hover { transform: translateY(-5px); background: #fff; }


/* ==================== 其他 ==================== */
.timeline { margin-top: 1rem; }
/* 修改原本的 timeline-item 讓它垂直置中對齊 */
.timeline-item {
  display: flex;
  gap: 1.5rem;       /* 圖片跟文字的距離 */
  margin: 2rem 0;    /* 每個項目的上下間距 */
  align-items: center; /* 垂直置中 */
}

/* Logo 的外框 (白色卡片背景) */
.timeline-logo {
  width: 100px;      /* 固定寬度 (縮小很多) */
  height: 60px;      /* 固定高度 */
  flex-shrink: 0;    /* 禁止被擠壓 */
  background: #ffffff; /* 純白背景 */
  border-radius: 8px;  /* 圓角矩形 (比圓形更適合長條Logo) */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;      /* 內距，讓 Logo 不要貼邊 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* 輕微陰影 */
  border: 1px solid rgba(0, 212, 255, 0.3);  /* 淡藍色邊框 */
  transition: transform 0.3s ease;
  overflow: hidden; /* 確保圖片不超出圓角 */
}

/* 滑鼠移過去的效果 */
.timeline-item:hover .timeline-logo {
  transform: translateY(-3px); /* 微微浮起 */
  box-shadow: 0 6px 15px rgba(0, 212, 255, 0.4);
  border-color: #00d4ff;
}

/* 圖片本身的設定 (關鍵修正) */
.timeline-logo img {
  width: 100%;       /* 寬度填滿容器 */
  height: 100%;      /* 高度填滿容器 */
  object-fit: contain; /* 關鍵！保持比例縮放，不會變形或裁切 */
  display: block;
}

/* 手機版響應式調整 */
@media (max-width: 600px) {
  .timeline-item {
    flex-wrap: nowrap; /* 手機版也不換行，保持並排 */
    gap: 1rem;
  }
  
  .timeline-logo {
    width: 70px;  /* 手機版再稍微小一點 */
    height: 45px;
  }
  
  .year {
    min-width: 60px; /* 調整年份寬度，避免太擠 */
    font-size: 0.9rem;
  }
  
  .content h3 {
    font-size: 1.1rem; /* 手機版標題字體微調 */
  }
}
.year { min-width: 80px; font-weight: 700; color: #00d4ff; font-size: 1.1rem; }
.highlight { color: #ff6b6b; font-weight: bold; }

.lightbox { display: none; position: fixed; z-index: 99999; padding-top: 50px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.9); }
.lightbox-content { margin: auto; display: block; width: 80%; max-width: 1200px; max-height: 90vh; object-fit: contain; animation: zoom 0.6s; }
@keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} }
.close-lightbox { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }

.video-container video { width: 100%; border-radius: 8px; margin-bottom: 1rem; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

.file-scroll-box { max-height: 220px; overflow-y: auto; background: rgba(0, 10, 20, 0.6); border: 1px solid rgba(0, 212, 255, 0.2); border-radius: 8px; padding: 8px; margin: 1rem 0; }
.file-scroll-box a { display: flex; align-items: center; color: #88cfff; text-decoration: none; padding: 8px; font-size: 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); transition: 0.2s; }
.file-scroll-box a:hover { background: rgba(0, 212, 255, 0.15); color: #fff; padding-left: 12px; }
.file-scroll-box a::before { content: '📊'; margin-right: 8px; font-size: 10px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 1rem 0; }
.gallery-grid img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); transition: 0.3s; }
.gallery-grid img:hover { border-color: #00d4ff; transform: scale(1.05); }

@media (max-width: 768px) {
  .filters button { font-size: 0.8rem; padding: 6px 10px; }
  .navbar { justify-content: flex-start; } 
  .about-container, .ai-feature-content { flex-direction: column-reverse; }
}

/* 橫向歡迎跑馬燈 */
.welcome-marquee {
  font-size: 1.55rem;
  font-weight: 600;
  height: 56px;
  line-height: 56px;
  overflow: hidden;
  margin: 1.2rem 0;
  color: #aaccff;
  text-align: center;
}
.marquee-track {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 15s linear infinite;
}
.marquee-track span {
  color: #00ff88;
  font-weight: bold;
  letter-spacing: 1px;
}
@keyframes marquee {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
@media (max-width: 768px) {
  .welcome-marquee { font-size: 1.32rem; height: 48px; line-height: 48px; }
  .marquee-track { animation-duration: 12s; }
}

@keyframes fillProgress {
  to { width: inherit; } /* inherit 會取 inline width 值 */
}

/* 手機微調 */
@media (max-width: 768px) {
  .skills-grid { gap: 1.5rem; }
  .skill-category { padding: 1.2rem; }
}

/* style.css 新增的樣式 */
.img-container {
    text-align: center;
    margin: 2rem 0;
}
.img-container img {
    max-width: 100%; /* 確保圖片響應式 */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==================== 手機版專用優化 (Mobile Optimization) ==================== */
@media (max-width: 768px) {

  /* --- A. 全局容器調整 --- */
  .container {
    padding: 1rem;       /* 減少左右留白，爭取手機顯示空間 */
    margin-top: 65px;    /* 配合導覽列高度 */
    overflow-x: hidden;  /* 防止任何水平溢出 */
  }
  
  /* --- B. Hero 區塊 (大頭貼與標題) --- */
  h1 {
    font-size: 2rem;     /* 縮小標題字體 */
  }
  .welcome-marquee {
    font-size: 1rem;     /* 跑馬燈字體縮小 */
    height: 36px;
    line-height: 36px;
  }
  .role-wrapper {
    font-size: 1.1rem;   /* 職稱輪播縮小 */
  }
  .avatar-container {
    width: 120px;        /* 大頭貼縮小 */
    height: 120px;
  }

  /* --- C. 導覽列 (Navbar) 優化 --- */
  /* 讓導覽列在手機上更好滑動，隱藏醜醜的捲軸 */
  .nav-container {
    padding: 0 10px;
    -webkit-overflow-scrolling: touch; /* iOS 平滑捲動 */
  }
  .nav-link {
    padding: 8px 12px;
    font-size: 0.9rem; /* 字體稍微縮小 */
  }

  /* --- D. 作品集卡片 (關鍵修正) --- */
  .grid {
    /* 強制單欄顯示，並移除 minmax(320px)，改為自動適應 */
    grid-template-columns: 1fr; 
    gap: 1.5rem;
  }
  .card-img {
    height: 180px; /* 手機版圖片高度縮減，避免佔據太多垂直空間 */
  }
  /* 篩選按鈕改為橫向滑動，避免佔據多行 */
  .filters {
    display: flex;
    flex-wrap: nowrap; /* 不換行 */
    overflow-x: auto;  /* 可橫向滑動 */
    padding-bottom: 10px; /* 預留捲軸空間或觸控緩衝 */
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar { display: none; } /* 隱藏捲軸 */
  .filters button {
    flex: 0 0 auto; /* 防止按鈕被壓縮 */
    padding: 8px 20px; /* 加大觸控範圍 */
  }

  /* --- E. 技能儀表板 (Skills) --- */
  .skill-outer-frame {
    padding: 1.5rem 1rem; /* 減少外框內距 */
  }
  .skills-dashboard {
    grid-template-columns: 1fr; /* 強制單欄 */
    gap: 1.2rem;
  }

  /* --- F. 燈箱 (Lightbox) --- */
  .lightbox-content {
    width: 95%; /* 手機版圖片放寬到 95% */
    margin-top: 20vh; /* 垂直置中調整 */
  }
  .close-lightbox {
    top: 10px;
    right: 20px;
    font-size: 3rem; /* 加大關閉按鈕，方便手指點擊 */
    background: rgba(0,0,0,0.5); /* 增加背景色防止與圖片重疊看不見 */
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 45px;
    border-radius: 50%;
  }

  /* --- G. 其他細節 --- */
  /* 隱藏桌機版的 Hover 特效 (手機沒有 hover) */
  .card:hover { transform: none; }
  .social-links { gap: 0.8rem; }
  .social-btn { padding: 10px 16px; font-size: 0.9rem; }
  
  /* Timeline 調整 */
  .timeline-item {
    flex-direction: column; /* 垂直排列 */
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(0, 212, 255, 0.3); /* 增加左側線條指引 */
  }
  .timeline-logo {
    width: 60px;
    height: 60px;
    position: absolute;
    left: -30px; /* 讓 Logo 浮在線條上 */
    top: 0;
    background: #0a1a2e; /* 避免線條穿過 Logo */
  }
  .timeline-item .content {
    margin-left: 20px; /* 避開 Logo */
  }
  .timeline-item .year {
    margin-left: 20px;
    margin-bottom: 5px;
  }
}