:root {
  --preview-height: 42px;
  --green-950: #163126;
  --green-850: #24483a;
  --green-700: #32614f;
  --gold: #b89352;
  --gold-soft: #d7c08a;
  --paper: #f4f7f2;
  --paper-2: #ffffff;
  --ink: #292620;
  --muted: #6b6258;
  --line: #d9e1d7;
  --blue: #315d7c;
  --red: #9a4a42;
  --shadow: 0 18px 46px rgba(31, 49, 39, .13);
  --sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --serif: "Noto Serif TC", "PMingLiU", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 126px; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.topbar {
  position: sticky;
  top: var(--preview-height);
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 10px clamp(16px, 3vw, 34px);
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand-logo {
  width: 42px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(31, 49, 39, .12));
}
.brand-title { font-family: var(--serif); font-weight: 800; color: var(--green-950); white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: .78rem; letter-spacing: .08em; white-space: nowrap; }
.nav { display: flex; justify-content: center; gap: 8px; min-width: 0; }
.nav a {
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--green-850);
  white-space: nowrap;
}
.nav a:hover { border-color: var(--gold-soft); background: rgba(255,255,255,.5); }
.mobile-nav { display: none; }
.clock {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--green-950);
  white-space: nowrap;
}
.clock span { color: var(--gold); font-weight: 800; font-size: .78rem; letter-spacing: .12em; }
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--preview-height);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid rgba(225, 217, 201, .55);
  background: #fff8e6;
  color: var(--green-950);
  font-weight: 900;
  letter-spacing: .04em;
  padding: 6px clamp(16px, 4vw, 42px);
  text-align: center;
  white-space: normal;
}
main { width: min(1500px, 100%); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr);
  gap: clamp(22px, 4vw, 54px);
  padding: clamp(34px, 6vw, 74px) clamp(16px, 4vw, 42px) 24px;
}
.kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .18em;
}
h1, h2, h3 { margin: 0; font-family: var(--serif); color: var(--green-950); line-height: 1.18; }
h1 { font-size: 3.5rem; letter-spacing: 0; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.08rem; }
.lede { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.search-panel {
  align-self: end;
  padding: 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
}
.search-panel label { color: var(--green-850); font-weight: 800; }
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  min-height: 44px;
}
button {
  border: 1px solid var(--green-700);
  border-radius: 6px;
  background: var(--green-850);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}
button:hover { background: var(--green-950); }
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.check {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248,244,235,.58);
  color: var(--muted);
  font-weight: 700;
}
.check input { width: auto; min-height: auto; }
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.quick-filters button {
  min-height: 34px;
  padding: 6px 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--green-850);
  font-weight: 800;
}
.quick-filters button:hover {
  border-color: var(--gold);
  background: #fff8e6;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
  padding: 18px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 clamp(16px, 4vw, 42px) 26px;
}
.metrics div {
  background: var(--green-950);
  color: var(--paper);
  border-radius: 8px;
  padding: 18px;
  min-height: 96px;
}
.metrics span { display: block; font-size: 2.45rem; font-family: var(--serif); font-weight: 900; line-height: 1; }
.metrics small { color: var(--gold-soft); letter-spacing: .08em; }
.workspace {
  display: grid;
  grid-template-columns: 270px minmax(360px, 1fr) 380px;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 42px) 34px;
  align-items: start;
}
.panel, .detail, .results, .current, .pdf-zone {
  border: 1px solid var(--line);
  background: rgba(255,253,247,.86);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31,49,39,.06);
}
.panel { padding: 16px; margin-bottom: 14px; }
.panel.compact { max-height: 390px; overflow: auto; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: var(--green-850);
  font-size: .86rem;
}
.results { padding: 18px; min-height: 640px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.result-count { color: var(--muted); font-weight: 800; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.person-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.person-card:hover, .person-card.active { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 26px rgba(31,49,39,.12); }
.person-top { display: flex; justify-content: space-between; gap: 12px; }
.person-name { font-family: var(--serif); font-size: 1.28rem; font-weight: 900; color: var(--green-950); }
.person-en { color: var(--muted); font-size: .88rem; }
.person-en:empty { display: none; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(49,93,124,.12);
  color: var(--blue);
  font-size: .75rem;
  font-weight: 900;
  white-space: nowrap;
}
.person-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; color: var(--muted); font-size: .85rem; }
.detail {
  position: sticky;
  top: 88px;
  padding: 18px;
  min-height: 640px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.empty-detail { color: var(--muted); padding-top: 30px; }
.detail-title { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.timeline { display: grid; gap: 10px; margin-top: 18px; }
.timeline-item {
  border-left: 3px solid var(--gold);
  background: #fff;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.timeline-current { border-left-color: var(--green-950); background: #fbfaf3; }
.timeline-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--green-950);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  vertical-align: middle;
}
.timeline-note { color: var(--muted); font-size: .85rem; margin: 4px 0 0; line-height: 1.6; }
.timeline-year { font-weight: 900; color: var(--green-950); }
.timeline-source { color: var(--muted); font-size: .82rem; margin-top: 6px; }
.source-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}
.copy-link {
  display: inline-block;
  margin: 8px 0 0 10px;
  color: var(--green-700);
  font-weight: 900;
  cursor: pointer;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  background: var(--green-950);
  color: var(--paper);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: var(--shadow);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.current, .pdf-zone { margin: 0 clamp(16px, 4vw, 42px) 34px; padding: 22px; }
.current { margin-top: 24px; }
.section-note { color: var(--muted); margin: 8px 0 0; }
.year-team-filter {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--green-850);
  font-weight: 900;
}
.year-team-filter span {
  font-size: .78rem;
  letter-spacing: .16em;
  color: var(--gold);
}
.year-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 12px;
  margin: -2px 0 14px;
}
.year-chip {
  flex: 0 0 auto;
  min-width: 76px;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
}
.year-chip strong {
  color: var(--green-950);
  font-family: var(--serif);
  line-height: 1;
}
.year-chip span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
}
.year-chip.pdf-only span { color: var(--blue); }
.year-chip.active {
  border-color: var(--gold);
  background: #fff8e6;
  box-shadow: 0 8px 18px rgba(31,49,39,.08);
}
.role-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 10px;
  margin: 4px 0 16px;
}
.role-stat {
  width: 100%;
  min-height: 82px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}
