:root {
  /* 品牌原色 */
  --brand: #436d99;

  /* 重點色  */
  --accent: #58a9ff;
  --on-accent: #0d1117;

  /* 底色 */
  --bg: #0d1117; /* 頁面底色 */
  --band: color-mix(in srgb, var(--accent) 3%, transparent); /* 滿版色帶 */
  --surface: color-mix(in srgb, var(--accent) 2%, transparent); /* 數字列、卡片底色 */
  --placeholder: #1c232c; /* 圖片佔位 */
  --placeholder-on-band: #222b36;

  /* 線條 */
  --line: color-mix(in srgb, var(--accent) 20%, transparent);
  --border: #30363d;

  /* 文字 */
  --text: #e6edf3;
  --text-2: #c2ccd6;
  --muted: #9aa7b4;

  /* 圓角：依 logo 在 header（寬 108px）時右側圓角換算 ≈ 5px */
  --radius: 5px;

  --container: 1200px;
  --gutter: 24px;

  --font-sans: "Noto Sans TC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (width <= 1200px) {
  :root {
    --container: 100%;
  }
}

@media (width <= 768px) {
  :root {
    --gutter: 5%;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
}

a {
  color: var(--text);
}
a:hover {
  color: #ffffff;
}

img,
video {
  max-width: 100%;
  height: auto; /* 有寫 width/height 屬性的圖，縮小時才不會被拉長變形 */
  display: block;
}

button,
input,
select,
textarea {
  font: inherit; /* 表單元件預設不繼承字體，統一跟著頁面走 */
  color: inherit;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre, hr {
  margin: 0;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Header ---------- */

.site-header .container {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

@media (width <= 400px) {
  .site-header .container {
    flex-direction: column;
  }
}

.site-logo {
  display: block;
  width: 108px;
}
.site-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 1rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* ---------- 共用元件 ---------- */

/* ---------- 區塊上下間距 ----------
   所有內容區塊的上下 padding 都寫在這裡、寫在 section 本身；.container 只負責寬度與左右留白。
   標準間距用 .section；間距不同的區塊用自己的 class 寫在下面。
   畫面 ≤ 580px 時統一縮小（下方 @media）。新增區塊時也加在這裡。 */
.section {
  padding-top: 96px;
  padding-bottom: 96px;
}
.hero {
  padding-top: 120px;
  padding-bottom: 140px;
}
.stats {
  padding-top: 56px;
  padding-bottom: 56px;
}
.about {
  padding-top: 100px;
  padding-bottom: 100px;
}
.thursday {
  padding-top: 80px;
  padding-bottom: 80px;
}
.members {
  padding-top: 80px;
  padding-bottom: 96px;
}
.channels {
  padding-top: 64px;
  padding-bottom: 80px;
}
.archive-intro {
  padding-top: 80px;
  padding-bottom: 48px;
}
.archive {
  padding-top: 48px;
  padding-bottom: 120px;
}
.event-page {
  padding-top: 24px;
  padding-bottom: 120px;
}

@media (width <= 580px) {
  .section {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .hero {
    padding-top: 60px;
    padding-bottom: 80px;
  }
  .stats {
    padding-top: 40px;
    padding-bottom: 40px;
  }
  .about {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .thursday {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .members {
    padding-top: 40px;
    padding-bottom: 48px;
  }
  .channels {
    padding-top: 40px;
    padding-bottom: 48px;
  }
  .archive-intro {
    padding-top: 48px;
    padding-bottom: 32px;
  }
  .archive {
    padding-top: 32px;
    padding-bottom: 80px;
  }
  .event-page {
    padding-top: 16px;
    padding-bottom: 80px;
  }
}
.band {
  background: var(--band);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.3;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}
.btn-lg {
  min-height: 52px;
  padding: 0 32px;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  color: var(--on-accent);
  filter: brightness(1.08);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}
.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover {
  color: var(--accent);
  background: rgba(95, 166, 242, 0.08);
}

.placeholder {
  background: var(--placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--muted);
}

/* ---------- 首頁：主視覺 ---------- */

.hero .container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
}
.hero-lead {
  max-width: 640px;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 8px;
}

/* 主視覺背景：coding 影片風格打字效果（js/hero-code.js）
   .hero-code 是不旋轉的外框，負責遮罩（上下淡出、左側標語處淡化）；
   裡面的 .hero-code-pre 轉 -12°、往右推，避開左側標語，以底部中點為軸心，讓正在打字的那一行固定在下方附近。
   標語與內文的對比仍需維持 4.5:1 以上，調亮時請注意。 */
.hero {
  position: relative;
  overflow: hidden;
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero-code {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 25%, #000 90%, transparent 100%),
    linear-gradient(to right, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.45) 30%, #000 70%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 25%, #000 90%, transparent 100%),
    linear-gradient(to right, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.45) 30%, #000 70%);
  mask-composite: intersect;
}

.hero-code-pre {
  position: absolute;
  left: 80%; /* 原本 50%，往右推 30% 避開左側標語 */
  bottom: 200px; /* 斜過去之後左端會往下掉約 100px，留空間避免打字那行掉出畫面 */
  width: 1000px;
  height: 160%;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* 最新一行貼在下方，舊的往上推 */
  transform: translateX(-40%) rotate(-12deg);
  transform-origin: 50% 100%;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre;
  overflow: hidden;
}
.code-line {
  min-height: 1.7em;
}
.c-keyword {
  color: var(--accent);
}
.c-type {
  color: #4ec9b0;
}
.c-string {
  color: #e6a27a;
}
.c-comment {
  color: #7f9a6b;
  font-style: italic;
}
.code-caret {
  display: inline-block;
  width: 0.6em;
  height: 1.2em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

/* ---------- 首頁：累積數字 ---------- */

.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  /* 上下兩道光暈：往上、往下各一層，負的 spread 讓光只從上下邊緣透出 */
  position: relative;
  z-index: 1;
  box-shadow:
    0 -8px 24px -12px color-mix(in srgb, var(--accent) 20%, transparent),
    0 8px 24px -12px color-mix(in srgb, var(--accent) 20%, transparent);
}
.stats .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--accent);
}
.stat-label {
  font-size: 1rem;
  color: var(--muted);
}

/* ---------- 首頁：關於 ---------- */

.about .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 48px;
}

@media (width <= 520px) {
  .about .container {
    grid-template-columns: repeat(1, 1fr);
  }
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about-text .body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-2);
}
.about-lists {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.about-lists h3 {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 16px;
}
.about-lists ul {
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 1.0625rem;
}
.about-lists .creed {
  color: var(--text-2);
}

/* ---------- 首頁：週四聚會（收據） ---------- */

.thursday .container {
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
  align-items: center;
  justify-content: center;
}


.thursday-text {
  flex: 1 1 360px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.thursday-text p {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-2);
}

/* 收據外面包一層連結（外連 FB 貼文），排版尺寸放在連結上 */
.receipt-link {
  display: block;
  flex: 0 0 auto;
  width: 340px;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
}
.receipt-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 12px;
}
.receipt-link .receipt {
  transition: filter 0.2s;
}
.receipt-link:hover .receipt,
.receipt-link:focus-visible .receipt {
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.6)); /* hover 時影子加深，像被拿起來一點 */
}

.receipt {
  width: 100%;
  transform: rotate(-2deg);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}
/* 收據飄入：捲到「那些週四晚上」時才從上方飄下來（js/site.js 加上 .is-in）
   先 rotate 再 translateY，位移方向就會沿著收據本身 -2° 的斜角。
   .receipt-wait 由 JS 加上，所以沒有 JS 或開啟「減少動態效果」時收據直接顯示。 */
.receipt.receipt-wait {
  opacity: 0;
  transform: rotate(-2deg) translateY(-120px);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s; /* filter 給 hover 影子用 */
}
.receipt.receipt-wait.is-in {
  opacity: 1;
  transform: rotate(-2deg) translateY(0);
}
/* 撕紙鋸齒邊 */
.receipt::before,
.receipt::after {
  content: "";
  display: block;
  height: 12px;
}
.receipt::before {
  background: radial-gradient(circle at 8px 0, transparent 8px, #f4f1ea 8.5px) 0 0 / 16px 12px repeat-x;
}
.receipt::after {
  background: radial-gradient(circle at 8px 12px, transparent 8px, #f4f1ea 8.5px) 0 0 / 16px 12px repeat-x;
}

.receipt-paper {
  background: #f4f1ea;
  color: #23211d;
  padding: 20px 28px 24px;
  font-family: var(--font-mono), var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.receipt-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.receipt-head strong {
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}
.receipt-rule {
  border: 0;
  border-top: 1px dashed #8a857a;
  margin: 0;
}
.receipt-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.receipt-total {
  font-weight: 600;
  font-size: 1rem;
}
.receipt-note {
  font-size: 1rem;
  color: #4a463e;
}
.receipt-foot {
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #4a463e;
}

/* ---------- 首頁：成員 ---------- */

.members .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  text-align: center;
}


.member-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
}
.member-group-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.avatar {
  border-radius: 50%;
  overflow: hidden;
  flex: none;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 每位成員的 Facebook／網站連結 */
.member-links {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.member-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  color: var(--muted);
}
.member-links a:hover,
.member-links a:focus-visible {
  color: var(--accent);
  background: rgba(95, 166, 242, 0.08);
}
.member-links svg {
  width: 20px;
  height: 20px;
}

/* 執行總召：頭像在左、資訊在右，整組置中 */
.member-lead {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  align-items: center;
}

@media (width <= 510px) {
  .member-lead {
    flex-direction: column;
    gap: 16px;
  }
}

.member-lead .avatar {
  width: 200px;
  height: 200px;
  border: 2px solid var(--accent);
  transition: width 0.2s, height 0.2s, margin 0.2s, border-width 0.2s, padding 0.2s;
}
.member-lead .avatar img {
  border-radius: 50%;
}
/* 執行總召頭像不裁切（照片本身已是圓形），讓 hover 光暈能透出到外框外面 */
.member-lead .avatar {
  position: relative;
  overflow: visible;
}
/* 讓光暈（z-index: -1）墊在整個頭像（含彩框、間隔）後面，但不會掉到頁面底色之下 */
.member-lead {
  isolation: isolate;
}

/* 執行總召 hover 彩蛋：電競 RGB 外框
   外框變粗（5px）、與照片間隔 3px，彩虹漸層持續旋轉，外側有同色光暈（::before 模糊）。
   用負 margin 往外長，照片本身大小不變、旁邊的文字也不會被推動。
   間隔那一圈用 padding-box 的頁面底色蓋住；成員區若改成色帶底色，這裡的 var(--bg) 要跟著改。 */
@property --ring-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes ring-spin {
  to {
    --ring-angle: 360deg;
  }
}
.member-lead:hover .avatar,
.member-lead:focus-within .avatar {
  width: 210px;
  height: 210px;
  margin: -5px;
  border-width: 5px;
  border-color: transparent;
  padding: 3px;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(from var(--ring-angle),
    #ff0040, #ff8a00, #ffe600, #00ff6a, #00c8ff, #7a00ff, #ff00c8, #ff0040) border-box;
  animation: ring-spin 1.6s linear infinite;
}
/* 光暈：同一組彩虹漸層模糊後墊在彩框後面，角度跟著彩框一起轉 */
.member-lead .avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from var(--ring-angle),
    #ff0040, #ff8a00, #ffe600, #00ff6a, #00c8ff, #7a00ff, #ff00c8, #ff0040);
  filter: blur(14px);
  opacity: 0;
  transition: opacity 0.2s;
}
.member-lead:hover .avatar::before,
.member-lead:focus-within .avatar::before {
  --ring-angle: inherit;
  opacity: 0.85;
}
@media (prefers-reduced-motion: reduce) {
  .member-lead:hover .avatar,
  .member-lead:focus-within .avatar {
    animation: none;
  }
}
.member-lead .role {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
}
.member-lead .name {
  font-size: 2rem;
  font-weight: 700;
}
.member-lead .info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}
.member-lead .member-links {
  margin-left: -6px;
}

@media (width <= 510px) {
  .member-lead .info {
    align-items: center;
  }
}

/* 核心成員、創始成員：同樣尺寸，頭像在上、姓名置中在下 */
.member-core,
.member-founders {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
}
.member-core .member,
.member-founders .member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 200px;
}
.member-core .avatar,
.member-founders .avatar {
  width: 140px;
  height: 140px;
  position: relative;
  overflow: visible;
}
.member-core .avatar img,
.member-founders .avatar img {
  border-radius: 50%;
}

/* 核心／創始成員 hover：外圍一圈長短交錯的虛線環，慢慢旋轉（單色 --accent）
   虛線用 repeating-conic-gradient 畫（長 14° → 空 6° → 短 4° → 空 6°，每 30° 一組），
   再用 radial-gradient mask 只留外圈 3px，所以不是 border。環在照片外 8px，不影響版面。 */
.member-core .avatar::before,
.member-founders .avatar::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: repeating-conic-gradient(from var(--ring-angle),
    var(--accent) 0deg 14deg, transparent 14deg 20deg,
    var(--accent) 20deg 24deg, transparent 24deg 30deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.member-core .member:hover .avatar::before,
.member-core .member:focus-within .avatar::before,
.member-founders .member:hover .avatar::before,
.member-founders .member:focus-within .avatar::before {
  opacity: 1;
  animation: ring-spin 8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .member-core .avatar::before,
  .member-founders .avatar::before {
    animation: none !important;
  }
}
.member-core .name,
.member-founders .name {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ---------- 首頁：最新活動（滿版色帶） ---------- */

.latest .container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.latest-event {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: center;
}
.latest-cover {
  flex: 1 1 480px;
  min-height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--placeholder-on-band);
}
.latest-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.latest-info {
  flex: 1 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.latest-no {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}
.latest-meta {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-2);
}
.latest-speakers {
  font-size: 1rem;
  color: var(--muted);
}
.latest-talks {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ---------- 活動卡（首頁歷史活動、活動回顧頁共用） ---------- */

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

@media (width <= 580px) {
  .event-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.event-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.event-cover {
  aspect-ratio: 1200 / 628;
} /* 舊站封面多為 1200×628；比例不同的舊封面會被裁切 */
.event-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.event-cover a {
  display: block;
  height: 100%;
}
.event-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
}

@media (width <= 580px) {
  .event-head {
    flex-direction: column;
    justify-content: flex-start;
  }
}

.event-no {
  font-family: var(--font-mono);
  font-size: 1.1875rem;
  font-weight: 700;
}
.event-meta {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--muted);
}
.event-speakers {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}
.event-talks {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1rem;
  line-height: 1.6;
}

/* 首頁：歷史活動 */
.history .container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.history .event-no {
  color: var(--accent);
  font-size: 1.25rem;
}
.history-more {
  display: flex;
  justify-content: center;
}

/* ---------- 首頁：其他管道（獨立於歷史活動，上方以分隔線區隔） ---------- */

.channels {
  /* 上方分隔線：用背景畫在區塊最上緣，寬度等於內容寬（不滿版），不佔 padding */
  background: linear-gradient(var(--line), var(--line)) no-repeat top center / calc(min(var(--container), 100%) - 2 * var(--gutter)) 1px;
}
.channels .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.channels-title {
  font-size: 1.5rem;
  font-weight: 700;
}
.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.resource {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.resource-icon {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--text-2);
}
.resource-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.resource-name {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
}
.resource-desc {
  font-size: 1rem;
  color: var(--text-2);
}
.resource:hover {
  border-color: var(--accent);
}
.resource:hover .resource-icon {
  color: var(--accent);
}

/* ---------- 首頁：協助推廣（滿版色帶） ---------- */

.promote .container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.promote-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}
.promote-intro h2 {
  font-size: 2.25rem;
}
.promote-intro p {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-2);
}
.stickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

