/* =====================================================
   RESET & BASE
===================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.6;
  color: #2f3e34;

  background-image: url("../assets/images/hero-medical-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: #f7faf8;

  padding-top: 80px;
}

/* =====================================================
   COLOR VARIABLES
===================================================== */
:root {
  /* =====================
     PURPLE – 主視覺
  ===================== */
  --purple-main: #5B3F8C;     /* 主紫：標題 / 主CTA */
  --purple-dark: #432C6D;     /* 深紫：Header / 強調 */
  --purple-light: #EEE9F6;    /* 淡紫：Hover / 區塊 */

  /* =====================
     GREEN – 醫療輔色
  ===================== */
  --green-main: #2E8B6D;      /* Icon / Link */
  --green-dark: #1F5E4A;      /* Footer / 深文字 */
  --green-light: #E6F4EE;     /* Badge / 卡片 */

  --gray-light: #F2F3F5;
}


/* =====================================================
   CONTAINER
===================================================== */
.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
}

/* =====================================================
   HEADER
===================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  border-bottom: 3px solid var(--purple-main);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-transparent {
  background: transparent;
}


/* =====================================================
   HEADER – PURPLE GLASS
===================================================== */
.header-glass {
  background: rgba(238, 233, 246, 0.85); /* 淡紫霧感 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 8px 26px rgba(67, 44, 109, 0.18);
  border-bottom: 1px solid rgba(91, 63, 140, 0.25);
}


.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

/* =====================================================
   SITE BRAND
===================================================== */
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  height: 42px;
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.title-main {
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(
    110deg,
    #2F1B4F 0%,   /* 極深紫：學術底蘊 */
    #432C6D 30%,  /* 深紫 */
    #5B3F8C 55%,  /* 主紫 */
    #7A64B8 75%,  /* 淡紫提亮 */
    #5B3F8C 100%  /* 收回主紫，穩住 */
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-sub {
  font-size: 0.75rem;
  color: #19221f;
}

/* Header shrink */
.header-glass .site-logo {
  height: 32px;
}

.header-glass .title-main {
  font-size: 0.9rem;
}

.header-glass .title-sub {
  font-size: 0.65rem;
}

/* =====================================================
   HERO – Highlight Title
===================================================== */

.hero-highlight {
  font-weight: 900;
  background: linear-gradient(
    110deg,
    #0f5c4c 0%,
    #2fa36b 40%,
    #c9a24d 50%,  /* 淡金，醫學質感 */
    #2fa36b 60%,
    #1f6f4a 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}



/* =====================================================
   NAVIGATION
===================================================== */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.main-nav a {
  text-decoration: none;
  color: #444;
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--green-main);
}

.menu-toggle {
  display: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--green-dark);
}

/* =====================================================
   HERO
===================================================== */
.hero-inner {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 40px 45px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   SECTIONS
===================================================== */
.section {
  padding: 70px 0;
}

/* 👉 內容區塊玻璃卡（恢復版） */
.section-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   NEWS ACCORDION (ENHANCED)
===================================================== */
.news-item {
  padding: 20px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background-color 0.3s ease;
  border-radius: 8px; /* 增加輕微圓角，懸停時較美觀 */
}

/* 懸停效果：讓使用者明確知道可點擊 */
.news-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.news-header {
  display: grid;
  grid-template-columns: 100px 1fr 30px; /* 固定寬度讓視覺整齊 */
  gap: 16px;
  cursor: pointer;
  align-items: center; /* 改為置中對齊較專業 */
}

.news-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.news-date {
  font-size: 0.9rem;
  color: #666;
  font-family: 'Inter', sans-serif; /* 建議使用等寬感較強的字體 */
  font-weight: 500;
}

.news-tag {
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 4px; /* 改為微圓角更有質感 */
  font-weight: 600;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 標籤配色優化 */
.news-tag.new {
  background: #EEE9F6;
  color: #5B3F8C;
  border: 1px solid rgba(91, 63, 140, 0.35);
}

.news-tag.important {
  background: #F3E8F1;
  color: #7A2E5C;
  border: 1px solid rgba(122, 46, 92, 0.35);
}

.news-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #222;
  line-height: 1.5;
  transition: color 0.3s ease;
}

.news-item:hover .news-title {
  color: #0056b3; /* 懸停時標題變藍 */
}

.news-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  background: #f0f0f0;
  border-radius: 50%; /* 圓形按鈕感 */
  font-size: 0.8rem;
  color: #888;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-item.open .news-toggle {
  background: #333;
  color: #fff;
  transform: rotate(135deg); /* 順暢旋轉成 X 或調整角度 */
}

/* 內容區塊優化 */
.news-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0, 1, 0, 1); /* 動畫更自然的技巧 */
  padding-left: 116px; /* 與標題對齊 */
  color: #444;
  line-height: 1.8;
  font-size: 0.98rem;
}

.news-item.open .news-body {
  max-height: 1000px; /* 給予足夠高度 */
  margin-top: 15px;
  padding-bottom: 10px;
  transition: max-height 0.5s ease-in;
}

/* 響應式微調 */
@media (max-width: 600px) {
  .news-header {
    grid-template-columns: 1fr auto; /* 手機版日期與標題並列 */
  }
  
  .news-meta {
    flex-direction: row;
    align-items: center;
    grid-column: 1 / -1; /* 日期標籤佔據整排 */
    margin-bottom: 4px;
  }
  
  .news-body {
    padding-left: 0; /* 手機版取消縮進，節省空間 */
  }
}
/* ===============================
   🟣 Certificate Status Banner
================================ */
.cert-banner {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 16px 20px;
  border-radius: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.6;
}

.cert-banner.open {
  background: linear-gradient(135deg, #6b5bd6, #8b7cf2);
  color: #fff;
  box-shadow: 0 12px 30px rgba(107, 91, 214, 0.35);
}

.cert-banner.closed {
  background: #f5f6fa;
  color: #555;
  border: 1px dashed #c7c9e5;
}

.cert-banner i {
  font-size: 1.3rem;
  margin-top: 2px;
}
/* ===============================
   🔐 Locked State
================================ */
.cert-locked {
  text-align: center;
  padding: 48px 24px;
  color: #666;
}

.cert-locked i {
  font-size: 2.5rem;
  color: #b0b3d6;
  margin-bottom: 16px;
}

.cert-locked h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #444;
}

.cert-locked p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =====================================================
   Conference Access – Glass & Status
===================================================== */

.access-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* 狀態標籤 */
.status-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-badge.upcoming {
  background: #e6f4ee;
  color: #1f6f4a;
}

.status-badge.live {
  background: #e53935;
  color: #fff;
}

.status-badge.ended {
  background: #ccc;
  color: #555;
}

/* 區塊本體 */
.access-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 24px;
}

