/**
 * CN/IVX 學習中心 — 深色主題可讀性
 * 覆蓋 platform-secondary-nav 淺底 + platform-common 白卡片，修復 text-white/* 不可見
 */
body.ivx-hub-page,
body.ivx-hub-page.platform-dark-hub:has(.platform-subnav):has(.hero-gradient),
body.ivx-hub-page.platform-dark-hub:has(.platform-subnav):has(.hero-grad) {
  background: linear-gradient(135deg, #1a1f3a 0%, #0f1419 50%, #1a1f3a 100%) !important;
  color: #e2e8f0 !important;
}

body.ivx-hub-page::before {
  display: none !important;
}

/* Hero */
body.ivx-hub-page .hero-gradient,
body.ivx-hub-page .hero-grad {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.08) 100%) !important;
  color: #f9fafb !important;
}

body.ivx-hub-page .hero-gradient :is(h1, h2, h3, p),
body.ivx-hub-page .hero-grad :is(h1, h2, h3, p) {
  color: inherit;
}

body.ivx-hub-page .hero-gradient .glow-text,
body.ivx-hub-page .hero-grad .glow-text {
  color: #34d399 !important;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

body.ivx-hub-page .glow-text {
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

/* Main 區標題與正文（深色底 + 淺色字） */
body.ivx-hub-page main .text-white,
body.ivx-hub-page main h1.text-white,
body.ivx-hub-page main h2.text-white,
body.ivx-hub-page main h3.text-white,
body.ivx-hub-page main h4.text-white {
  color: #fff !important;
}

body.ivx-hub-page main [class*="text-white/80"],
body.ivx-hub-page main [class*="text-white/70"],
body.ivx-hub-page main [class*="text-white/60"] {
  color: rgba(255, 255, 255, 0.78) !important;
}

body.ivx-hub-page main .text-emerald-200,
body.ivx-hub-page main [class*="text-emerald-200"] {
  color: #a7f3d0 !important;
}

body.ivx-hub-page main .text-emerald-300,
body.ivx-hub-page main [class*="text-emerald-300"] {
  color: #6ee7b7 !important;
}

body.ivx-hub-page main .text-emerald-400 {
  color: #34d399 !important;
}

/* 卡片：半透明深色（覆蓋 platform-common 白底） */
body.ivx-hub-page .card-tech,
body.ivx-hub-page .tech-card,
body.ivx-hub-page .jdy-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
  box-shadow: none !important;
  color: #e2e8f0 !important;
}

body.ivx-hub-page .card-tech::before,
body.ivx-hub-page .tech-card::before,
body.ivx-hub-page .jdy-card::before {
  display: none !important;
}

body.ivx-hub-page .card-tech:hover,
body.ivx-hub-page .tech-card:hover,
body.ivx-hub-page .jdy-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(16, 185, 129, 0.15) !important;
}

body.ivx-hub-page .card-tech :is(h1, h2, h3, h4, h5, h6),
body.ivx-hub-page .card-tech .text-white,
body.ivx-hub-page .tech-card .text-white,
body.ivx-hub-page .jdy-card .text-white {
  color: #fff !important;
}

body.ivx-hub-page .card-tech [class*="text-white/80"],
body.ivx-hub-page .card-tech [class*="text-white/70"],
body.ivx-hub-page .card-tech [class*="text-white/60"],
body.ivx-hub-page .tech-card [class*="text-white/70"],
body.ivx-hub-page .jdy-card [class*="text-white/70"] {
  color: rgba(255, 255, 255, 0.78) !important;
}

body.ivx-hub-page .card-tech [class*="text-emerald-200"],
body.ivx-hub-page .card-tech [class*="text-emerald-200/80"] {
  color: #a7f3d0 !important;
}

/* 淺灰區塊在 IVX 仍保持深色可讀 */
body.ivx-hub-page section[class*="bg-white/5"],
body.ivx-hub-page section[class*="bg-white/10"] {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.ivx-hub-page .bg-white,
body.ivx-hub-page .bg-gray-50 {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e2e8f0 !important;
}

/* 表格 */
body.ivx-hub-page table thead[class*="bg-emerald"] {
  color: #fff !important;
}

body.ivx-hub-page tbody[class*="text-white"],
body.ivx-hub-page tbody [class*="text-white/80"] {
  color: rgba(255, 255, 255, 0.85) !important;
}

body.ivx-hub-page tbody tr {
  border-color: rgba(16, 185, 129, 0.15);
}

/* 頂欄導航保持深色字（白底頂欄） */
header#navbar nav a,
header#navbar nav .dropbtn {
  color: #1d2129 !important;
  font-weight: 600 !important;
  -webkit-text-fill-color: currentColor !important;
}

@media (max-width: 767px) {
  body.ivx-hub-page main p,
  body.ivx-hub-page main li {
    color: rgba(255, 255, 255, 0.82) !important;
  }
}