@media (width <= 580px) {
  .stickers {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* 圖片列固定 100px 高（最高那張），小張的垂直置中，讓左右的尺寸文字與程式碼區塊對齊 */
.sticker {
  display: grid;
  grid-template-rows: 100px auto 1fr;
  justify-items: center;
  align-items: center;
  gap: 16px;
}
.sticker-img {
  border: 1px dotted #3d4651;
  font-size: 1rem;
}
.sticker-img.is-180x100 {
  width: 180px;
  height: 100px;
}
.sticker-img.is-180x35 {
  width: 180px;
  height: 35px;
  font-size: 1rem;
}
.sticker-size {
  font-family: var(--font-mono);
  font-size: 1rem;
}
.sticker code {
  display: block;
  justify-self: stretch;
  align-self: stretch;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- 回到頂端按鈕（全站，js/site.js 產生） ----------
   捲動超過一個畫面高度才出現；固定在右下角、半透明。z-index 低於開場動畫（1000）。 */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, border-color 0.2s, color 0.2s;
}
.back-to-top.is-shown {
  opacity: 0.8;
  visibility: visible;
  transform: none;
}
.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 600px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
}
.site-footer .container {
  padding-top: 40px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: flex-end;
  font-size: 1rem;
  color: var(--muted);
}

/* ---------- 活動回顧頁 ---------- */

.archive-intro .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.archive-intro h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
}
.archive-intro .lead {
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--muted);
}
.archive-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--muted);
}
.archive-stats strong {
  font-size: 1.75rem;
  color: var(--text);
}

