/* ============================================================
   yulinf.com 共用設計系統
   ------------------------------------------------------------
   個人站維持自己的中性淺灰／藍調（履歷要好讀、能列印，所以保留
   淺色與深淺雙模式），但字型層次與版面節奏向 lighthousecc.tw
   對齊：內文黑體、大標宋體，相同的圓角、緩動曲線與導覽間距。
   ============================================================ */

/* --- 網頁字型未載入時的備援：用系統字型並校正字面尺寸，
       避免 Noto 載入完成的瞬間整頁位移 --- */
@font-face {
  font-family: "Noto Sans TC fb";
  src: local("PingFang TC"), local("Heiti TC"), local("Microsoft JhengHei");
  ascent-override: 116%;
  descent-override: 28.8%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Noto Serif TC fb";
  src: local("Songti TC"), local("PMingLiU");
  ascent-override: 115.1%;
  descent-override: 28.6%;
  line-gap-override: 0%;
}

:root {
  /* 色彩：淺色為預設 */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #2f3237;
  --text-muted: #6b7078;
  --heading: #1e2126;
  --accent: #0b5cad;
  --accent-hover: #08427c;
  --border: #e2e5e9;
  --rule: #dfe3e8;
  --table-head: #f4f6f8;
  --mark: rgba(11, 92, 173, .07);
  --shadow: 0 1px 3px rgba(15, 20, 30, .06), 0 8px 24px rgba(15, 20, 30, .06);
  --shadow-lift: 0 2px 6px rgba(15, 20, 30, .08), 0 16px 40px rgba(15, 20, 30, .10);

  /* 節奏：與 lighthousecc.tw 同一組值 */
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --nav-gap: 34px;

  /* 字型層次：內文黑體、大尺寸標題宋體 */
  --font: "Noto Sans TC", "Noto Sans TC fb", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "PingFang TC", "Microsoft JhengHei", Roboto, Arial, sans-serif;
  --font-display: "Noto Serif TC", "Noto Serif TC fb", "Songti TC", "PMingLiU", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316;
    --surface: #1c1e22;
    --surface-2: #212429;
    --text: #dfe2e6;
    --text-muted: #9aa0a8;
    --heading: #f2f4f6;
    --accent: #6fb3f2;
    --accent-hover: #a3cdf7;
    --border: #33373d;
    --rule: #2b2f34;
    --table-head: #24272c;
    --mark: rgba(111, 179, 242, .09);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 16px 40px rgba(0, 0, 0, .38);
  }
}
/* 手動切換要能蓋過系統偏好，兩個方向都要贏 */
:root[data-theme="dark"] {
  --bg: #121316;
  --surface: #1c1e22;
  --surface-2: #212429;
  --text: #dfe2e6;
  --text-muted: #9aa0a8;
  --heading: #f2f4f6;
  --accent: #6fb3f2;
  --accent-hover: #a3cdf7;
  --border: #33373d;
  --rule: #2b2f34;
  --table-head: #24272c;
  --mark: rgba(111, 179, 242, .09);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 16px 40px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: clamp(15px, 0.4vw + 14px, 17px);
  line-height: 1.75;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

img { max-width: 100%; }

/* ============================================================
   導覽列
   ============================================================ */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 6vw, 52px);
}
.site-nav .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: .02em;
  white-space: nowrap;
}
.site-nav .brand:hover { color: var(--accent); }
.site-nav .links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, var(--nav-gap));
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9em;
}
.site-nav .links a {
  color: var(--text-muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.site-nav .links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.site-nav .links a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--accent); }

.nav-tools { display: flex; align-items: center; gap: 8px; }
.nav-tools button {
  font: inherit;
  font-size: .8em;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.nav-tools button:hover { color: var(--accent); border-color: var(--accent); }
.nav-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   標題
   ============================================================ */
h1, h2, h3 { color: var(--heading); line-height: 1.35; }

/* 大尺寸的顯示型標題才用宋體：宋體的筆畫對比讓標題自己站得住，
   小字用宋體在螢幕上會糊掉，所以內文一律維持黑體。 */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: .01em;
}

/* ============================================================
   按鈕 / 卡片
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--mark); color: var(--accent-hover); }

.card {
  display: block;
  padding: clamp(20px, 3.5vw, 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
  color: inherit;
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ============================================================
   共用內容元件（沿用自舊版履歷頁）
   ============================================================ */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95em;
}
th, td {
  border: 1px solid var(--border);
  padding: .6em .8em;
  text-align: left;
  vertical-align: top;
}
thead th { background: var(--table-head); font-weight: 600; white-space: nowrap; }

.split {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
  flex-wrap: wrap;
}
.split figure {
  margin: 0;
  flex: 0 0 clamp(180px, 30%, 240px);
  max-width: 100%;
}
.split figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}
.split figcaption {
  font-size: .82em;
  color: var(--text-muted);
  margin-top: .5em;
  line-height: 1.6;
}
.split-body { flex: 1 1 320px; min-width: 0; }

.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: flex;
  gap: .8em;
  padding: .35em 0;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.facts li:last-child { border-bottom: 0; }
.facts .label {
  flex: 0 0 5.5em;
  color: var(--text-muted);
  font-size: .92em;
}

/* ============================================================
   頁尾
   ============================================================ */
.site-footer {
  margin-top: clamp(48px, 9vw, 76px);
  padding-top: clamp(24px, 5vw, 34px);
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  font-size: .86em;
  line-height: 1.8;
}
.site-footer p { margin: 0 0 .4em; }
.site-footer p:last-child { margin-bottom: 0; }

/* ============================================================
   回到頂部
   ============================================================ */
#back-to-top {
  position: fixed;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  font: inherit;
  font-size: .82em;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s var(--ease), border-color .2s var(--ease);
}
#back-to-top.is-visible { opacity: 1; visibility: visible; }
#back-to-top:hover { border-color: var(--accent); color: var(--accent); }
#back-to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   列印：履歷要能直接印出來
   ============================================================ */
@media print {
  .site-nav, .nav-tools, #back-to-top { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .container { box-shadow: none; border: 0; }
  a { color: #000; text-decoration: underline; }
}

/* ============================================================
   導引卡片格線（入口頁）
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(14px, 2.5vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.card .eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .7em;
}
.card .card-title {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 .45em;
  line-height: 1.3;
}
.card .card-desc {
  font-size: .92em;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.7;
}
.card .card-go {
  display: inline-block;
  margin-top: 1em;
  font-size: .88em;
  font-weight: 600;
  color: var(--accent);
}
.card:hover .card-go { color: var(--accent-hover); }
