/*
  使用 CSS 變數統一設計系統 Token，確保全站色彩、邊距與微動畫風格一致。
  選擇暗色與 Glassmorphism 質感基調，突顯數位門牌（Domain Portal）的科技與現代感。
*/
:root {
  --bg-primary: #0b0f19;
  --card-bg: rgba(22, 30, 46, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(99, 102, 241, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  /* 品牌與漸層色調 */
  --accent-blue: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --grad-hero: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #a855f7 100%);
  
  /* 服務狀態指示燈色彩 (Status Badges) */
  --status-active-bg: rgba(16, 185, 129, 0.12);
  --status-active-text: #34d399;
  --status-active-border: rgba(52, 211, 153, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans TC", sans-serif;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.25);
}

/* 基礎重置與 Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 採用 Mobile-First 基礎版型設定 */
html {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: 
    radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    var(--bg-primary);
}

/* 頁首與頁尾容器：調大寬度至 680px 以平衡單張照護卡與雙欄生活連結網格的視覺寬度 */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* 全站膠囊導覽列 (Portal Navigation Bar) */
/* 提供 Work 履歷入口快速切換，維持高顯眼度與極速載入 */
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  color: #ffffff;
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

/* Header 門牌標頭區塊 */
.site-header {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  margin-bottom: 1.25rem;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.brand-domain {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.site-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  font-weight: 400;
}

/* 主內容區 (Main Portal Grid) */
.main-content {
  flex: 1;
  padding: 1.5rem 0 4rem;
}

.services-grid {
  display: flex;
  justify-content: center;
}

/* 單一服務卡片 Focus 佈局 */
.service-card {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease, 
              box-shadow 0.25s ease;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-hero);
  opacity: 0.7;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-hover);
}

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

.card-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.card-icon-wrapper svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-active {
  background: var(--status-active-bg);
  color: var(--status-active-text);
  border-color: var(--status-active-border);
}
.status-active::before { background: var(--status-active-text); }

.card-title-group {
  margin-bottom: 0.85rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

/* 支援英文副標題 (Family Health Log) 輔助顯示，提升品牌識別與視覺層次感 */
.card-subtitle {
  display: inline-block;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.card-domain {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-blue);
  opacity: 0.9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.card-summary {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.card-target-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.card-target-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 0.35rem;
  display: block;
}

.card-target-text {
  font-size: 0.9375rem;
  color: var(--text-main);
  opacity: 0.9;
}

.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.btn-open:hover {
  background: var(--grad-hero);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-open:active {
  transform: scale(0.98);
}

.btn-open svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.btn-open:hover svg {
  transform: translateX(4px);
}

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-subtle);
}

@media (min-width: 640px) {
  .site-header {
    padding: 5rem 0 2.5rem;
  }

  .site-title {
    font-size: 3rem;
  }
}

/* 
  多區塊結構 (Section Blocks & Dividers):
  建立明確的視覺分隔線與燈號，讓正經事 (家健錄 JiaJian Log) 與吃喝玩樂 (雙人舞/音樂) 在同一頁面卻保有清晰的層次感。
*/
.section-block {
  margin-bottom: 3.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 600;
  margin-left: auto;
}

/* 吃喝玩樂連結雙欄網格 (Leisure Cards Responsive Grid) */
.leisure-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 600px) {
  .leisure-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 吃喝玩樂單張 Glassmorphism 卡片設計 */
.leisure-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  overflow: hidden;
}

/* 懸浮微動畫與漸層頂條增加精緻質感 */
.leisure-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-hero);
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.leisure-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-hover);
}

.leisure-card:hover::before {
  opacity: 1;
}

.leisure-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.leisure-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.leisure-icon-wrapper svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* 分類標籤 Badge (使用不同色彩標籤提升辨識度) */
.tag-badge {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
}

.tag-instagram {
  background: rgba(225, 48, 108, 0.12);
  color: #f472b6;
  border: 1px solid rgba(225, 48, 108, 0.3);
}

.tag-gitbook {
  background: rgba(56, 178, 172, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(56, 178, 172, 0.3);
}

.tag-form {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-hashnode {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.leisure-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.leisure-card-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.15rem;
  flex: 1;
}

.btn-leisure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.btn-leisure:hover {
  background: var(--grad-hero);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-leisure svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.btn-leisure:hover svg {
  transform: translateX(3px);
}

