/* 系所資訊各頁（2026-10 改版）：區塊導覽、卡片、圖文並排、數字、時間軸、相簿、影片、右側書籤。配色同行政人員頁 */

.ab-page,
.ab-bookmark {
  --ab-accent: #832e33;
  --ab-accent-dark: #5a1419;
  --ab-ink: #2b2523;
  --ab-muted: #6b605c;
  --ab-line: #e5dfda;
  --ab-soft: #f6eded;
  --ab-tint: #f8f1ef;
}

.ab-page {
  padding: 22px 0 56px;
  color: var(--ab-ink);
  font-size: 16px;
  line-height: 1.8;
}

#top-pic h1 {
  text-align: left;
}

#top-pic .top-pic-en {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: #f5e4e5;
}

/* 系網全站 CSS 會給 li 加圓點、給 img 寬度，這裡重設；
   用 :where() 把優先順序壓低，下面各元件（時間軸、數字列等）自己的 margin/padding 才蓋得過去 */
.ab-page :where(ul, ol) {
  margin: 0;
  padding: 0;
}

.ab-page li {
  list-style: none;
}

.ab-page img {
  max-width: 100%;
  height: auto;
}

.ab-page a {
  color: var(--ab-accent);
}

.ab-page a:hover {
  color: var(--ab-accent-dark);
}

.ab-page :where(p) {
  margin: 0 0 0.9em;
}

.ab-page :where(p):last-child {
  margin-bottom: 0;
}

/* ---- 系所資訊各頁之間的導覽 ---- */

.ab-subnav {
  margin: 0 0 22px;
}

.ab-subnav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ab-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid var(--ab-line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ab-ink);
  text-decoration: none;
}

.ab-subnav a:hover {
  border-color: #d9b9bb;
  color: var(--ab-accent);
  text-decoration: none;
}

.ab-subnav a[aria-current="page"] {
  border-color: var(--ab-accent);
  background: var(--ab-accent);
  color: #ffffff;
  font-weight: 700;
}

/* ---- 卡片 ---- */

.ab-card {
  margin-bottom: 22px;
  padding: 28px 32px;
  border: 1px solid var(--ab-line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(60, 20, 22, 0.05), 0 6px 18px rgba(60, 20, 22, 0.05);
  scroll-margin-top: 64px;
}

.ab-card-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--ab-ink);
}

.ab-card-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #e3cfd0, rgba(227, 207, 208, 0));
}

.ab-card-lead {
  margin: -8px 0 18px;
  color: var(--ab-muted);
}

.ab-h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ab-accent);
}

/* 圖文並排：左圖右文，is-flip 左右對調 */
.ab-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 28px;
  align-items: start;
}

.ab-split + .ab-split {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px dashed var(--ab-line);
}

.ab-split.is-flip > :first-child {
  order: 2;
}

.ab-photo {
  margin: 0;
}

.ab-photo img {
  display: block;
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.ab-photo figcaption {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ab-muted);
}

.ab-text > .ab-h3:not(:first-child) {
  margin-top: 18px;
}

/* ---- 數字 ---- */

.ab-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.ab-stat {
  padding: 16px 18px;
  border: 1px solid var(--ab-line);
  border-radius: 12px;
  background: #fbf7f6;
}

.ab-stat-num {
  display: block;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ab-accent);
}

.ab-stat-num small {
  margin-left: 2px;
  font-size: 15px;
}

.ab-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ab-muted);
}

a.ab-stat {
  display: block;
  height: 100%;
  text-decoration: none;
}

a.ab-stat:hover {
  border-color: #d9b9bb;
}

/* 系所簡介「關於本系」卡片底部的數字列：細線分隔、數字與單位同一套字級 */
.ab-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #efe7e4;
}

.ab-facts > li + li {
  border-left: 1px solid #efe7e4;
}

.ab-fact {
  display: block;
  padding: 2px 12px;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.ab-fact-num {
  display: block;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ab-accent);
}

