:root {
  color-scheme: light;
  --ink: #183436;
  --muted: #637875;
  --forest: #173a3a;
  --green: #277761;
  --mint: #e9f2ed;
  --cream: #f5f2e9;
  --line: #dce6e0;
  --orange: #df9c61;
  font-family: "Atkinson Hyperlegible Next", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fbfcf9; color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.site-header { background: var(--forest); color: #fff; }
.header-inner, .hero-inner, .explorer-inner, .footer-inner { width: min(1216px, calc(100% - 64px)); margin: auto; }
.header-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.school-mark { display: flex; align-items: center; gap: 13px; }
.mark-symbol { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #b7d5c9; border-radius: 12px; color: #d6eadc; font-weight: 800; font-size: 22px; }
.mark-label { font-size: 12px; line-height: 1.35; letter-spacing: .08em; color: #b7d5c9; }
.mark-label strong { font-size: 15px; color: white; letter-spacing: .15em; }
.academic-year { border: 1px solid #668883; border-radius: 100px; padding: 9px 15px; font-size: 13px; letter-spacing: .04em; color: #e1eee9; }

.hero { background: var(--cream); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 356px; align-items: center; gap: 70px; min-height: 440px; padding: 54px 0 58px; }
.eyebrow { margin: 0 0 18px; color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: .2em; }
.hero h1 { margin: 0; font-family: "Bricolage Grotesque", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: clamp(50px, 6vw, 78px); line-height: 1.16; letter-spacing: -.035em; font-weight: 850; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero-description { max-width: 560px; margin: 25px 0 19px; font-size: 17px; line-height: 1.8; color: #536b65; }
.text-button { padding: 0 0 5px; background: none; border: 0; border-bottom: 1.5px solid var(--green); color: var(--green); font-weight: 750; }
.text-button span { margin-left: 8px; }
.text-button:hover, .text-button:focus-visible { color: #15553e; border-color: #15553e; }
.hero-summary { position: relative; padding: 35px 34px 34px; min-height: 294px; background: var(--forest); color: white; border-radius: 7px; box-shadow: 16px 16px 0 #dfebdf; }
.summary-label { font-size: 12px; letter-spacing: .17em; color: #b4d8c5; }
.summary-number { margin-top: 8px; font-family: "Bricolage Grotesque", sans-serif; font-size: 82px; line-height: 1; font-weight: 800; letter-spacing: -.075em; }
.summary-number span { color: #9fcbb3; font-size: 51px; letter-spacing: -.1em; }
.hero-summary p { margin: 12px 0 23px; line-height: 1.6; font-size: 17px; }
.summary-rule { height: 1px; background: #55766a; margin-bottom: 19px; }
.summary-small { color: #d4e8da; font-size: 13px; }

.explorer { padding: 72px 0 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 27px; }
.eyebrow.dark { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-size: 31px; letter-spacing: -.035em; }
.section-aside { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.filter-panel { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(23, 58, 58, .04); }
.filter-row { display: flex; gap: 20px; }
.filter-row + .filter-row { margin-top: 20px; }
.filter-field { flex: 1; min-width: 0; }
.filter-field.wide { flex: 1.5; }
.filter-field label, .segmented legend { display: block; margin-bottom: 9px; color: #415d56; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; top: 14px; left: 14px; width: 19px; fill: none; stroke: #779188; stroke-width: 1.8; stroke-linecap: round; }
input, select { width: 100%; height: 48px; border: 1px solid #cbdcd2; border-radius: 8px; background: #fbfdfa; color: var(--ink); outline: none; }
input { padding: 0 15px 0 43px; }
select { padding: 0 14px; }
input:focus-visible, select:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px #d8eadc; }
.segmented-row { align-items: flex-start; justify-content: space-between; }
.segmented { border: 0; padding: 0; margin: 0; min-width: 0; }
.segment-options { display: flex; flex-wrap: wrap; gap: 7px; }
.segment-options button { padding: 9px 13px; border: 1px solid #d2e0d6; border-radius: 7px; background: white; color: #4c665b; font-size: 13px; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.segment-options button:hover { border-color: var(--green); color: var(--green); }
.segment-options button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: white; }
.segment-options button:focus-visible, .reset-button:focus-visible, .text-button:focus-visible, dialog button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 18px; }
.results-heading p { margin: 0; font-size: 18px; font-weight: 800; }
.reset-button { border: 0; background: none; padding: 7px 0; color: var(--green); font-size: 14px; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card { display: flex; flex-direction: column; min-height: 210px; padding: 23px 23px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; transition: transform .18s, box-shadow .18s; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(24, 52, 54, .09); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.category-tag { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.unique-tag { padding: 4px 7px; border-radius: 4px; background: #f8e7d8; color: #a45e28; font-size: 11px; font-weight: 800; white-space: nowrap; }
.course-card h3 { margin: 18px 0 17px; font-size: 21px; line-height: 1.45; letter-spacing: -.025em; }
.semester-values { display: flex; gap: 8px; margin-top: auto; }
.semester-value { flex: 1; padding: 8px 9px; border-radius: 6px; background: #f2f6f2; color: #496258; font-size: 12px; }
.semester-value strong { display: block; margin-top: 2px; font-size: 16px; color: var(--ink); font-weight: 800; }
.semester-value.absent { color: #a2b0aa; background: #f7f8f6; }
.semester-value.absent strong { color: #98a8a0; }
.empty-state { text-align: center; padding: 70px 20px; border: 1px dashed #cbdcd2; border-radius: 12px; background: white; }
.empty-state h3 { margin: 0 0 8px; font-size: 23px; }
.empty-state p { color: var(--muted); }
.empty-state button { margin-top: 10px; padding: 11px 20px; background: var(--forest); border: 0; border-radius: 7px; color: white; font-weight: 750; }

.site-footer { border-top: 1px solid var(--line); background: #f2f5ef; }
.footer-inner { min-height: 86px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: #577167; }
.footer-inner a { color: var(--forest); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 4px; }
dialog { width: min(590px, calc(100% - 32px)); max-height: min(650px, calc(100vh - 40px)); padding: 27px 30px 31px; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 25px 90px rgba(0,0,0,.22); color: var(--ink); }
dialog::backdrop { background: rgba(11, 37, 35, .55); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-header h2 { margin: 0 0 12px; font-size: 26px; }
.dialog-header button { border: 0; background: #edf3ee; border-radius: 50%; width: 34px; height: 34px; font-size: 23px; line-height: 1; color: var(--forest); }
dialog p { line-height: 1.8; color: #4d635b; }
.dialog-source { font-size: 13px; color: var(--muted); }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr 300px; gap: 35px; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented-row { flex-direction: column; }
}
@media (max-width: 680px) {
  .header-inner, .hero-inner, .explorer-inner, .footer-inner { width: min(100% - 36px, 1216px); }
  .header-inner { min-height: 75px; }
  .academic-year { font-size: 11px; padding: 7px 9px; }
  .hero-inner { display: block; padding: 45px 0 58px; }
  .hero h1 { font-size: clamp(42px, 11vw, 64px); }
  .hero-description { font-size: 15px; }
  .hero-summary { margin: 40px 14px 0 0; min-height: 0; }
  .summary-number { font-size: 68px; }
  .explorer { padding: 55px 0 75px; }
  .section-heading { display: block; }
  .section-heading h2 { font-size: 27px; }
  .section-aside { margin-top: 10px; }
  .filter-panel { padding: 18px; }
  .filter-row { flex-direction: column; gap: 18px; }
  .filter-row + .filter-row { margin-top: 18px; }
  .segment-options button { padding: 9px 11px; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card { min-height: 180px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 20px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .course-card, .segment-options button { transition: none; }
}
