@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

@view-transition {
  navigation: auto;
}

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-divider: rgba(32,30,29,0.4);
  --color-card-bg: #fff;

  /* CERC 機構橙色 */
  --color-accent: #f07d18;
  --color-accent-100: #fff4e8;
  --color-accent-200: #ffe4c9;
  --color-accent-300: #ffcd9c;
  --color-accent-400: #ffb066;
  --color-accent-500: #ff9331;
  --color-accent-600: #d96a0a;
  --color-accent-700: #a85005;
  --color-accent-800: #6f3703;
  --color-accent-900: #472403;
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Archivo, "Noto Sans TC", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}
a { color: var(--color-accent-700); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); }
h1, h2, h3, h4, h5, h6 { font-family: Archivo, "Noto Sans TC", sans-serif; margin: 0; }
img { max-width: 100%; display: block; }
.text-muted { color: rgba(32,30,29,0.55); }

.wrap { padding-left: clamp(24px,5.5vw,56px); padding-right: clamp(24px,5.5vw,56px); }

/* ---- Header ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--color-bg);
  padding: 14px clamp(24px,5.5vw,56px);
  display: flex; align-items: center; flex-wrap: wrap;
  gap: clamp(16px,3vw,40px);
  border-bottom: 1px solid transparent;
}
.nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.nav .brand .brand-logo-full { height: 46px; width: auto; display: block; }
.nav nav { display: flex; flex-wrap: wrap; gap: clamp(14px,2.4vw,30px); align-items: center; }
.nav nav a { font-size: 14px; font-weight: 500; color: var(--color-text); }
.nav nav a[aria-current="page"] { color: var(--color-accent-700); }

/* ---- Buttons / Tags ---- */
.btn { display: inline-block; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 12px 20px; text-decoration: none; }
.btn-primary { background: var(--color-accent); color: var(--color-text); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-text); }
.btn-outline { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); padding: 10px 18px; }

.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 5px 10px; border-radius: 999px; }
.tag-neutral { background: var(--color-surface); color: var(--color-text); }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-700); }

/* ---- Media placeholder ---- */
.media { position: relative; background: var(--color-surface); overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.contain img { object-fit: contain; }
.media.empty { display: flex; align-items: center; justify-content: center; color: rgba(32,30,29,0.4); font-size: 13px; text-align: center; padding: 12px; }
.grayscale img { filter: grayscale(100%); }

/* ---- Sections ---- */
.section { padding: clamp(36px,5vw,72px) clamp(24px,5.5vw,56px); }
.section-divider { border-bottom: 2px solid var(--color-divider); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(20px,3vw,32px); }
.section-head h2 { font-size: clamp(24px,3vw,36px); font-weight: 900; letter-spacing: -0.01em; }
.section-head .more { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }

.hero { position: relative; }
.hero-carousel { position: relative; width: 100%; height: clamp(380px,64vh,660px); overflow: hidden; background: var(--color-surface); }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .65s ease, visibility .65s ease; }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slide img, .hero-slide .media { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide img { transform: scale(1.03); transition: transform 1.5s ease-out; }
.hero-slide.is-active img { transform: scale(1); }
.hero .overlay {
  position: absolute; inset: auto 0 0 0; z-index: 3; padding: clamp(24px,4vw,56px);
  background: linear-gradient(to top, rgba(32,30,29,0.82), rgba(32,30,29,0));
}
.hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: #fff; opacity: 0.75; margin-bottom: 14px; }
.hero h1 { color: #fff; font-size: clamp(26px,4.4vw,60px); line-height: 1.25; font-weight: 900; letter-spacing: -0.01em; }

.tagline-band { background: var(--color-accent); color: var(--color-text); padding: clamp(22px,3vw,36px) clamp(24px,5.5vw,56px); }
.tagline-columns { display: grid; grid-template-columns: repeat(2,1fr); gap: clamp(20px,3vw,48px); align-items: start; }
.tagline-columns p { margin: 0; font-size: clamp(15px,1.3vw,18px); font-weight: 500; line-height: 1.75; white-space: pre-line; letter-spacing: 0.005em; }
@media (max-width: 640px) {
  .tagline-columns { grid-template-columns: 1fr; }
}

.stats-band {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  border-bottom: 2px solid var(--color-divider);
}
.stats-band .stat {
  padding: clamp(28px,4vw,48px) clamp(20px,4vw,32px);
  border-right: 1px solid var(--color-divider);
  text-align: center;
}
.stats-band .stat:last-child { border-right: none; }
.stats-band .stat-num {
  font-family: Archivo, sans-serif; font-weight: 900;
  font-size: clamp(36px,5vw,64px); line-height: 1; color: var(--color-accent-700);
  letter-spacing: -0.01em;
}
.stats-band .stat-label { margin-top: 10px; font-size: 14px; font-weight: 700; color: rgba(32,30,29,0.7); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: clamp(20px,2.6vw,40px); }
.card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card .media { aspect-ratio: 16/10; }
.card .title { font-size: clamp(19px,1.9vw,26px); font-weight: 900; line-height: 1.4; letter-spacing: -0.005em; }

.list-plain { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--color-divider); }
.list-plain li { border-bottom: 1px solid var(--color-divider); }
.list-plain a { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: clamp(16px,2.4vw,32px); align-items: center; padding: clamp(14px,1.8vw,22px) 0; text-decoration: none; color: inherit; }
.list-plain .media { aspect-ratio: 3/2; }
.list-plain .cat { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--color-accent-700); margin-bottom: 6px; }
.list-plain .title { font-size: clamp(17px,1.5vw,21px); font-weight: 700; line-height: 1.4; }

