:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --ink: #222831;
  --muted: #4a5361;
  --line: #c9d0da;
  --brand: #154c79;
  --brand-dark: #0d3355;
  --brand-soft: #e4edf6;
  --link: #1557a0;
  --accent: #b54708;
  --error: #b42318;
  --focus: #e8a400;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: .875rem/1.6 "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: .5rem; top: -3rem; background: #fff; padding: .25rem .5rem; z-index: 10; }
.skip:focus { top: .5rem; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 .75rem; }
ul, ol { margin: 0; padding: 0; }

/* 頁首 */
.util { background: var(--brand-dark); }
.util ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 .75rem; }
.util a { color: #fff; font-size: .8125rem; display: inline-block; min-height: 24px; line-height: 24px; text-decoration: none; }
.brand-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; padding-block: .75rem; background: var(--surface); }
header.site { background: var(--surface); border-bottom: 3px solid var(--brand); }
.logo { font-size: 1.375rem; font-weight: 700; color: var(--brand); text-decoration: none; min-height: 24px; display: inline-block; }
.slogan { color: var(--muted); font-size: .8125rem; }

.mega { background: var(--brand); }
.mega .wrap { position: relative; }
.mega-top { list-style: none; display: flex; flex-wrap: wrap; }
.mega-top > li > details > summary, .mega-link {
  display: block; min-height: 40px; line-height: 40px; padding: 0 .875rem;
  color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; list-style: none;
}
.mega-top > li > details > summary::-webkit-details-marker { display: none; }
.mega-top > li > details[open] > summary { background: var(--brand-dark); }
.mega-panel {
  position: absolute; left: .75rem; right: .75rem; top: 100%; z-index: 5;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand-dark);
  padding: .75rem 1rem; box-shadow: 0 8px 20px rgb(0 0 0 / .15);
}
.mega-head { font-size: .9375rem; margin: 0 0 .5rem; color: var(--brand); }
.mega-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .25rem 1.25rem; align-items: start; }
.mega-panel ul { list-style: none; }
.mega-panel a { display: inline-block; min-height: 24px; line-height: 24px; }
.mega-panel details summary, .acc > summary { min-height: 24px; line-height: 24px; cursor: pointer; font-weight: 700; color: var(--ink); }
.mega-panel details > ul, .mega-panel .nest { padding-left: 1rem; }

/* 首頁 */
main { display: block; max-width: 72rem; margin: 0 auto; padding: .75rem .75rem 2rem; }
.hero { background: var(--brand-soft); border-left: 6px solid var(--brand); padding: .75rem 1rem; margin-bottom: .75rem; }
.hero-title { margin: 0 0 .25rem; font-size: 1.125rem; color: var(--brand-dark); }
.hero p { margin: 0; }
.quick ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .375rem; margin-bottom: .75rem; }
.quick a { display: block; min-height: 32px; line-height: 32px; text-align: center; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.columns { display: grid; gap: .75rem; }
@media (min-width: 900px) { .columns { grid-template-columns: 3fr 2fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); padding: .75rem 1rem; margin-bottom: .75rem; }
.panel > h2 { font-size: 1.0625rem; margin: 0 0 .5rem; padding-bottom: .375rem; border-bottom: 2px solid var(--brand-soft); color: var(--brand-dark); }
.fake-link { color: var(--link); cursor: pointer; }
h2.fake-link::after, h3.fake-link::after { content: " ›"; }
.news { list-style: none; }
.news li { display: flex; flex-wrap: wrap; gap: .125rem .5rem; align-items: baseline; padding: .375rem 0; border-bottom: 1px dashed var(--line); }
.news time { color: var(--muted); font-size: .8125rem; }
.tag { font-size: .75rem; color: var(--accent); border: 1px solid currentColor; padding: 0 .25rem; }
.news h3 { font-size: .875rem; margin: 0; font-weight: 400; text-decoration: underline; }
#services h3 { font-size: .9375rem; margin: .5rem 0 .125rem; }
#services p { margin: 0; }
.cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem; }
.cards li { border: 1px solid var(--line); padding: .5rem .75rem; }
.cards h3 { font-size: .9375rem; margin: 0; }
.cards p { margin: .25rem 0 0; color: var(--muted); }
#about h3 { font-size: .9375rem; margin: .75rem 0 .125rem; }
#about p { margin: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 28rem; }
caption { text-align: left; font-weight: 700; padding: .25rem 0; }
th, td { border: 1px solid var(--line); padding: .25rem .5rem; text-align: left; vertical-align: middle; }
thead th, tbody th { background: var(--brand-soft); }

