/* ===== 明曜長期照護 全站樣式（v2 — 清淨白底質感版） ===== */

/* 字型改由 knowledge.html 的 <link> 載入（與其他 7 頁相同，含襯線字） */

/* ===== CSS 變數 ===== */
:root {
  /* 2026-11 改版：色彩取自 Logo，與 css/theme.css 的 --mx-* 及其他 7 頁的 Tailwind 設定對應 */
  --primary: #24525a;
  --primary-dark: #1c3a40;
  --primary-light: #36659a;
  --accent: #36659a;
  --accent-dark: #2b5482;
  --accent-light: #b9cbe0;

  --white: #ffffff;
  --bg: #ffffff;
  --bg-light: #faf9f6;
  --bg-soft: #f4f1eb;

  --text-dark: #1d353b;
  --text-mid: #55504a;
  --text-light: #67615a;

  --border: #e2ddd4;
  --border-soft: #f2efe9;

  --shadow-sm: 0 1px 2px rgba(29, 53, 59, 0.05);
  --shadow: 0 1px 3px rgba(29, 53, 59, 0.07);
  --shadow-md: 0 4px 12px -4px rgba(29, 53, 59, 0.10);
  --shadow-hover: 0 10px 24px -8px rgba(29, 53, 59, 0.12);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --transition: 0.25s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', sans-serif;
  color: var(--text-dark);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

ul { list-style: none; }

img {
  max-width: 100%;
  display: block;
}

/* 中文排版：pretty 由 body 繼承到所有文字，避免最後一行只剩一個字；標題用 balance（與其他 7 頁一致） */
body { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

/* ===== 版面容器 ===== */
.container {
  max-width: 1200px;   /* 對齊 theme.css 的 .mx-wrap */
  margin: 0 auto;
  padding: 0 40px;
}

.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-light);
}

/* ===== 標題樣式 ===== */
.section-header {
  text-align: center;
  margin-bottom: 64px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-tag {
  display: inline-block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
  position: relative;
  padding-left: 40px;
}

.section-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.section-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-mid);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.85;
}

.divider {
  display: none;
}

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 151, 167, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-white {
  background: white;
  color: var(--primary);
  border-color: white;
}

.btn-white:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== 導覽列 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;   /* 同其他頁 z-50；須低於 LINE 彈窗遮罩（60），原 1000 會浮在遮罩上 */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
  transition: all var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo img {
  height: 40px;
  width: auto;
}

.navbar-logo-text {
  display: flex;
  flex-direction: column;
}

.navbar-logo-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}

.navbar-logo-sub {
  font-size: 0.75rem;
  color: #6b7280;   /* 與其他 7 頁 text-gray-500 一致 */
  line-height: 1.3333;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 20px;              /* 對齊其他分頁的 gap-5 xl:gap-7（≥1280px 見下方） */
}
@media (min-width: 1280px) { .navbar-nav { gap: 28px; } }
.navbar-nav a { white-space: nowrap; letter-spacing: .1em; }   /* 與其他 7 頁導覽列字距一致；1024px 時不折行 */

.navbar-nav a {
  padding: 6px 0;
  font-size: 0.875rem;    /* 對齊 text-sm */
  font-weight: 500;       /* 對齊 font-medium */
  line-height: 1.4286;    /* 20px，不繼承 body 的 1.75 */
  color: #4b5563;         /* 對齊 text-gray-600 */
  transition: color var(--transition);
  position: relative;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--primary);
}

.navbar-nav a:not(.navbar-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: center;
}

.navbar-nav a:not(.navbar-cta):hover::after,
.navbar-nav a:not(.navbar-cta).active::after {
  transform: scaleX(1);
}

.navbar-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: var(--primary) !important;
  color: white !important;
  font-size: 0.875rem !important;   /* text-sm */
  font-weight: 600 !important;      /* font-semibold */
  line-height: 1.4286 !important;   /* 20px */
  padding: 10px 20px !important;    /* px-5 py-2.5 */
  border-radius: 9999px !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  margin-left: 0;
}

.navbar-cta:hover {
  background: var(--primary-dark) !important;
}

.navbar-cta::after { display: none !important; }

/* 右側動作區：桌機顯示 CTA、行動版顯示漢堡鈕 */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-nav-cta { display: none; }   /* < 768px 才顯示，見導覽列收合區段 */

/* 漢堡選單 */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.navbar-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.navbar-toggle span {
  display: block;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all var(--transition);
}

.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 卡片元件 ===== */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 36px 32px;
  transition: all var(--transition);
}

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

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.8;
}

/* ===== 網格 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ===== 標籤 ===== */
.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-primary {
  background: rgba(42, 90, 158, 0.1);
  color: var(--primary);
}

.badge-accent {
  background: rgba(0, 151, 167, 0.1);
  color: var(--accent);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* ===== 內頁 Hero ===== */
/* 深色漸層 Hero（與其他分頁的 .hero-bg 一致） */
/* 頁面 Hero：已改用 theme.css 的 .mx-page-hero（2026-11 改版） */

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.breadcrumb a { color: var(--text-mid); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }

/* ===== 首頁 Hero（白底大圖風） ===== */
.hero {
  padding: 140px 0 100px;
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-content {
  max-width: 580px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 28px;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-mid);
  line-height: 1.9;
  margin-bottom: 40px;
}

.hero-btns {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.hero-stat .num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}

.hero-stat .label {
  font-size: 0.85rem;
  color: var(--text-mid);
}

.hero-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-light), var(--primary-light));
  box-shadow: var(--shadow-hover);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Hero 浮動小卡 */