.org-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 0; border-top: 1px solid var(--color-divider); border-left: 1px solid var(--color-divider); }
.org-grid a, .org-grid .org-cell { text-decoration: none; color: inherit; border-right: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); padding: clamp(18px,2.2vw,28px); display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: hidden; }
.org-grid .media { aspect-ratio: 4/3; width: 100%; }
.org-grid .name { font-size: 15px; font-weight: 700; line-height: 1.5; }

.cta-band { background: var(--color-accent); color: var(--color-text); padding: clamp(40px,6vw,88px) clamp(24px,5.5vw,56px); display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: clamp(28px,4vw,64px); align-items: center; border-top: 2px solid var(--color-divider); }
.cta-band h2 { font-size: clamp(28px,4vw,52px); line-height: 1.25; font-weight: 900; }
.cta-band p { font-size: clamp(15px,1.2vw,17px); line-height: 1.85; margin: 0 0 20px; max-width: 44ch; }

footer.site-footer {
  border-top: 2px solid var(--color-divider);
  padding: clamp(28px,3.5vw,48px) clamp(24px,5.5vw,56px);
  display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
  gap: clamp(24px,4vw,64px);
  font-size: 13px;
}
footer.site-footer > div:first-child { align-self: center; }
footer.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
footer.site-footer > div:last-child { flex: 0 0 auto; white-space: nowrap; }
footer.site-footer .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
footer.site-footer .brand-row .brand-logo-full { height: 30px; width: auto; display: block; }

.page-head { padding: clamp(36px,5.5vw,80px) clamp(24px,5.5vw,56px) clamp(28px,4vw,56px); border-bottom: 2px solid var(--color-divider); display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: clamp(24px,4vw,64px); align-items: end; }
.page-head .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: clamp(16px,2.4vw,28px); }
.page-head h1 { font-size: clamp(30px,7vw,64px); line-height: 1.2; font-weight: 900; letter-spacing: -0.01em; }
.page-head .lead { margin: 0; max-width: 44ch; font-size: clamp(15px,1.2vw,17px); line-height: 1.85; }