.ab-fact-num small {
  margin: 0 3px;
  font-size: 15px;
  font-weight: 700;
}

.ab-fact-label {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ab-muted);
}

a.ab-fact:hover {
  text-decoration: none;
}

a.ab-fact:hover .ab-fact-label {
  color: var(--ab-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- 標籤（研究領域、設備規格等） ---- */

.ab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ab-chips li {
  padding: 3px 12px;
  border: 1px solid #eedcdd;
  border-radius: 6px;
  background: var(--ab-soft);
  font-size: 14.5px;
  line-height: 1.6;
  color: #6a2328;
}

.ab-chips a {
  color: inherit;
  text-decoration: none;
}

.ab-chips a:hover {
  color: var(--ab-accent-dark);
  text-decoration: underline;
}

/* 方塊圓點清單 */
.ab-list > li {
  position: relative;
  padding: 3px 0 7px 18px;
}

.ab-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--ab-accent);
}

.ab-list small {
  display: block;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ab-muted);
}

/* ---- 時間軸（沿革、歷屆系主任、大事紀要） ---- */

.ab-timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 26px;
}

.ab-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #d9b9bb, #efe4e2);
}

.ab-timeline > li {
  position: relative;
  padding: 0 0 18px;
}

.ab-timeline > li:last-child {
  padding-bottom: 0;
}

.ab-timeline > li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 7px;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--ab-accent);
  box-shadow: 0 0 0 1px #d9b9bb;
}

.ab-when {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ab-accent);
}

/* 歷屆系主任 */
.ab-chair {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 4px 20px;
  padding: 12px 16px;
  border: 1px solid var(--ab-line);
  border-radius: 10px;
  background: #ffffff;
}

.ab-chair.is-current {
  border-color: #d9b9bb;
  background: linear-gradient(90deg, #f6eaea, #ffffff 60%);
}

.ab-chair-name {
  margin: 0;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.ab-chair-name small {
  margin-left: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--ab-muted);
}

.ab-chair-resume {
  font-size: 15px;
  line-height: 1.7;
  color: #4c4340;
}

.ab-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--ab-accent);
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  vertical-align: 3px;
  color: #ffffff;
}

/* 大事紀要：依年份分段 */
.ab-year {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  scroll-margin-top: 64px;
}

.ab-year + .ab-year {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid #f0e8e5;
}

.ab-year-label {
  margin: 0;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ab-accent);
}

.ab-event {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
}

.ab-event > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 內文裡的連結要有底線（不能只靠顏色區分，WCAG 1.4.1） */
.ab-page p a:not(.ab-button),
.ab-event a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ab-event-date {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ab-muted);
}

/* ---- 相簿、設備 ---- */

.ab-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.ab-gallery figure {
  margin: 0;
}

.ab-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #f1ebe8;
}

.ab-gallery figcaption {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: var(--ab-muted);
}

.ab-gear {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.ab-gear li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 12px;
  border: 1px solid var(--ab-line);
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
}

.ab-gear img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.ab-gear-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}

.ab-gear-count {
  font-size: 13.5px;
  color: var(--ab-accent);
}

/* ---- 影片（點了才載入 YouTube） ---- */

.ab-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.ab-video {
  margin: 0;
}

.ab-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1514;
}

.ab-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ab-video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: #1c1514 center / cover no-repeat;
  cursor: pointer;
}

.ab-video-play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 40px;
  margin: -20px 0 0 -29px;
  border-radius: 10px;
  background: rgba(131, 46, 51, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 26px no-repeat;
  transition: transform 0.15s;
}

.ab-video-play:hover::after,
.ab-video-play:focus-visible::after {
  transform: scale(1.08);
}

.ab-video-play:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: -3px;
}

