/* info 模組共用樣式表 (符合無障礙 AA、響應式 RWD 與嚴格 CSP) */

body {
  margin: 0;
  padding: 0;
  background-color: #999;
}

#h1 {
  font-family: "微軟正黑體", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.375rem;
  font-weight: bold;
  color: #58207D;
  text-align: left;
}

.c1 {
  list-style-type: disc;
  font-family: "微軟正黑體", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  font-weight: bold;
  color: #CC0000;
  line-height: 1.5;
  text-align: left;
}

.c2 {
  list-style-type: disc;
  font-family: "微軟正黑體", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  color: #000000;
  line-height: 1.5;
}

.text {
  font-size: 0.9375rem;
  font-family: "微軟正黑體", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #000000;
  line-height: 1.8;
}

a.text:link,
a.text:visited {
  color: #4A4A9C;
}

a.text:hover,
a.text:focus {
  color: #2A2A7C;
}

.text_color {
  font-size: 1rem;
  font-family: "微軟正黑體", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #CC0000;
  line-height: 1.8;
  font-weight: bold;
}

/* 考試日期特別字型 (a4.php) */
.exam-date-font {
  font-weight: 900;
  font-size: 1.5em;
}

/* 無障礙樣式 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 確保鍵盤焦點可見 (3px 藍色外框) */
a:focus,
button:focus,
.nav-link:focus {
  outline: 3px solid #005fcc !important;
  outline-offset: 3px !important;
}

a[data-hover-src]:focus,
a.info-nav-link:focus {
  outline: 3px solid #005fcc !important;
  outline-offset: 3px !important;
  background-color: rgba(0, 95, 204, 0.1);
  border-radius: 4px;
}

a[data-hover-src]:focus img,
a.info-nav-link:focus img {
  opacity: 0.85;
  transform: scale(1.03);
  transition: all 0.2s ease;
}

a {
  text-decoration: underline;
}

a:hover,
a:focus {
  text-decoration: none;
}

h1, h2, h3 {
  margin: 0;
  font-weight: bold;
}

h1 {
  font-size: 1.5em;
}

h2 {
  font-size: 1.25em;
}

h3 {
  font-size: 1.1em;
}

img {
  max-width: 100%;
  height: auto;
}

table {
  border-collapse: collapse;
}

/* 跳過內容連結：預設用transform整個移出可視範圍外(依自身高度計算，不受字級/縮放影響)，focus時才移回 */
.skip-link {
  position: absolute;
  top: 6px;
  left: 6px;
  transform: translateY(-150%);
  background: #000;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

#main-container {
  max-width: 100%;
  margin: 0 auto;
}

/* 行動版 RWD 樣式與切換 */
.mobile-info-nav {
  display: none;
}

@media screen and (max-width: 1024px) {
  body {
    background-color: #f8f9fa !important;
    background-image: none !important;
  }

  /* 行動版隱藏大桌機背景表格，改為現代流體 Bootstrap 版型 */
  .desktop-table-layout {
    display: none !important;
  }

  /* 運用 Flexbox 彈性高，實現 Sticky Footer 自動推至底部 */
  .mobile-rwd-container {
    display: flex !important;
    flex-direction: column;
    min-height: 100vh;
    padding: 15px 15px 0 15px;
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .mobile-info-nav {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
  }

  .mobile-info-nav .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
  }

  .mobile-info-nav .nav-link:hover,
  .mobile-info-nav .nav-link:focus {
    background-color: #e9ecef;
    color: #005fcc;
  }

  .mobile-info-nav .nav-link.active {
    background-color: #58207D;
    color: #ffffff;
    border-color: #58207D;
  }

  .mobile-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .mobile-card h1 img {
    max-width: 160px;
    height: auto;
  }

  .mobile-card ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
  }

  .mobile-card ul li {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  /* 插畫容器：margin-top: auto 負責將插畫推至視窗最底部 */
  .mobile-illustration-box {
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
    text-align: center;
  }

  /* 行動版共用插畫圖片縮放（保持完美比例不變形） */
  .mobile-illustration-img {
    max-width: 480px;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

@media screen and (min-width: 1025px) {
  .mobile-rwd-container {
    display: none !important;
  }
  .desktop-table-layout {
    display: block !important;
  }
}