/*
 * TrekMe public site styles (mobile-first).
 * Breakpoints: 600px (tablet), 960px (desktop), 1280px (wide).
 *
 * Scoping: component and base styles only apply inside <body class="site">
 * (written as :where(.site) so page styles still win on specificity). Legacy
 * pages that link this file without body.site only get the shell header,
 * footer and report modal, whose inner classes are prefixed with "sh-".
 */

:root {
  --c-brand: #00c853;
  --c-brand-strong: #00873c;
  --c-brand-dark: #006b30;
  --c-brand-soft: #e8f8ee;
  --c-text: #1a1a1a;
  --c-text-2: #555;
  --c-muted: #767676;
  --c-line: #e3e3e3;
  --c-bg: #fff;
  --c-bg-2: #f6f7f6;
  --c-dark: #17191c;
  --c-link: #00703a;
  --c-danger: #c62828;
  --c-danger-soft: #fdecea;
  --c-caution: #a15c00;
  --c-caution-soft: #fff4e0;
  --c-info: #1565c0;
  --c-info-soft: #e8f1fc;
  --c-focus: #1565c0;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .14);

  --container-max: 1200px;
  --container-narrow: 760px;
  --gutter: clamp(16px, 4vw, 32px);
  --touch: 44px;

  --fs-sm: clamp(.8125rem, .78rem + .15vw, .875rem);
  --fs-base: clamp(.9375rem, .9rem + .2vw, 1.0625rem);
  --fs-lg: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --fs-xl: clamp(1.25rem, 1.1rem + .8vw, 1.75rem);
  --fs-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;

  --site-header-h: 60px;
}

/* ---------- Base (body.site only) ---------- */

body.site {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-wrap: break-word;
}
:where(.site) *, :where(.site) *::before, :where(.site) *::after {
  box-sizing: border-box;
}
:where(.site) img, :where(.site) video, :where(.site) svg,
:where(.site) canvas, :where(.site) iframe {
  max-width: 100%;
}
:where(.site) img, :where(.site) video { height: auto; }
:where(.site) a { color: var(--c-link); text-underline-offset: 2px; }
:where(.site) h1, :where(.site) h2, :where(.site) h3, :where(.site) h4 {
  line-height: 1.35;
  margin: 0 0 var(--sp-3);
}
:where(.site) p { margin: 0 0 var(--sp-4); }
:where(.site) button, :where(.site) input, :where(.site) select,
:where(.site) textarea {
  font: inherit;
  color: inherit;
}
:where(.site) :focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ---------- */

:where(.site) .site-main { flex: 1 0 auto; padding-bottom: var(--sp-7); }
:where(.site) .container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
:where(.site) .container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }

:where(.site) .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-5);
}

:where(.site) .section { padding-block: var(--sp-6); }
:where(.site) .section + .section { padding-top: 0; }
:where(.site) .section__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  margin: 0 0 var(--sp-4);
}
:where(.site) .section__title a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
:where(.site) .page-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  margin: var(--sp-5) 0 var(--sp-4);
}
:where(.site) .muted { color: var(--c-muted); }
:where(.site) .list-plain { list-style: none; margin: 0; padding: 0; }

/* ---------- Breadcrumb ---------- */

:where(.site) .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  list-style: none;
  margin: var(--sp-4) 0 0;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
:where(.site) .breadcrumb li + li::before { content: "›"; margin-right: var(--sp-2); }
:where(.site) .breadcrumb a { color: inherit; }

/* ---------- Hero ---------- */

:where(.site) .hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(220px, 45vw, 460px);
  padding: var(--sp-6) var(--gutter);
  color: #fff;
  background: var(--c-dark) center / cover no-repeat;
  overflow: hidden;
}
:where(.site) .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .65) 100%);
}
:where(.site) .hero > * { position: relative; }
:where(.site) .hero h1, :where(.site) .hero h2 { font-size: var(--fs-2xl); margin: 0 0 var(--sp-2); }
:where(.site) .hero a { color: #fff; }
:where(.site) .hero img.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Card ---------- */

:where(.site) .card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}
:where(.site) a.card:hover, :where(.site) .card:has(a:hover) { box-shadow: var(--shadow-2); }
:where(.site) .card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--c-bg-2);
  overflow: hidden;
}
:where(.site) .card__media img, :where(.site) img.card__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:where(.site) .card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  flex: 1;
}
:where(.site) .card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}
:where(.site) .card__title a { color: inherit; text-decoration: none; }
:where(.site) .card__title a::after { content: ""; position: absolute; inset: 0; }
:where(.site) .card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 0;
}