.article-body { padding: clamp(32px,4.5vw,64px) clamp(24px,5.5vw,56px); max-width: 76ch; }
.article-body p { font-size: 16px; line-height: 1.9; margin: 0 0 1.2em; text-align: justify; }
.article-body p:empty,
.article-body p:has(> br:only-child) { display: none; }
.about-copy p:empty { display: none; }
.article-body img { max-width: 100%; height: auto; border-radius: 4px; margin: 1.4em 0; }
.article-body video { max-width: 100%; height: auto; border-radius: 4px; margin: 1.4em 0; background: #000; display: block; }
.article-body iframe.ql-video { width: 100%; aspect-ratio: 16/9; height: auto; border: none; border-radius: 4px; margin: 1.4em 0; display: block; }
.article-body h2 { font-size: 24px; font-weight: 900; margin: 1.4em 0 .6em; }
.article-body h3 { font-size: 20px; font-weight: 900; margin: 1.2em 0 .5em; }
.article-body ul, .article-body ol { font-size: 16px; line-height: 1.9; margin: 0 0 1.2em; padding-left: 1.4em; }
.article-body blockquote { border-left: 3px solid var(--color-accent); margin: 1.2em 0; padding: 0.2em 0 0.2em 1.2em; color: rgba(32,30,29,0.75); font-style: italic; }
.article-body a { text-decoration: underline; }
.article-body .ql-align-center { text-align: center; }
.article-body .ql-align-right { text-align: right; }

/* ============ 關於我們：起源 / 會長獻辭 ============ */
.about-block { display: grid; grid-template-columns: minmax(200px,260px) minmax(0,640px); gap: clamp(28px,4vw,56px); align-items: start; }
.about-block-reverse { grid-template-columns: minmax(0,640px) minmax(200px,260px); }
.about-photo .media { border-radius: 4px; }
.about-copy h2 { font-size: clamp(24px,3vw,32px); font-weight: 900; letter-spacing: -0.01em; margin-bottom: 16px; }
.about-copy p { font-size: clamp(15px,1.2vw,17px); line-height: 1.9; margin: 0 0 1.6em; max-width: 62ch; text-align: justify; }
.about-signoff { font-weight: 700; margin-top: 4px; }

/* ============ 成員組織內頁：歷屆主席 ============ */
.chairmen-list { border-top: 2px solid var(--color-divider); }
.chairmen-row {
  display: grid; grid-template-columns: 90px 140px 1fr; gap: clamp(12px,2vw,24px);
  padding: 12px 0; border-bottom: 1px solid var(--color-divider); align-items: baseline;
}
.chairmen-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: rgba(32,30,29,0.5); text-transform: uppercase; border-bottom-width: 2px; }
.chairmen-year { font-weight: 900; color: var(--color-accent-700); font-size: 15px; }
.chairmen-term { font-size: 14px; color: rgba(32,30,29,0.65); }
.chairmen-name { font-size: 15px; font-weight: 700; }
@media (max-width: 560px) {
  .chairmen-row { grid-template-columns: 56px 84px 1fr; gap: 8px; }
  .chairmen-term, .chairmen-name { font-size: 13px; }
}

/* ============ 關於羣力：子導覽分頁籤 ============ */
.subnav {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: clamp(20px,3vw,28px) clamp(24px,5.5vw,56px);
  border-bottom: 2px solid var(--color-divider);
}
.subnav-tab {
  font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: 999px;
  background: var(--color-surface); color: var(--color-text); text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}
.subnav-tab:hover { background: var(--color-accent-100); }
.subnav-tab.is-active { background: var(--color-accent); color: var(--color-text); }

/* ============ 成員芳名 ============ */
.roster-leaders { display: flex; flex-direction: column; gap: 10px; padding-top: clamp(16px,2.4vw,24px); margin-bottom: clamp(20px,3vw,28px); }
.roster-role { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }
.roster-role-label { font-weight: 700; color: rgba(32,30,29,0.55); min-width: 220px; flex-shrink: 0; }
.roster-role-name { font-weight: 900; }
.roster-directors { margin-bottom: clamp(24px,3.5vw,36px); font-size: 15px; line-height: 1.9; padding-top: clamp(12px,2vw,20px); border-top: 1px solid var(--color-divider); }
.roster-directors .roster-directors-names { margin-top: 6px; }
.roster-sponsors { padding-top: clamp(20px,3vw,28px); border-top: 1px solid var(--color-divider); }
.roster-sponsors h3 { font-size: clamp(17px,1.6vw,20px); font-weight: 900; margin: 0 0 clamp(16px,2.4vw,24px); }
.roster-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px 24px; }
.roster-name { font-size: 14px; line-height: 2; border-bottom: 1px solid var(--color-divider); }
@media (max-width: 900px) { .roster-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 640px) { .roster-grid { grid-template-columns: repeat(2,1fr); } .roster-role-label { min-width: 100%; } }
@media (max-width: 380px) { .roster-grid { grid-template-columns: 1fr; } }