.year-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.year-nav .container {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.year-nav label {
  font-size: 1rem;
  color: var(--muted);
}
.year-nav select {
  appearance: none;
  min-height: 44px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239aa7b4' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px,
    var(--bg);
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
}
.year-nav select:hover,
.year-nav select:focus-visible {
  border-color: var(--accent);
}
.year-nav option {
  background: var(--bg);
  color: var(--text);
}

.archive .container {
  display: flex;
  flex-direction: column;
  gap: 72px;
}
.year-block {
  display: flex;
  flex-direction: column;
  gap: 40px;
  scroll-margin-top: 80px;
}

/* 只給螢幕閱讀器讀的文字 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----- 活動回顧頁：中軸時間軸 -----
   中間一條虛線，年份標籤壓在線上；卡片左右交錯（左、右、左、右…，新的在上），
   右欄往下錯開一點。每張卡片有指向中線的小三角，中線上有對應的圓點。
   窄螢幕改成線在左邊、卡片全部在右側。 */
.archive {
  --tl-gap: 88px; /* 左右欄間距（中線在正中間） */
  --tl-card: color-mix(in srgb, var(--accent) 3%, var(--bg)); /* 卡片底色（不透明，三角形才蓋得住框線） */
}
.archive .container {
  position: relative;
}
.archive .container::before { /* 中線 */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed var(--border);
}

.archive .year-head {
  position: relative;
  display: flex;
  justify-content: center;
}
.archive .year-head h2 {
  padding: 6px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--accent);
}