.hero-float-card {
  position: absolute;
  bottom: 32px;
  left: -40px;
  background: white;
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 240px;
}

.hero-float-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 151, 167, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.hero-float-title {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 2px;
}

.hero-float-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* ===== 步驟流程 ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
}

.step {
  text-align: center;
  padding: 32px 24px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.step:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: 0 4px 16px rgba(42, 90, 158, 0.25);
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.step-text {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ===== 服務區域卡片 ===== */
.area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.area-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

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

.area-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.area-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.area-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.area-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 2px;
}

.area-districts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.district-tag {
  background: var(--bg-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
}

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead th {
  background: var(--bg-light);
  color: var(--text-dark);
  padding: 18px 24px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 16px 24px;
  font-size: 0.92rem;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border-soft);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-light); }

/* ===== 淡入動畫 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ===== 響應式 ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { max-width: 480px; margin: 0 auto; aspect-ratio: 4 / 3; }
  .hero-float-card { left: 16px; bottom: 16px; }
}

/* ===== 導覽列收合 =====
   < 1024px 收成漢堡選單（同其他 7 頁的 lg 斷點）。原本到 768px 才收，
   769～1023px 時 8 個連結會被擠到逐字折行。
   上限寫 .98：Windows 125% 縮放等情況寬度會帶小數（如 1023.2px），
   寫 1023px 會和其他頁的 min-width:1024px 之間出現兩邊都不套用的縫隙。 */
@media (max-width: 1023.98px) {
  .navbar-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 4px 24px;              /* 同其他頁 px-6 py-1 */
    gap: 0;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--border);
  }
  .navbar-nav.open { display: flex; }
  /* 對齊其他分頁的行動選單：text-sm、py-3、細分隔線，每項 45px 高。
     必須 display:block——行內元素的上下 padding 撐不開高度，原本每項只有 28px */
  .navbar-nav a {
    display: block;
    padding: 12px 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #f9fafb;
  }
  .navbar-nav li:nth-last-child(2) > a { border-bottom: 0; }   /* 最後一個連結（聯絡我們）不加分隔線 */
  .navbar-nav a::after { display: none; }
  .navbar-toggle { display: flex; }
}

/* < 768px：頂列「免費諮詢」收進下拉選單（同其他 7 頁的 md 斷點） */
@media (max-width: 767.98px) {
  .navbar-cta {
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 12px;            /* 同其他頁 mt-2 mb-3 */
    margin-left: 0;
    border-bottom: 0 !important;
  }
  .navbar-cta-top { display: none !important; }
  .navbar-nav-cta { display: block; }
  /* 選單內的諮詢鈕滿版、高 44px（同其他頁 py-3） */
  .navbar-nav-cta .navbar-cta { display: flex !important; padding: 12px 20px !important; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }   /* 對齊 px-6 */
  .section { padding: 72px 0; }
  .section-title { font-size: 1.8rem; }
  .section-header { margin-bottom: 48px; }

  .hero { padding: 110px 0 72px; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-btns { width: 100%; }
  .hero-btns .btn { flex: 1; justify-content: center; }

  .grid-2, .grid-3, .grid-4, .area-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 16px; }

}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.8rem; }
  .card { padding: 28px 24px; }
  .area-card { padding: 24px; }
}

/* ===== 底部固定行動列（僅手機／平板 < 1024px） =====
   刻意與其他 7 頁的 Tailwind 版本逐項對齊：
   高 52px（padding 16px + 行高 20px）、藍 #2a5a9e + 藍綠 #00838f、
   單行不換行 14px/600（寬度 < 360px 縮為 13px）、16px 線條圖示、hover 換底色（非調亮度）。
   ⚠️ 這裡的數值若要改，7 個 Tailwind 頁的底欄要一起改。 */
body { padding-bottom: 52px; }

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;   /* 同其他頁 z-50；須低於 LINE 彈窗遮罩（60） */
  display: flex;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.bottom-bar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  border: none;
  cursor: pointer;
  color: white;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  /* 必須明寫，否則會繼承 body 的 line-height:1.75，高度就跟其他頁對不上 */
  line-height: 1.25rem;
  white-space: nowrap;
  transition: background-color 0.2s;
}

@media (max-width: 359.98px) {
  .bottom-bar-btn { font-size: 13px; gap: 6px; }
}

.bottom-bar-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bottom-bar-btn.bar-family { background: var(--primary); }
.bottom-bar-btn.bar-family:hover { background: #1e4278; color: white; }
.bottom-bar-btn.bar-worker { background: var(--accent); }
.bottom-bar-btn.bar-worker:hover { background: var(--accent-dark); color: white; }

/* 電腦版（≥1024px）改用 js/line-modal.js 的右下角浮動按鈕：底欄與預留空間都收起（同其他頁 lg:hidden） */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .bottom-bar { display: none; }
}