.ab-video figcaption {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.ab-video figcaption small {
  display: block;
  font-size: 13.5px;
  color: var(--ab-muted);
}

/* 研究計畫年度切換 */
.ab-years {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ab-year-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 76px;
  padding: 8px 12px;
  border: 1px solid var(--ab-line);
  border-radius: 10px;
  background: #ffffff;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ab-ink) !important;
  text-decoration: none !important;
}

.ab-year-tab small {
  margin-top: 2px;
  font-family: system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ab-muted);
}

.ab-year-tab:hover {
  border-color: #d9b9bb;
}

.ab-year-tab[aria-selected="true"] {
  border-color: var(--ab-accent);
  background: var(--ab-accent);
  color: #ffffff !important;
}

.ab-year-tab[aria-selected="true"] small {
  color: #f5e4e5;
}

.ab-year-tab:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: 2px;
}

/* 歷屆系主任：現任一張大卡，歷任兩欄小卡 */
.ab-chairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ab-chairs .ab-chair {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.ab-chair.is-current {
  padding: 18px 22px;
}

.ab-chair.is-current .ab-chair-name {
  font-size: 24px;
}

/* 數外桃園：文字繞著照片 */
.ab-essay-wrap .ab-photo {
  float: right;
  width: 44%;
  margin: 4px 0 14px 26px;
}

.ab-essay-wrap::after {
  content: "";
  display: block;
  clear: both;
}

/* ---- 表格 ---- */

.ab-table-wrap {
  overflow-x: auto;
}

.ab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.ab-table th,
.ab-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #efe7e4;
  text-align: left;
  vertical-align: top;
}

.ab-table thead th {
  border-bottom: 2px solid #e3cfd0;
  background: var(--ab-tint);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ab-accent);
}

.ab-table tbody tr:hover {
  background: #fbf7f6;
}

.ab-table .is-nowrap {
  white-space: nowrap;
}

.ab-table .is-code {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ab-muted);
}

/* 開放時間 */
.ab-hours {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ab-hours div {
  padding: 12px 14px;
  border: 1px solid var(--ab-line);
  border-radius: 10px;
  text-align: center;
}

.ab-hours dt {
  font-size: 14px;
  font-weight: 400;
  color: var(--ab-muted);
}

.ab-hours dd {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ab-ink);
}

.ab-hours .is-open {
  border-color: #d9b9bb;
  background: var(--ab-soft);
}

.ab-hours .is-open dd {
  color: var(--ab-accent);
}

/* 連結卡片 */
.ab-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.ab-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 10px 16px;
  border: 1px solid var(--ab-line);
  border-radius: 10px;
  background: #ffffff;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

.ab-links a:hover {
  border-color: #d9b9bb;
  background: var(--ab-tint);
  text-decoration: none;
}

.ab-links a::after {
  content: "↗";
  flex-shrink: 0;
  color: var(--ab-muted);
}

.ab-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--ab-accent);
  font-weight: 700;
  color: #ffffff !important;
  text-decoration: none;
}

.ab-button:hover {
  background: var(--ab-accent-dark);
  text-decoration: none;
}

/* 可展開的名單 */
.ab-details {
  margin-top: 18px;
  border: 1px solid var(--ab-line);
  border-radius: 10px;
}

.ab-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--ab-accent);
  cursor: pointer;
}

.ab-details summary::marker {
  color: var(--ab-accent);
}

.ab-details[open] summary {
  border-bottom: 1px solid var(--ab-line);
}

.ab-details > div {
  padding: 6px 16px 14px;
}

/* 聯絡資訊 */
.ab-contact {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 28px;
}

.ab-map {
  position: relative;
  min-height: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1ebe8;
}

.ab-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ab-contact-list > li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0e8e5;
}

.ab-contact-list > li:last-child {
  border-bottom: 0;
}

.ab-contact-list svg {
  margin-top: 4px;
  color: var(--ab-accent);
}

.ab-contact-label {
  display: block;
  font-size: 13.5px;
  color: var(--ab-muted);
}