.archive .event-grid {
  position: relative;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--tl-gap);
  row-gap: 40px;
  align-items: start;
}
.archive .event-card:nth-child(even) {
  margin-top: 40px;
} /* 右欄往下錯開 */

.archive .event-card {
  position: relative;
  overflow: visible;
  background: var(--tl-card);
}
.archive .event-body {
  gap: 14px;
}
.archive .event-no {
  color: var(--accent);
  font-size: 1.25rem;
}

.archive .event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-item svg {
  width: 1em;
  height: 1em;
  flex: none;
}
.archive .event-cover {
  margin: 0 -24px;
} /* 封面滿版貼齊卡片左右 */

/* 指向中線的小三角（轉 45° 的方塊，只畫兩邊框線） */
.archive .event-card::before {
  content: "";
  position: absolute;
  top: 22px;
  width: 14px;
  height: 14px;
  background: var(--tl-card);
  border: 1px solid var(--border);
  transform: rotate(45deg);
}
.archive .event-card:nth-child(odd)::before {
  right: -8px;
  border-left: 0;
  border-bottom: 0;
}
.archive .event-card:nth-child(even)::before {
  left: -8px;
  border-right: 0;
  border-top: 0;
}

/* 中線上的圓點 */
.archive .event-card::after {
  content: "";
  position: absolute;
  top: 24px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.archive .event-card:nth-child(odd)::after {
  right: calc(var(--tl-gap) / -2 - 5.5px);
}
.archive .event-card:nth-child(even)::after {
  left: calc(var(--tl-gap) / -2 - 5.5px);
}

.archive .event-card:hover {
  border-color: var(--accent);
}
.archive .event-card:hover::before {
  border-color: var(--accent);
}

@media (max-width: 820px) {
  .archive {
    --tl-gap: 0px;
  }
  .archive .container::before {
    left: calc(var(--gutter) + 5px);
  }
  .archive .year-head {
    justify-content: flex-start;
  }
  .archive .event-grid {
    grid-template-columns: 1fr;
    padding-left: 36px;
  }
  .archive .event-card:nth-child(even) {
    margin-top: 0;
  }
  .archive .event-card:nth-child(n)::before {
    left: -8px;
    right: auto;
    border: 1px solid var(--border);
    border-right: 0;
    border-top: 0;
  }
  .archive .event-card:nth-child(n)::after {
    left: -36px;
    right: auto;
  }
  .archive .event-card:hover::before {
    border-color: var(--accent);
  }
}

/* ---------- 單場活動頁（events/*.html） ----------
   左寬欄：活動內容；右窄欄：推薦活動（SkillTree 的 script 寫入，寬 263px），捲動時黏在右上。
   寬度 960px 以下改成單欄，推薦活動移到內容下方、不再黏住。 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 32px;
}
.breadcrumb a {
  color: var(--accent);
}

.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 303px; /* 263px 內容 + 左右各 20px 內距 */
  gap: 56px;
  align-items: start;
}
.event-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}
.event-main-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.event-main-head h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.event-facts {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 1rem;
  color: var(--text-2);
}
.event-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.event-facts svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  color: var(--accent);
}
.event-hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.talk {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.talk-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
}
.talk-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 1rem;
  color: var(--text-2);
}
.talk-speaker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.talk-speaker svg {
  width: 1.1em;
  height: 1.1em;
  color: var(--accent);
}
.talk-level {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--accent);
}
.talk-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-2);
}
.talk-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.talk-sub {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}
/* 講師介紹（選擇性）：底色框，和活動內容區隔 */
.talk-bio {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.talk-bio .talk-body {
  font-size: 1rem;
  line-height: 1.8;
}
.event-back {
  padding-top: 16px;
}

.event-side {
  position: sticky;
  top: 24px;
}
.side-box {
  padding: 15px 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.side-title {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line); /* 標題下分隔線 */
  font-size: 1.25rem;
  font-weight: 700;
}
.side-feed {
  overflow: hidden;
}
.side-feed img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 960px) {
  .event-layout {
    grid-template-columns: 1fr;
  }
  .event-side {
    position: static;
    max-width: 303px;
  }
}