/* ---------- Badge, chip, verified ---------- */

:where(.site) .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.6;
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
  white-space: nowrap;
}
:where(.site) .badge--danger { background: var(--c-danger-soft); color: var(--c-danger); }
:where(.site) .badge--caution { background: var(--c-caution-soft); color: var(--c-caution); }
:where(.site) .badge--info { background: var(--c-info-soft); color: var(--c-info); }

:where(.site) .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  text-decoration: none;
  white-space: nowrap;
}
:where(.site) a.chip:hover, :where(.site) button.chip:hover { border-color: var(--c-brand-strong); color: var(--c-brand-strong); }
:where(.site) .chip[aria-current="page"], :where(.site) .chip.is-active {
  background: var(--c-brand-strong);
  border-color: var(--c-brand-strong);
  color: #fff;
}

.verified, :where(.site) .verified {
  position: relative;
  display: inline-block;
  width: .8em;
  height: .8em;
  min-width: 14px;
  min-height: 14px;
  border-radius: 50%;
  background: #1d9bf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat;
  vertical-align: -0.08em;
  overflow: hidden;
  color: transparent;
  user-select: none;
  flex: none;
}
.verified > * { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

/* ---------- Buttons ---------- */

:where(.site) .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 10px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-text);
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
:where(.site) .btn:hover { border-color: #bdbdbd; }
:where(.site) .btn:disabled, :where(.site) .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
:where(.site) .btn--primary { background: var(--c-brand-strong); border-color: var(--c-brand-strong); color: #fff; }
:where(.site) .btn--primary:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); }
:where(.site) .btn--ghost { background: transparent; border-color: transparent; color: var(--c-link); }
:where(.site) .btn--ghost:hover { background: var(--c-brand-soft); border-color: transparent; }
:where(.site) .btn--danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
:where(.site) .btn--block { display: flex; width: 100%; }

/* ---------- Article typography ---------- */

:where(.site) .article { font-size: var(--fs-base); line-height: 1.85; }
:where(.site) .article > * + * { margin-top: var(--sp-4); }
:where(.site) .article h2 {
  font-size: var(--fs-xl);
  margin: var(--sp-7) 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--c-brand);
  scroll-margin-top: calc(var(--site-header-h) + 12px);
}
:where(.site) .article h3 {
  font-size: var(--fs-lg);
  margin: var(--sp-6) 0 var(--sp-2);
  padding-left: var(--sp-3);
  border-left: 4px solid var(--c-brand);
  scroll-margin-top: calc(var(--site-header-h) + 12px);
}
:where(.site) .article p { margin: 0; }
:where(.site) .article p + p { margin-top: var(--sp-4); }
:where(.site) .article img { display: block; border-radius: var(--r-sm); margin-inline: auto; }
:where(.site) .article figure { margin: var(--sp-5) 0; }
:where(.site) .article figcaption {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  text-align: center;
}
:where(.site) .article blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-3) var(--sp-4);
  border-left: 4px solid var(--c-line);
  background: var(--c-bg-2);
  color: var(--c-text-2);
}
:where(.site) .article blockquote > :last-child { margin-bottom: 0; }
:where(.site) .article ul, :where(.site) .article ol { padding-left: 1.5em; }
:where(.site) .article li + li { margin-top: var(--sp-1); }
:where(.site) .article hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--sp-6) 0; }
:where(.site) .article pre { overflow-x: auto; padding: var(--sp-3); background: var(--c-bg-2); border-radius: var(--r-sm); }
/* Tables: wrap in <div class="table-wrap"> for horizontal scrolling. */
:where(.site) .table-wrap, :where(.site) .article .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--sp-5) 0;
}
:where(.site) .article table, :where(.site) table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 480px;
}
:where(.site) .article th, :where(.site) .article td,
:where(.site) table.table th, :where(.site) table.table td {
  padding: 8px 12px;
  border: 1px solid var(--c-line);
  text-align: left;
  vertical-align: top;
}
:where(.site) .article th, :where(.site) table.table th { background: var(--c-bg-2); font-weight: 700; }