.access-item {
  text-align: center;
  padding: 20px 16px;
  position: relative;
}

.access-item i {
  font-size: 2.2rem;
  color: var(--green-main);
  margin-bottom: 10px;
}

/* LIVE badge */
.live-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #e53935;
  color: #fff;
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  display: none;
}

/* YouTube 強調 */
.access-item.warning i {
  color: #cc0000;
}

.live-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  text-decoration: underline;
  color: #cc0000;
}

/* Mobile */
@media (max-width: 768px) {
  .access-grid {
    grid-template-columns: 1fr;
  }

  .access-header {
    flex-direction: column;
    gap: 8px;
  }
}

/* =====================================================
   FOOTER – CLEAN & FORMAL (維持決策)
===================================================== */
.site-footer {
  background: rgba(244, 247, 246, 0.88);
  color: hsl(140, 14%, 21%);
  padding: 48px 20px 28px;
  border-top: 1px solid #e0e6e3;
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.site-footer h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1f6f4a;
}

.site-footer p {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 6px;
}

.site-footer .en {
  display: block;
  font-size: 0.78rem;
  color: #5c7f73;
}

.site-footer a {
  color: #1f6f4a;
  text-decoration: underline;
}

.footer-copy {
  margin-top: 26px;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7f77;
}

/* =====================================================
   RESPONSIVE – MOBILE
===================================================== */
@media (max-width: 768px) {

  body {
    padding-top: 64px;
  }

  .header-inner {
    padding: 12px 16px;
  }

  .menu-toggle {
    display: block;
  }

  .title-main {
    background: none !important;
    -webkit-text-fill-color: var(--green-dark) !important;
    color: var(--green-dark) !important;
    font-size: 0.9rem;
  }

  .title-sub {
    display: none;
  }

  .site-logo {
    height: 34px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .section {
    padding: 40px 0;
  }

  .section-card {
    padding: 32px 26px;
  }

  .news-body {
    padding-left: 0;
  }

  .site-footer .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
}
/* =====================================================
   LOGO GRID – SIZE CONTROL (HOMEPAGE)
===================================================== */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: center;
  gap: 40px;
}

