/* =====================================================================
   高師大科教中心網站｜共用樣式表 site.css
   ---------------------------------------------------------------------
   所有頁面共用這一支。原本 5 個 HTML 各自內嵌重複 CSS，改成外部連結：
     <link rel="stylesheet" href="assets/site.css">
   分區：① 設計變數  ② 基礎  ③ 頁首/導覽  ④ 內頁框架  ⑤ 元件  ⑥ 頁尾/浮動  ⑦ RWD
   風格：專業鋼藍 + 單一琥珀點綴 + 切角（clip-path）
   ===================================================================== */

/* ① 設計變數 ----------------------------------------------------------
   配色：html[data-palette] 1 鋼藍＋琥珀（預設）／2 LOGO 湖水綠＋橘／3 森林綠＋暖棕／4 深海藍＋珊瑚
   字級：html[data-fs] s 小／m 中（預設）／l 大 → --fs 倍率；所有字級用 rem，跟著放大縮小
   --accent 只當線條、色塊；當「文字」用時改用 --accent-text（對白底至少 4.5:1） */
:root {
  --primary: #1f4e79;  --primary-rgb: 31 78 121;
  --primary-deep: #143655;  --deep-rgb: 20 54 85;
  --steel: #2c6a93;  --steel-rgb: 44 106 147;
  --accent: #c98a3c;  --accent-rgb: 201 138 60;
  --accent-soft: #e3b574;
  --accent-text: #8a5a14;
  --slate: #5a6b7b;
  --ink: #1a2a3d;  --ink-rgb: 26 42 61;
  --text: #41526a;
  --text-strong: #2f4257;
  --muted: #5f6d7c;
  --bg: #eef1f5;
  --tint: #f4f6f8;
  --tint-2: #f7f9fb;
  --shadow-rgb: 20 40 60;
  /* LOGO 原色（所有配色共用）：只當大面積淡色裝飾，不當小字 */
  --logo-teal: #2592b3;  --logo-green: #6fa388;  --logo-orange: #e88034;  --logo-brown: #bda787;
  /* 深色帶、主要按鈕 */
  --band-grad: linear-gradient(112deg, var(--primary-deep) 0%, var(--primary) 58%, var(--steel) 110%);
  --soft-grad: linear-gradient(115deg, #dfe9f3 0%, #eaf0f6 100%);
  --cta: var(--primary);  --cta-hover: var(--primary-deep);
  --join-bg: var(--accent-soft);  --join-ink: #1b2a3a;
  --fs: 1.125;
  --hdr-stick: calc(92 * var(--px));   /* 頁首捲動後仍可見的高度（內頁子選單黏在它下方） */
}
/* 2：LOGO 色系。讓 LOGO 當畫面上最彩色的東西：白／淺灰底、單一深湖水綠（純色，不漸層）、
   橘色只用在少數重點（主要按鈕、強調線，約一成）；草綠、棕只留在 LOGO 裡 */
html[data-palette="2"] {
  --primary: #17716b;  --primary-rgb: 23 113 107;
  --primary-deep: #0f4f4b;  --deep-rgb: 15 79 75;
  --steel: #1f7a74;  --steel-rgb: 31 122 116;
  --accent: #f1622f;  --accent-rgb: 241 98 47;
  --accent-soft: #f6a37f;  --accent-text: #b5401a;
  --slate: #5a6866;  --ink: #1b2826;  --ink-rgb: 27 40 38;
  --text: #3e4e4c;  --text-strong: #2b3a38;  --bg: #ffffff;  --tint: #f4f6f6;  --tint-2: #f7f9f9;  --shadow-rgb: 20 36 34;
  --band-grad: var(--primary-deep);
  --soft-grad: linear-gradient(115deg, #cfeee8 0%, #dcf1e2 100%);
  --cta: #c8461a;  --cta-hover: #a33914;
  --join-bg: #c8461a;  --join-ink: #fff;
}
/* 5：LOGO 繽紛。白底；結構文字用深湖水綠，每一區輪流用 LOGO 的一個顏色（湖水綠、草綠、橘、棕），
   顏色都取 LOGO 色加深一階，白字對比 4.5:1 以上；各區的配色在 home.css「配色 5」 */
html[data-palette="5"] {
  --primary: #1b7d76;  --primary-rgb: 27 125 118;
  --primary-deep: #0f4f4b;  --deep-rgb: 15 79 75;
  --steel: #1b7d76;  --steel-rgb: 27 125 118;
  --accent: #f1622f;  --accent-rgb: 241 98 47;
  --accent-soft: #ffc2a6;  --accent-text: #b5401a;
  --slate: #5a6866;  --ink: #1b2826;  --ink-rgb: 27 40 38;
  --text: #3e4e4c;  --text-strong: #2b3a38;  --bg: #ffffff;  --tint: #f4f6f6;  --tint-2: #f7f9f9;  --shadow-rgb: 20 36 34;
  --band-grad: #1b7d76;
  --cta: #c8461a;  --cta-hover: #a33914;
  --join-bg: #fff;  --join-ink: #c8461a;
  --v-teal: #1b7d76;  --v-green: #367f3f;  --v-orange: #c8461a;  --v-brown: #7a6046;
}
html[data-palette="3"] {
  --primary: #2d6a45;  --primary-rgb: 45 106 69;
  --primary-deep: #1b452d;  --deep-rgb: 27 69 45;
  --steel: #4a8a5f;  --steel-rgb: 74 138 95;
  --accent: #b5803f;  --accent-rgb: 181 128 63;
  --accent-soft: #dcbb8a;  --accent-text: #7e5520;
  --slate: #5c6b5f;  --ink: #1c2b21;  --ink-rgb: 28 43 33;
  --text: #435346;  --text-strong: #2f4134;  --bg: #eff3ee;  --tint: #f3f6f2;  --tint-2: #f7f9f6;  --shadow-rgb: 30 50 36;
}
html[data-palette="4"] {
  --primary: #1d3f6e;  --primary-rgb: 29 63 110;
  --primary-deep: #102748;  --deep-rgb: 16 39 72;
  --steel: #2f5f94;  --steel-rgb: 47 95 148;
  --accent: #e0664e;  --accent-rgb: 224 102 78;
  --accent-soft: #f2a593;  --accent-text: #b03e29;
  --slate: #586a80;  --ink: #17243a;  --ink-rgb: 23 36 58;
  --text: #3f4f66;  --text-strong: #2b3b54;  --bg: #edf0f6;  --tint: #f3f5f9;  --tint-2: #f7f8fb;  --shadow-rgb: 16 30 56;
}

/* 6～8：清新、平易近人的全新配色（不依 LOGO）。左側「配色」按鈕可切換 */
html[data-palette="6"] {   /* 晴空藍＋鵝黃：清爽明亮，藍天與陽光 */
  --primary: #2f6fa8;  --primary-rgb: 47 111 168;
  --primary-deep: #1d4b77;  --deep-rgb: 29 75 119;
  --steel: #3b7fbd;  --steel-rgb: 59 127 189;
  --accent: #f2b134;  --accent-rgb: 242 177 52;
  --accent-soft: #ffd77a;  --accent-text: #a8650c;
  --slate: #5b6b7c;  --ink: #1b2a3a;  --ink-rgb: 27 42 58;
  --text: #3d4f63;  --text-strong: #1b2a3a;  --bg: #ffffff;  --tint: #f3f7fb;  --tint-2: #f3f7fb;  --shadow-rgb: 20 40 70;
  --band-grad: #2f6fa8;
  --cta: #a3560f;  --cta-hover: #84450b;
  --join-bg: #fff;  --join-ink: #a3560f;
  --logo-teal: #7cb6e8;  --logo-green: #f2c14e;
}
html[data-palette="7"] {   /* 薄荷綠＋珊瑚：清新柔和，帶一點暖意 */
  --primary: #237a6d;  --primary-rgb: 35 122 109;
  --primary-deep: #15574f;  --deep-rgb: 21 87 79;
  --steel: #2f8f80;  --steel-rgb: 47 143 128;
  --accent: #ff8a70;  --accent-rgb: 255 138 112;
  --accent-soft: #ffc2b3;  --accent-text: #c0442c;
  --slate: #56706b;  --ink: #182e2b;  --ink-rgb: 24 46 43;
  --text: #3c5551;  --text-strong: #182e2b;  --bg: #ffffff;  --tint: #f1f8f6;  --tint-2: #f1f8f6;  --shadow-rgb: 16 50 46;
  --band-grad: #2a8577;
  --cta: #c94a32;  --cta-hover: #a63b27;
  --join-bg: #fff;  --join-ink: #c94a32;
  --logo-teal: #7fd1bf;  --logo-green: #ffab96;
}
html[data-palette="8"] {   /* 薰衣草紫＋暖杏：溫柔親切，適合閱讀與藝文感 */
  --primary: #5b5ea6;  --primary-rgb: 91 94 166;
  --primary-deep: #3a3c78;  --deep-rgb: 58 60 120;
  --steel: #6c70b8;  --steel-rgb: 108 112 184;
  --accent: #f0a868;  --accent-rgb: 240 168 104;
  --accent-soft: #ffd2a8;  --accent-text: #9a5a1c;
  --slate: #64667e;  --ink: #22233a;  --ink-rgb: 34 35 58;
  --text: #45475f;  --text-strong: #22233a;  --bg: #ffffff;  --tint: #f6f6fb;  --tint-2: #f6f6fb;  --shadow-rgb: 34 30 70;
  --band-grad: #5b5ea6;
  --cta: #b05a24;  --cta-hover: #8f481c;
  --join-bg: #fff;  --join-ink: #b05a24;
  --logo-teal: #a9abe0;  --logo-green: #f5c08e;
}

/* 9～11：淡色版。色塊（底條、圓形、LINE 區…）改成淺粉彩，上面的字改深色；覆寫規則在 site.css 與 home.css 的「淡色版」段落 */
html[data-palette="9"] {   /* 淡空藍 */
  --primary: #2f6496;  --primary-rgb: 47 100 150;
  --primary-deep: #1e4166;  --deep-rgb: 30 65 102;
  --steel: #2f6496;  --steel-rgb: 47 100 150;
  --accent: #f2a65a;  --accent-rgb: 242 166 90;
  --accent-soft: #f8c99a;  --accent-text: #a3561a;
  --slate: #5b6b7c;  --ink: #1b2a3a;  --ink-rgb: 27 42 58;
  --text: #3d4f63;  --text-strong: #1b2a3a;  --bg: #ffffff;  --tint: #f3f8fd;  --tint-2: #f3f8fd;  --shadow-rgb: 30 60 100;
  --band-grad: #e3f0fb;  --band-2: #cfe4f6;
  --cta: #b5571f;  --cta-hover: #94461a;
  --join-bg: #b5571f;  --join-ink: #fff;
  --logo-teal: #9cc9ee;  --logo-green: #f6c38f;
}
html[data-palette="10"] {   /* 淡薄荷 */
  --primary: #227266;  --primary-rgb: 34 114 102;
  --primary-deep: #134a42;  --deep-rgb: 19 74 66;
  --steel: #227266;  --steel-rgb: 34 114 102;
  --accent: #f59e8b;  --accent-rgb: 245 158 139;
  --accent-soft: #f9c6bb;  --accent-text: #b84a35;
  --slate: #56706b;  --ink: #182e2b;  --ink-rgb: 24 46 43;
  --text: #3c5551;  --text-strong: #182e2b;  --bg: #ffffff;  --tint: #f2faf7;  --tint-2: #f2faf7;  --shadow-rgb: 30 80 70;
  --band-grad: #def3ec;  --band-2: #c7eadf;
  --cta: #c4513b;  --cta-hover: #a2402e;
  --join-bg: #c4513b;  --join-ink: #fff;
  --logo-teal: #9adbc8;  --logo-green: #f7b8aa;
}
html[data-palette="11"] {   /* 淡杏桃 */
  --primary: #9a4f2c;  --primary-rgb: 154 79 44;
  --primary-deep: #6b3a22;  --deep-rgb: 107 58 34;
  --steel: #9a4f2c;  --steel-rgb: 154 79 44;
  --accent: #6fb7a8;  --accent-rgb: 111 183 168;
  --accent-soft: #a9d9cf;  --accent-text: #2f7a6d;
  --slate: #76655c;  --ink: #2e2019;  --ink-rgb: 46 32 25;
  --text: #55453c;  --text-strong: #2e2019;  --bg: #ffffff;  --tint: #fdf6f1;  --tint-2: #fdf6f1;  --shadow-rgb: 100 60 40;
  --band-grad: #fdeadd;  --band-2: #fad9c4;
  --cta: #2f7a6d;  --cta-hover: #245f55;
  --join-bg: #2f7a6d;  --join-ink: #fff;
  --logo-teal: #f5bfa0;  --logo-green: #9fd3c7;
}
html[data-palette="12"] {   /* LOGO 繽紛 B：草綠領頭，橘、湖水綠、棕輪替 */
  --primary: #1b7d76;  --primary-rgb: 27 125 118;
  --primary-deep: #0f4f4b;  --deep-rgb: 15 79 75;
  --steel: #1b7d76;  --steel-rgb: 27 125 118;
  --accent: #f1622f;  --accent-rgb: 241 98 47;
  --accent-soft: #ffc2a6;  --accent-text: #b5401a;
  --slate: #5a6866;  --ink: #1b2826;  --ink-rgb: 27 40 38;
  --text: #3e4e4c;  --text-strong: #2b3a38;  --bg: #ffffff;  --tint: #f4f6f6;  --tint-2: #f7f9f9;  --shadow-rgb: 20 36 34;
  --band-grad: #367f3f;
  --cta: #c8461a;  --cta-hover: #a33914;
  --join-bg: #c8461a;  --join-ink: #fff;
  --v-teal: #1b7d76;  --v-green: #367f3f;  --v-orange: #c8461a;  --v-brown: #7a6046;
}

/* 13～16：正式、學術感的配色 */
html[data-palette="13"] {   /* 學院深藍＋金：沉穩正式，傳統大學感 */
  --primary: #1f3a5f;  --primary-rgb: 31 58 95;
  --primary-deep: #132640;  --deep-rgb: 19 38 64;
  --steel: #2c4f7c;  --steel-rgb: 44 79 124;
  --accent: #c9a04a;  --accent-rgb: 201 160 74;
  --accent-soft: #e6cc8f;  --accent-text: #8a6a24;
  --slate: #5a6676;  --ink: #17202c;  --ink-rgb: 23 32 44;
  --text: #3b4757;  --text-strong: #17202c;  --bg: #ffffff;  --tint: #f4f6f9;  --tint-2: #f4f6f9;  --shadow-rgb: 19 38 64;
  --band-grad: #1f3a5f;
  --cta: #8a6a24;  --cta-hover: #6f551c;
  --join-bg: #fff;  --join-ink: #1f3a5f;
  --logo-teal: #8fa6c4;  --logo-green: #d9bd7a;
}
html[data-palette="14"] {   /* 酒紅＋暖灰：典雅、人文學術感 */
  --primary: #7a2738;  --primary-rgb: 122 39 56;
  --primary-deep: #521a26;  --deep-rgb: 82 26 38;
  --steel: #8f3446;  --steel-rgb: 143 52 70;
  --accent: #b89a6a;  --accent-rgb: 184 154 106;
  --accent-soft: #dcc8a6;  --accent-text: #7d6338;
  --slate: #6e6466;  --ink: #2a1a1e;  --ink-rgb: 42 26 30;
  --text: #4e4245;  --text-strong: #2a1a1e;  --bg: #ffffff;  --tint: #f8f5f5;  --tint-2: #f8f5f5;  --shadow-rgb: 60 26 34;
  --band-grad: #7a2738;
  --cta: #7a2738;  --cta-hover: #5e1e2b;
  --join-bg: #fff;  --join-ink: #7a2738;
  --logo-teal: #c79aa3;  --logo-green: #cdb48c;
}
html[data-palette="15"] {   /* 墨綠＋古銅：穩重、研究機構感 */
  --primary: #234d3c;  --primary-rgb: 35 77 60;
  --primary-deep: #163328;  --deep-rgb: 22 51 40;
  --steel: #2f6450;  --steel-rgb: 47 100 80;
  --accent: #b07a3a;  --accent-rgb: 176 122 58;
  --accent-soft: #ddb98a;  --accent-text: #8a5a20;
  --slate: #5d6a63;  --ink: #18241e;  --ink-rgb: 24 36 30;
  --text: #3d4b44;  --text-strong: #18241e;  --bg: #ffffff;  --tint: #f4f7f5;  --tint-2: #f4f7f5;  --shadow-rgb: 22 51 40;
  --band-grad: #234d3c;
  --cta: #8a5a20;  --cta-hover: #6e4819;
  --join-bg: #fff;  --join-ink: #234d3c;
  --logo-teal: #8fb3a2;  --logo-green: #d4a96f;
}
html[data-palette="16"] {   /* 石墨灰＋鋼藍：理性、現代學術感 */
  --primary: #37424e;  --primary-rgb: 55 66 78;
  --primary-deep: #232b33;  --deep-rgb: 35 43 51;
  --steel: #4a5866;  --steel-rgb: 74 88 102;
  --accent: #2f6fa8;  --accent-rgb: 47 111 168;
  --accent-soft: #9cc0e2;  --accent-text: #2a649a;
  --slate: #626b74;  --ink: #1c2228;  --ink-rgb: 28 34 40;
  --text: #424b55;  --text-strong: #1c2228;  --bg: #ffffff;  --tint: #f5f6f7;  --tint-2: #f5f6f7;  --shadow-rgb: 35 43 51;
  --band-grad: #37424e;
  --cta: #2a649a;  --cta-hover: #21507c;
  --join-bg: #fff;  --join-ink: #37424e;
  --logo-teal: #a7b3bf;  --logo-green: #8fb6dc;
}
html[data-fs="s"] { --fs: 1; }
html[data-fs="l"] { --fs: 1.25; }
/* 等比例縮放：以 1707px 寬為基準（2560 螢幕 150% 顯示，也就是設計定稿的畫面）。
   螢幕更寬時整頁（字、間距、卡片、圖形）一起放大，最多 1.6 倍；比基準窄時不縮放，照常響應式排版。
   版面尺寸寫成 calc(N * var(--px))（只跟著螢幕縮放），字級用 rem（螢幕縮放 × 字級小中大） */
@property --px { syntax: "<length>"; inherits: true; initial-value: 1px; }
:root { --px: clamp(1px, 100vw / 1707, 1.6px); }
html { font-size: calc(16 * var(--px) * var(--fs)); }

/* ② 基礎 -------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 88% -4%, rgb(var(--primary-rgb) / .08), transparent 30%),
    radial-gradient(circle at -4% 8%, rgb(var(--steel-rgb) / .07), transparent 26%),
    var(--bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }

/* ③ 頁首 + 主導覽 + 下拉子選單 ---------------------------------------
   A 版（預設）：一列，LOGO 靠左、主選單置中、右側無障礙工具（字級／高對比）
   B 版（html[data-header="b"]）：兩列都置中；往下捲動時 LOGO 列捲走，只留選單列黏在上方 */
.site-header {
  position: sticky; top: 0; z-index: 20; width: 100%; min-height: calc(92 * var(--px)); margin: 0; padding: 0 clamp(calc(16 * var(--px)), 2.4vw, calc(40 * var(--px)));
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "brand nav tools"; align-items: stretch;
  background: rgb(255 255 255 / .96); box-shadow: 0 calc(4 * var(--px)) calc(18 * var(--px)) rgb(var(--shadow-rgb) / .12); backdrop-filter: blur(calc(12 * var(--px)));
}
.brand { grid-area: brand; justify-self: start; display: flex; align-items: center; padding: calc(12 * var(--px)) 0; }
.brand-logo { display: block; height: calc(70 * var(--px)); width: auto; }

.nav { grid-area: nav; justify-self: center; display: flex; align-self: stretch; align-items: stretch; gap: clamp(calc(2 * var(--px)), .8vw, calc(16 * var(--px))); font-size: min(1.1875rem, calc(22 * var(--px))); letter-spacing: calc(1 * var(--px)); }
.nav-item { position: relative; display: flex; }
.nav-item > a { display: flex; align-items: center; padding: 0 clamp(calc(10 * var(--px)), 1.3vw, calc(22 * var(--px))); font-weight: 700; color: var(--ink); white-space: nowrap; }
.nav-item > a.cur { color: var(--primary); }
.nav-item > a::after { position: absolute; left: clamp(calc(10 * var(--px)), 1.3vw, calc(22 * var(--px))); right: clamp(calc(10 * var(--px)), 1.3vw, calc(22 * var(--px))); bottom: 0; height: calc(3 * var(--px)); content: ""; transform: scaleX(0); transform-origin: left; background: var(--accent); transition: transform .2s ease; }
.nav-item > a.cur::after { transform: scaleX(1); }
.nav-item:hover > a { color: var(--primary); }
.nav-item:hover > a::after { transform: scaleX(1); }
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 100%; width: max-content; padding: calc(8 * var(--px)); background: #fff;
  border-top: calc(3 * var(--px)) solid var(--accent);
  clip-path: polygon(0 0, calc(100% - calc(16 * var(--px))) 0, 100% calc(16 * var(--px)), 100% 100%, 0 100%);
  filter: drop-shadow(0 calc(16 * var(--px)) calc(28 * var(--px)) rgb(var(--shadow-rgb) / .18));
  opacity: 0; visibility: hidden; transform: translateY(calc(8 * var(--px)));
  transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 40;
}
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: calc(12 * var(--px)) calc(20 * var(--px)); font-size: min(1.0625rem, calc(20 * var(--px))); line-height: 1.5; font-weight: 600; color: var(--ink); white-space: nowrap; transition: background .15s ease, color .15s ease; }
.dropdown a:hover { background: rgb(var(--primary-rgb) / .08); color: var(--primary); }
.nav-item:last-child .dropdown { left: auto; right: 0; }