/* ============ 起源相簿：大圖下方的橫向縮圖列 ============ */
.origin-gallery-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.origin-gallery-thumb {
  min-width: 0; aspect-ratio: 1/1; padding: 0; border: none; border-radius: 4px;
  overflow: hidden; cursor: zoom-in; background: var(--color-surface);
}
.origin-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.origin-gallery-thumb:hover img { transform: scale(1.1); }
@media (max-width: 640px) {
  .origin-gallery-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .origin-gallery-thumb { flex: 0 0 68px; scroll-snap-align: start; }
}

@media (max-width: 640px) {
  .about-block, .about-block-reverse { grid-template-columns: 1fr; }
  .about-block .about-photo { max-width: 260px; order: -1; }
}

/* ============ 社群分享按鈕 ============ */
.share-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.share-label { font-size: 13px; font-weight: 700; color: rgba(32,30,29,0.6); margin-right: 2px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; color: #fff; text-decoration: none;
  transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s ease;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 18px -12px rgba(32,30,29,0.4); }
.share-whatsapp { background: #25d366; }
.share-facebook { background: #1877f2; }
.share-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4); border: none; font-family: inherit; }
.share-note { margin: 10px 0 0; font-size: 12px; color: rgba(32,30,29,0.6); min-height: 1em; }

/* ============ 回到頂部 ============ */
.back-to-top {
  position: fixed; right: clamp(16px,3vw,32px); bottom: clamp(16px,3vw,32px); z-index: 50;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--color-accent); color: var(--color-text); font-size: 20px; cursor: pointer;
  box-shadow: 0 10px 22px -12px rgba(32,30,29,0.5);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-accent-600); }

.timeline { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--color-divider); }
.timeline-item { border-bottom: 1px solid var(--color-divider); transition: background-color .3s ease; }
.timeline-summary {
  width: 100%; display: flex; align-items: center; gap: clamp(16px,3vw,40px);
  background: none; border: none; text-align: left; cursor: pointer; font-family: inherit; color: inherit;
  padding: clamp(20px,3vw,28px) 0;
}
.timeline-summary-left { display: flex; flex-direction: column; min-width: 88px; flex-shrink: 0; }
.timeline-summary .year { font-size: clamp(24px,2.6vw,34px); font-weight: 900; line-height: 1; letter-spacing: 0.01em; color: var(--color-accent-700); }
.timeline-summary .bar { width: 24px; height: 4px; background: var(--color-accent); margin-top: 12px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.timeline-summary h3 { flex: 1; min-width: 0; font-size: clamp(17px,1.6vw,22px); font-weight: 900; line-height: 1.4; margin: 0; }
.timeline-chevron { display: none; font-size: 18px; color: var(--color-accent-700); transition: transform .3s ease; flex-shrink: 0; }
.timeline-item.is-open .timeline-chevron { transform: rotate(180deg); }
.timeline-summary.no-expand { cursor: default; }

.timeline-details { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .45s cubic-bezier(.16,.84,.44,1), opacity .3s ease; }
.timeline-item.is-open .timeline-details { max-height: 1400px; opacity: 1; }
.timeline-item.is-open { background: rgba(240,125,24,0.05); }
.timeline-item.is-open .bar { width: 52px; }
.timeline-details-inner { display: flex; flex-wrap: wrap; gap: clamp(16px,2.4vw,32px); align-items: flex-start; padding: 0 0 clamp(20px,3vw,28px); }
.timeline-details-inner p { flex: 1 1 320px; margin: 0; font-size: clamp(15px,1.15vw,16px); line-height: 1.85; max-width: 56ch; text-align: justify; }
.timeline-thumb-wrap { flex: 0 1 30%; max-width: 220px; min-width: 140px; }
.timeline-thumb-wrap .timeline-media { aspect-ratio: 4/3; }

/* 桌面（有滑鼠）：滑鼠移過去自動展開 */
@media (hover: hover) and (pointer: fine) {
  .timeline-item:hover { background: rgba(240,125,24,0.05); }
  .timeline-item:hover .bar { width: 52px; }
  .timeline-item:hover .timeline-details { max-height: 1400px; opacity: 1; }
}

/* 手機/觸控裝置：顯示展開按鈕，靠點擊展開 */
@media (hover: none), (pointer: coarse) {
  .timeline-chevron { display: block; }
}

@media (max-width: 560px) {
  .timeline-summary { padding: clamp(20px,5vw,28px) 0; gap: 16px; }
  .timeline-summary .year { font-size: clamp(24px,8vw,32px); }
  .timeline-summary-left { min-width: 60px; }
  .timeline-details-inner { flex-direction: column; }
  .timeline-thumb-wrap { max-width: 100%; width: 100%; }
}

.work-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 0; border-top: 2px solid var(--color-divider); }
.work-grid .cell { padding: clamp(20px,2.4vw,32px) clamp(16px,2vw,28px) clamp(24px,3vw,40px) 0; min-width: 0; }
.work-grid .num { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--color-accent-700); margin-bottom: 12px; }
.work-grid .t { font-size: 21px; font-weight: 900; margin-bottom: 10px; }
.work-grid p { margin: 0; font-size: 15px; line-height: 1.8; }