.role-stat:hover,
.role-stat.active {
  border-color: var(--gold);
  background: #fff8e6;
  box-shadow: 0 8px 18px rgba(31,49,39,.08);
}
.role-stat strong {
  display: block;
  color: var(--green-950);
  font-family: var(--serif);
  font-size: 1.8rem;
  line-height: 1;
}
.role-stat span { color: var(--muted); font-weight: 900; }
.role-stat.active span { color: var(--green-950); }
.current-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.current-item {
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.current-item:hover,
.current-item:focus-visible {
  border-color: var(--gold);
  background: #fff8e6;
  box-shadow: 0 10px 24px rgba(31,49,39,.1);
  outline: none;
}
.year-empty {
  grid-column: 1 / -1;
}
.year-empty strong {
  color: var(--green-950);
  font-family: var(--serif);
  font-size: 1.25rem;
}
.year-empty p { margin: 8px 0 12px; }
.contact-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
}
.contact-box ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.contact-box li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.contact-box span { color: var(--green-850); font-weight: 900; }
.contact-box a { color: var(--blue); font-weight: 900; }
.contact-box em { font-style: normal; }
.pdf-layout { display: grid; grid-template-columns: 270px 1fr; gap: 14px; min-height: 620px; }
.pdf-list { display: grid; align-content: start; gap: 8px; max-height: 620px; overflow: auto; }
.pdf-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: #fff;
  cursor: pointer;
}
.pdf-row.active { border-color: var(--gold); background: #fff8e6; }
.pdf-preview { position: relative; min-height: 620px; }
.pdf-person-summary {
  display: none;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fffdf7;
  padding: 12px 14px;
}
.pdf-person-summary:not(:empty) { display: block; }
.pdf-person-summary h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.pdf-person-summary h3 span {
  font-family: var(--sans);
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
}
.pdf-person-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.pdf-status {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, .94);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
  padding: 5px 10px;
}
.pdf-status.ready { color: var(--green-700); }
.pdf-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 0 10px;
  border: 1px solid var(--green-700);
  border-radius: 6px;
  background: var(--green-850);
  color: #fff;
  font-weight: 900;
  padding: 8px 12px;
}
iframe { width: 100%; min-height: 620px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pdf-images {
  display: grid;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f0e8;
}
.pdf-page-img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31,49,39,.1);
}
.pdf-noimg {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 42px) 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
mark {
  background: rgba(215,192,138,.55);
  color: inherit;
  padding: 0 2px;
}
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .detail { position: static; max-height: none; min-height: auto; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .panel { margin-bottom: 0; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 100px; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }

  /* 防止任何區塊撐寬手機頁面（右邊空白 / 內容擠左的根因） */
  main { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .hero, .metrics, .workspace, .current, .pdf-zone,
  .results, .sidebar, .search-panel, .section-head { min-width: 0; max-width: 100%; }
  .people-grid, .current-grid, .filters, .search-row { min-width: 0; }
  /* 橫向捲動容器鎖寬，內容多也不撐爆父層 */
  .year-chips, .role-stats, .quick-filters, .chip-list, .pdf-list { max-width: 100%; }
  h1 { font-size: 1.62rem; }
  h2 { font-size: 1.3rem; }
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 56px;
    gap: 10px;
    padding: 7px 12px;
  }
  .brand-logo { width: 34px; height: 38px; }
  .brand-title { font-size: 1rem; white-space: normal; }
  .brand-sub { font-size: .68rem; letter-spacing: .04em; }
  .clock { display: none; }
  .preview-banner {
    min-height: 32px;
    font-size: .74rem;
    line-height: 1.35;
    letter-spacing: 0;
    padding: 5px 12px;
  }
  .nav { display: none; }

  /* 底部固定導航 — 加圖示感 + 當前高亮 */
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.97);
    box-shadow: 0 -10px 26px rgba(31,49,39,.14);
    backdrop-filter: blur(12px);
  }
  .mobile-nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--paper);
    color: var(--green-850);
    font-weight: 900;
    font-size: .95rem;
    padding: 8px 6px;
    transition: background .15s, border-color .15s, color .15s;
  }
  .mobile-nav a.active {
    background: #fff8e6;
    border-color: var(--gold);
    color: var(--green-950);
  }

  /* Hero：手機保留精簡標題，不再整段隱藏 */
  .hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 12px 12px;
  }
  .hero-copy { display: block; }
  .hero-copy .kicker { font-size: .66rem; letter-spacing: .14em; }
  .hero-copy .lede { display: none; }
  .hero-copy h1 { margin-bottom: 2px; }
  .search-panel {
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--shadow);
  }
  .search-panel label { font-size: .92rem; }
  .search-row,
  .filters,
  .pdf-layout {
    grid-template-columns: 1fr;
  }
  .search-row { grid-template-columns: 1fr auto; }
  .search-row button { min-height: 46px; padding: 0 16px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters .check { grid-column: 1 / -1; }
  .quick-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin: 12px -3px 0;
    padding-left: 3px;
  }
  .quick-filters::-webkit-scrollbar { display: none; }
  .quick-filters button {
    flex: 0 0 auto;
    min-height: 40px;
  }

  /* 總覽三格：一行放得下、字級協調 */
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 12px 14px;
  }
  .metrics div {
    min-height: 72px;
    padding: 12px 8px;
    text-align: center;
  }
  .metrics span { font-size: 1.55rem; }
  .metrics small {
    display: block;
    font-size: .68rem;
    line-height: 1.25;
    letter-spacing: 0;
  }

  .current, .pdf-zone {
    margin: 12px;
    padding: 14px;
    border-radius: 12px;
  }
  .workspace {
    padding: 0 12px 16px;
    gap: 12px;
  }
  .section-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .year-team-filter { min-width: 0; }
  .year-chips {
    margin-left: -2px;
    margin-right: -2px;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .year-chips::-webkit-scrollbar { display: none; }
  .role-stats {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 8px;
  }
  .role-stats::-webkit-scrollbar { display: none; }
  .role-stat {
    flex: 0 0 90px;
    min-height: 64px;
    padding: 10px;
  }
  .role-stat strong { font-size: 1.4rem; }
  .current-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }
  .results { padding: 14px; min-height: auto; border-radius: 12px; }
  .person-card,
  .current-item {
    padding: 14px;
    border-radius: 10px;
  }
  .person-top { align-items: flex-start; }
  .person-name { font-size: 1.22rem; }
  .person-meta { font-size: .8rem; }
  .contact-box li { grid-template-columns: 1fr; }

  /* 詳情面板：手機點人後浮出，置頂顯示，不再夾在中間 */
  .detail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 38;
    max-height: 82vh;
    min-height: 0;
    margin: 0;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -18px 46px rgba(31,49,39,.24);
    transform: translateY(110%);
    transition: transform .28s ease;
  }
  .detail.mobile-open {
    transform: translateY(0);
  }
  .detail .detail-close {
    display: inline-flex;
  }

  .sidebar { display: block; }
  .panel.compact {
    max-height: 150px;
    overflow: auto;
  }
  .chip-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .chip-list::-webkit-scrollbar { display: none; }
  .chip {
    flex: 0 0 auto;
    min-height: 36px;
  }
  .pdf-layout {
    min-height: auto;
    gap: 10px;
  }
  .pdf-list {
    display: flex;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .pdf-list::-webkit-scrollbar { display: none; }
  .pdf-row {
    flex: 0 0 148px;
    min-height: 88px;
  }
  .pdf-preview { min-height: auto; }
  .pdf-status {
    position: static;
    display: inline-flex;
    margin-bottom: 8px;
  }
  .pdf-open-link {
    display: flex;
    width: 100%;
  }
  .pdf-images {
    max-height: none;
  }
  iframe {
    min-height: 66vh;
    border-radius: 8px;
  }
  footer { flex-direction: column; gap: 8px; font-size: .82rem; }
}

/* 詳情關閉鈕：桌面隱藏，手機浮層才顯示 */
.detail-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-950);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  flex: 0 0 auto;
}
/* 手機詳情浮層開啟時的背景遮罩 */
.detail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 37;
  background: rgba(22,49,38,.34);
  opacity: 0;
  transition: opacity .28s ease;
}
.detail-backdrop.show {
  display: block;
  opacity: 1;
}

/* 回到頂部按鈕（膠囊形，帶中文字「回頂」讓長者看懂） */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 22px;
  z-index: 36;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 54px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  background: var(--green-950);
  color: #fff;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(31,49,39,.28);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, background .15s;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover { background: var(--green-850); }
.btt-arrow { font-size: 1.2rem; font-weight: 900; }
.btt-text { font-size: .8rem; font-weight: 900; letter-spacing: .04em; }
@media (max-width: 760px) {
  /* 手機時避開底部固定導航列 */
  .back-to-top {
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    min-width: 52px;
    padding: 7px 9px;
  }
}
