/* ============================================================
   VHCT 智慧報告系統 — 共用樣式
   沿用「深呼吸．好睡眠」首頁的鼠尾草綠 / 米白日式美學
   套用於既有報告頁(表格 / 輸入框 / 計算結果),不更動其 JS 邏輯
   ============================================================ */

:root {
  --bg: #f8f5ef;
  --bg-soft: #fffdf8;
  --paper: rgba(255, 252, 246, 0.92);
  --text: #2d3a36;
  --muted: #65746d;
  --primary: #6f9c95;
  --primary-deep: #4f726d;
  --accent: #d9be8f;
  --line: rgba(111, 156, 149, 0.22);
  --shadow: 0 20px 60px rgba(98, 115, 109, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans TC", -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.7;
  background:
    radial-gradient(circle at top left, rgba(220, 235, 229, 0.95), transparent 32%),
    radial-gradient(circle at right center, rgba(240, 225, 196, 0.45), transparent 24%),
    linear-gradient(180deg, #fcfbf8 0%, #f6f2ea 100%);
  background-attachment: fixed;
}

/* ---------- 頁首導覽列 ---------- */
.vhct-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 251, 248, 0.85);
  border-bottom: 1px solid rgba(111, 156, 149, 0.14);
  backdrop-filter: blur(12px);
}

.vhct-nav {
  width: min(calc(100% - 32px), 1080px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.vhct-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.vhct-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7ea8a1, #d8c090);
  color: #fff;
  font-family: "Noto Serif TC", serif;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px rgba(111, 156, 149, 0.26);
}

.vhct-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.vhct-brand-text strong { font-family: "Noto Serif TC", serif; font-size: 1.02rem; }
.vhct-brand-text small { color: var(--muted); font-size: 0.8rem; }

.vhct-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vhct-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: 0.2s ease;
}

.vhct-links a:hover { background: rgba(111, 156, 149, 0.12); }

.vhct-links a.vhct-home {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(79, 114, 109, 0.22);
}
.vhct-links a.vhct-home:hover { transform: translateY(-1px); }

/* ---------- 內容容器 ---------- */
.vhct-shell { padding: 40px 16px 64px; }

.vhct-main {
  width: min(100%, 880px);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 44px clamp(20px, 5vw, 56px);
}

/* 標題與既有 80% 標題列表格 */
.vhct-main h1 {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  color: #24322f;
  text-align: center;
  line-height: 1.35;
  margin: 0 0 6px;
}

/* 報告頁頂端用來放標題與更新日期的無框表格 */
.vhct-main > table[width="80%"] { width: 100%; margin: 0 auto 8px; }
.vhct-main > table[width="80%"] td { border: none; background: none; padding: 2px 8px; }
.vhct-main > table[width="80%"] td[width="34%"] {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  vertical-align: bottom;
  white-space: nowrap;
}

/* 段落 / 區塊小標(Patient Info、Results 等) */
.vhct-main > p,
.vhct-main > div > p {
  color: var(--primary-deep);
  font-weight: 600;
  margin: 26px 0 10px;
}

/* ---------- 資料表格 ---------- */
.vhct-main table {
  border-collapse: collapse;
  margin: 0 auto 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
  max-width: 640px;
}

.vhct-main table[border] td,
.vhct-main table[border] th {
  border: 1px solid var(--line);
}

.vhct-main td,
.vhct-main th {
  padding: 10px 14px;
  font-size: 0.95rem;
  vertical-align: middle;
}

.vhct-main th,
.vhct-main td[bgcolor] {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)) !important;
  color: #fff !important;
  font-weight: 600;
}

/* 表頭列(藍底)改為品牌色 */
.vhct-main tr[bgcolor] td {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ---------- 表單元件 ---------- */
.vhct-main input[type="text"],
.vhct-main input:not([type]),
.vhct-main input[type="number"],
.vhct-main select {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: 0.2s ease;
}

.vhct-main input:focus,
.vhct-main select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(111, 156, 149, 0.18);
}

.vhct-main input[type="radio"],
.vhct-main input[type="checkbox"] {
  accent-color: var(--primary);
  transform: scale(1.15);
  margin: 0 4px;
}