/* 散文（數外桃園） */
.ab-essay p {
  text-indent: 2em;
}

.ab-essay .ab-credit {
  margin-top: 14px;
  text-indent: 0;
  text-align: right;
  font-size: 14px;
  color: var(--ab-muted);
}

.ab-essay em {
  font-style: normal;
  font-weight: 700;
  color: var(--ab-accent);
}

.ab-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid #d9b9bb;
  border-radius: 0 8px 8px 0;
  background: var(--ab-tint);
  font-size: 14.5px;
  color: #5f5450;
}

/* ---- 右側書籤（覆蓋各頁 css 的 #right-nav 樣式） ---- */

#right-nav .ab-bookmark {
  position: -webkit-sticky;
  position: sticky;
  top: 56px;
  padding-top: 24px;
}

#right-nav .ab-bookmark-title {
  margin: 0 0 10px;
  padding-left: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ab-accent);
}

#right-nav .ab-bookmark ul {
  position: static;
  max-height: calc(100vh - 150px);
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  border-left: 0;
  box-shadow: inset 1px 0 0 #e0d8d2;
  overflow-y: auto;
}

#right-nav .ab-bookmark ul li {
  margin: 0;
  padding: 0;
  list-style: none;
}

#right-nav .ab-bookmark ul li a {
  display: flex;
  align-items: center;
  max-width: none;
  min-height: 40px;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  white-space: normal;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  font-size: 15px;
  font-weight: 500;
  color: var(--ab-ink);
  background: none;
}

#right-nav .ab-bookmark ul li a:hover {
  background: rgba(131, 46, 51, 0.04);
  color: var(--ab-accent);
  text-decoration: none;
}

#right-nav .ab-bookmark ul li a.is-current {
  border-left-color: var(--ab-accent);
  color: var(--ab-accent);
  font-weight: 700;
}

#right-nav .ab-bookmark-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding-left: 14px;
  font-size: 13px;
  color: var(--ab-muted);
}

#right-nav .ab-bookmark-top:hover {
  color: var(--ab-accent);
  text-decoration: none;
}

/* ---- 窄螢幕 ---- */

@media (max-width: 991.98px) {
  .ab-card {
    padding: 24px 22px;
  }

  .ab-split,
  .ab-contact {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .ab-split.is-flip > :first-child {
    order: 0;
  }

  .ab-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ab-page {
    padding-top: 16px;
    font-size: 15.5px;
  }

  .ab-subnav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .ab-subnav a {
    white-space: nowrap;
  }

  .ab-card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .ab-card-title {
    font-size: 21px;
  }

  .ab-chair,
  .ab-chairs {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-essay-wrap .ab-photo {
    float: none;
    width: 100%;
    margin: 0 0 14px;
  }

  .ab-year {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .ab-event {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .ab-hours {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
  }

  .ab-facts > li:nth-child(odd) {
    border-left: 0;
  }

  .ab-fact-num {
    font-size: 28px;
  }

  .ab-map {
    min-height: 280px;
  }

  /* 研究計畫表格在手機改成一筆一張卡 */
  .ab-table.is-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .ab-table.is-stack tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #efe7e4;
  }

  .ab-table.is-stack td {
    display: block;
    padding: 2px 0;
    border: 0;
  }

  .ab-table.is-stack td[data-label]::before {
    content: attr(data-label) "：";
    color: var(--ab-muted);
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-video-play::after {
    transition: none;
  }
}

/* =====================================================================
   課程介紹、活動紀錄（2026-10 改版）共用同一套元件，以下是這兩區另外用到的
   ===================================================================== */

.ab-count {
  margin-left: 4px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ab-muted);
}

/* 修課規定：學年度一列、檔案連結 */
.ab-files-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid #f0e8e5;
}

.ab-files-row:last-child {
  border-bottom: 0;
}

.ab-files-year {
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ab-accent);
}

.ab-files-year small {
  margin-left: 3px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--ab-muted);
}

