/* ==========================================================================
   Weiß Personal Website - Complete Integrated Style Sheet
   Includes global layouts, navigation, Astro component styles & animations
   ========================================================================== */

/* 1. 全域 CSS 變數與 Reset */
:root {
  --bg-color: #0d0d11;
  --card-bg: rgba(22, 22, 29, 0.85);
  --card-border: #262633;
  --hover-bg: #2d2d3d;
  --text-main: #f1f1f5;
  --text-muted: #a0a0b0;

  /* 漸層雙色 */
  --color-top: #8888cc;    /* 主色藍 */
  --color-bottom: #8888cc; /* 次色紫 */
  --primary-color: #6eacfc;
  --accent-gradient: linear-gradient(180deg, var(--color-top), var(--color-bottom));

  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

/* 固定背景漸層 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(180deg, rgba(110, 172, 252, 0.12) 0%, rgba(136, 136, 204, 0.12) 100%);
  pointer-events: none;
  z-index: -1;
}

/* 主容器 */
.container {
  max-width: 1050px;
  margin: 40px auto;
  padding: 0 24px;
}

/* ==========================================================================
   模式內容顯隱控制 (Mode Content Toggle)
   ========================================================================== */
.social-only {
  display: none !important;
}

html.social-mode .pro-only {
  display: none !important;
}

html.social-mode .social-only {
  display: block !important;
}

html.social-mode span.social-only,
html.social-mode a.social-only {
  display: inline-block !important;
}

html.social-mode li.social-only {
  display: flex !important;
}


/* ==========================================================================
   2. 頂部導覽列 (Navbar) 與 語言選擇器 / 膠囊切換器 / 音樂播放器
   ========================================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background-color: rgba(13, 13, 17, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--card-border);
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.menu-btn:hover {
  background-color: var(--hover-bg);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  margin-left: 16px;
  text-decoration: none;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

/* 🎛️ 單一膠囊切換按鈕 (Single Toggle Switch) */
.mode-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 62px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 3px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: all 0.3s ease;
}

.mode-toggle-switch:hover {
  border-color: rgba(110, 172, 252, 0.4);
}

.mode-toggle-switch:active {
  transform: scale(0.95);
}

.toggle-icon {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* 平滑切換滑塊 (Glider) */
.toggle-glider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 2px 8px rgba(110, 172, 252, 0.4);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease, box-shadow 0.35s ease;
  z-index: 1;
}

/* 預設（專業模式）：滑塊在左側 */
html:not(.social-mode) .icon-pro {
  color: #ffffff;
}

/* 社交模式：滑塊滑向右側 */
html.social-mode .toggle-glider {
  transform: translateX(30px);
}

html.social-mode .icon-social {
  color: #ffffff;
}

/* 語言切換選擇選單 */
.minimal-lang-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 10px center;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 28px 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  vertical-align: middle;
}

.minimal-lang-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.minimal-lang-select option {
  background: #18181b;
  color: #ffffff;
}

/* 頂部迷你黑膠唱片播放器 */
.header-vinyl-player {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.mini-vinyl-disc {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #2d2d32 18%, #111115 20%, #1a1a1e 40%, #0a0a0c 100%);
  border: 2px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mini-vinyl-disc:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); /* 移除 box-shadow 的藍紫色發光 */
}

.vinyl-note {
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.9;
}

/* 🎵 播放時旋轉動畫 */
.mini-vinyl-disc.playing {
  animation: spin-vinyl 3s linear infinite;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); /* 移除 box-shadow 的藍紫色發光 */
}

@keyframes spin-vinyl {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* ==========================================================================
   3. 側邊欄 (Sidebar) & 遮罩 (Overlay)
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 300;
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 18px;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--card-border);
  border-radius: 0 24px 24px 0;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
}

.sidebar-header .menu-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.sidebar-header .menu-btn:hover {
  background: var(--hover-bg);
  transform: rotate(90deg);
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  position: relative;
}

.sidebar-menu li a:hover {
  background-color: var(--hover-bg);
  color: var(--text-main);
  transform: translateX(4px);
}

.sidebar-menu li a.active {
  background: rgba(110, 172, 252, 0.12);
  color: var(--color-top);
  font-weight: 700;
}

.sidebar-menu li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 4px;
  background: var(--accent-gradient);
  border-radius: 0 4px 4px 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}


/* ==========================================================================
   4. 通用區塊、名片與卡片基底 (Card & Section Layouts)
   ========================================================================== */
.profile-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 36px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  border: 1px solid var(--card-border);
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.avatar-wrapper {
  position: relative;
  padding: 3px;
  border-radius: 50%;
  background: var(--accent-gradient);
  flex-shrink: 0;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background-color: var(--bg-color);
}