.vhct-main label { cursor: pointer; }

/* 送出按鈕 */
.vhct-main input[type="submit"],
.vhct-main input[type="button"],
.vhct-main button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: none;
  color: #fff;
  padding: 12px 30px;
  margin: 6px 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 14px 30px rgba(79, 114, 109, 0.22);
  transition: 0.25s ease;
}

.vhct-main input[type="submit"]:hover,
.vhct-main input[type="button"]:hover,
.vhct-main button:hover { transform: translateY(-2px); }

/* 結果輸出框 */
.vhct-main textarea {
  font-family: "Menlo", "Consolas", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  width: 100%;
  max-width: 640px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffdf8;
  color: var(--text);
  box-shadow: inset 0 2px 6px rgba(98, 115, 109, 0.06);
  resize: vertical;
}

.vhct-main textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(111, 156, 149, 0.18);
}

/* 參考文獻 / 版本紀錄(內容末段的小字) */
.vhct-main a { color: var(--primary-deep); }

.vhct-ref,
.vhct-main > p:last-of-type {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- 頁尾 ---------- */
.vhct-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 28px 16px 44px;
}
.vhct-footer p { margin: 4px 0; }

/* ---------- 報告總覽首頁(index)專用 ---------- */
.vhct-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}
.vhct-hero .eyebrow {
  color: var(--primary-deep);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 10px;
}
.vhct-hero h1 {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  color: #24322f;
  margin: 0 0 14px;
}
.vhct-hero p { color: var(--muted); margin: 0; }

.vhct-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  width: min(calc(100% - 32px), 1080px);
  margin: 0 auto;
}

.vhct-cat {
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(111, 156, 149, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}

.vhct-cat h2 {
  font-family: "Noto Serif TC", serif;
  font-size: 1.15rem;
  color: var(--primary-deep);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vhct-cat h2 .ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(111,156,149,0.18), rgba(217,190,143,0.28));
  font-size: 0.95rem;
}

.vhct-cat ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vhct-cat li a {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(111, 156, 149, 0.1);
  transition: 0.2s ease;
}
.vhct-cat li a:hover {
  background: linear-gradient(135deg, rgba(111,156,149,0.14), rgba(217,190,143,0.18));
  transform: translateX(3px);
  border-color: var(--primary);
}
.vhct-cat li a .en { color: var(--muted); font-size: 0.82rem; }

/* ---------- 子網站(Bronchoscopy / ChestSono / PFT)相容覆寫 ----------
   這些舊頁面原本使用 Dreamweaver 深色模板與 .container/.content 等 class,
   移除其 <style> 後,以下規則確保內容在新版容器內自然呈現。 */
.vhct-main .container,
.vhct-main .content {
  width: auto !important;
  max-width: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--text) !important;
}

.vhct-main img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 6px 0;
}

.vhct-main h2,
.vhct-main h3,
.vhct-main h4 {
  font-family: "Noto Serif TC", serif;
  color: var(--primary-deep);
  line-height: 1.35;
}
.vhct-main h2 { font-size: 1.25rem; margin: 26px 0 12px; }
.vhct-main h3 { font-size: 1.08rem; margin: 22px 0 10px; }

.vhct-main ul,
.vhct-main ol { padding-left: 22px; margin: 10px 0; }
.vhct-main li { margin: 4px 0; }

/* 舊版連結色與底線覆寫 */
.vhct-main a:link,
.vhct-main a:visited { color: var(--primary-deep); text-decoration: none; }
.vhct-main a:hover { text-decoration: underline; }

/* 舊版浮動工具 class 維持可用,但避免溢出 */
.vhct-main .fltrt { float: right; margin-left: 12px; }
.vhct-main .fltlft { float: left; margin-right: 12px; }
.vhct-main .clearfloat { clear: both; height: 0; font-size: 1px; line-height: 0; }

/* ---------- RWD ---------- */
@media (max-width: 640px) {
  .vhct-main { padding: 28px 18px; }
  .vhct-brand-text small { display: none; }
  .vhct-main table { font-size: 0.88rem; }
}