/* 活動列表上有單場頁的卡片，場次名稱變成連結 */
.event-no a {
  color: inherit;
  text-decoration: none;
}
.event-no a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* =========================================================
   開場拉鍊動畫
   流程（總長 2.4s）：
     0    – 0.45s 停頓：白幕、鍊齒、拉鍊頭停在最左
     0.45 – 1.65s 拉開：拉鍊頭往右，左緣經過處白幕與鍊齒上下分開（V 字形）
     1.65 – 2.03s 白幕上下退開；拉鍊頭白色襯底淡出、藍色漸變為白
     1.65 – 2.4s  拉鍊頭斜線飛回 header logo 位置並縮小
   狀態 class 掛在 <html>：
     .intro-pending  顯示白幕（尚未開始動）
     .intro-play     開始播放所有動畫
   ========================================================= */

.intro {
  display: none;
}
html.intro-pending .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  --hw: min(300px, 60vw); /* 拉鍊頭寬度 */
  --x0: 24px; /* 拉鍊頭左緣起點 = 裂開點 */
}
html.intro-pending .site-logo {
  opacity: 0;
}
html.intro-pending body {
  overflow: hidden;
}

.intro-half {
  position: absolute;
  inset: 0;
  background: #ffffff;
}
.intro-half.is-top {
  clip-path: polygon(0 0, 100% 0, 100% 50%, var(--x0) 50%, var(--x0) 50%, 0 50%);
}
.intro-half.is-bottom {
  clip-path: polygon(0 100%, 100% 100%, 100% 50%, var(--x0) 50%, var(--x0) 50%, 0 50%);
}
html.intro-play .intro-half.is-top {
  animation: zipTop 1.2s linear 0.45s both, zipTopOut 0.375s ease-in 1.65s both;
}
html.intro-play .intro-half.is-bottom {
  animation: zipBottom 1.2s linear 0.45s both, zipBottomOut 0.375s ease-in 1.65s both;
}