.profile-info h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.profile-info p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 18px;
  white-space: pre-line;
}

.section {
  background-color: var(--card-bg);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 32px 40px;
  border: 1px solid var(--card-border);
  margin-bottom: 28px;
  scroll-margin-top: 90px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: 4px;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header-flex .section-title {
  margin-bottom: 0;
}

.section-header-link {
  color: var(--color-top);
  text-decoration: none;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.section-header-link:hover {
  opacity: 0.8;
}

/* 按鈕樣式 */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-block;
}

.btn-primary {
  background: var(--color-top);
  color: #0d0d11;
}

.btn-primary:hover {
  background: var(--color-bottom);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-outline:hover {
  background: var(--hover-bg);
}

.btn-full {
  width: 100%;
  border: none;
}

/* 無資料提示字串 */
.no-data-msg {
  color: var(--text-muted);
  text-align: center;
  padding: 30px 0;
  font-size: 0.95rem;
}


/* ==========================================================================
   5. 個人資訊 & 技能 (About)
   ========================================================================== */
.bio-banner {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: -4px;
  margin-bottom: 20px;
  width: 100%;
}

.bio-text {
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-muted);
  word-break: normal;
  overflow-wrap: break-word;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, border-color 0.25s ease;
  word-break: normal;
  overflow-wrap: break-word;
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 172, 252, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: break-word;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.9rem;
}

.info-list li {
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.info-list li > span:first-child {
  flex-shrink: 0;
}

.info-list li strong {
  color: var(--text-main);
}

/* 標籤組 (Tag Badges) */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 0;
}

.tag {
  background: rgba(110, 172, 252, 0.1);
  border: 1px solid rgba(110, 172, 252, 0.25);
  color: var(--color-top);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tag:hover {
  background: rgba(136, 136, 204, 0.25);
  color: #fff;
  border-color: var(--color-bottom);
}

/* ==========================================================================
   6. 學習經歷 (Experience)
   ========================================================================== */
.section-header-wrap {
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: -4px;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exp-card {
  text-decoration: none;
  color: inherit;
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 24px;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.exp-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(110, 172, 252, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.exp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(110, 172, 252, 0.12);
  border: 1px solid rgba(110, 172, 252, 0.25);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

.exp-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: monospace;
}

.exp-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.exp-org {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}


/* ==========================================================================
   7. 作品集 (Portfolio Grid & Horizontal List)
   ========================================================================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.portfolio-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  border-color: rgba(110, 172, 252, 0.4);
}

.portfolio-cover {
  position: relative;
  width: 100%;
  height: 170px;
  overflow: hidden;
}

.portfolio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-cover img {
  transform: scale(1.05);
}

.portfolio-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-top);
  color: #0d0d11;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.portfolio-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.portfolio-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.portfolio-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.portfolio-item-horizontal {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 240px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item-horizontal:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 172, 252, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.portfolio-item-horizontal .item-cover {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  overflow: hidden;
}

.portfolio-item-horizontal .item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-item-horizontal:hover .item-cover img {
  transform: scale(1.05);
}

.portfolio-item-horizontal .item-content {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
}

.portfolio-item-horizontal .item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-top);
  margin-bottom: 8px;
  font-weight: 600;
}

.portfolio-item-horizontal .item-year {
  font-family: monospace;
  opacity: 0.7;
}

.portfolio-item-horizontal .item-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-main);
}

.portfolio-item-horizontal .item-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.portfolio-item-horizontal .item-title a:hover {
  color: var(--color-top);
}

.portfolio-item-horizontal .item-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.portfolio-item-horizontal .item-actions {
  margin-top: auto;
}


/* ==========================================================================
   8. 部落格 (Blog Grid & List)
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.blog-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.blog-card:hover {
  border-color: rgba(110, 172, 252, 0.4);
  transform: translateY(-4px);
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  display: block;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-item.has-thumb {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  align-items: center;
}

.blog-item:hover {
  border-color: rgba(136, 136, 204, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.blog-item-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Meta 資訊區塊（Tags 膠囊、日期、閱讀時間） */
.blog-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Tags 標籤膠囊 (代替原分類名稱位置) */
.blog-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(136, 136, 204, 0.18);
  border: 1px solid rgba(136, 136, 204, 0.35);
  color: var(--color-top);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.blog-tag:hover {
  background: rgba(136, 136, 204, 0.3);
  border-color: var(--color-top);
}

.blog-date,
.blog-read-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 文章標題 */
.blog-item-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 4px 0 8px 0;
  line-height: 1.4;
}

.blog-item-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-item-title a:hover {
  color: var(--color-top);
}

/* 文章摘要 */
.blog-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.blog-item-thumb {
  width: 100%;
  height: 130px;
  border-radius: 12px;
  overflow: hidden;
}

.blog-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ==========================================================================
   9. 搜尋與分類過濾列 (Filters & Search)
   ========================================================================== */
.filter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  padding: 12px 16px 12px 42px;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--color-top);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 12px rgba(110, 172, 252, 0.2);
}

.filter-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* 🟢 校正：加入 Flexbox 水平/垂直雙向置中，與社交模式對齊 */
.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-top);
  color: #0d0d11;
  border-color: var(--color-top);
  font-weight: 600;
}