/* ---------- TOC ---------- */

:where(.site) .toc {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-bg-2);
  font-size: var(--fs-sm);
}
:where(.site) .toc > :first-child { margin-top: 0; }
:where(.site) .toc ol, :where(.site) .toc ul { margin: var(--sp-2) 0 0; padding-left: 1.4em; }
:where(.site) .toc li { margin: 4px 0; }
:where(.site) .toc a { color: var(--c-text); text-decoration: none; }
:where(.site) .toc a:hover { color: var(--c-link); text-decoration: underline; }

/* ---------- Callout & alert banner ---------- */

:where(.site) .callout {
  margin: var(--sp-5) 0;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border-left: 4px solid var(--c-brand);
  background: var(--c-brand-soft);
}
:where(.site) .callout > :last-child { margin-bottom: 0; }
:where(.site) .callout--info { border-color: var(--c-info); background: var(--c-info-soft); }
:where(.site) .callout--caution { border-color: var(--c-caution); background: var(--c-caution-soft); }
:where(.site) .callout--danger { border-color: var(--c-danger); background: var(--c-danger-soft); }

:where(.site) .alert-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--gutter);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--c-info-soft);
  color: var(--c-info);
}
:where(.site) .alert-banner a { color: inherit; }
:where(.site) .alert-banner--info { background: var(--c-info-soft); color: var(--c-info); }
:where(.site) .alert-banner--caution { background: var(--c-caution-soft); color: var(--c-caution); }
:where(.site) .alert-banner--danger { background: var(--c-danger); color: #fff; }

/* ---------- Embeds, carousel ---------- */

:where(.site) .embed-16x9 {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: #000;
}
:where(.site) .embed-16x9 > iframe, :where(.site) .embed-16x9 > video,
:where(.site) .embed-16x9 > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

:where(.site) .carousel {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--r-md);
}
:where(.site) .carousel__item {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--c-bg-2);
  overflow: hidden;
  border-radius: var(--r-md);
}
:where(.site) .carousel__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Commerce ---------- */

:where(.site) .product-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--c-text);
}
:where(.site) .product-price s, :where(.site) .product-price del {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--c-muted);
}
:where(.site) .price--sale { color: var(--c-danger); }

/* ---------- Share bar, pager ---------- */

:where(.site) .share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-5) 0;
}
:where(.site) .share-bar a, :where(.site) .share-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
}

:where(.site) .pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-6) 0 0;
  padding: 0;
  list-style: none;
}
:where(.site) .pager a, :where(.site) .pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--c-text);
}
:where(.site) .pager [aria-current="page"] {
  background: var(--c-brand-strong);
  border-color: var(--c-brand-strong);
  color: #fff;
}

/* ---------- Forms ---------- */

:where(.site) .form-field, .sh-modal .form-field { display: grid; gap: 6px; margin: 0 0 var(--sp-4); }
:where(.site) .form-field > label, .sh-modal .form-field > label,
:where(.site) .form-field > .form-field__label {
  font-weight: 700;
  font-size: var(--fs-sm);
}
:where(.site) .form-field input:not([type="checkbox"]):not([type="radio"]),
:where(.site) .form-field select, :where(.site) .form-field textarea,
.sh-modal .form-field textarea, .sh-modal .form-field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 12px;
  border: 1px solid #c4c4c4;
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 16px; /* keeps iOS from zooming on focus */
  color: var(--c-text);
}
:where(.site) .form-field textarea, .sh-modal .form-field textarea { min-height: 96px; resize: vertical; }
:where(.site) .form-field input:focus, :where(.site) .form-field select:focus,
:where(.site) .form-field textarea:focus, .sh-modal .form-field textarea:focus {
  border-color: var(--c-brand-strong);
  outline: 2px solid var(--c-brand-soft);
}
:where(.site) .form-field__hint { font-size: var(--fs-sm); color: var(--c-muted); }
:where(.site) .form-field__error { font-size: var(--fs-sm); color: var(--c-danger); }