@keyframes zipTop {
  from {
    clip-path: polygon(0 0, 100% 0, 100% 50%, var(--x0) 50%, var(--x0) 50%, 0 50%);
  }
  to {
    clip-path: polygon(0 0, 100% 0, 100% 50%, calc(100vw + var(--x0)) 50%, var(--x0) 0%, 0 0%);
  }
}
@keyframes zipBottom {
  from {
    clip-path: polygon(0 100%, 100% 100%, 100% 50%, var(--x0) 50%, var(--x0) 50%, 0 50%);
  }
  to {
    clip-path: polygon(0 100%, 100% 100%, 100% 50%, calc(100vw + var(--x0)) 50%, var(--x0) 100%, 0 100%);
  }
}
@keyframes zipTopOut {
  to {
    transform: translateY(-60vh);
  }
}
@keyframes zipBottomOut {
  to {
    transform: translateY(60vh);
  }
}

/* 鍊齒：由 intro.js 依視窗寬度產生，每顆的 animation-delay = 拉鍊頭左緣抵達該處的時間 */
.intro-teeth {
  position: absolute;
  inset: 0;
}
html.intro-play .intro-teeth {
  animation: introFade 0.3s ease-in 1.65s both;
}
.tooth {
  position: absolute;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: #9aa3ad;
}
.tooth.is-top {
  top: calc(50% - 8px);
}
.tooth.is-bottom {
  top: calc(50% - 2px);
}
html.intro-play .tooth.is-top {
  animation: toothUp 1.2s linear both;
}
html.intro-play .tooth.is-bottom {
  animation: toothDown 1.2s linear both;
}
@keyframes toothUp {
  to {
    transform: translateY(-50vh);
  }
}
@keyframes toothDown {
  to {
    transform: translateY(50vh);
  }
}
@keyframes introFade {
  to {
    opacity: 0;
  }
}