/* ==========================================================================
   10. 聯絡資訊與表單 (Contact Form)
   ========================================================================== */
.contact-subtitle {
  margin-top: -14px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 14px 18px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
  background: var(--hover-bg);
  border-color: rgba(110, 172, 252, 0.4);
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
  flex-shrink: 0;
}

.contact-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.contact-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.contact-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--color-top);
  color: #0d0d11;
}

.arrow-icon {
  font-size: 1.1rem;
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-card:hover .arrow-icon {
  transform: translate(2px, -2px);
  opacity: 1;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-group label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-top);
  background: rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   11. Keystatic 自訂圖文與文章區塊 (Grid Feature)
   ========================================================================== */
.grid-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2.5rem 0;
}

.grid-feature[data-layout="right"] {
  direction: rtl;
}

.grid-feature[data-layout="right"] > * {
  direction: ltr;
}

.grid-feature-img img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}

.grid-feature-text h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}


/* ==========================================================================
   12. 全域質感動畫系統 (Premium Motion System)
   ========================================================================== */

:root {
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-smooth: 1s;
}

/* 🟢 1. 獨立大卡片與區塊 */
.profile-card,
.section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-smooth) var(--ease-expo),
              transform var(--duration-smooth) var(--ease-expo);
  will-change: opacity, transform;
}

.profile-card.is-visible,
.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 🟢 2. 網格與列表卡片 (瀑布流依次登場) */
.about-grid > *,
.experience-list > *,
.portfolio-grid > *,
.blog-grid > *,
.blog-list > *,
.portfolio-list > *,
.contact-grid > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-smooth) var(--ease-expo),
              transform var(--duration-smooth) var(--ease-expo),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  will-change: opacity, transform;
}

.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* 🟢 3. 懸浮懸停 (Hover Effects) */
.profile-card,
.info-card,
.exp-card,
.portfolio-card,
.blog-card,
.contact-card {
  transition: transform 0.3s var(--ease-expo),
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              background-color 0.3s ease;
}

.info-card:hover,
.exp-card:hover,
.portfolio-card:hover,
.blog-card:hover,
.contact-card:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: rgba(110, 172, 252, 0.45);
  box-shadow: 0 10px 30px -10px rgba(110, 172, 252, 0.25);
}

/* 打字機閃爍光標 */
.typewriter-text::after {
  content: '|';
  color: var(--color-top);
  font-weight: bold;
  display: inline-block;
  margin-left: 2px;
  animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}


/* ==========================================================================
   13. 響應式 RWD (Responsive Media Queries)
   ========================================================================== */
@media (max-width: 868px) {
  .portfolio-item-horizontal {
    grid-template-columns: 1fr;
  }
  .portfolio-item-horizontal .item-cover {
    height: 200px;
  }
  .blog-item {
    grid-template-columns: 1fr;
  }
  .blog-item-thumb {
    order: -1;
    height: 180px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .profile-card {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
  }
  .section {
    padding: 24px 20px;
  }
  .grid-feature {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

/* ==========================================================================
   文章 Tags & 篩選按鈕無痕切換對齊補丁 (Append to bottom of style.css)
   ========================================================================== */

/* 1. 確保 Tag 與 Filter Pills 兩模式寬高、間距完全無縫對齊 */
.filter-pills.pro-only,
.filter-pills.social-only,
.tag-group.pro-only,
.tag-group.social-only {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 0;
  min-height: 38px;
}

/* 2. 嚴謹的顯隱控制 */
html:not(.social-mode) .filter-pills.social-only,
html:not(.social-mode) .tag-group.social-only {
  display: none !important;
}

html.social-mode .filter-pills.pro-only,
html.social-mode .tag-group.pro-only {
  display: none !important;
}

/* 3. 卡片標籤組結構對齊 */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

/* ==========================================================================
   從 about.astro 移入：修正標題左側裝飾條與文字邊距
   ========================================================================== */

.section-title {
  gap: 16px !important;
}

.section-title::before {
  margin-right: 4px !important;
  flex-shrink: 0 !important;
}