.logo-grid img {
  max-height: 90px;        /* 🔑 關鍵：限制高度 */
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
@media (max-width: 768px) {
  .logo-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .logo-grid img {
    max-height: 70px;
  }
}
/* =====================================================
   COUNTDOWN TIMER – FIXED
===================================================== */
.countdown {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.time-box {
  background: rgba(216, 215, 235, 0.9);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 90px;
  text-align: center;
}

.time-box span {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #243d34;
  line-height: 1.2;
}

.time-box small {
  display: block;
  font-size: 0.75rem;
  margin-top: 4px;
  color: #577067;
  letter-spacing: 0.5px;
}
@media (max-width: 768px) {
  .countdown {
    justify-content: center;
  }

  .time-box {
    min-width: 80px;
    padding: 12px 14px;
  }

  .time-box span {
    font-size: 1.25rem;
  }
}
/* =====================================================
   BUTTONS
===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  border: none;
  cursor: pointer;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;

  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Hover 微浮起 */
.btn:hover {
  transform: translateY(-2px);
}

/* Active 回饋 */
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* =========================
   Primary（主行動）
   ========================= */
/* =========================
   Primary Button – Purple CTA
   ========================= */
.btn-primary {
  background: linear-gradient(
    180deg,
    #6A4BA3 0%,
    #5B3F8C 100%
  );
  color: #ffffff;

  box-shadow:
    inset 0 -10px 16px rgba(67, 44, 109, 0.35),
    0 10px 22px rgba(91, 63, 140, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(
    180deg,
    #7354AD 0%,
    #5F4394 100%
  );

  box-shadow:
    inset 0 -8px 14px rgba(67, 44, 109, 0.45),
    0 14px 28px rgba(91, 63, 140, 0.45);
}


/* =========================
   Secondary（次要行動）
   ========================= */
.btn-secondary {
  background: #ffffff;
  color: var(--green-main);
  border: 2px solid var(--green-main);

  box-shadow:
    inset 0 -8px 12px rgba(0, 0, 0, 0.05),
    0 6px 14px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
  background: var(--green-light);
  color: #ffffff;

  box-shadow:
    inset 0 -6px 10px rgba(0, 0, 0, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.12);
}

/* =====================================================
   Conference Access – Outline Buttons (FINAL)
===================================================== */

/* 共用：改為框線按鈕 */
.btn-traffic,
.btn-youtube {
  background: transparent !important;
  border: 2px solid;
  box-shadow: none;
  font-weight: 600;
}

/* 交通指引（綠） */
.btn-traffic {
  border-color: #1f6f4a;
  color: #1f6f4a;
}

.btn-traffic i {
  color: #1f6f4a;
}

/* YouTube（紅） */
.btn-youtube {
  border-color: #cc0000;
  color: #cc0000;
}

.btn-youtube i {
  color: #cc0000;
}

/* Hover：才輕微填色 */
.btn-traffic:hover {
  background: rgba(31, 111, 74, 0.08);
}

.btn-youtube:hover {
  background: rgba(204, 0, 0, 0.08);
}


/* =====================================================
   MOBILE FULLSCREEN SLIDE MENU
===================================================== */
@media (max-width: 768px) {

  /* 避免 header 影響 fixed 定位 */
  .header-transparent,
  .header-inner {
    transform: none !important;
  }

  /* 導覽選單（真正全螢幕） */
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh; /* 比 100vh 穩定（手機） */

    z-index: 2000;

    background: rgba(238, 233, 246, 0.96); /* 淡紫霧 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    display: flex;
    justify-content: center;
    align-items: center;

    transform: translateX(100%);
    opacity: 0;

    transition:
      transform 0.45s cubic-bezier(.4,0,.2,1),
      opacity 0.35s ease;
  }

  .main-nav.active {
    transform: translateX(0);
    opacity: 1;
  }

  /* X 按鈕 */
  .menu-close {
    position: fixed; /* ⚠️ 關鍵：不是 absolute */
    top: 16px;
    right: 16px;
    z-index: 2100;

    background: none;
    border: none;
    font-size: 1.6rem;
  }

  /* 選單列表 */
  .main-nav ul {
    display: flex;
    flex-direction: column;
    gap: 28px;
    text-align: center;
  }

  /* 背景遮罩 */
  .nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;

    background: rgba(67, 44, 109, 0.45);
    z-index: 1500;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .nav-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }
}
/* =====================================================
   MENU CLOSE BUTTON VISIBILITY
===================================================== */

/* 桌機版：隱藏 X 且精緻版*/
.menu-close {
  display: none;
}
@media (min-width: 769px) {

  .main-nav ul {
    display: flex;
    align-items: center;
    gap: 32px;
  }

  .main-nav a {
    position: relative;
    padding: 6px 2px;
    font-weight: 500;
    color: #1f3d2b; /* 深醫療綠 */
    text-decoration: none;
    transition: color 0.25s ease;
  }
}
@media (min-width: 769px) {

  .main-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;

    width: 0;
    height: 2px;
    background: linear-gradient(
      90deg,
    #5B3F8C,   /* 主紫 */
    #7A64B8    /* 淡紫 */
    );

    transition:
      width 0.3s ease,
      left 0.3s ease;
  }

  .main-nav a:hover {
    color: #5B3F8C; /* Hover 主紫 */
  }

  .main-nav a:hover::after {
    width: 100%;
    left: 0;
  }
}

/* 手機版：顯示 X */
@media (max-width: 768px) {
  .menu-close {
    display: block;
  }
}

/* =========================
   Language Switch - Pill Style
========================= */

.lang-switch {
  display: flex;
  align-items: center;
  margin-left: 24px;
}

/* 桌機位置 */
@media (min-width: 992px) {
  .lang-switch {
    margin-left: 32px;
  }
}

/* 手機：側滑選單底部 */
@media (max-width: 991px) {
  .lang-switch {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: center;
  }
}

/* Pill 按鈕本體 */
.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 14px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;

  color: var(--purple-dark);
  background: rgba(238, 233, 246, 0.8);
  border: 1px solid rgba(91, 63, 140, 0.35);

  text-decoration: none;
  white-space: nowrap;

  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

/* Hover（桌機） */
@media (hover: hover) {
  .lang-pill:hover {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(91, 63, 140, 0.25);
    transform: translateY(-1px);
  }
}

/* Active / tap feedback（手機） */
.lang-pill:active {
  transform: scale(0.96);
}
/* =========================
   Header Language Position Fix (Desktop)
========================= */

/* 讓導覽列變成水平排列 */
@media (min-width: 992px) {
  .main-nav {
    display: flex;
    align-items: center;
  }

  /* 導覽選單在左 */
  .main-nav .nav-links {
    display: flex;
    gap: 32px;
  }

  /* 語言切換推到最右 */
  .main-nav .lang-switch {
    margin-left: auto;
  }
}