/* ---------- Modal (also used by the report widget on legacy pages) ---------- */

:where(.site) .modal, .sh-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  font-family: var(--font);
  color: var(--c-text);
  line-height: 1.6;
}
:where(.site) .modal[hidden], .sh-modal[hidden] { display: none; }
:where(.site) .modal__panel, .sh-modal .modal__panel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: #fff;
  padding: var(--sp-5) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
.sh-modal .modal__panel *, .sh-modal .modal__panel *::before, .sh-modal .modal__panel *::after { box-sizing: border-box; }
@media (min-width: 600px) {
  :where(.site) .modal, .sh-modal { align-items: center; padding: var(--sp-5); }
  :where(.site) .modal__panel, .sh-modal .modal__panel {
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-2);
  }
}
:where(.site) .modal__close, .sh-modal .modal__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: var(--touch);
  height: var(--touch);
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}
:where(.site) .modal__title, .sh-modal .modal__title {
  margin: 0 40px var(--sp-3) 0;
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.4;
}
:where(.site) .modal__actions, .sh-modal .modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
html.sh-scroll-lock, html.sh-scroll-lock body { overflow: hidden; }

/* Report widget internals */
.sh-modal .sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-text);
  font: 700 15px/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.sh-modal .sh-btn--primary { background: var(--c-brand-strong); border-color: var(--c-brand-strong); color: #fff; }
.sh-modal .sh-btn:disabled { opacity: .5; cursor: not-allowed; }
.sh-modal .sh-btn:focus-visible, .sh-modal .modal__close:focus-visible,
.sh-modal input:focus-visible, .sh-modal textarea:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}
.sh-modal .sh-cats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0 0 var(--sp-4);
  padding: 0;
  border: 0;
}
@media (min-width: 600px) {
  .sh-modal .sh-cats { grid-template-columns: 1fr 1fr; }
}
.sh-modal .sh-cats legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
.sh-modal .sh-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  font-size: 15px;
  cursor: pointer;
}
.sh-modal .sh-cat:has(input:checked) { border-color: var(--c-brand-strong); background: var(--c-brand-soft); }
.sh-modal .sh-cat input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-brand-strong); }
.sh-modal .sh-msg { margin: 0 0 var(--sp-3); font-size: 15px; color: var(--c-text-2); }
.sh-modal .sh-err { margin: var(--sp-2) 0 0; font-size: 14px; color: var(--c-danger); }
.sh-modal .sh-err:empty { display: none; }

/* Inline "檢舉" trigger used by legacy pages */
.sh-report-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #767676;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.sh-report-link:hover { color: var(--c-danger); text-decoration: underline; }
.sh-report-link:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* ---------- Shell header ---------- */

.site-header[data-shell] {
  position: sticky;
  top: 0;
  z-index: 1100;
  box-sizing: border-box;
  height: var(--site-header-h);
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--c-line);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  color: var(--c-text);
  -webkit-backdrop-filter: saturate(1.4) blur(6px);
  backdrop-filter: saturate(1.4) blur(6px);
}
.site-header[data-shell="compact"] { --site-header-h: 48px; height: 48px; }
.site-header[data-shell] *, .site-header[data-shell] *::before, .site-header[data-shell] *::after,
.site-footer[data-shell] *, .site-footer[data-shell] *::before, .site-footer[data-shell] *::after {
  box-sizing: border-box;
}
.site-header[data-shell] a:focus-visible, .site-header[data-shell] button:focus-visible,
.site-footer[data-shell] a:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}
.sh-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-header[data-shell="compact"] .sh-bar { max-width: none; padding: 0 12px; }
.sh-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--c-text);
  text-decoration: none;
  white-space: nowrap;
}
.sh-logo img { display: block; height: 28px; width: auto; }
.site-header[data-shell="compact"] .sh-logo img { height: 24px; }
.sh-nav { display: none; flex: 1; min-width: 0; }
.sh-nav ul, .sh-drawer ul { list-style: none; margin: 0; padding: 0; }
.sh-nav ul { display: flex; gap: 2px; }
.sh-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--c-text-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.sh-nav a:hover { color: var(--c-text); background: var(--c-bg-2); }
.sh-nav a[aria-current="page"] { color: var(--c-brand-strong); box-shadow: inset 0 -3px 0 var(--c-brand); border-radius: 0; }
.sh-right { display: flex; align-items: center; gap: 4px; margin-left: auto; position: relative; }
.sh-login {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--c-text);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.site-header[data-shell="compact"] .sh-login { min-height: 36px; padding: 0 12px; }
.sh-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.sh-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
  font-weight: 800;
  font-size: 15px;
  border: 1px solid var(--c-line);
}
.sh-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}
.sh-menu[hidden] { display: none; }
.sh-menu__name { padding: 8px 12px; font-weight: 700; color: var(--c-text); border-bottom: 1px solid var(--c-line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-menu a, .sh-menu button, .sh-drawer__links a, .sh-drawer__links button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sh-menu a:hover, .sh-menu button:hover, .sh-drawer__links a:hover, .sh-drawer__links button:hover { background: var(--c-bg-2); }
.sh-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text);
  cursor: pointer;
}
.sh-burger svg { width: 24px; height: 24px; }