.ab-files-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.ab-files-links a,
.ab-list a,
.ab-photo figcaption a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ab-filetype {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid #e3cfd0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: 2px;
  color: var(--ab-muted);
}

.ab-rule-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
}

/* 課程簡介：一門課一個可展開的方塊 */
.ab-courses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.ab-course {
  border: 1px solid var(--ab-line);
  border-radius: 10px;
  background: #ffffff;
}

.ab-course[open] {
  grid-column: 1 / -1;
  border-color: #d9b9bb;
}

.ab-course summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.ab-course summary::-webkit-details-marker {
  display: none;
}

.ab-course summary::before {
  content: "+";
  flex-shrink: 0;
  width: 18px;
  font-weight: 700;
  color: var(--ab-accent);
}

.ab-course[open] summary::before {
  content: "−";
}

.ab-course summary:hover {
  background: var(--ab-tint);
}

.ab-course-name {
  font-weight: 700;
}

.ab-course-en {
  font-size: 14px;
  color: var(--ab-muted);
}

.ab-course-body {
  padding: 4px 18px 16px 42px;
  border-top: 1px solid #f0e8e5;
}

.ab-course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin: 10px 0;
}

.ab-course-meta dt {
  display: inline;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ab-muted);
}

.ab-course-meta dt::after {
  content: "：";
}

.ab-course-meta dd {
  display: inline;
  margin: 0;
}

.ab-course-desc {
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.ab-course-desc table {
  width: 100%;
  margin: 8px 0;
}

/* 教育目標、EMI 原則：編號清單 */
.ab-goals {
  counter-reset: ab-goal;
}

.ab-goals > li {
  position: relative;
  padding: 6px 0 6px 40px;
  counter-increment: ab-goal;
}

.ab-goals > li::before {
  content: counter(ab-goal);
  position: absolute;
  left: 0;
  top: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ab-soft);
  font-weight: 700;
  line-height: 28px;
  text-align: center;
  color: var(--ab-accent);
}

/* 核心能力 */
.ab-ability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ab-ability {
  padding: 12px 16px;
  border: 1px solid var(--ab-line);
  border-radius: 10px;
}

.ab-ability-name {
  display: block;
  font-weight: 700;
  color: var(--ab-ink);
}

.ab-ability-name small {
  margin-left: 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ab-muted);
}

.ab-ability .ab-course-meta {
  flex-direction: column;
  gap: 2px;
}

.ab-ability-desc {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  line-height: 1.7;
  color: #4c4340;
}

.ab-caption {
  caption-side: top;
  padding: 0 0 8px;
  font-weight: 700;
  text-align: left;
  color: var(--ab-ink);
}

.ab-table-wrap:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: 2px;
}

/* ---- 活動紀錄：左清單、右照片 ---- */

.ab-rec {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.ab-rec-list-col {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.ab-rec-yearbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ab-line);
  background: var(--ab-tint);
}

.ab-rec-heading {
  flex: 1 0 100%;
  margin: 0;
  font-family: 'Noto Serif TC', 'Noto Serif CJK TC', serif;
  font-size: 20px;
  font-weight: 700;
}

.ab-rec-yearlabel {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ab-accent);
}

.ab-rec-yearbar select {
  flex: 1;
  min-height: 38px;
  padding: 4px 10px;
  border: 1px solid #d9c8c6;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
  font-size: 15px;
  color: var(--ab-ink);
}

.ab-page .ab-rec-list {
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
}

.ab-rec-list button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
  color: var(--ab-ink);
  cursor: pointer;
}

.ab-rec-list button:hover {
  background: var(--ab-tint);
}

.ab-rec-list button:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: -3px;
}

.ab-rec-list button.is-active {
  background: var(--ab-accent);
  color: #ffffff;
}

