/* ============================================================
   暖心診所 —— 全站樣式表
   台灣地區診所風格：清新、溫暖、專業、乾淨
   後期換模板 : 只需修改本檔即可改變全站視覺
   ============================================================ */

:root {
  --primary: #2a8c7f;        /* 主色：醫療綠 */
  --primary-dark: #1f6e64;
  --primary-light: #e6f4f1;
  --accent: #e08a5b;         /* 強調色：暖橙 */
  --text: #2c3e42;
  --text-muted: #6b7c80;
  --bg: #ffffff;
  --bg-soft: #f6faf9;
  --border: #e2ebe9;
  --shadow: 0 8px 30px rgba(31, 110, 100, 0.08);
  --radius: 14px;
  --max-width: 1140px;
  --header-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: min(var(--max-width), 92%); margin: 0 auto; }

/* ---------- 頂部資訊列 ---------- */
.topbar { background: var(--primary-dark); color: #fff; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.topbar-hours { opacity: 0.9; }

/* ---------- 導覽列 ---------- */
.site-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: bold;
  box-shadow: 0 4px 12px rgba(42,140,127,0.3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 20px; letter-spacing: 1px; }
.brand-text small { font-size: 10px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 10px 14px; border-radius: 8px; color: var(--text); font-size: 15px; font-weight: 500;
  transition: all .2s;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav-link.active { color: var(--primary); font-weight: 700; }
.nav-link.nav-cta {
  background: var(--primary); color: #fff; margin-left: 8px; padding: 10px 20px; border-radius: 24px;
}
.nav-link.nav-cta:hover { background: var(--primary-dark); color: #fff; }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--primary-dark); cursor: pointer; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 30px; font-size: 15px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #c9754a; color: #fff; }
.btn-block { width: 100%; }

/* ---------- 通用區段 ---------- */
.section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: 32px; color: var(--text); margin-bottom: 10px; position: relative; display: inline-block; }
.section-head h2::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -12px;
  width: 56px; height: 3px; background: var(--accent); border-radius: 2px;
}
.section-head p { color: var(--text-muted); margin-top: 20px; font-size: 16px; }
.section-head .eyebrow { color: var(--primary); font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

.lead { font-size: 17px; color: var(--text-muted); max-width: 760px; margin: 0 auto; }

/* ---------- Hero 首頁（真實照片輪播） ---------- */
.hero { position: relative; min-height: 480px; display: flex; align-items: center; overflow: hidden; background: #1f6e64; }
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18,52,50,0.88) 0%, rgba(18,52,50,0.62) 45%, rgba(18,52,50,0.25) 100%);
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; padding: 70px 0; }
.hero-main { color: #fff; }
.hero-badge { display: inline-block; background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.35); padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; margin-bottom: 18px; }
.hero h1 { font-size: 44px; line-height: 1.3; color: #fff; margin-bottom: 18px; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.hero h1 span { color: #a8e6da; }
.hero p.hero-sub { font-size: 18px; color: rgba(255,255,255,0.9); margin-bottom: 28px; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions .btn-outline { border-color: #fff; color: #fff; }
.hero-actions .btn-outline:hover { background: #fff; color: var(--primary-dark); }
.hero-dots { display: flex; gap: 8px; margin-top: 28px; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: all .2s; }
.hero-dot.active { background: #fff; width: 26px; border-radius: 6px; }
.hero-card {
  background: #fff; border-radius: 20px; padding: 34px; box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}
.hero-card h3 { color: var(--primary-dark); margin-bottom: 16px; font-size: 20px; }
.hero-card .info-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.hero-card .info-row:last-child { border-bottom: none; }
.hero-card .info-row .ico { color: var(--primary); font-size: 18px; min-width: 24px; }

/* ---------- 服務卡片 ---------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; transition: all .25s; box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--primary-light); }
.card-icon { font-size: 38px; margin-bottom: 14px; }
.card h3 { font-size: 19px; margin-bottom: 10px; color: var(--text); }
.card p { color: var(--text-muted); font-size: 15px; }

/* ---------- 醫師卡片 ---------- */
.doctor-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: all .25s; }
.doctor-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.doctor-photo { height: 240px; background: linear-gradient(135deg, #dceee9, #eef6f3); display: grid; place-items: center; }
.doctor-photo img { width: 100%; height: 100%; object-fit: cover; }
.doctor-photo .ph { font-size: 64px; color: var(--primary-light); }
.doctor-body { padding: 22px; }
.doctor-body h3 { font-size: 19px; margin-bottom: 4px; }
.doctor-body .title { color: var(--primary); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.doctor-body .specialty { color: var(--text-muted); font-size: 14px; }
.doctor-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { background: var(--primary-light); color: var(--primary-dark); font-size: 12px; padding: 3px 10px; border-radius: 12px; }

/* ---------- 文章卡片 ---------- */
.article-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .25s; display: flex; flex-direction: column; }
.article-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.article-cover { height: 170px; background: linear-gradient(135deg, var(--primary-light), #f0f7f5); display: grid; place-items: center; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover .ph { font-size: 44px; color: var(--primary); opacity: 0.5; }
.article-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.article-meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.article-cat { background: var(--accent); color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 11px; }
.article-body h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.5; }
.article-body h3 a { color: var(--text); }
.article-body h3 a:hover { color: var(--primary); }
.article-body p { color: var(--text-muted); font-size: 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-foot { margin-top: 14px; font-size: 12px; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 10px; }
.badge-featured { background: #fdf0e8; color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 10px; }

/* ---------- 文章詳情 ---------- */
.article-view { max-width: 820px; margin: 0 auto; }
.crumb { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.crumb a { color: var(--text-muted); }
.article-view h1 { font-size: 32px; line-height: 1.4; margin-bottom: 14px; }
.article-view .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-content { font-size: 16px; line-height: 1.9; }
.article-content h2 { font-size: 22px; margin: 30px 0 14px; color: var(--primary-dark); }
.article-content h3 { font-size: 18px; margin: 24px 0 10px; }
.article-content p { margin-bottom: 16px; }
.article-content ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.article-content img { border-radius: var(--radius); margin: 16px 0; }

/* ---------- 表格：門診時間 ---------- */
.schedule-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.schedule-table th { background: var(--primary); color: #fff; padding: 14px; font-weight: 600; text-align: left; }
.schedule-table td { padding: 14px; border-bottom: 1px solid var(--border); }
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table tr:hover td { background: var(--bg-soft); }
.day-badge { display: inline-block; background: var(--primary-light); color: var(--primary-dark); padding: 3px 12px; border-radius: 8px; font-weight: 600; }

/* ---------- 常見問題 ---------- */
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.faq-q { padding: 18px 22px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: "+"; color: var(--primary); font-size: 20px; }
.faq-item.open .faq-q::after { content: "−"; }
.faq-a { padding: 0 22px; max-height: 0; overflow: hidden; transition: max-height .3s, padding .3s; color: var(--text-muted); }
.faq-item.open .faq-a { max-height: 400px; padding: 0 22px 18px; }

/* ---------- 表單 ---------- */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; max-width: 760px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--text); }
.form-group label .req { color: var(--accent); }
.form-control {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
  font-family: inherit; transition: border-color .2s; width: 100%; background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-note { font-size: 13px; color: var(--text-muted); grid-column: 1 / -1; }
.form-message { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; display: none; }
.form-message.success { display: block; background: var(--primary-light); color: var(--primary-dark); }
.form-message.error { display: block; background: #fdecea; color: #c0392b; }

/* ---------- 分頁 ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination button { padding: 8px 16px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 篩選標籤 ---------- */
.filter-tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-tab { padding: 8px 20px; border-radius: 22px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 14px; color: var(--text-muted); transition: all .2s; }
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 頁尾 ---------- */
.site-footer { background: #1f3a3a; color: #cfe0dd; padding: 54px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 16px; }
.footer-col p { font-size: 14px; margin-bottom: 10px; line-height: 1.9; }
.footer-col a { color: #cfe0dd; }
.footer-col a:hover { color: #fff; }
.footer-brand { font-size: 20px; color: #fff; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand .brand-mark { width: 34px; height: 34px; font-size: 18px; }
.footer-slogan { color: var(--accent); font-size: 15px; margin-bottom: 12px; }
.footer-note { font-size: 12px; color: #8fa8a5; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 18px 0; text-align: center; font-size: 12px; color: #8fa8a5; }

/* ---------- 載入中 / 空狀態 ---------- */
.loading { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty .ico { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ---------- 內頁橫幅 ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 50px 0; text-align: center;
}
.page-hero h1 { font-size: 34px; margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 16px; }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: #fff; padding: 12px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .section { padding: 48px 0; }
  .section-head h2 { font-size: 26px; }
  .topbar-hours { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px; }
}