.sh-drawer { position: fixed; inset: 0; z-index: 1200; }
.sh-drawer[hidden] { display: none; }
.sh-drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s ease; }
.sh-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  overflow-y: auto;
  background: #fff;
  padding: 8px 12px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-2);
  transform: translateX(100%);
  transition: transform .22s ease;
}
.sh-drawer.is-open .sh-drawer__backdrop { opacity: 1; }
.sh-drawer.is-open .sh-drawer__panel { transform: none; }
.sh-drawer__head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 8px; }
.sh-drawer__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: #555;
  cursor: pointer;
}
.sh-drawer__links { border-top: 1px solid var(--c-line); padding-top: 8px; margin-top: 8px; }
.sh-drawer__links:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.sh-drawer__links a[aria-current="page"] { color: var(--c-brand-strong); background: var(--c-brand-soft); }

@media (min-width: 960px) {
  .site-header[data-shell]:not([data-shell="compact"]) .sh-nav { display: block; }
  .site-header[data-shell]:not([data-shell="compact"]) .sh-burger { display: none; }
}

/* ---------- Shell footer ---------- */

.site-footer[data-shell] {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--c-dark);
  color: #cfcfcf;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}
.sh-foot {
  display: grid;
  gap: 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
}
.sh-foot .sh-logo { color: #fff; min-height: 0; }
.sh-foot__tag { margin: 6px 0 14px; color: #a9a9a9; font-size: 13px; }
.sh-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #555;
  border-radius: var(--r-sm);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.sh-play:hover { border-color: #aaa; }
.sh-foot__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sh-foot__cols h2 { margin: 0 0 6px; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.sh-foot__cols ul { list-style: none; margin: 0; padding: 0; }
.sh-foot__cols a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: #cfcfcf;
  text-decoration: none;
}
.sh-foot__cols a:hover { color: #fff; text-decoration: underline; }
.sh-copy { margin: 0; padding-top: 16px; border-top: 1px solid #2e3136; color: #8d8d8d; font-size: 12px; }
@media (min-width: 600px) {
  .sh-foot__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .sh-foot { grid-template-columns: minmax(240px, 1fr) 2fr; }
  .sh-copy { grid-column: 1 / -1; }
}

/* ---------- Breakpoint helpers ---------- */

@media (min-width: 600px) {
  :where(.site) .carousel__item { flex-basis: 85%; }
}
@media (min-width: 960px) {
  :where(.site) .carousel__item { flex-basis: 70%; }
  :where(.site) .section { padding-block: var(--sp-7); }
}
@media (min-width: 1280px) {
  :where(.site) .grid--wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  :where(.site) *, :where(.site) *::before, :where(.site) *::after,
  .sh-drawer *, .sh-modal *, .site-header[data-shell] * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header[data-shell], .site-footer[data-shell], .sh-drawer, .sh-modal, .share-bar { display: none !important; }
}