.ab-rec-list .idx {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ab-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  color: var(--ab-accent);
}

.ab-rec-list .is-active .idx {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.ab-rec-list .txt {
  overflow-wrap: anywhere;
}

.ab-rec-list .cnt {
  padding-top: 2px;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--ab-muted);
}

.ab-rec-list .is-active .cnt {
  color: #f5e4e5;
}

.ab-rec-list .is-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--ab-muted);
}

.ab-rec-pager,
.ab-rec-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ab-muted);
}

.ab-rec-pager {
  border-top: 1px solid var(--ab-line);
}

.ab-rec-pager button,
.ab-rec-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ab-line);
  border-radius: 50%;
  background: #ffffff;
  font-size: 16px;
  color: var(--ab-accent);
  cursor: pointer;
}

.ab-rec-controls button {
  border-color: var(--ab-accent);
  background: var(--ab-accent);
  color: #ffffff;
}

.ab-rec-pager button:disabled,
.ab-rec-controls button:disabled {
  border-color: #e5dfda;
  background: #f4f0ee;
  color: #8f8380;
  cursor: default;
}

.ab-rec-title {
  margin: 4px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--ab-accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ab-rec-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 480px;
  border-radius: 14px;
  background: #241c1b;
  overflow: hidden;
}

.ab-rec-empty {
  padding: 0 24px;
  text-align: center;
  color: #e6dcda;
}

.ab-rec-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.ab-rec-open[hidden] {
  display: none;
}

.ab-rec-open:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: -3px;
}

.ab-rec-open img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s;
}

.ab-rec-open img.is-ready {
  opacity: 1;
}

.ab-rec-spin {
  position: absolute;
  display: none;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: ab-rot 0.8s linear infinite;
}

.ab-rec-stage.is-loading .ab-rec-spin {
  display: block;
}

@keyframes ab-rot {
  to { transform: rotate(360deg); }
}

.ab-rec-light {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 10, 0.94);
}

.ab-rec-light[hidden] {
  display: none;
}

.ab-rec-light img {
  max-width: 86vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
}

.ab-rec-light button {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 22px;
  color: #ffffff;
  cursor: pointer;
}

.ab-rec-light button:hover,
.ab-rec-light button:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: 2px solid #f2c94c;
}

.ab-rec-light-x {
  top: 18px;
  right: 22px;
}

.ab-rec-light-nav.is-prev {
  left: 2vw;
}

.ab-rec-light-nav.is-next {
  right: 2vw;
}

.ab-rec-light-hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: #d8cecb;
}

@media (max-width: 991.98px) {
  .ab-rec {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-page .ab-rec-list {
    max-height: 340px;
  }

  .ab-rec-stage {
    height: 340px;
  }
}

@media (max-width: 767.98px) {
  .ab-files-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .ab-rule-cols,
  .ab-courses,
  .ab-ability-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-course-body {
    padding-left: 16px;
  }

  .ab-rec-stage {
    height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-rec-open img {
    transition: none;
  }

  .ab-rec-spin {
    animation-duration: 2s;
  }
}

/* ---- 英文修業規定（/en/course/rule，2026-10-30）：條文編號一欄、內文一欄 ---- */

.ab-reg-head {
  margin: -6px 0 14px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ab-muted);
}

.ab-reg-head p {
  margin: 0 0 2px;
}

.ab-reg-head .ab-reg-title {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ab-ink);
}

.ab-reg,
.ab-reg-items {
  list-style: none;
}

.ab-reg > li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 2px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--ab-line);
}

.ab-reg > li:first-child {
  border-top: 0;
}

.ab-reg-no {
  font-weight: 700;
  color: var(--ab-accent);
  white-space: nowrap;
}

.ab-reg p {
  margin: 0 0 6px;
}

.ab-reg p:last-child {
  margin-bottom: 0;
}

.ab-reg-note {
  font-size: 14.5px;
  color: var(--ab-muted);
}

