/* ==========================================================================
   開放架構風格（scunew3）：瑞士網格、看得見的細格線、等寬字體編號、直角、節點網路主視覺
   variant-1 藍綠、variant-2 翠綠＋靛、variant-3 青＋紫
   ========================================================================== */
:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #e6eeeb;
  --text: #0b1513;
  --muted: #4f5f5a;
  --border: #c9d6d2;
  --line: #0b1513;
  --accent: #0a8277;   /* 白字對比 4.7:1（原 #0d9488 只有 3.7:1） */
  --accent-2: #0ea5e9;
  --accent-ink: #ffffff;
  --font-body: "Noto Sans TC", system-ui, sans-serif;
  --font-display: "Noto Sans TC", system-ui, sans-serif;
  --font-latin: "JetBrains Mono", ui-monospace, monospace;
  --radius: 3px;
  --radius-sm: 2px;
  --radius-pill: 3px;
  --shadow: 0 0 0 1px var(--line);
  --shadow-lg: 6px 6px 0 var(--accent);
}
body.variant-2 { --accent: #02845c; --accent-2: #4f46e5; }
body.variant-3 { --accent: #057f9c; --accent-2: #7c3aed; }

body { background-color: var(--bg); background-image: radial-gradient(color-mix(in srgb, var(--line) 14%, transparent) 1px, transparent 1.2px); background-size: 24px 24px; }
h1, h2, h3 { font-weight: 900; letter-spacing: -.015em; }
.eyebrow { font-family: var(--font-latin); text-transform: lowercase; letter-spacing: .06em; font-size: 14px; font-weight: 700; color: var(--accent); }
.eyebrow .idx { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; background: var(--line); color: var(--bg); font-size: 12.5px; }
.section-head h2, .section-head h1 { font-size: clamp(26px, 3.1vw, 45px); }
/* 主按鈕是深色底（--line）：文字固定白色；滑過變主色時才用 --accent-ink（品牌色偏淺時會是深色字） */
.btn { --btn-bg: var(--line); --btn-fg: #ffffff; letter-spacing: .06em; }
.btn:hover { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); border-color: var(--accent); box-shadow: 4px 4px 0 var(--line); transform: translate(-2px, -2px); }
.btn-secondary { --btn-bg: transparent; --btn-fg: var(--text); border-color: var(--line); }
.btn-secondary:hover { --btn-bg: var(--surface); box-shadow: 4px 4px 0 var(--line); border-color: var(--line); }
.text-link { font-family: var(--font-latin); font-size: 15px; }

/* ---------- 頁首 ---------- */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.brand-mark { border-radius: 2px; background: var(--line); color: var(--bg); font-family: var(--font-latin); }
.site-nav a { border-radius: 0; }
.site-nav a::after { height: 2px; bottom: 0; background: var(--accent); }
.nav-toggle { border-radius: 2px; border-color: var(--line); }

/* ---------- 主視覺 ---------- */
.hero { padding: clamp(39px, 5.7vw, 92px) 0 clamp(39px, 4.9vw, 79px); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.mono-label { font: 700 15px/1.4 var(--font-latin); color: var(--accent); margin-bottom: 26px; display: flex; gap: 6px; align-items: center; }
.blink { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.hero-title { font-size: clamp(38px, 5.7vw, 84px); line-height: 1.06; letter-spacing: -.035em; margin: 0 0 28px; }
.hero-lead { font-size: var(--fs-lead); color: var(--muted); max-width: 32em; margin-bottom: 36px; border-left: 3px solid var(--accent); padding-left: 18px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual { position: relative; padding: clamp(14px, 2vw, 28px); border: 1px dashed color-mix(in srgb, var(--line) 45%, transparent); }
.cross { position: absolute; width: 18px; height: 18px; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--line); }
.cross::before { left: 8px; top: 0; width: 2px; height: 18px; }
.cross::after { top: 8px; left: 0; width: 18px; height: 2px; }
.cross.tl { top: -9px; left: -9px; } .cross.tr { top: -9px; right: -9px; } .cross.bl { bottom: -9px; left: -9px; } .cross.br { bottom: -9px; right: -9px; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(1.05); }
.network { width: 100%; display: block; overflow: visible; }
.network .link { stroke: var(--line); stroke-width: 1.4; stroke-dasharray: 6 6; animation: dash 3.5s linear infinite; animation-delay: var(--d); }
.network .link.faint { stroke: var(--accent); opacity: .35; stroke-dasharray: 2 6; }
@keyframes dash { to { stroke-dashoffset: -48; } }
.network .core { fill: var(--line); }
.network .core-ring { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 8; transform-origin: 260px 245px; animation: rot 24s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.network .core-text { fill: var(--bg); font: 900 30px var(--font-display); }
.network .node circle { fill: var(--bg); stroke: var(--accent); stroke-width: 3.5; transform-box: fill-box; transform-origin: center; animation: pulse 2.6s var(--ease-in-out) infinite alternate; animation-delay: var(--d); }
@keyframes pulse { to { transform: scale(1.35); fill: var(--accent); } }
.network .node text { font: 700 16px var(--font-display); fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 6px; stroke-linejoin: round; }
@media (max-width: 960px) { .hero-inner { grid-template-columns: 1fr; } .hero-visual { max-width: 520px; } }
@media (max-width: 560px) { .hero-actions { display: grid; grid-template-columns: 1fr 1fr; } .hero-actions .btn { padding-inline: 10px; font-size: 15px; } .hero-actions .btn::after { display: none; } }

/* ---------- 數據 ---------- */
.stats-band { border-bottom: 1px solid var(--line); background: var(--surface); }
.grid-cells { gap: 0; }
.grid-cells .stat { border-left: 1px solid var(--line); padding: clamp(24px, 3vw, 44px) clamp(18px, 2.4vw, 32px); }
.grid-cells .stat:last-child { border-right: 1px solid var(--line); }
.stat-num { font-family: var(--font-latin); font-weight: 700; letter-spacing: -.04em; }
.stat-label { font-size: 14px; }
@media (max-width: 760px) { .grid-cells { grid-template-columns: 1fr 1fr; } .grid-cells .stat:nth-child(n+3) { border-top: 1px solid var(--line); } .grid-cells .stat:nth-child(2n) { border-right: 1px solid var(--line); } }

/* ---------- 分類 ---------- */
.cat-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cat-row li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat-row a { display: flex; align-items: center; gap: 10px; padding: 18px 20px; text-decoration: none; font-weight: 700; background: var(--surface); transition: background-color .2s, color .2s; height: 100%; }
.cat-row a:hover { background: var(--line); color: var(--bg); }

/* ---------- 服務（藍圖格） ---------- */
.blueprint { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.bp-cell { position: relative; overflow: hidden; isolation: isolate; min-height: 210px; padding: clamp(22px, 2.4vw, 32px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; transition: background-color .3s; }
.bp-cell::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); }
.bp-cell:hover::before { opacity: 1; }
.bp-cell h3 { margin: 0; font-size: clamp(16px, 1.5vw, 21px); }
.bp-cell p { margin: 0; color: var(--muted); font-size: 15.5px; }
.bp-index { position: absolute; top: 18px; left: 22px; font: 700 13px/1 var(--font-latin); color: var(--accent); }
.bp-cell.size-large { grid-column: span 2; grid-row: span 2; background: var(--line); color: var(--bg); }
.bp-cell.size-large h3 { font-size: clamp(22px, 2.6vw, 34px); }
.bp-cell.size-large p { color: color-mix(in srgb, var(--bg) 75%, transparent); font-size: 17px; }
.bp-cell.size-large::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%); }
.bp-cell.size-wide { grid-column: span 2; }
@media (max-width: 900px) { .blueprint { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .blueprint { grid-template-columns: 1fr; } .bp-cell.size-large, .bp-cell.size-wide { grid-column: auto; grid-row: auto; } .bp-cell { min-height: 0; padding-top: 48px; } }

/* ---------- 特色 ---------- */
.highlights { border-top: 1px solid var(--line); }
.hl-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(20px, 4vw, 64px); padding: clamp(28px, 3.4vw, 48px) 0; border-bottom: 1px solid var(--line); align-items: start; }
.hl-mark { aspect-ratio: 1; border: 1px solid var(--line); display: grid; place-items: center; position: relative; background: var(--surface); font-size: 46px; }
.hl-mark small { position: absolute; top: 10px; left: 12px; font: 700 12.5px/1 var(--font-latin); color: var(--accent); }
.hl-body h3 { font-size: clamp(19px, 2.1vw, 28px); margin-bottom: 10px; }
.hl-body p { color: var(--muted); max-width: 40em; }
.hl-row:nth-child(even) { grid-template-columns: minmax(0, 1fr) 180px; }
.hl-row:nth-child(even) .hl-mark { order: 2; }
@media (max-width: 640px) { .hl-row, .hl-row:nth-child(even) { grid-template-columns: 88px minmax(0, 1fr); } .hl-row:nth-child(even) .hl-mark { order: 0; } .hl-mark { font-size: 30px; } }

/* ---------- 活動 ---------- */
.event-link { border: 1px solid var(--line); border-radius: 2px; }
.event-link:hover { box-shadow: 6px 6px 0 var(--accent); transform: translate(-3px, -3px); border-color: var(--line); }
.event-date { border-radius: 2px; background: var(--line); color: var(--bg); }
.event-month { color: var(--accent-2); font-family: var(--font-latin); }
.event-weekday { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.event-day { font-weight: 700; }
.event-badge { border-radius: 2px; font-family: var(--font-latin); }
.event-image { border-radius: 0; }
.events-empty { border: 1px dashed var(--line); background: var(--surface); }

/* ---------- 消息（紀錄列） ---------- */
.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log a { display: grid; grid-template-columns: 150px minmax(0, 1fr) 40px; gap: 20px; align-items: center; padding: 22px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background-color .25s, padding .35s var(--ease); }
.log a:hover { background: var(--surface); padding-left: 18px; color: inherit; }
.log time { font: 500 14px/1 var(--font-latin); color: var(--muted); }
.log span { font: 700 clamp(17px, 1.6vw, 21px)/1.5 var(--font-display); }
.log i { font-style: normal; font-family: var(--font-latin); text-align: right; color: var(--accent); transition: transform .35s var(--ease); }
.log a:hover i { transform: translate(3px, -3px); }
@media (max-width: 560px) { .log a { grid-template-columns: 1fr 24px; gap: 6px 12px; } .log time { grid-column: 1 / -1; } }

/* ---------- 常見問題 ---------- */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 52px minmax(0, 1fr) 28px; gap: 12px; align-items: center; padding: 22px 0; font-weight: 700; font-size: clamp(15px, 1.4vw, 17px); }
.faq summary::-webkit-details-marker { display: none; }
.q-idx { font: 700 14px/1 var(--font-latin); color: var(--accent); }
.q-toggle { position: relative; width: 20px; height: 20px; justify-self: end; }
.q-toggle::before, .q-toggle::after { content: ""; position: absolute; left: 0; top: 9px; width: 20px; height: 2px; background: var(--line); transition: transform .35s var(--ease); }
.q-toggle::after { transform: rotate(90deg); }
.faq details[open] .q-toggle::after { transform: rotate(0); }
.faq-a { padding: 0 40px 24px 64px; color: var(--muted); }
@media (max-width: 860px) { .faq-wrap { grid-template-columns: 1fr; } .faq-a { padding-left: 0; } }

/* ---------- 引言 ---------- */
.rule-quote { border-left: 4px solid var(--accent); padding-left: clamp(20px, 4vw, 56px); }
.rule-quote p::before { content: "// voice"; font: 700 14px/1 var(--font-latin); color: var(--accent); margin-bottom: 22px; letter-spacing: .06em; }

/* ---------- 合作單位 ---------- */
.logo-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.logo-wall li { display: grid; place-items: center; text-align: center; min-height: 104px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--muted); transition: color .2s, background-color .2s; }
.logo-wall li:hover { color: var(--text); background: var(--bg); }

/* ---------- 頁尾 ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-cta { background-color: var(--line); color: var(--bg); background-image: linear-gradient(color-mix(in srgb, var(--bg) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--bg) 8%, transparent) 1px, transparent 1px); background-size: 48px 48px; }
.footer-cta-eyebrow { color: var(--accent); font-family: var(--font-latin); text-transform: lowercase; }
.footer-cta .btn { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); border-color: var(--accent); }
.footer-cta .btn:hover { box-shadow: 4px 4px 0 var(--bg); }
.footer-bottom { border-top-color: var(--line); }
.footer-heading { font-family: var(--font-latin); color: var(--accent); }

/* ---------- 內頁 ---------- */
.page-hero { border-bottom: 1px solid var(--line); margin-bottom: clamp(40px, 5vw, 72px); }
.page-hero .eyebrow { text-transform: lowercase; }
.page-hero h1 { font-size: clamp(34px, 5.2vw, 72px); letter-spacing: -.035em; }
.mission-card { border-radius: 2px; background: var(--line); }
.mission-card .eyebrow { color: var(--accent); }
.value-card { border-top-color: var(--line); background: var(--surface); border: 1px solid var(--line); }
.timeline::before { background: var(--line); opacity: 1; width: 1px; left: 12px; }
.timeline-item::before { border-radius: 2px; border-color: var(--accent); }
.card, .register-card, .session-item { border-radius: 2px; border-color: var(--line); }
.register-card { box-shadow: 6px 6px 0 var(--accent); }
.event-poster { border-radius: 2px; background: var(--line); }
.event-poster-month { color: var(--accent); font-family: var(--font-latin); }
.news-card-media.is-placeholder { border-radius: 2px; background: var(--line); }
input[type=text], input[type=email], input[type=tel], input[type=password], select, textarea { border-color: var(--line); }
.contact-map { border-radius: 2px; border-color: var(--line); }
.contact-list, .contact-row, .news-list, .news-item, .event-facts, .event-facts > div { border-color: var(--line); }
@media (max-width: 560px) {
  .cat-row { grid-template-columns: 1fr 1fr; }
  .cat-row a { padding: 14px 14px; font-size: 15px; }
  .logo-wall { grid-template-columns: 1fr 1fr; }
  .logo-wall li { min-height: 76px; font-size: 14.5px; }
  .network .node text { font-size: 25px; stroke-width: 8px; }
  .network .core-text { font-size: 38px; }
}
.bp-cell:only-child { grid-column: 1 / -1 !important; }

/* 旅遊行程＝行程表格、影片＝等寬編號的影音索引（開放架構） */
.tours { gap: 0; border-top: 1px solid var(--text); border-left: 1px solid var(--border); }
.tour { border-radius: 0; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); box-shadow: none; }
.tour:hover { transform: none; box-shadow: none; background: var(--surface-2); }
.tour-media { aspect-ratio: 16 / 9; margin: 16px 16px 0; background: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--accent) 60%, transparent) 1px, transparent 1.4px); background-size: 14px 14px; }
.tour-ph { background: none; }
.tour-ph-no, .tour-days, .tour-price { font-family: var(--font-mono, ui-monospace, monospace); }
.tour-days { border-radius: 0; background: var(--text); color: var(--bg); }
.tour-price { border-radius: 0; }
.video-frame { border-radius: 0; box-shadow: none; outline: 1px solid var(--text); outline-offset: 6px; }
.video-icon { border-radius: 0; box-shadow: none; }
.videos { counter-reset: vid; }
.video figcaption { counter-increment: vid; grid-template-columns: auto 1fr; column-gap: 12px; }
.video figcaption::before { content: counter(vid, decimal-leading-zero); grid-row: span 2; font: 500 13px/1.6 var(--font-mono, ui-monospace, monospace); color: var(--accent); }

/* 長的機構名稱：字級縮小、各行平均斷開（不會變成「台北市產／業工業學／會」）；寬橫幅完整顯示不裁切 */
.hero-title { text-wrap: balance; overflow-wrap: anywhere; }
.hero-title.is-long { font-size: clamp(31px, 4vw, 62px); }
.hero-title.is-xlong { font-size: clamp(26px, 3.1vw, 48px); }
.hero-photo.is-wide img { aspect-ratio: auto; object-fit: contain; }
