/* ==========================================================================
   SSFT 學校服務 — Base
   依賴 tokens.css（須先載入）。本檔不得出現任何色碼或自創數值。
   ========================================================================== */

/* ---------- 字型載入（第 3 條：只載入兩套） ---------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=Noto+Sans+TC:wght@400;700;900&display=swap');

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-spacing-trim: space-all;
  text-autospace: normal;
}

body {
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- 標題 ---------- */
h1,
h2,
h3 {
  font-weight: var(--fw-black);
  color: inherit;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-bold);
}

p {
  max-width: var(--measure);
  text-wrap: pretty;
}

small {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

kbd {
  font-family: var(--font-num);
  font-size: var(--fs-small);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 var(--space-4);
  background-color: var(--paper);
  color: var(--ink);
}

/* ---------- 連結 ---------- */
a {
  color: var(--brand);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 3px;
}

/* ---------- Focus ---------- */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: var(--bw-bold) solid var(--brand);
  outline-offset: 3px;
}

/* 藍底區塊內 focus 改用白紙色 */
.on-brand :focus-visible {
  outline-color: var(--paper);
}

::selection {
  background-color: var(--highlight);
  color: var(--ink);
}

/* ---------- 無障礙工具類 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-16);
  inset-block-start: var(--space-8);
  transform: translateY(-200%);
  background-color: var(--ink);
  color: var(--paper);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--r-sm);
  z-index: 10;
}

.skip-link:focus {
  transform: none;
}

/* ---------- 減少動態：全部歸零（第 8 條） ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}