/* ---- Admin ---- */
.admin-wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 80px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 20px; border-bottom: 2px solid var(--color-divider); align-items: center; }
.admin-nav a { font-size: 14px; font-weight: 700; }
.admin-nav .spacer { margin-left: auto; }
.admin-card { background: #fff; border: 1px solid var(--color-divider); border-radius: 10px; padding: 24px; margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.admin-table th { font-weight: 700; color: rgba(32,30,29,0.6); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-row input[type=text], .form-row input[type=date], .form-row input[type=password], .form-row textarea, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid rgba(32,30,29,0.3); border-radius: 6px; font-family: inherit; font-size: 14px; background: #fff;
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.btn-admin { display: inline-block; background: var(--color-accent); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-admin.secondary { background: transparent; color: var(--color-text); border: 1px solid rgba(32,30,29,0.3); }
.btn-admin.danger { background: #b23a2f; }
.thumb-preview { width: 100px; height: 70px; object-fit: cover; border-radius: 4px; background: var(--color-surface); }
.login-box { max-width: 360px; margin: 80px auto; padding: 32px; background: #fff; border-radius: 10px; border: 1px solid var(--color-divider); }
.flash { background: var(--color-accent-100); color: var(--color-accent-800); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 20px; }

/* ============ 分類篩選 ============ */
.filter-pills { display: flex; flex-wrap: wrap; gap: 10px; padding: clamp(20px,3vw,28px) clamp(24px,5.5vw,56px) clamp(16px,2.4vw,24px); }
.filter-pills .pill {
  font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  background: var(--color-surface); color: var(--color-text); text-decoration: none;
  border: 1px solid transparent; transition: background-color .25s ease, border-color .25s ease;
}
.filter-pills .pill:hover { background: var(--color-accent-100); }
.filter-pills .pill.is-active { background: var(--color-accent); border-color: var(--color-accent-700); color: var(--color-text); }

/* ============ 相簿 + 燈箱 ============ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 10px; }
.gallery-thumb { padding: 0; border: none; background: var(--color-surface); border-radius: 4px; overflow: hidden; cursor: zoom-in; aspect-ratio: 1/1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.gallery-thumb:hover img { transform: scale(1.08); }
.timeline-thumb { display: block; width: 100%; aspect-ratio: auto; background: none; border-radius: 0; }

.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(16,14,12,0.92); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 40px;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-overlay .lightbox-img { max-width: 100%; max-height: 90vh; border-radius: 4px; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff; border: none; font-size: 18px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff; border: none; font-size: 28px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background-color .2s ease;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
}

/* ============ 後台圖片裁切 ============ */
.crop-modal { position: fixed; inset: 0; background: rgba(16,14,12,0.85); z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; }
.crop-modal.is-open { display: flex; }
.crop-modal-inner { background: #fff; border-radius: 10px; padding: 20px; max-width: 720px; width: 100%; }
.crop-modal-image-wrap { max-height: 60vh; overflow: hidden; }
.crop-modal-image { display: block; max-width: 100%; }
.crop-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.crop-live-preview { width: 100px; height: 70px; object-fit: cover; border-radius: 4px; margin-top: 8px; background: var(--color-surface); }

/* ============ 無障礙 ============ */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--color-accent); color: var(--color-text); padding: 12px 20px;
  font-weight: 700; text-decoration: none; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-accent-700); outline-offset: 2px;
}

/* ============ 捲動進度條 ============ */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; }
.scroll-progress-bar { height: 100%; width: 0%; background: var(--color-accent); transition: width .1s linear; }

/* ============ 簽名線條（母題：飛鳥標誌 + 延伸線）============ */
.signature-mark { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; }
.signature-bird {
  display: block; width: 17px; height: 22px; flex-shrink: 0;
  background-color: var(--color-accent-700);
  -webkit-mask: url("/images/signature-bird.svg") no-repeat center / contain;
  mask: url("/images/signature-bird.svg") no-repeat center / contain;
}
.signature-line-svg path { fill: none; stroke: var(--color-accent-700); stroke-width: 2.5; stroke-linecap: round; }
.hero .signature-mark .signature-bird { background-color: #fff; }
.hero .signature-mark .signature-line-svg path { stroke: #fff; }
.cta-band .signature-mark .signature-bird { background-color: var(--color-text); }
.cta-band .signature-mark .signature-line-svg path { stroke: var(--color-text); }
@media (prefers-reduced-motion: no-preference) {
  .signature-bird {
    opacity: 0; transform: scale(.6);
    transition: opacity .4s ease, transform .4s cubic-bezier(.34,1.56,.64,1);
  }
  .signature-line-svg path {
    stroke-dasharray: 100; stroke-dashoffset: 100;
    transition: stroke-dashoffset .55s cubic-bezier(.16,.84,.44,1) .38s;
  }
  .draw-line.is-visible .signature-bird { opacity: 1; transform: scale(1); }
  .draw-line.is-visible .signature-line-svg path { stroke-dashoffset: 0; }
}

/* ============ 首字放大（Drop Cap）============ */
.article-body.drop-cap > p:first-of-type::first-letter {
  font-family: Archivo, sans-serif; font-weight: 900; font-size: 3.4em; line-height: 0.8;
  float: left; margin: 0.05em 0.08em 0 0; color: var(--color-accent-700);
}

/* ============ 卡片陰影升級 ============ */
.card, .org-grid a { transition: background-color .3s ease, transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s cubic-bezier(.2,.7,.2,1); }
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 34px -22px rgba(32,30,29,0.4); }

/* ============ 首頁大圖視差 ============ */
.hero { overflow: hidden; }
.hero-carousel { will-change: contents; }
.hero-slide img { will-change: opacity, transform; }

/* ============ 微噪點紋理 ============ */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ 動效 ============ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s cubic-bezier(.16,.84,.44,1), transform .8s cubic-bezier(.16,.84,.44,1);
  }
  .reveal.is-visible { opacity: 1; transform: none; }

  .hero-slide.is-active img { animation: heroZoom 1.5s ease-out forwards; }
  @keyframes heroZoom { from { transform: scale(1.04); } to { transform: scale(1); } }
}
.reveal.is-visible, .reveal { will-change: transform, opacity; }