.ab-reg-items > li {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr);
  padding: 3px 0;
}

.ab-reg-items .ab-reg-items {
  margin-top: 4px;
}

.ab-reg-mk {
  font-weight: 600;
  color: var(--ab-muted);
}

.ab-reg-cats {
  display: grid;
  gap: 6px;
  margin: 8px 0 2px;
}

.ab-reg-cats > div {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ab-tint);
}

.ab-reg-cats dt {
  font-weight: 700;
  color: var(--ab-accent-dark);
}

.ab-reg-cats dd {
  margin: 0;
}

.ab-reg-docs {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--ab-line);
}

.ab-reg-docs-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ab-ink);
}

@media (max-width: 575px) {
  .ab-reg > li {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- 系所資訊英文版（/en/about/*，2026-10-30） ---- */

/* 機器人實驗室「課程教學目標」三欄：中文版用行內樣式固定三欄，英文單字長（Intelligence 等）在手機會撐破，窄螢幕改一欄 */
.ab-stats.ab-en-stats3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .ab-stats.ab-en-stats3 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 研究計畫表格在手機改卡片時：欄位名稱後面用半形冒號；計畫編號等可換行，避免長字串撐出卡片 */
  .ab-table.is-stack.ab-en-stack td[data-label]::before {
    content: attr(data-label) ": ";
  }

  .ab-table.is-stack.ab-en-stack td {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
/* ---- 課程介紹英文版（/en/course/*，2026-10-30） ---- */

/* 英文頁的「標籤：內容」用半形冒號（中文版是全形「：」） */
.ab-course-meta.ab-cen-meta dt::after {
  content: ":\00a0";
}

/* 課程地圖英文版：逐欄列出地圖內容的編號清單，每一欄之間留空 */
.ab-cen-stages {
  margin-top: 22px;
}

.ab-cen-stages > li + li {
  margin-top: 12px;
}

.ab-cen-stages .ab-h3 {
  margin-bottom: 10px;
}
/* =====================================================================
   第一段：附加到 public/css/about-pages.css 最後（入學資訊三頁用；頁面引用 ?v=20261030h）
   ===================================================================== */

/* ---- 入學資訊（/info/college、/info/master、/info/phd，2026-10-30）---- */

/* 外部連結卡片（.ab-links）裡的第二行：來源網站、補充說明 */
.ab-info-src {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ab-muted);
}

/* 資料庫有、主機上沒有的檔案：不給連結，文字變淡並加「檔案遺失」標籤（不只靠顏色區分） */
.ab-info-missing {
  color: var(--ab-muted);
}

.ab-info-missing-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px dashed #c9b7b5;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.6;
  vertical-align: 2px;
  color: var(--ab-muted);
}

.ab-info-points,
.ab-info-forms {
  margin-bottom: 18px;
}

.ab-info-more {
  margin: 16px 0 0;
  font-size: 14.5px;
  color: var(--ab-muted);
}

/* 博士班資格考考古題：科目快速跳轉 */
.ab-info-jump {
  margin-bottom: 6px;
}

.ab-info-jump a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.ab-info-jump-count {
  font-size: 12px;
  color: var(--ab-muted);
}

/* 一個科目一段 */
.ab-info-subject {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f0e8e5;
  scroll-margin-top: 64px;
}

/* 考試範圍與參考資料：兩欄清單 */
.ab-info-cols {
  columns: 2;
  column-gap: 32px;
}

.ab-info-cols > li {
  break-inside: avoid;
}

/* 一年一個小方塊：年份＋春季／秋季連結，整排自動換行 */
.ab-info-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ab-info-terms > li {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 4px 12px;
  border: 1px solid var(--ab-line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 15px;
  line-height: 1.6;
}

.ab-info-term-year {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ab-ink);
}

.ab-info-terms a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 767.98px) {
  .ab-info-cols {
    columns: 1;
  }
}