/* 拉鍊頭：外層管水平、內層管垂直與尺寸，兩者用同一條緩動 → 斜線飛回 */
.intro-head-x {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 0;
}
.intro-head-y {
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--hw);
  translate: 0 -50%;
}
.intro-head-y svg {
  display: block;
  width: 100%;
  height: auto;
}
html.intro-play .intro-head-x {
  animation: headX 1.95s 0.45s both;
}
html.intro-play .intro-head-y {
  animation: headY 1.95s 0.45s both;
}

/* 61.538% = 1.2s / 1.95s（拉開段結束、飛回段開始） */
@keyframes headX {
  0% {
    transform: translateX(0);
    animation-timing-function: linear;
  }
  61.538% {
    transform: translateX(100vw);
    animation-timing-function: cubic-bezier(.45, 0, .25, 1);
  }
  100% {
    transform: translateX(max(0px, calc((100vw - var(--container)) / 2)));
  }
}
@keyframes headY {
  0%, 61.538% {
    top: 50%;
    width: var(--hw);
    animation-timing-function: cubic-bezier(.45, 0, .25, 1);
  }
  100% {
    top: 42px;
    width: 108px;
  } /* 42px = header 上 padding 24 + logo 高度一半 */
}

.intro-head-fill {
  fill: #ffffff;
} /* 白色襯底：在白幕上遮住後方鍊齒 */
.intro-head-mark {
  fill: var(--brand);
}
html.intro-play .intro-head-fill {
  animation: introFade 0.225s ease-in 1.65s both;
}
html.intro-play .intro-head-mark {
  animation: headWhite 0.675s ease-in-out 1.65s both;
}
@keyframes headWhite {
  to {
    fill: #ffffff;
  }
}

.intro-skip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.intro-skip-label {
  position: absolute;
  right: 24px;
  bottom: 24px;
  font-size: 1rem;
  color: #5f6773;
  pointer-events: none;
}

/* 主視覺在白幕退開時淡入 */
html.intro-play .hero .container {
  animation: heroIn 0.75s ease-out 1.65s both;
}
@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