/* 導覽列：捲動陰影 + 連結底線滑入 */
.nav { transition: box-shadow .3s ease, border-color .3s ease; border-bottom: 1px solid transparent; }
.nav.is-scrolled { box-shadow: 0 8px 20px -16px rgba(32,30,29,0.45); border-bottom-color: var(--color-divider); }
.nav nav a { position: relative; padding-bottom: 2px; transition: color .25s ease; }
.nav nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2px;
  background: var(--color-accent); transition: right .32s cubic-bezier(.2,.7,.2,1);
}
.nav nav a:hover::after, .nav nav a[aria-current="page"]::after { right: 0; }
.nav .brand .brand-logo-full { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.nav .brand:hover .brand-logo-full { transform: scale(1.06); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes logoIntro { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
  .brand-logo-full { animation: logoIntro .6s cubic-bezier(.16,.84,.44,1) both; }
}

/* ---- 漢堡選單（僅小螢幕顯示）---- */
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .nav { position: relative; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 38px; height: 38px; border: 1px solid var(--color-divider); border-radius: 8px;
    background: var(--color-surface); cursor: pointer; order: 2; flex-shrink: 0;
  }
  .nav-toggle-bar { width: 18px; height: 2px; background: var(--color-text); margin: 0 auto; transition: transform .25s ease, opacity .25s ease; }
  .nav.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav nav {
    order: 4; flex-basis: 100%;
    flex-direction: column; align-items: flex-start; gap: 4px;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s ease, opacity .25s ease;
  }
  .nav.is-open nav { max-height: 320px; opacity: 1; padding-top: 8px; }
  .nav nav a { padding: 10px 4px; width: 100%; }
}

/* 圖片懸浮縮放 */
.media img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .media img, .list-plain a:hover .media img, .org-grid a:hover .media img { transform: scale(1.06); }
.card .title, .list-plain .title { transition: color .25s ease; }
.card:hover .title, .list-plain a:hover .title { color: var(--color-accent-700); }

/* 成員組織方塊懸浮 */
.org-grid a, .org-grid .org-cell { transition: background-color .3s ease, transform .3s cubic-bezier(.2,.7,.2,1); }
.org-grid a:hover { background: var(--color-accent-100); transform: translateY(-4px); }

/* 按鈕懸浮 */
.btn { transition: transform .25s cubic-bezier(.2,.7,.2,1), background-color .25s ease, box-shadow .25s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -14px rgba(32,30,29,0.4); }
.btn-primary:hover { background: var(--color-accent-600); }

/* 更多連結箭頭滑動 */
.section-head .more { display: inline-flex; align-items: center; transition: gap .25s ease, color .25s ease; }
.section-head .more:hover { color: var(--color-accent-700); }



/* 全站轉色 / 悼念模式（可靠版）
   先把前台內容真正灰階，再利用 html overlay 套用後台指定色。
   overlay 放在 html 層，避免 body/filter 建立 stacking context 後令 blend mode 失效。 */
html.site-tint-active {
  isolation: isolate;
}
html.site-tint-active body > :not(script):not(style) {
  filter: grayscale(100%) !important;
}
html.site-tint-active::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  background: var(--site-tint-color, #000000);
  mix-blend-mode: color;
}

/* ============ Upgrade 3: 手動 Hero Carousel ============ */
.hero-carousel {
  aspect-ratio: 21 / 9;
  height: auto;
  min-height: 0;
  touch-action: pan-y;
}
.hero-slide { transition: opacity .35s ease, visibility .35s ease; }
.hero-slide img { transform: none; transition: none; }
.hero-slide.is-active img { transform: none; animation: none !important; }
.hero-arrow {
  position: absolute; z-index: 5; top: 50%; transform: translateY(-50%);
  width: clamp(42px,4vw,54px); height: clamp(42px,4vw,54px);
  border-radius: 50%; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.90); color: var(--color-text);
  box-shadow: 0 6px 20px rgba(0,0,0,.16); cursor: pointer;
  font-size: clamp(32px,3vw,42px); line-height: 1; display: flex;
  align-items: center; justify-content: center; padding: 0 0 4px;
  transition: transform .2s ease, background-color .2s ease;
}
.hero-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.hero-arrow-prev { left: clamp(12px,2vw,28px); }
.hero-arrow-next { right: clamp(12px,2vw,28px); }
.hero-dots {
  position: absolute; z-index: 5; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center;
}
.hero-dot {
  width: 9px; height: 9px; border: 0; border-radius: 50%; padding: 0;
  background: rgba(255,255,255,.58); cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,.18);
}
.hero-dot.is-active { background: var(--color-accent); }