/* 右側工具：字級（小／中／大）＋高對比。字級按鈕不跟著縮放，避免頁首跳動 */
.hd-tools { grid-area: tools; justify-self: end; display: flex; align-items: center; gap: calc(10 * var(--px)); font-size: calc(14 * var(--px)); }
.fs-pick { display: flex; align-items: center; gap: calc(2 * var(--px)); }
.tool-k { margin-right: calc(6 * var(--px)); color: var(--slate); font-weight: 700; letter-spacing: calc(1 * var(--px)); }
.fs-pick button, .hc-toggle {
  display: grid; place-items: center; height: calc(34 * var(--px)); padding: 0; font: inherit; font-weight: 800; color: var(--primary-deep);
  background: transparent; border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .22); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.fs-pick button { width: calc(34 * var(--px)); }
.fs-pick button[data-fs="s"] { font-size: calc(13 * var(--px)); }
.fs-pick button[data-fs="m"] { font-size: calc(15 * var(--px)); }
.fs-pick button[data-fs="l"] { font-size: calc(18 * var(--px)); }
.fs-pick button + button { margin-left: calc(-1 * var(--px)); }
.fs-pick button:hover, .hc-toggle:hover { background: rgb(var(--primary-rgb) / .08); }
.fs-pick button[aria-pressed="true"] { position: relative; color: #fff; background: var(--primary); border-color: var(--primary); }
.hc-toggle { display: flex; gap: calc(6 * var(--px)); padding: 0 calc(12 * var(--px)); }
.hc-toggle svg { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.hc-toggle[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
/* 停止動畫：所有持續動畫停在原地（JS 驅動的星座訊號、機器人另外判斷 data-still） */
html[data-still] *, html[data-still] *::before, html[data-still] *::after { animation-play-state: paused !important; }

/* B 版：兩列置中 */
html[data-header="b"] { --hdr-stick: calc(60 * var(--px)); }
html[data-header="b"] .site-header { --brand-row: calc(100 * var(--px)); top: calc(-1 * var(--brand-row)); grid-template-rows: var(--brand-row) calc(60 * var(--px)); grid-template-areas: "brand brand brand" ". nav tools"; }
html[data-header="b"] .site-header::before { position: absolute; left: 0; right: 0; top: var(--brand-row); height: calc(1 * var(--px)); content: ""; background: rgb(var(--ink-rgb) / .08); }
html[data-header="b"] .brand { justify-self: center; padding: calc(14 * var(--px)) 0 calc(10 * var(--px)); }
html[data-header="b"] .brand-logo { height: calc(72 * var(--px)); }

/* ④ 內頁框架：標題帶 + 左側子選單 + 分頁內容 ------------------------- */
.page-hero {
  position: relative; overflow: hidden; padding: calc(44 * var(--px)) clamp(calc(24 * var(--px)), 5vw, calc(80 * var(--px))) calc(38 * var(--px)); color: #fff;
  background: var(--band-grad);
}
.page-hero .inner { position: relative; z-index: 1; width: min(94vw, calc(1640 * var(--px))); margin: 0 auto; }
.breadcrumb { font-size: 0.8125rem; color: rgba(255, 255, 255, .75); margin-bottom: calc(12 * var(--px)); }
.breadcrumb a:hover { color: #fff; }
.page-hero h1 { margin: 0; font-size: clamp(1.625rem, calc(3vw * var(--fs)), 2.5rem); font-weight: 900; letter-spacing: calc(1 * var(--px)); display: inline-block; }
.page-hero .en { margin-left: calc(12 * var(--px)); font-size: 0.9375rem; font-weight: 800; color: rgba(255, 255, 255, .7); }

.about-wrap { width: min(94vw, calc(1640 * var(--px))); margin: 0 auto; padding: calc(34 * var(--px)) 0 calc(64 * var(--px)); display: grid; grid-template-columns: calc(288 * var(--px)) 1fr; gap: calc(32 * var(--px)); align-items: start; }
.subnav {
  position: sticky; top: calc(var(--hdr-stick) + calc(20 * var(--px))); background: #fff; padding: calc(10 * var(--px));
  border-top: calc(3 * var(--px)) solid var(--accent);
  clip-path: polygon(0 0, calc(100% - calc(16 * var(--px))) 0, 100% calc(16 * var(--px)), 100% 100%, 0 100%);
  filter: drop-shadow(0 calc(14 * var(--px)) calc(26 * var(--px)) rgb(var(--shadow-rgb) / .1));
}
.subnav .label { padding: calc(6 * var(--px)) calc(16 * var(--px)) calc(10 * var(--px)); font-size: 0.8125rem; font-weight: 800; color: var(--slate); }
.subnav a { position: relative; display: block; padding: calc(13 * var(--px)) calc(18 * var(--px)); font-size: 1.0625rem; line-height: 1.5; font-weight: 700; color: var(--ink); transition: background .15s ease, color .15s ease; }
.subnav a::before { position: absolute; left: 0; top: 50%; width: calc(3 * var(--px)); height: 0; content: ""; transform: translateY(-50%); background: var(--accent); transition: height .2s ease; }
.subnav a:hover { background: rgb(var(--primary-rgb) / .06); color: var(--primary); }
.subnav a.active { color: var(--primary); background: rgb(var(--primary-rgb) / .08); }
.subnav a.active::before { height: 62%; }

.content { background: #fff; padding: clamp(calc(24 * var(--px)), 3vw, calc(46 * var(--px))); clip-path: polygon(0 0, calc(100% - calc(30 * var(--px))) 0, 100% calc(30 * var(--px)), 100% 100%, 0 100%); filter: drop-shadow(0 calc(16 * var(--px)) calc(32 * var(--px)) rgb(var(--shadow-rgb) / .09)); }
.panel { display: none; }
.panel.active { display: block; animation: fade .26s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(calc(8 * var(--px))); } to { opacity: 1; transform: none; } }

.sec-title { display: flex; align-items: center; gap: calc(12 * var(--px)); margin: calc(4 * var(--px)) 0 calc(20 * var(--px)); font-size: 1.25rem; font-weight: 800; color: var(--primary-deep); }
.sec-title::before { content: ""; width: calc(14 * var(--px)); height: calc(14 * var(--px)); flex: none; background: var(--primary); }
.block { margin-bottom: calc(36 * var(--px)); }
.block:last-child { margin-bottom: 0; }
.hint { display: inline-block; margin-left: calc(8 * var(--px)); padding: calc(2 * var(--px)) calc(10 * var(--px)); border-radius: calc(999 * var(--px)); font-size: 0.75rem; font-weight: 700; color: var(--accent-text); background: rgb(var(--accent-rgb) / .12); }

/* ⑤ 元件 -------------------------------------------------------------- */

/* 5a 資料表（歷任主任等） */
.tbl { width: 100%; border-collapse: collapse; overflow: hidden; }
.tbl th { padding: calc(13 * var(--px)) calc(18 * var(--px)); text-align: left; font-size: 0.875rem; font-weight: 800; color: #fff; background: var(--primary); }
.tbl td { padding: calc(13 * var(--px)) calc(18 * var(--px)); border-bottom: calc(1 * var(--px)) solid rgb(var(--ink-rgb) / .1); font-size: 0.9375rem; color: var(--text-strong); }
.tbl tr:hover td { background: rgb(var(--primary-rgb) / .045); }
.tbl .c { text-align: center; color: var(--slate); }
.tbl th.c { color: #fff; }

/* 5b 主任名片（歷史沿革） */
.director { text-align: center; margin-bottom: calc(14 * var(--px)); }
.director .photo { width: calc(196 * var(--px)); height: calc(236 * var(--px)); margin: 0 auto calc(16 * var(--px)); display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 60%, #fff); font-size: 0.875rem; letter-spacing: calc(2 * var(--px)); background: repeating-linear-gradient(135deg, #eef1f4 0 calc(12 * var(--px)), #e4e9ee calc(12 * var(--px)) calc(24 * var(--px))); clip-path: polygon(0 0, calc(100% - calc(22 * var(--px))) 0, 100% calc(22 * var(--px)), 100% 100%, 0 100%); }
.director .name { font-size: 1.125rem; font-weight: 800; }
.director .roles { margin-top: calc(8 * var(--px)); color: var(--slate); font-size: 0.875rem; line-height: 1.6; }

/* 5c 人員卡（人員組織） */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(220 * var(--px)), 1fr)); gap: calc(16 * var(--px)); }
.person { display: flex; align-items: center; gap: calc(14 * var(--px)); padding: calc(16 * var(--px)) calc(18 * var(--px)); background: var(--tint-2); border-left: calc(3 * var(--px)) solid var(--accent); }
.person .avatar { flex: none; width: calc(46 * var(--px)); height: calc(46 * var(--px)); display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; }
.person .nm { font-weight: 800; }
.person .ti { color: var(--slate); font-size: 0.8125rem; margin-top: calc(2 * var(--px)); }

/* 5d 文字/清單（工作要項、介紹頁、說明頁） */
.lead-text { color: var(--text); font-size: 1rem; line-height: 1.95; }
.lead-text + .lead-text { margin-top: calc(14 * var(--px)); }
/* 後台頁面編輯器的內容（標題、段落、強調文字、步驟…整段一起）：區塊間距與原本逐塊排列相同 */
.page-flow > .sec-title { line-height: normal; }
.page-flow > .sec-title:not(:first-child) { margin-top: calc(38 * var(--px)); }
.desc { color: var(--text); font-size: 1rem; line-height: 1.95; }
.desc + .desc { margin-top: calc(16 * var(--px)); }
.t-list { display: grid; gap: calc(9 * var(--px)); margin: calc(10 * var(--px)) 0 0; }
.t-list .row2 { display: grid; grid-template-columns: calc(26 * var(--px)) 1fr; gap: calc(10 * var(--px)); font-size: 0.9375rem; line-height: 1.8; color: var(--text); }
.t-list .row2 .k { font-weight: 800; color: var(--primary); }
.t-bullets { margin: calc(10 * var(--px)) 0 0; padding: 0; list-style: none; display: grid; gap: calc(9 * var(--px)); }
.t-bullets li { position: relative; padding-left: calc(20 * var(--px)); font-size: 0.9375rem; line-height: 1.75; color: var(--text); }
.t-bullets li::before { content: ""; position: absolute; left: calc(3 * var(--px)); top: calc(11 * var(--px)); width: calc(7 * var(--px)); height: calc(7 * var(--px)); background: var(--accent); }
.duties { display: grid; gap: calc(16 * var(--px)); }
.duty { display: grid; grid-template-columns: calc(36 * var(--px)) 1fr; gap: calc(16 * var(--px)); align-items: start; }
.duty .no { width: calc(34 * var(--px)); height: calc(34 * var(--px)); display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--primary); clip-path: polygon(0 0, calc(100% - calc(8 * var(--px))) 0, 100% calc(8 * var(--px)), 100% 100%, 0 100%); }
.duty b { font-size: 1rem; }
.duty p { margin: calc(5 * var(--px)) 0 0; color: var(--slate); font-size: 0.9062rem; line-height: 1.7; }

/* 5e 重點框「融入 18 項目標」 */
.goal-box { margin-top: calc(12 * var(--px)); padding: calc(18 * var(--px)) calc(22 * var(--px)); background: rgb(var(--primary-rgb) / .055); border-left: calc(4 * var(--px)) solid var(--primary); }
.goal-box .gh { font-weight: 800; color: var(--primary-deep); margin-bottom: calc(6 * var(--px)); }
.goal-box .g { font-size: 0.9062rem; line-height: 1.75; color: var(--text); margin-top: calc(8 * var(--px)); }
.goal-box .g b { color: var(--primary); }

/* 5f 圖片/圖說 */
.figure { margin-top: calc(22 * var(--px)); }
.figure .ph { width: min(calc(440 * var(--px)), 100%); aspect-ratio: 4 / 3; display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 60%, #fff); font-size: 0.8125rem; letter-spacing: calc(2 * var(--px)); background: repeating-linear-gradient(135deg, #eef1f4 0 calc(12 * var(--px)), #e4e9ee calc(12 * var(--px)) calc(24 * var(--px))); clip-path: polygon(0 0, calc(100% - calc(20 * var(--px))) 0, 100% calc(20 * var(--px)), 100% 100%, 0 100%); }
.figure figcaption { margin-top: calc(8 * var(--px)); color: var(--slate); font-size: 0.8125rem; }

/* 5g 作業要點（計畫申請） */
.gl-row { padding: calc(14 * var(--px)) calc(18 * var(--px)); margin-bottom: calc(10 * var(--px)); background: var(--tint); color: var(--text); font-size: 0.9375rem; line-height: 1.75; }
.gl-row .star { color: var(--primary); font-weight: 800; margin-right: calc(6 * var(--px)); }
.gl-row.hl { background: rgb(var(--accent-rgb) / .15); border-left: calc(4 * var(--px)) solid var(--accent); color: color-mix(in srgb, var(--accent-text) 68%, #000); font-weight: 700; }
.gl-list { display: grid; gap: calc(16 * var(--px)); margin-top: calc(4 * var(--px)); }
.gl-item { display: grid; grid-template-columns: calc(30 * var(--px)) 1fr; gap: calc(12 * var(--px)); font-size: 0.9375rem; line-height: 1.8; color: var(--text); }
.gl-item .nm { font-weight: 800; color: var(--primary-deep); }
.gl-sub { margin: calc(8 * var(--px)) 0 0; display: grid; gap: calc(5 * var(--px)); color: var(--slate); font-size: 0.9062rem; line-height: 1.7; }
.em { color: #c0392b; font-weight: 700; }

/* 5h 篩選列 + 年度/類別下拉 */
.filter-bar { margin-bottom: calc(24 * var(--px)); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: calc(14 * var(--px)); margin-bottom: calc(24 * var(--px)); }
.year-select { width: 100%; padding: calc(13 * var(--px)) calc(16 * var(--px)); font: inherit; font-weight: 700; color: var(--primary-deep); text-align: center; text-align-last: center; background: #fff; border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .22); }

/* 5i 卡片網格（活動/花絮/成果相簿） */
.event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(20 * var(--px)); }
.event-grid.cols4 { grid-template-columns: repeat(4, 1fr); }
.event-card { display: flex; flex-direction: column; background: var(--tint-2); clip-path: polygon(0 0, calc(100% - calc(18 * var(--px))) 0, 100% calc(18 * var(--px)), 100% 100%, 0 100%); transition: transform .18s ease; }
.event-card:hover { transform: translateY(calc(-3 * var(--px))); }
.event-card .thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; color: rgba(255, 255, 255, .85); font-size: 0.8125rem; letter-spacing: calc(2 * var(--px)); background: linear-gradient(135deg, var(--steel), var(--primary)); }
.thumb-a { background: linear-gradient(135deg, var(--steel), var(--primary)); }
.thumb-b { background: linear-gradient(135deg, var(--primary-deep), var(--steel)); }
.thumb-c { background: linear-gradient(135deg, var(--slate), var(--primary-deep)); }
.thumb-d { background: linear-gradient(135deg, var(--steel), var(--primary-deep)); }
.event-card .body { padding: calc(14 * var(--px)) calc(16 * var(--px)) calc(16 * var(--px)); display: flex; flex-direction: column; gap: calc(7 * var(--px)); flex: 1; }
.event-card .date { color: var(--slate); font-size: 0.8125rem; }
.event-card h3 { margin: 0; font-size: 0.9375rem; line-height: 1.45; }
.event-card .views { color: var(--muted); font-size: 0.8125rem; }
.event-card .more { margin-top: auto; align-self: flex-start; color: var(--primary); font-weight: 800; font-size: 0.875rem; }
.event-card .more::after { content: " ›"; }

/* 師生迴響：照片＋校名（一校一筆） */
/* 師生迴響卡片：沿用活動卡片，多一行心得與「首頁輪播中」標籤 */
.fb-card .thumb, .event-card .thumb { position: relative; }
/* 科教活動主題頁：活動紀錄（學年度切換＋卡片） */
.te-title { margin-top: calc(40 * var(--px)); }
.yr-tabs { display: flex; flex-wrap: wrap; gap: calc(8 * var(--px)); margin: 0 0 calc(18 * var(--px)); }
.yr-tabs button { padding: calc(8 * var(--px)) calc(16 * var(--px)); font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--primary-deep); background: var(--tint); border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .16); cursor: pointer; transition: background .15s ease, color .15s ease; }
.yr-tabs button:hover { background: rgb(var(--primary-rgb) / .08); }
.yr-tabs button[aria-pressed="true"] { color: #fff; background: var(--primary); border-color: var(--primary); }
.te-card[hidden], [data-yr-block] [data-year][hidden] { display: none; } /* 學年度切換：其他年的卡片不顯示，照片也不會下載 */
.te-school { margin: 0; color: var(--text); font-size: 0.875rem; font-weight: 600; }
.fb-quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0; color: var(--text); font-size: 0.875rem; line-height: 1.6; }
.fb-quote::before { content: "“"; margin-right: calc(2 * var(--px)); color: var(--accent); font-weight: 900; }
.fb-pin { position: absolute; top: calc(10 * var(--px)); left: calc(10 * var(--px)); padding: calc(3 * var(--px)) calc(10 * var(--px)); background: var(--primary-deep); color: #fff; font-size: 0.75rem; font-weight: 800; letter-spacing: calc(1 * var(--px)); }

/* 5j 下載清單（年度報告書） */
.dl-list { display: grid; gap: calc(10 * var(--px)); }
.dl-row { display: flex; align-items: center; gap: calc(16 * var(--px)); padding: calc(16 * var(--px)) calc(20 * var(--px)); background: var(--tint); transition: background .15s ease; }
.dl-row:hover { background: rgb(var(--primary-rgb) / .06); }
.dl-row .fi { flex: none; width: calc(30 * var(--px)); height: calc(36 * var(--px)); background: linear-gradient(135deg, var(--accent-soft), var(--accent)); clip-path: polygon(0 0, 70% 0, 100% 26%, 100% 100%, 0 100%); }
.dl-row .nm { flex: 1; font-size: 0.9688rem; font-weight: 600; color: var(--text-strong); }
.dl-row .dl { flex: none; width: calc(32 * var(--px)); height: calc(32 * var(--px)); display: grid; place-items: center; border-radius: 50%; border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .3); color: var(--primary); font-size: 1rem; transition: background .15s ease, color .15s ease; }
.dl-row:hover .dl { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 5k 聯絡資訊 + 地圖（聯繫我們） */
.contact-rows { display: grid; gap: calc(16 * var(--px)); font-size: 1rem; }
.contact-rows .row { display: flex; align-items: center; gap: calc(14 * var(--px)); color: var(--text-strong); }
.contact-rows .ic { flex: none; width: calc(38 * var(--px)); height: calc(38 * var(--px)); display: grid; place-items: center; border-radius: calc(10 * var(--px)); color: #fff; background: linear-gradient(135deg, var(--primary), var(--steel)); font-size: 1.0625rem; }
.map { margin-top: calc(14 * var(--px)); aspect-ratio: 16 / 6.5; display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 68%, #fff); font-size: 0.875rem; letter-spacing: calc(2 * var(--px)); background: repeating-linear-gradient(45deg, #eef1f4 0 calc(16 * var(--px)), #e4e9ee calc(16 * var(--px)) calc(32 * var(--px))); clip-path: polygon(0 0, calc(100% - calc(26 * var(--px))) 0, 100% calc(26 * var(--px)), 100% 100%, 0 100%); }

/* 5l 分頁 */
.pager { display: flex; justify-content: center; gap: calc(8 * var(--px)); margin-top: calc(30 * var(--px)); flex-wrap: wrap; }
.pager button { padding: calc(8 * var(--px)) calc(14 * var(--px)); font: inherit; font-size: 0.875rem; color: var(--slate); background: #fff; border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .2); cursor: pointer; }
.pager button.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:hover:not(.cur):not(:disabled) { background: rgb(var(--primary-rgb) / .06); }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .gap { align-self: center; padding: 0 calc(4 * var(--px)); color: var(--slate); }
/* 最新消息：分類籤（沿用學年度切換的樣子）＋頁碼 */
.news-filter[hidden], .news-pager[hidden], .news-row[hidden] { display: none; }
.news-filter button .n { margin-left: .45em; font-weight: 600; font-size: .8125rem; opacity: .75; }
.news-pager { margin-top: calc(24 * var(--px)); }
.tag-filter { cursor: pointer; }
.tag-filter:hover, a.tag:hover { background: var(--primary-deep); color: #fff; }

/* ⑥ 頁尾 -------------------------------------------------- */
.footer { flex-shrink: 0; width: 100%; padding: calc(30 * var(--px)) clamp(calc(24 * var(--px)), 5vw, calc(80 * var(--px))); background: rgba(255, 255, 255, .96); box-shadow: 0 calc(-4 * var(--px)) calc(18 * var(--px)) rgb(var(--shadow-rgb) / .12); }
.footer-inner { width: min(94vw, calc(1640 * var(--px))); margin: 0 auto; display: flex; align-items: center; gap: calc(22 * var(--px)) calc(48 * var(--px)); flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.footer-brand { display: flex; align-items: center; gap: calc(14 * var(--px)); margin: 0; }
.footer-brand .brand-logo { height: calc(64 * var(--px)); }
.footer-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: calc(6 * var(--px)) calc(28 * var(--px)); margin-left: auto; font-size: 0.9375rem; line-height: 1.7; color: var(--slate); }
.footer-info a:hover { color: var(--primary); }


/* ⑦ 響應式 ------------------------------------------------------------ */
@media (max-width: 1320px) {
  /* 兩側放不下等寬欄時：選單在 LOGO 與工具之間的空間置中 */
  .site-header { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 1180px) {
  .brand-logo { height: calc(54 * var(--px)); }
  .nav { gap: 0; letter-spacing: 0; }
  .nav-item > a { padding: 0 calc(12 * var(--px)); }
  .nav-item > a::after { left: calc(12 * var(--px)); right: calc(12 * var(--px)); }
  .tool-k { display: none; }
  .hc-toggle span { display: none; }
  .hc-toggle { padding: 0 calc(9 * var(--px)); }
}
/* 平板、手機：A、B 版相同。第一列 LOGO＋工具，第二列主選單；往下捲動時只留選單列 */
@media (max-width: 960px) {
  :root, html[data-header="b"] { --hdr-stick: calc(54 * var(--px)); }
  .site-header, html[data-header="b"] .site-header {
    --brand-row: calc(76 * var(--px)); top: calc(-1 * var(--brand-row)); min-height: 0; padding: 0 calc(16 * var(--px));
    grid-template-columns: 1fr auto; grid-template-rows: var(--brand-row) calc(54 * var(--px)); grid-template-areas: "brand tools" "nav nav";
  }
  .site-header::before, html[data-header="b"] .site-header::before { position: absolute; left: 0; right: 0; top: var(--brand-row); height: calc(1 * var(--px)); content: ""; background: rgb(var(--ink-rgb) / .08); }
  .brand, html[data-header="b"] .brand { justify-self: start; padding: calc(10 * var(--px)) 0; }
  .brand-logo, html[data-header="b"] .brand-logo { height: calc(54 * var(--px)); }
}
@media (max-width: 980px) {
  .about-wrap { grid-template-columns: 1fr; gap: calc(18 * var(--px)); }
  .subnav { position: static; display: flex; gap: calc(4 * var(--px)); overflow-x: auto; padding: calc(8 * var(--px)); }
  .subnav .label { display: none; }
  .subnav a { white-space: nowrap; padding: calc(10 * var(--px)) calc(14 * var(--px)); }
  .subnav a::before { display: none; }
  .event-grid, .event-grid.cols4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .site-header, html[data-header="b"] .site-header { --brand-row: calc(64 * var(--px)); padding: 0 calc(12 * var(--px)); }
  .brand-logo, html[data-header="b"] .brand-logo { height: calc(46 * var(--px)); }
  /* 主選單 5 項（各 4 字）：字級跟著螢幕寬縮，375px 寬也排得下一列 */
  .nav { justify-self: stretch; justify-content: space-between; font-size: min(1rem, 3.9vw); }
  .nav-item > a { padding: 0 calc(4 * var(--px)); }
  .nav-item > a::after { left: calc(4 * var(--px)); right: calc(4 * var(--px)); }
  .nav-item { position: static; }
  .dropdown, .nav-item:last-child .dropdown { left: calc(8 * var(--px)); right: calc(8 * var(--px)); width: auto; min-width: 0; }
  .dropdown a { white-space: normal; }
  .fs-pick button { width: calc(30 * var(--px)); height: calc(32 * var(--px)); }
  .hc-toggle { height: calc(32 * var(--px)); }
  .footer-inner { width: 100%; }
  .footer-info { margin: 0; }
  .filters { grid-template-columns: 1fr; }
  .event-grid, .event-grid.cols4 { grid-template-columns: 1fr; }
}

/* 註：首頁（index）專屬的 Bento／滿版長河／切角覆寫等樣式，建議另存
   home.css 只在首頁載入，避免內頁載入用不到的規則。 */
/* 富文本內的巢狀編號清單：呈現為「一、二、」與子層「（一）（二）」 */
.lead-text ol { margin: calc(8 * var(--px)) 0; padding-left: 2em; list-style: cjk-ideographic; }
.lead-text ol > li { margin: calc(7 * var(--px)) 0; line-height: 1.85; color: var(--text); }
.lead-text ol > li::marker { color: var(--primary-deep); font-weight: 800; }
.lead-text ol ol { list-style: none; counter-reset: sub; padding-left: 1.4em; margin: calc(6 * var(--px)) 0; }
.lead-text ol ol > li { counter-increment: sub; }
.lead-text ol ol > li::before { content: "（" counter(sub, cjk-ideographic) "）"; margin-right: calc(2 * var(--px)); color: var(--slate); }
/* 最新消息列表 + 標籤 */
.tag { display: inline-block; padding: calc(2 * var(--px)) calc(12 * var(--px)); border-radius: calc(999 * var(--px)); font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--primary); }
.news-list { display: grid; gap: calc(10 * var(--px)); }
.news-row { display: flex; align-items: center; gap: calc(16 * var(--px)); padding: calc(16 * var(--px)) calc(20 * var(--px)); background: var(--tint); transition: background .15s ease; }
.news-row:hover { background: rgb(var(--primary-rgb) / .06); }
.news-row time { flex: none; width: 6.8em; color: var(--accent-text); font-weight: 800; font-size: 0.875rem; }
.news-row .t { flex: 1; font-weight: 600; color: var(--text-strong); }
/* 手機：日期與分類小小的放上面一行，消息標題自己一整行 */
@media (max-width: 760px) {
  .news-row { flex-wrap: wrap; gap: calc(6 * var(--px)) calc(10 * var(--px)); padding: calc(14 * var(--px)) calc(16 * var(--px)); }
  .news-row time { width: auto; font-size: 0.8125rem; }
  .news-row .tag { padding: 0 calc(9 * var(--px)); font-size: 0.6875rem; line-height: 1.7; }
  .news-row .t { flex-basis: 100%; line-height: 1.6; }
  .news-pager { gap: calc(6 * var(--px)); flex-wrap: nowrap; }
  .news-pager button { min-width: calc(38 * var(--px)); padding: calc(8 * var(--px)) calc(10 * var(--px)); }
  .news-pager .step .lbl { display: none; }
}

/* 協同研究人員卡片 */
.researchers { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(300 * var(--px)), 1fr)); gap: calc(18 * var(--px)); }
.researcher { display: grid; grid-template-columns: calc(96 * var(--px)) 1fr; gap: calc(18 * var(--px)); padding: calc(18 * var(--px)); background: var(--tint-2); border-left: calc(3 * var(--px)) solid var(--accent); }
.r-photo { width: calc(96 * var(--px)); aspect-ratio: 4 / 5; display: grid; place-items: center; color: #fff; font-size: 1.875rem; font-weight: 800; background: var(--primary) center / cover no-repeat; clip-path: polygon(0 0, calc(100% - calc(14 * var(--px))) 0, 100% calc(14 * var(--px)), 100% 100%, 0 100%); }
.r-name { font-size: 1.125rem; font-weight: 800; color: var(--primary-deep); }
.r-name small { margin-left: calc(10 * var(--px)); font-size: 0.875rem; font-weight: 700; color: var(--slate); }
.r-aff { margin-top: calc(6 * var(--px)); font-size: 0.9375rem; line-height: 1.7; color: var(--text); }
.r-exp { margin-top: calc(8 * var(--px)); font-size: 0.9062rem; line-height: 1.7; color: var(--slate); }
.r-exp b { margin-right: calc(8 * var(--px)); color: var(--accent-text); }

/* 分段切換（歷年成果） */
.seg { display: flex; flex-wrap: wrap; gap: calc(8 * var(--px)); margin-bottom: calc(24 * var(--px)); }
.seg button { padding: calc(10 * var(--px)) calc(18 * var(--px)); font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--primary-deep); background: var(--tint); border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .16); cursor: pointer; transition: background .15s ease, color .15s ease; }
.seg button:hover { background: rgb(var(--primary-rgb) / .08); }
.seg button.on { color: #fff; background: var(--primary); border-color: var(--primary); }
.seg-panel { display: none; }
.seg-panel.on { display: block; animation: fade .26s ease; }

/* 消息詳細頁：分類＋日期列 */
.news-meta { display: flex; align-items: center; gap: calc(14 * var(--px)); margin-bottom: calc(20 * var(--px)); color: var(--slate); }

/* 頁尾「管理登入」與登入頁 */
.staff-login { color: var(--muted); font-size: 0.875rem; text-decoration: underline; text-underline-offset: calc(3 * var(--px)); }
.staff-login:hover { color: var(--primary); }
.login-wrap { grid-template-columns: minmax(0, calc(560 * var(--px))); justify-content: center; }
.login-form { display: grid; gap: calc(8 * var(--px)); margin-top: calc(22 * var(--px)); }
.login-form label { margin-top: calc(8 * var(--px)); font-weight: 800; color: var(--primary-deep); }
.login-form input { padding: calc(12 * var(--px)) calc(14 * var(--px)); font: inherit; font-size: 1rem; background: var(--tint-2); border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .22); }
.login-form input:focus { outline: calc(2 * var(--px)) solid var(--accent); background: #fff; }
.login-form button { justify-self: start; margin-top: calc(12 * var(--px)); padding: calc(12 * var(--px)) calc(44 * var(--px)); font: inherit; font-size: 1.0625rem; font-weight: 800; color: #fff; background: var(--primary); border: 0; cursor: pointer; clip-path: polygon(0 0, calc(100% - calc(14 * var(--px))) 0, 100% calc(14 * var(--px)), 100% 100%, 0 100%); }
.login-form button:hover { background: var(--primary-deep); }
.login-form button:disabled { opacity: .6; }
.login-error { min-height: 1.4em; margin: calc(4 * var(--px)) 0 0; color: #b03a2e; font-weight: 700; }

/* 公告附件 */
.attach { display: grid; gap: calc(10 * var(--px)); margin-top: calc(30 * var(--px)); padding-top: calc(22 * var(--px)); border-top: calc(1 * var(--px)) solid rgb(var(--ink-rgb) / .12); }
.attach-head { font-size: 1.0625rem; font-weight: 800; color: var(--primary-deep); }
.attach .nm small { margin-left: calc(10 * var(--px)); font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
/* 活動／成果內容頁（深入了解）：封面、相簿、照片放大檢視 */
.event-card .more::before { position: absolute; inset: 0; z-index: 2; content: ""; }  /* 整張卡片都可點 */
.post-detail .news-meta { flex-wrap: wrap; row-gap: calc(8 * var(--px)); }
.post-views { margin-left: auto; font-size: 0.875rem; }
.post-quote { position: relative; margin: 0 0 calc(24 * var(--px)); padding: calc(18 * var(--px)) calc(24 * var(--px)) calc(18 * var(--px)) calc(56 * var(--px)); background: var(--tint-2); border-left: calc(4 * var(--px)) solid var(--accent); color: var(--primary-deep); font-size: 1.125rem; font-weight: 700; line-height: 1.75; }
.post-quote::before { position: absolute; left: calc(16 * var(--px)); top: calc(4 * var(--px)); content: "“"; color: var(--accent); font: 900 2.75rem/1 Georgia, serif; }
.post-cover { margin: 0 0 calc(26 * var(--px)); clip-path: polygon(0 0, calc(100% - calc(28 * var(--px))) 0, 100% calc(28 * var(--px)), 100% 100%, 0 100%); background: var(--tint-2); }
.post-cover img { display: block; width: 100%; max-height: min(70vh, calc(720 * var(--px))); object-fit: contain; }
.post-gallery { margin-top: calc(30 * var(--px)); padding-top: calc(22 * var(--px)); border-top: calc(1 * var(--px)) solid rgb(var(--ink-rgb) / .12); }
.post-gallery .attach-head small { margin-left: calc(12 * var(--px)); font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.pg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(12 * var(--px)); margin: calc(14 * var(--px)) 0 0; padding: 0; list-style: none; }
.pg-item { display: block; width: 100%; padding: 0; border: 0; background: var(--tint-2); cursor: zoom-in; overflow: hidden; }
.pg-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s var(--ease-out), opacity .2s ease; }
.pg-item:hover img { transform: scale(1.04); opacity: .9; }
.pg-box { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: calc(56 * var(--px)) calc(72 * var(--px)); background: rgb(var(--deep-rgb) / .92); }
.pg-box[hidden] { display: none; }
.pg-box img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 calc(10 * var(--px)) calc(40 * var(--px)) rgb(0 0 0 / .35); }
.pg-box button { position: absolute; display: grid; place-items: center; width: calc(48 * var(--px)); height: calc(48 * var(--px)); padding: 0; border: calc(1 * var(--px)) solid rgb(255 255 255 / .4); border-radius: 50%; font: inherit; font-size: 1.75rem; line-height: 1; color: #fff; background: rgb(255 255 255 / .08); cursor: pointer; transition: background .15s ease; }
.pg-box button:hover { background: rgb(255 255 255 / .22); }
.pg-x { top: calc(14 * var(--px)); right: calc(14 * var(--px)); }
.pg-nav { top: 50%; transform: translateY(-50%); }
.pg-nav.prev { left: calc(14 * var(--px)); }
.pg-nav.next { right: calc(14 * var(--px)); }
.pg-box.single .pg-nav, .pg-box.single .pg-count { display: none; }
.pg-count { position: absolute; bottom: calc(18 * var(--px)); left: 50%; transform: translateX(-50%); color: rgb(255 255 255 / .85); font-size: 0.875rem; letter-spacing: .08em; }
@media (max-width: 760px) {
  .pg-grid { grid-template-columns: repeat(2, 1fr); }
  .pg-box { padding: calc(64 * var(--px)) 0; }
  .pg-nav { top: auto; bottom: calc(8 * var(--px)); transform: none; }
  .post-views { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .pg-item img { transition: none; } }

.clip { display: inline-block; margin-left: calc(10 * var(--px)); padding: calc(1 * var(--px)) calc(8 * var(--px)); font-size: 0.75rem; font-weight: 700; color: var(--slate); border: calc(1 * var(--px)) solid rgb(var(--primary-rgb) / .25); vertical-align: calc(2 * var(--px)); }

/* 最新消息列表：置頂標籤 */
.pin-tag { display: inline-block; margin-right: calc(8 * var(--px)); padding: calc(1 * var(--px)) calc(8 * var(--px)); font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--accent-text); vertical-align: calc(2 * var(--px)); }

/* 跨頁面變形過渡：首頁的深藍色帶與內頁標題帶共用名稱 hero-band，換頁時平順變形
   （Chrome／Edge／Safari 支援；其他瀏覽器照常換頁）；系統設定減少動態時關閉 */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
.page-hero { view-transition-name: hero-band; }
::view-transition-group(hero-band) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); overflow: clip; }
::view-transition-old(hero-band), ::view-transition-new(hero-band) { height: 100%; object-fit: cover; object-position: top; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* =====================================================================
   全站動態（強度：html[data-motion] 1 輕／2 中／3 強；motion.js 負責需要計算的部分）
   節奏統一：回饋 .2s、進場 .6～.7s，同一條緩出曲線；系統減少動態時停用
   ===================================================================== */
:root { --ease-out: cubic-bezier(.2, .7, .2, 1); }

/* 環境：深藍帶上的同心圓緩慢漂移（所有強度） */

/* 回饋：箭頭輕推、卡片頂端琥珀線、列表左側琥珀線（所有強度） */
.arw { display: inline-block; transition: transform .2s var(--ease-out); }
a:hover .arw, a:focus-visible .arw { transform: translateX(calc(3 * var(--px))); }
.event-card { position: relative; }
.event-card::after { position: absolute; z-index: 1; left: 0; top: 0; width: 100%; height: calc(3 * var(--px)); content: ""; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.event-card:hover::after { transform: scaleX(1); }
.news-row, .dl-row { transition: background .15s ease, box-shadow .2s var(--ease-out); }
.news-row:hover, .dl-row:hover { box-shadow: inset calc(3 * var(--px)) 0 0 var(--accent); }

/* 進場：內容隨捲動浮現（中、強；motion.js 加上 .rv／.in） */
html.rv-on .rv { opacity: 0; transform: translateY(var(--rv-y, calc(14 * var(--px)))); }
html.rv-on .rv.in { opacity: 1; transform: none; transition: opacity .6s ease var(--rv-delay, 0ms), transform .7s var(--ease-out) var(--rv-delay, 0ms); }
html[data-motion="3"] { --rv-y: calc(28 * var(--px)); }
/* 標題的琥珀線／方塊跟著畫出 */
html.rv-on .layer-head.rv .bar { transform: scaleY(0); }
html.rv-on .layer-head.rv.in .bar { transform: none; transition: transform .5s var(--ease-out) calc(var(--rv-delay, 0ms) + .25s); }
html.rv-on .sec-title.rv::before { transform: scale(0); }
html.rv-on .sec-title.rv.in::before { transform: none; transition: transform .45s var(--ease-out) calc(var(--rv-delay, 0ms) + .2s); }

/* 主選單：滑動跟隨的指示線（中、強） */
.nav { position: relative; }
.nav-ind { position: absolute; z-index: 1; left: 0; bottom: 0; width: 0; height: calc(3 * var(--px)); background: var(--accent); opacity: 0; pointer-events: none; transition: left .35s var(--ease-out), width .35s var(--ease-out), opacity .2s ease; }
html.nav-ind-on .nav-item > a::after { display: none; }

/* 內頁子選單：滑動的指示條（中、強） */
.sub-ind { position: absolute; left: calc(10 * var(--px)); top: 0; width: calc(3 * var(--px)); height: 0; background: var(--accent); opacity: 0; pointer-events: none; transition: top .35s var(--ease-out), height .35s var(--ease-out), opacity .2s ease; }
html.sub-ind-on .subnav a::before { display: none; }

/* 強：往下捲動時頁首縮小 */
.site-header { transition: min-height .3s var(--ease-out); }
.brand-logo { transition: height .3s var(--ease-out); }
html[data-motion="3"].scrolled .site-header { min-height: calc(68 * var(--px)); }
html[data-motion="3"].scrolled .site-header .brand-logo { height: calc(44 * var(--px)); }

@media (prefers-reduced-motion: reduce) {
  .arw, .event-card::after, .nav-ind, .sub-ind, .site-header, .brand-logo { transition: none; }
}

/* 背景「科學手札」（doodles.js；後台可關閉）：細線圖示固定在最底層，只在灰底留白處看得到 */
.doodles { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.dd { position: absolute; top: 0; color: var(--primary); opacity: .06; will-change: transform; }
.dd.accent { color: var(--accent); opacity: .12; }
.dd svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: calc(1.4 * var(--px)); stroke-linecap: round; stroke-linejoin: round;
  animation: dd-float var(--dur, 90s) ease-in-out var(--delay, 0s) infinite alternate; }
.dd svg * { vector-effect: non-scaling-stroke; }
@keyframes dd-float { from { transform: translate(0, 0) rotate(var(--r0, 0deg)); } to { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--r1, 0deg)); } }
@media (prefers-reduced-motion: reduce) { .dd svg { animation: none; transform: rotate(var(--r0, 0deg)); } }

/* =====================================================================
   無障礙（數位發展部「網站無障礙規範」、WCAG 2.1 基本項目）
   ===================================================================== */
/* 跳到主要內容：平常藏在畫面外，按 Tab 第一下出現 */
.skip-link { position: absolute; z-index: 100; left: calc(16 * var(--px)); top: calc(-100 * var(--px)); padding: calc(10 * var(--px)) calc(18 * var(--px)); font-weight: 800; color: #fff; background: var(--primary-deep); }
.skip-link:focus { top: calc(12 * var(--px)); }
/* 導盲磚 :::（accesskey U 上方／C 中央／Z 下方）：放在各區塊開頭，平常不佔版面，聚焦時才看得到 */
.acc { position: absolute; z-index: 5; width: calc(1 * var(--px)); height: calc(1 * var(--px)); overflow: hidden; color: transparent; font-size: calc(12 * var(--px)); line-height: 1; }
.acc:focus { width: auto; height: auto; padding: calc(4 * var(--px)) calc(6 * var(--px)); color: var(--ink); background: #fff; }
main { position: relative; }
main:focus { outline: none; }
.noscript { margin: 0; padding: calc(10 * var(--px)) calc(20 * var(--px)); text-align: center; font-weight: 700; color: #fff; background: var(--primary-deep); }
/* 鍵盤聚焦外框：全站一致 */
:focus-visible { outline: calc(3 * var(--px)) solid var(--accent-text); outline-offset: calc(2 * var(--px)); }
.page-hero :focus-visible, .ph-title :focus-visible, .follow-line :focus-visible { outline-color: #fff; }

/* =====================================================================
   快速入口（科教專案／科教活動／LINE／FB／回頂端）
   桌機：右側中間一條直列；手機：底部工具列
   ===================================================================== */
.quick-rail {  /* 寬 calc(68 * var(--px))；桌機的內容寬度兩側各留出這條的空間（見下方） */
  position: fixed; z-index: 30; right: 0; top: 50%; transform: translateY(-50%);
  display: grid; width: calc(68 * var(--px)); background: #fff;
  clip-path: polygon(calc(14 * var(--px)) 0, 100% 0, 100% 100%, 0 100%, 0 calc(14 * var(--px)));
  filter: drop-shadow(0 calc(10 * var(--px)) calc(24 * var(--px)) rgb(var(--shadow-rgb) / .2));
  transition: transform .35s var(--ease-out), opacity .25s ease, visibility .35s;
}
.quick-rail a { display: grid; justify-items: center; gap: calc(4 * var(--px)); padding: calc(13 * var(--px)) calc(4 * var(--px)) calc(11 * var(--px)); font-size: calc(13 * var(--px)); font-weight: 800; line-height: 1.25; text-align: center; color: var(--primary-deep); transition: background .15s ease, color .15s ease; }
.quick-rail a + a { border-top: calc(1 * var(--px)) solid rgb(var(--ink-rgb) / .08); }
.quick-rail svg { width: calc(24 * var(--px)); height: calc(24 * var(--px)); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-rail a:hover { color: var(--primary); background: rgb(var(--primary-rgb) / .07); }
.quick-rail .qr-main { color: #fff; background: var(--primary); }
.quick-rail .qr-main + .qr-main { border-top-color: rgb(255 255 255 / .18); }
.quick-rail .qr-main:hover { background: var(--primary-deep); color: #fff; }
.quick-rail a:focus-visible { outline-offset: calc(-3 * var(--px)); }
.quick-rail.is-hidden { transform: translate(100%, -50%); opacity: 0; visibility: hidden; }
@media (max-width: 760px) {
  body { padding-bottom: calc(calc(62 * var(--px)) + env(safe-area-inset-bottom, 0)); }
  .quick-rail {
    top: auto; bottom: 0; left: 0; width: auto; transform: none; padding-bottom: env(safe-area-inset-bottom, 0);
    grid-auto-flow: column; grid-auto-columns: 1fr; clip-path: none;
    filter: drop-shadow(0 calc(-4 * var(--px)) calc(14 * var(--px)) rgb(var(--shadow-rgb) / .14));
  }
  .quick-rail a { padding: calc(9 * var(--px)) calc(2 * var(--px)) calc(8 * var(--px)); font-size: calc(12 * var(--px)); gap: calc(2 * var(--px)); }
  .quick-rail a + a { border-top: 0; border-left: calc(1 * var(--px)) solid rgb(var(--ink-rgb) / .08); }
  .quick-rail svg { width: calc(22 * var(--px)); height: calc(22 * var(--px)); }
  .quick-rail.is-hidden { transform: translateY(100%); }
}
@media (prefers-reduced-motion: reduce) { .quick-rail { transition: none; } }


/* =====================================================================
   高對比模式（頁首「高對比」按鈕）：黑底、白字、黃色連結，拿掉裝飾與陰影
   ===================================================================== */
html[data-contrast="high"] { --accent: #ffd400; --accent-text: #ffd400; --accent-soft: #ffd400; color-scheme: dark; }
html[data-contrast="high"] body { background: #000 !important; color: #fff; }
html[data-contrast="high"] body *:not(svg):not(svg *):not(img) {
  color: #fff !important; background-color: #000 !important; background-image: none !important;
  border-color: #fff !important; box-shadow: none !important; text-shadow: none !important;
}
html[data-contrast="high"] body * { filter: none !important; }
html[data-contrast="high"] a, html[data-contrast="high"] a *:not(svg):not(svg *) { color: #ffe14d !important; }
html[data-contrast="high"] a:hover, html[data-contrast="high"] a:hover * { text-decoration: underline; }
html[data-contrast="high"] .doodles, html[data-contrast="high"] .deco, html[data-contrast="high"] .layer-line::before, html[data-contrast="high"] .stage,
html[data-contrast="high"] .page-hero::before, html[data-contrast="high"] .ph-title::before, html[data-contrast="high"] .follow-line::before { display: none !important; }
html[data-contrast="high"] .site-header, html[data-contrast="high"] .footer { border-bottom: calc(2 * var(--px)) solid #fff; }
html[data-contrast="high"] .footer { border-top: calc(2 * var(--px)) solid #fff; }
html[data-contrast="high"] .brand-logo { background: #fff !important; padding: calc(4 * var(--px)) calc(8 * var(--px)); }
html[data-contrast="high"] .nc, html[data-contrast="high"] .follow-fb, html[data-contrast="high"] .content, html[data-contrast="high"] .subnav,
html[data-contrast="high"] .dropdown, html[data-contrast="high"] .quick-rail, html[data-contrast="high"] .entry-card,
html[data-contrast="high"] .contact-strip li { outline: calc(2 * var(--px)) solid #fff; outline-offset: calc(-2 * var(--px)); }
html[data-contrast="high"] .fs-pick button[aria-pressed="true"], html[data-contrast="high"] .hc-toggle[aria-pressed="true"],
html[data-contrast="high"] .seg button.on, html[data-contrast="high"] .pager button.cur, html[data-contrast="high"] .yr-tabs button[aria-pressed="true"] { color: #000 !important; background-color: #ffe14d !important; }
html[data-contrast="high"] :focus-visible { outline: calc(3 * var(--px)) solid #ffe14d !important; outline-offset: calc(2 * var(--px)); }
html[data-contrast="high"] svg { color: currentColor; }
html[data-contrast="high"] .c-ic, html[data-contrast="high"] .entry-ic svg { stroke: #fff !important; }
html[data-contrast="high"] .layer-head .bar, html[data-contrast="high"] .sec-title::before, html[data-contrast="high"] .hero::after { background-color: #ffe14d !important; }

/* 網站導覽頁 */
.sitemap-wrap { grid-template-columns: minmax(0, calc(960 * var(--px))); }
.sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(220 * var(--px)), 1fr)); gap: calc(18 * var(--px)) calc(28 * var(--px)); margin: 0 0 calc(36 * var(--px)); padding: 0; list-style: none; }
.sitemap > li > a { display: block; padding-bottom: calc(8 * var(--px)); margin-bottom: calc(8 * var(--px)); font-size: 1.0625rem; font-weight: 800; color: var(--primary-deep); border-bottom: calc(2 * var(--px)) solid var(--accent); }
.sitemap ul { margin: 0; padding: 0; list-style: none; display: grid; gap: calc(6 * var(--px)); }
.sitemap ul a { color: var(--text); font-size: .9375rem; }
.sitemap a:hover { color: var(--primary); text-decoration: underline; }
/* 隱私權、著作權等政策頁（固定文字） */
.policy-wrap .sec-title:not(:first-child) { margin-top: calc(36 * var(--px)); }
.policy-wrap .t-bullets { margin-top: calc(6 * var(--px)); }
.policy-wrap .lead-text + .t-bullets, .policy-wrap .t-bullets + .lead-text { margin-top: calc(12 * var(--px)); }
.policy-wrap .lead-text a, .policy-wrap .t-bullets a { color: var(--primary); text-decoration: underline; }
.policy-meta { margin-top: calc(40 * var(--px)); padding-top: calc(14 * var(--px)); border-top: 1px solid rgb(var(--shadow-rgb) / .18); font-size: .875rem; color: var(--slate); }
/* 桌機：內容兩側各讓出快速入口的寬度，避免被蓋住 */
@media (min-width: 761px) {
  .about-wrap, .page-hero .inner, .footer-inner { width: min(calc(100vw - 2 * calc(84 * var(--px))), calc(1640 * var(--px))); }
}
html[data-contrast="high"] body *:not(svg):not(svg *) { clip-path: none !important; }
html[data-contrast="high"] .hc-name::before, html[data-contrast="high"] .hc-name::after, html[data-contrast="high"] .fit-contain::before,
html[data-contrast="high"] .qr-card::before { display: none !important; }
html[data-contrast="high"] .btn-solid, html[data-contrast="high"] .btn-line, html[data-contrast="high"] .c-btn,
html[data-contrast="high"] .join-btn, html[data-contrast="high"] .entry-chips a { border: calc(2 * var(--px)) solid #ffe14d !important; }
html[data-contrast="high"] .qr-card img { background: #fff !important; }
html[data-contrast="high"] .hero { outline: calc(2 * var(--px)) solid #fff; outline-offset: calc(-2 * var(--px)); }
html[data-contrast="high"] .fs-pick button[aria-pressed="true"] *, html[data-contrast="high"] .hc-toggle[aria-pressed="true"] * { color: #000 !important; background-color: transparent !important; }


/* 淡色版（9～11）：內頁標題帶改淺色、字改深色 */
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .page-hero { color: var(--primary-deep); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .breadcrumb { color: var(--slate); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .breadcrumb a:hover { color: var(--primary); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .page-hero .en { color: var(--slate); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .page-hero :focus-visible { outline-color: var(--accent-text); }

/* =====================================================================
   科學圖示網絡（constel.js＋sci-icons.js，全站共用）
   首頁第一視覺左下、內頁標題帶右半邊（白色細線）、內頁子選單下方、頁尾上方的分隔線
   ===================================================================== */
.constel { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.constel .ln { stroke: rgb(var(--primary-rgb) / .22); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: cn-draw 1s var(--ease-out) forwards; animation-delay: calc(var(--i) * 90ms + .3s); }
.constel .dot { fill: #fff; stroke: rgb(var(--primary-rgb) / .35); stroke-width: 1.2; animation: cn-pulse 4s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.constel .halo { fill: #fff; stroke: rgb(var(--primary-rgb) / .14); stroke-width: 1; stroke-dasharray: 2 4; }
.constel .ic svg { overflow: visible; stroke: rgb(var(--primary-rgb) / .55); stroke-width: 1.3; }
.constel .ic svg * { vector-effect: non-scaling-stroke; }
.constel .ic.acc svg { stroke: var(--logo-teal); }
.constel .ic { opacity: 0; animation: cn-in .8s var(--ease-out) forwards; animation-delay: calc(var(--i) * 80ms + .6s); }
.constel .star { fill: rgb(var(--primary-rgb) / .35); }
.constel .fl { animation: cn-float 7s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); transform-box: fill-box; transform-origin: center; }
/* 持續動態（constel.js）：訊號沿連線流動；抵達圖示時點亮並做該學科的小動作 */
.constel .flow { stroke: var(--logo-teal); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: .3 1; stroke-dashoffset: .3; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--logo-teal) 70%, transparent)); }
.constel .halo { transition: fill .4s ease, stroke .4s ease; }
.constel .ic.hit .halo { fill: color-mix(in srgb, var(--logo-teal) 12%, #fff); stroke: var(--logo-teal); stroke-opacity: 1; stroke-dasharray: none; animation: cn-halo .9s var(--ease-out); }
.constel .ic.hit svg { stroke: var(--logo-teal); }
.constel .dot.hit { animation: cn-dot .9s ease-out; }
.constel .act { transform-box: view-box; transform-origin: 12px 12px; }
.constel [data-ic="atom"].hit .act { animation: act-spin 1.4s var(--ease-out); }
.constel [data-ic="planet"].hit .act { animation: act-wobble 1.4s ease-in-out; }
.constel [data-ic="compass"].hit .act { transform-origin: 12px 4px; animation: act-swing 1.4s ease-in-out; }
.constel [data-ic="magnifier"].hit .act { animation: act-sweep 1.4s ease-in-out; }
.constel [data-ic="beaker"].hit .act > circle { animation: act-bubble 1.2s ease-out; }
.constel [data-ic="beaker"].hit .act > circle + circle { animation-delay: .25s; }
.constel [data-ic="prism"].hit .act > path:last-child { animation: act-ray 1.2s ease-out; }
.constel [data-ic="ruler"].hit .act { animation: act-swing 1.4s ease-in-out; transform-origin: 4px 20px; }
.constel [data-ic="microscope"].hit .act { animation: act-sweep 1.4s ease-in-out; }
.constel [data-ic="book"].hit .act { animation: act-wobble 1.4s ease-in-out; }
.constel [data-ic="crane"].hit .act { animation: act-fly 1.4s ease-in-out; }
@keyframes act-fly { 0%, 100% { transform: translate(0, 0) rotate(0); } 40% { transform: translate(2px, -3px) rotate(-8deg); } }
@keyframes cn-halo { 0% { r: 26; } 40% { r: 30; } 100% { r: 26; } }
@keyframes cn-dot { 0% { fill: #fff; } 30% { fill: var(--logo-teal); stroke: var(--logo-teal); r: 6; } 100% { fill: #fff; r: 4; } }
@keyframes act-spin { to { transform: rotate(120deg); } }
@keyframes act-wobble { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-16deg); } 65% { transform: rotate(10deg); } }
@keyframes act-swing { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(14deg); } 65% { transform: rotate(-10deg); } }
@keyframes act-sweep { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-2.5px, 1px); } 65% { transform: translate(2.5px, -1px); } }
@keyframes act-bubble { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-7px); opacity: 0; } }
@keyframes act-ray { 0% { stroke: var(--accent); opacity: .2; } 25% { opacity: 1; } 100% { stroke: var(--accent); opacity: 1; } }
/* 中心機器人（robot-art.js，形狀為設計師原檔）：頭框、身體、耳朵、手腳只在「外側」描細線（paint-order，
   頭框留白才不會被線吃掉）；螢幕與袖子實心、眼睛留白；道具不描線、雙色橘。顏色全部跟著網站配色 */
.constel .ic.rb { --rb-line: var(--primary); --rb-paper: #fff; --rb-face: #fff; --rb-acc: var(--accent); --rb-acc-l: color-mix(in srgb, var(--accent) 42%, #fff); }
.net-light .constel .ic.rb { --rb-line: #fff; --rb-paper: var(--primary-deep); --rb-face: var(--primary-deep); }
.constel .ic.rb svg, .constel .ic.rb svg path { stroke: none; vector-effect: none; }
.constel .ic.rb :is(.k-frame, .k-body, .k-ear, .k-limb) { fill: var(--rb-paper); stroke: var(--rb-line); stroke-width: 2.6px; stroke-linejoin: round; paint-order: stroke; vector-effect: non-scaling-stroke; }
.constel .ic.rb :is(.k-screen, .k-dark, .k-dot) { fill: var(--rb-line); }
.constel .ic.rb .k-eye { fill: var(--rb-face); }
.constel .ic.rb .k-p1 { fill: var(--rb-acc); }
.constel .ic.rb .k-p2 { fill: var(--rb-acc-l); }
.constel .ic.rb .k-psep { stroke: #fff; }
.constel .ic.rb .k-pline { stroke: var(--rb-acc); }
.constel .ic.rb .k-nofill { fill: none; }
/* 訊號抵達：整隻輕跳一下（不動個別零件，維持原檔造型） */
.constel .ic.rb .act { transform-box: fill-box; transform-origin: 50% 100%; }
.constel .ic.rb.hit .act { animation: rb-hop .7s var(--ease-out); }
@keyframes rb-hop { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-7%); } 60% { transform: translateY(0) scaleY(.97); } }
@keyframes cn-draw { to { stroke-dashoffset: 0; } }
@keyframes cn-in { from { opacity: 0; } to { opacity: var(--o, 1); } }
@keyframes cn-float { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(0, -7px) rotate(-8deg); } }
@keyframes cn-pulse { 0%, 100% { stroke-opacity: .35; } 50% { stroke-opacity: .9; fill: rgb(var(--primary-rgb) / .12); } }
.net-host { pointer-events: none; }
/* 白色細線版（深色色塊上，例如內頁標題帶） */
.net-light .constel .ln { stroke: rgb(255 255 255 / .35); }
.net-light .constel .dot { fill: transparent; stroke: rgb(255 255 255 / .5); }
.net-light .constel .halo { fill: rgb(255 255 255 / .06); stroke: rgb(255 255 255 / .28); }
.net-light .constel .ic svg, .net-light .constel .ic.acc svg { stroke: rgb(255 255 255 / .8); }
.net-light .constel .star { fill: rgb(255 255 255 / .45); }
.net-light .constel .flow { stroke: #fff; filter: drop-shadow(0 0 3px rgb(255 255 255 / .8)); }
.net-light .constel .ic.hit .halo { fill: rgb(255 255 255 / .2); stroke: #fff; }
.net-light .constel .ic.hit svg { stroke: #fff; }
/* 內頁標題帶右半邊 */
.page-hero { isolation: isolate; }
.hero-net { position: absolute; z-index: 0; top: 0; bottom: 0; right: 0; width: 55%; }
/* 內頁左側子選單下方 */
.about-wrap.has-side-net { grid-template-rows: auto 1fr; }
.about-wrap.has-side-net > .content { grid-row: 1 / span 2; }
.about-wrap.has-side-net > .subnav { grid-row: 1; }
.side-net { grid-column: 1; grid-row: 2; align-self: start; height: calc(440 * var(--px)); margin-top: calc(-8 * var(--px)); }
/* 頁尾上方的分隔線 */
.foot-net { width: min(calc(100vw - 2 * calc(84 * var(--px))), calc(1640 * var(--px))); height: calc(96 * var(--px)); margin: calc(40 * var(--px)) auto 0; }
.foot-net .constel .ln { animation: none; stroke-dashoffset: 0; }
@media (max-width: 980px) { .side-net { display: none; } .about-wrap.has-side-net > .content { grid-row: auto; } }
@media (max-width: 760px) { .hero-net { width: 100%; opacity: .5; } .foot-net { width: calc(100vw - 32px); } }
@media (prefers-reduced-motion: reduce) {
  .constel .ln { stroke-dashoffset: 0; animation: none; } .constel .ic { opacity: var(--o, 1); animation: none; } .constel .fl, .constel .dot { animation: none; }
}
html[data-contrast="high"] .net-host, html[data-contrast="high"] .watermark, html[data-contrast="high"] .orbit { display: none !important; }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .net-light .constel .ln { stroke: rgb(var(--deep-rgb) / .25); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .net-light .constel .ic svg { stroke: rgb(var(--deep-rgb) / .6); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .net-light .constel .dot, html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .net-light .constel .halo { stroke: rgb(var(--deep-rgb) / .3); }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .net-light .constel .flow { stroke: var(--primary); filter: none; }
html:is([data-palette="9"], [data-palette="10"], [data-palette="11"]) .net-light .constel .star { fill: rgb(var(--deep-rgb) / .3); }