/* 流程 */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; font-size: .8125rem; color: var(--muted); margin-bottom: .5rem; }
.crumbs li + li::before { content: "›"; margin-right: .25rem; }
.crumbs a { display: inline-block; min-height: 24px; line-height: 24px; }
main h1 { font-size: 1.25rem; margin: 0 0 .5rem; color: var(--brand-dark); }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .75rem; counter-reset: s; }
.steps li { counter-increment: s; font-size: .75rem; padding: .125rem .5rem; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(s) ". "; }
.steps li[aria-current] { background: var(--brand); color: #fff; border-color: var(--brand); }
.step h2 { font-size: 1rem; margin: 0 0 .5rem; }
.step h2:focus, h3:focus { outline: none; }
.rules { padding-left: 1.5rem; margin-bottom: .75rem; }
.check { display: flex; gap: .375rem; align-items: center; margin: .5rem 0; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 .75rem;
  font: inherit; color: var(--brand-dark); background: var(--surface); border: 1px solid var(--brand); border-radius: 2px; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }
.error { color: var(--error); margin: .25rem 0; }
.error:empty { display: none; }
.meta { margin: .25rem 0; }
.acc { border: 1px solid var(--line); margin-bottom: .375rem; background: var(--surface); }
.acc > summary { padding: .25rem .75rem; background: var(--brand-soft); }
.acc-body { padding: .5rem .75rem; }
.dept-list { list-style: none; display: flex; flex-wrap: wrap; gap: .375rem; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .25rem 0; }
.sched td { text-align: center; }
.sched .off { color: var(--muted); }
#schedule h3 { font-size: .9375rem; margin: .75rem 0 .25rem; }
.grid { display: grid; gap: .25rem 1rem; }
@media (min-width: 700px) { .grid { grid-template-columns: 1fr 1fr; } }
fieldset { border: 1px solid var(--line); margin: 0; padding: .25rem .75rem; }
fieldset .check { display: inline-flex; margin: .25rem .75rem .25rem 0; }
.field { margin: .25rem 0; display: grid; gap: .125rem; }
.field label { font-weight: 700; }
input:not([type="checkbox"], [type="radio"]), select { font: inherit; min-height: 28px; padding: .125rem .375rem; border: 1px solid #767f8c; background: #fff; color: var(--ink); width: 100%; }

/* 掛號服務專區 */
.split { display: grid; gap: .75rem; }
@media (min-width: 800px) { .split { grid-template-columns: 14rem 1fr; align-items: start; } }
.side { background: var(--surface); border: 1px solid var(--line); padding: .5rem .75rem; }
.side-title { font-size: .875rem; margin: 0 0 .25rem; }
.side ul { list-style: none; }
.side a { display: inline-block; min-height: 24px; line-height: 24px; }
.acc-body h3 { font-size: .9375rem; margin: .5rem 0 .125rem; }
.dl div { display: grid; grid-template-columns: 6rem 1fr; border-bottom: 1px dashed var(--line); padding: .125rem 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.dl { margin: 0; }

/* 頁尾 */
.site-foot { background: var(--brand-dark); color: #fff; padding: .75rem 0; font-size: .8125rem; }
.site-foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1rem; margin-bottom: .5rem; }
.site-foot a { color: #fff; display: inline-block; min-height: 24px; line-height: 24px; }
.site-foot p { margin: 0; }

@media (max-width: 599px) {
  .mega-top { display: grid; grid-template-columns: 1fr 1fr; }
  .mega-panel { position: static; box-shadow: none; }
  .mega-top > li:has(details[open]) { grid-column: 1 / -1; }
}