/* 手機版仍然維持與桌面相同 21:9 圖片比例 */
@media (max-width: 720px) {
  .hero-carousel { aspect-ratio: 21 / 9; height: auto; }
  .hero-arrow { width: 36px; height: 36px; font-size: 28px; }
  .hero-arrow-prev { left: 8px; }
  .hero-arrow-next { right: 8px; }
  .hero-dots { bottom: 8px; gap: 6px; }
  .hero-dot { width: 7px; height: 7px; }
}

/* ============ Upgrade 3: 成員組織相片直接置於標誌下 ============ */
.member-detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(0, 1.4fr);
  gap: clamp(24px,4vw,56px);
  align-items: start;
}
.member-detail-media { min-width: 0; }
.member-gallery-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 10px;
}
.member-gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 5px;
}
@media (max-width: 720px) {
  .member-detail-grid { grid-template-columns: 1fr; }
  .member-gallery-inline { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* ============ Upgrade 4: 新 Logo ============ */
.nav .brand .brand-logo-full {
  height: 54px;
  width: auto;
  max-width: min(360px, 42vw);
  object-fit: contain;
}
@media (max-width: 720px) {
  .nav .brand .brand-logo-full { height: 44px; max-width: 68vw; }
}

/* ============ Upgrade 4: 手機 Hero 回復原本較高比例 ============ */
@media (max-width: 720px) {
  .hero-carousel {
    aspect-ratio: auto;
    height: clamp(380px, 64vh, 520px);
  }
  .hero-slide img, .hero-slide .media { height: 100%; }
}

/* ============ Upgrade 4: 三行置中 Footer ============ */
footer.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(34px,4.5vw,58px) clamp(20px,5vw,56px);
  text-align: center;
  border-top: 2px solid var(--color-divider);
}
.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 40px;
}
.footer-social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-text);
  transition: transform .2s ease, opacity .2s ease;
}
.footer-social a:hover { transform: translateY(-2px); opacity: .82; }
.footer-social img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  filter: invert(1);
}
.footer-copyright {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(32,30,29,.68);
}
footer.site-footer .footer-legal {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.footer-legal a {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}
.footer-separator { color: rgba(32,30,29,.35); }
@media (max-width: 520px) {
  footer.site-footer { gap: 12px; }
  footer.site-footer .footer-legal { gap: 7px; }
  .footer-legal a, .footer-copyright { font-size: 12px; }
}

/* ============ Upgrade 4: 法律頁 / 網站地圖 ============ */
.legal-copy { max-width: 86ch; }
.legal-copy p { white-space: pre-wrap; }
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: clamp(28px,4vw,56px);
}
.sitemap-grid h2 { font-size: 20px; margin-bottom: 14px; }
.sitemap-grid ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-divider); }
.sitemap-grid li { border-bottom: 1px solid var(--color-divider); }
.sitemap-grid a { display: block; padding: 10px 0; color: var(--color-text); }
.sitemap-grid a:hover { color: var(--color-accent-700); }

