/* --- 1. 核心變數與基礎設定 --- */
:root {
  --primary: #0b3a6a;     /* 專業深藍 */
  --primary-2: #0ea5a4;   /* 醫療藍綠 */
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --radius: 20px;
  --shadow: 0 12px 30px rgba(11, 58, 106, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 18px; }

/* --- 2. 導航欄 (Nav) --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--primary); text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.nav-links { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.nav-links a { text-decoration: none; color: #1f6788; font-weight: 500; }

/* --- 3. Hero 區塊  --- */
.hero {
  position: relative; overflow: hidden; background: #2d5a88; color: white;
  min-height: 500px; display: flex; align-items: center;filter: brightness(1.05) contrast(1.1) saturate(1.1);
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0.25; filter: brightness(0.6); z-index: 1;
}
.hero-inner {
  font-size: 30px;
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.2fr 0.8fr; /* 左右比例 */
  gap: 40px; align-items: center; padding: 60px 0;
}

/* 主標題樣式 */
.kicker {
    /* 1. 優雅的靈魂：斜體與字間距 */
    font-style: italic;
    letter-spacing: 0.25em;    /* 增加字距，展現大氣感 */
    text-transform: uppercase; /* 維持全大寫，確保專業霸氣 */
    
    /* 2. 霸氣的視覺：字重與顏色 */
    font-weight: 700;          /* 足夠的粗度 */
    color: rgba(255, 255, 255, 0.85); /* 帶點透明的白，增加層次 */
    
    /* 3. 細節修飾 */
    font-size: 24px;
    margin-bottom: 15px;
    display: inline-block;
    
    /* 加入一個小底線增強設計感 */
    border-bottom: 2px solid var(--primary-2);
    padding-bottom: 4px;
    
    /* 讓字體邊緣在藍色背景下更銳利 */
    -webkit-font-smoothing: antialiased;
}
.hero-copy h1 {
    font-size: 46px;
    line-height: 1.4; /* 稍微增加行高，讓縮排視覺更舒適 */
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 第二行縮排 */
.indent-text {
    display: block;      /* 確保 span 換行並可套用邊距 */
    padding-left: 1.2em; /* 往後退約一個字的距離 */
    font-weight: 600;    /* 第二行稍微加細，增加層次感 */
    opacity: 0.95;       /* 稍微調淡，視覺更柔和 */
    color: #f0fdfa;      /* 賦予一個極淡的藍綠色，增加高級感 */
}
.hero-copy .muted { color: rgba(255,255,255,0.85); margin-bottom: 25px; }

/* 信任標籤與 Badge */
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.trust-item { 
  font-size: 16px; padding: 6px 12px; background: rgba(255,255,255,0.15); 
  border-radius: 99px; border: 1px solid rgba(255,255,255,0.25); 
}
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.badge { 
  font-size: 16px; font-weight: 800; padding: 5px 14px; 
  background: var(--primary-2); color: white; border-radius: 6px; 
}

/* 按鈕容器排列 */
.hero-actions {
    display: grid;
    /* 在電腦版平分三列 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px;
    margin-top: 25px;
}

/* 統一按鈕基礎樣式 */
.hero-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap; /* 防止文字換行 */
}

/* 樣式 A：主要掛號 (深色) */
.btn-primary {
    background-color: #2c5282; /* 專業醫療藍 */
    color: white !important;
    border-color: #11b681 !important;
}

/* 樣式 B：Instagram (品牌色邊框) */
.btn-instagram {
    background-color: transparent;
    color: #E1306C !important;
    border-color: #E1306C !important;
}

/* 樣式 C：專治項目 (淡色邊框) */
.btn-ghost {
    background-color: transparent;
    color: #de8c08 !important;
    border-color: #cbd5e0 !important;
}

/* 滑鼠懸停效果 (Hover) */
.btn-primary:hover { background-color: #27b961; }
.btn-instagram:hover { background-color: #E1306C; color: white !important; }
.btn-ghost:hover { background-color: #f7fafc; border-color: #d28b10; }

/* RWD 行動裝置優化：手機版時改為垂直排列或 1 大 2 小 */
@media (max-width: 480px) {
    .hero-actions {
        grid-template-columns: 1fr; /* 全部垂直堆疊 */
    }
}

/* Hero Card 整體容器 */
.hero-card {
    flex: 1;
    max-width: 420px;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

/* 醫師基本資訊 */
.doc {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.doc-photo {
    width: 120px;            /* 1. 稍微放大尺寸，增加視覺清晰度 (原本 90px) */
    height: 120px;
    border-radius: 50%;
    object-fit: cover;       /* 確保圖片不變形 */
    
    /* 2. 關鍵渲染優化 */
    image-rendering: -webkit-optimize-contrast; /* 增加對比渲染，讓照片在視網膜螢幕上更銳利 */
    image-rendering: crisp-edges;
    
    /* 3. 視覺處理：增加輕微對比與飽和，讓氣色更好 */
    filter: contrast(1.05) brightness(0.9); 
    
    /* 4. 裝飾性邊框與陰影 */
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);    /* 加深陰影，增加立體感 */
    border: 4px solid #ffffff;                  /* 加厚白邊，讓頭像更突出 */
    
    /* 防止縮放時產生鋸齒 */
    backface-visibility: hidden;
    transform: translateZ(0); 
}

.doc-name {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
}

.doc-title {
    font-size: 15px;
    color: #3b82f6; /* 醫療藍 */
    font-weight: 600;
}

/* 資歷容器 */
.doc-details {
    margin-top: 20px;
    text-align: left;
    margin-bottom: 20px;
}

.detail-group {
    margin-bottom: 20px;
}

/* 標題小字美化 */
.detail-label {
    font-size: 16px;
    font-weight: 700;
    color: #3b82f6; /* 醫療藍 */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border-left: 3px solid #3b82f6;
    padding-left: 10px;
}

.detail-content.highlight {
    font-size: 1.2rem;   /* 放大字體 */
    font-weight: 800;     /* 加粗 */
    color: var(--primary);/* 使用專業深藍 */
    margin-top: 5px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* 列表樣式調整 */
.doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-list li {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 5px;
}

.doc-list.highlight li {
    font-size: 1.15rem;
    color: #1a202c;
}

/* 專科標籤 (解決一長串文字的凌亂感) */
.cert-tags {
    font-size: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 兩列排列 */
    gap: 10px;
}

.cert-tags span {
    background: #f5c177; opacity: 0.1
    border: 1px solid #e2e8f0;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #454f5e;
    text-align: center;
    white-space: nowrap;
}

/* 國際經歷區塊加強 */
.doc-list b {
    color: #2d3748;
    margin-right: 5px;
}

/* --- 4. 內容區塊 (Section) --- */
.section { padding: 60px 0; }
.section-head { 
  display: flex; justify-content: space-between; align-items: flex-end; 
  margin-bottom: 30px; border-left: 4px solid var(--primary-2); padding-left: 15px; 
}
.section-head h2 { margin: 0; font-size: 26px; color: var(--primary); }

/* 網格系統 */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.card {
  background: white; padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: 0.3s;
  text-decoration: none; color: inherit;
}
.link-card { 
  display: flex; align-items: center; justify-content: center; height: 80px;
  text-align: center; font-weight: 700;
}
.card:hover { transform: translateY(-5px); border-color: var(--primary-2); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }

/* 環境照片 */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; background: #eee; }

/* --- 5. 按鈕 --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 99px; font-weight: 700;
  background: var(--primary); color: white; border: none; transition: 0.3s;
  cursor: pointer; text-decoration: none;
}
.btn.ghost { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.hero .btn.ghost { border-color: white; color: white; }
.btn.small { padding: 6px 14px; font-size: 13px; }

.nav-links .btn{
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(30,41,59,.25);
}

.nav-links .btn:hover{
  background: rgba(14,165,164,.08);
  border-color: var(--primary-2);
  color: var(--primary-2);
}

/* --- 6. 響應式設計 --- */
@media (max-width: 850px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy h1 { font-size: 32px; }
  .hero-cta, .trust-row, .badges { justify-content: center; }
  .nav-links { display: none; } /* 手機版隱藏選單，建議之後加漢堡選單 */
  .gallery { grid-template-columns: 1fr; }
}

.footer { padding: 40px 0; border-top: 1px solid var(--line); text-align: center; background: white; }



/* 管理後台導航與容器 */
.admin-header {
    background: var(--primary);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

/* 專業編輯容器 */
.editor-container {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.input-standard {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 16px;
    transition: 0.3s;
}

.input-standard:focus {
    border-color: var(--primary-2);
    outline: none;
    box-shadow: 0 0 0 4px rgba(14, 165, 164, 0.1);
}

/* 諮詢頁面專用 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.input-standard {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fcfcfc;
    font-size: 16px;
    transition: 0.3s;
    font-family: inherit;
}

.input-standard:focus {
    border-color: var(--primary-2);
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(14, 165, 164, 0.1);
}

textarea.input-standard {
    resize: vertical; /* 只允許垂直拉伸，避免破壞版型 */
}

.contact-info .card h3 {
    margin-top: 0;
    font-size: 18px;
    color: var(--primary);
}

.contact-info p {
    margin: 12px 0;
    font-size: 15px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 讓嵌入影片自適應寬度 */
.list-post-content iframe, 
.post-content iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 限制列表頁影片的高度，避免列表拉得太長（選用） */
.list-post-content {
    max-height: 500px;
    overflow: hidden;
    position: relative;
}

/* 門診資訊 */
.card {
    display: flex;
    flex-direction: column;
    align-items: center; /* 垂直軸置中 */
    justify-content: center; /* 水平軸置中 */
    text-align: center;
}

.schedule-info p {
    font-size: 16px;
    font-weight: 500;
    position: relative;
    padding-bottom: 8px;
}

/* 在手機版讓按鈕稍微寬一點更好按 */
@media (max-width: 480px) {
    .btn-primary {
        width: 100%;
        max-width: 250px;
    }
}

/* 經典網格佈局 */
.treatment-grid {
    display: grid;
    /* 在大螢幕上一排 5 個，平板 2-3 個，手機 2 個 */
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px;
    margin-top: 30px;
}

/* 統一卡片方框樣式 */
.treatment-grid .link-card {
    display: flex;
    align-items: center;      /* 垂直居中 */
    justify-content: center;   /* 水平居中 */
    text-align: center;        /* 文字置中 */
    min-height: 100px;        /* 統一高度，這點最重要！ */
    padding: 15px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    transition: all 0.3s ease;
}

/* 懸停效果 */
.treatment-grid .link-card:hover {
    background: var(--primary);
    color: white !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

/* 響應式調整 */
@media (max-width: 1024px) {
    .treatment-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .treatment-grid { grid-template-columns: repeat(2, 1fr); }
    .treatment-grid .link-card { font-size: 0.9rem; min-height: 80px; }
}


/* 橫向捲動容器 */
.treatment-nav-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px 25px;
    -webkit-overflow-scrolling: touch; /* 手機滑動更順暢 */
}

/* 隱藏捲動條 (可選，視審美而定) */
.treatment-nav-scroll::-webkit-scrollbar {
    height: 6px;
}
.treatment-nav-scroll::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 10px;
}

/* 小卡片樣式 */
.nav-item-card {
    flex: 0 0 auto; /* 防止縮小 */
    padding: 12px 20px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 50px; /* 膠囊狀設計 */
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap; /* 禁止文字換行 */
}

.nav-item-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdfa;
}

/* 當前頁面的高亮效果 */
.nav-item-card.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(14, 165, 164, 0.2);
}


/* treatment 頁面 */
.edu-content-wrapper {
    /* 1. 調整行高：1.8 對於長文稍寬，建議 1.7-1.75 並加上字間距 */
    line-height: 1.75;
    color: #334155;
    /* 2. 增加字間距：中文字稍微撐開 0.02em - 0.05em 會更有呼吸感 */
    letter-spacing: 0.03em;
    /* 3. 使用兩端對齊：讓長篇文章左右邊緣整齊 */
    text-align: justify;
}

/* 針對段落增加垂直間距，避免文字擠成一團 */
.edu-content-wrapper p {
    margin-bottom: 1.5em;
}

.edu-content-wrapper h3 {
    color: var(--primary);
    font-size: 1.6rem; /* 稍微放大一點點 */
    margin: 2em 0 1em; /* 增加上方間距，讓章節區分更明顯 */
    display: flex;
    align-items: center;
    gap: 12px;
    /* 4. 禁止兩端對齊套用到標題 */
    text-align: left;
    font-weight: 700;
}

.edu-content-wrapper h3::before {
    content: "";
    width: 5px; /* 加厚一點點 */
    height: 1.2em; /* 使用 em 讓它跟隨字體高度 */
    background: var(--primary-2);
    display: inline-block;
    border-radius: 4px;
}

/* 並列卡片佈局優化 */
.edu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px; /* 增加間距避免視覺干擾 */
    margin: 40px 0;
}

.edu-card {
    padding: 30px; /* 增加內距，讓內容不貼邊 */
    border-radius: 20px; /* 稍微圓潤一點更有親和力 */
    border: 1px solid transparent;
    height: 100%;
    /* 5. 加上淡淡的陰影增加質感 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    text-align: left; /* 卡片內容不建議兩端對齊 */
}

.edu-card li {
    margin-bottom: 15px; /* 增加列表項目的垂直間距 */
    font-size: 1rem; /* 稍微放大到 1rem 方便年長者閱讀 */
    line-height: 1.6;
}

/* 圖片與圖說優化 */
.edu-figure {
    margin: 2em 0;
    text-align: center;
}
.edu-figure img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}
.edu-figure figcaption {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}


/* 電腦版佈局 */
.contact-layout {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.contact-layout .contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-layout .contact-form-card {
    flex: 1.5;
}

/* 留言諮詢 手機版佈局 (寬度小於 768px 時觸發) */
@media (max-width: 768px) {
    .contact-layout {
        flex-direction: column; /* 改為垂直堆疊 */
    }

    /* 讓表單內的「姓名」與「Email」在手機上也改為上下堆疊 */
    .contact-layout form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* 調整手機版內距，避免太擠 */
    .contact-layout .card {
        padding: 25px !important;
    }

    .contact-layout .btn-primary {
        width: 100%; /* 按鈕在手機上全寬比較好按 */
    }
}


/*後台管理 */
/* 隱形入口樣式 */
.footer-admin-link {
    display: inline-block;
    margin-left: 5px; /* 跟在文字後面一點點 */
}

.footer-admin-link a {
    color: transparent;    /* 完全透明 */
    cursor: default;       /* 滑鼠移上去不會變手指圖標，徹底隱藏 */
    text-decoration: none;
    font-size: 12px;       /* 稍微大一點比較好點到 */
    user-select: none;     /* 防止被反白選中發現 */
}

/* 只有在滑鼠「精準」停在點上面時，才會透出淡淡的灰白色 */
.footer-admin-link a:hover {
    color: rgba(0, 0, 0, 0.1); 
    cursor: pointer;       /* 只有這時候才變手指 */
}


.visitor-counter {
    background: #f1f5f9; /* 淺灰色背景 */
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--line);
}

/* 讓數字跳動一點點動畫感 */
.visitor-counter span:last-child {
    display: inline-block;
    animation: countPulse 2s infinite ease-in-out;
}

@keyframes countPulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}