/* ============ Upgrade 4.3: 手機首頁數字三格平排 + Header 收緊 ============ */
@media (max-width: 720px) {
  /* Header：減少上下留白，讓 Hero 更貼近導覽列 */
  .nav {
    padding-top: 8px;
    padding-bottom: 8px;
    min-height: 0;
    gap: 12px;
  }
  .nav .brand .brand-logo-full {
    height: 40px;
  }
  .nav-toggle {
    width: 36px;
    height: 36px;
  }

  /* 首頁三個數字固定同一行，不再 2+1 換行 */
  .stats-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats-band .stat {
    min-width: 0;
    padding: 24px 8px 26px;
    border-right: 1px solid var(--color-divider);
  }
  .stats-band .stat:last-child {
    border-right: none;
  }
  .stats-band .stat-num {
    font-size: clamp(27px, 9vw, 40px);
    line-height: .95;
    white-space: nowrap;
    letter-spacing: -0.04em;
  }
  .stats-band .stat-label {
    margin-top: 9px;
    font-size: 11px;
    line-height: 1.35;
    word-break: keep-all;
  }
}

@media (max-width: 390px) {
  .stats-band .stat { padding-left: 5px; padding-right: 5px; }
  .stats-band .stat-num { font-size: clamp(23px, 8.2vw, 32px); }
  .stats-band .stat-label { font-size: 10px; }
}

/* ============ Upgrade 4.4: 手機首頁數字防溢出 ============ */
@media (max-width: 720px) {
  .stats-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    overflow: hidden;
  }
  .stats-band .stat {
    min-width: 0;
    overflow: hidden;
    padding-left: 4px;
    padding-right: 4px;
  }
  .stats-band .stat-num {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: clamp(18px, 6vw, 24px);
    line-height: 1;
    letter-spacing: -0.055em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
  }
  .stats-band .stat-label {
    font-size: clamp(9px, 2.7vw, 11px);
    line-height: 1.3;
    padding: 0 2px;
  }
}

@media (max-width: 380px) {
  .stats-band .stat-num {
    font-size: 20px;
    letter-spacing: -0.06em;
  }
  .stats-band .stat-label {
    font-size: 9px;
  }
}
