/* ============================================================
   styles.css — 只保留 Tailwind 不易表達、或需 JS 切換的部分
   版面主體交由 Tailwind Play CDN 的 utility class 負責。
   ============================================================ */

/* ===== CDN fallback：Tailwind 被擋／離線時，至少維持可讀的基本樣式 ===== */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --ink: #1a2230;
  --ink-soft: #4a5568;
  --muted: #7a8597;
  --border: #e4e8ef;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
img, video { max-width: 100%; }

/* ===== 行內 code（Tailwind 不套用 base 樣式到 code，統一在此定義） ===== */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: .1em .4em;
  border-radius: 5px;
  font-size: .88em;
}

/* ===== 技術棧標籤 ===== */
.tag {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: .82rem;
  font-weight: 500;
}

/* ===== 功能列表方形項目符號（::before 較難用 utility 表達） ===== */
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand);
}

/* ===== Hero 漸層背景 ===== */
.hero {
  background:
    radial-gradient(1200px 400px at 75% -10%, var(--brand-soft), transparent 70%),
    linear-gradient(180deg, #fff, #f6f8fb);
}

/* ===== 導覽列：目前區段高亮 + 行動版下拉選單 ===== */
.nav-link.is-active { background: var(--brand); color: #fff; }

@media (max-width: 767px) {
  .nav__links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(20, 30, 50, .06);
    margin: 0;
  }
  /* Tailwind 在手機把選單設為 hidden，開啟時以 is-open 覆蓋 */
  .nav__links.is-open { display: flex !important; }
}

/* ===== 圖庫項目（截圖，點擊放大） ===== */
.gallery-item {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .18s, box-shadow .18s;
}
.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .12), 0 16px 40px rgba(20, 30, 50, .10);
  outline: none;
}
.gallery-item:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft), 0 0 0 4px var(--brand); }
.gallery-item img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
  background: #f6f8fb;
}
.gallery-item figcaption {
  padding: 11px 14px;
  font-size: .85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
}
/* 手機：不裁切，讓截圖看得完整 */
@media (max-width: 640px) {
  .gallery-item img { height: auto; max-height: 420px; object-fit: contain; }
}

/* ===== 影片提示徽章（hover 時淡出，讓畫面乾淨） ===== */
.video-frame:hover .video-hint { opacity: 0; }
.video-hint { transition: opacity .2s; }

/* ===== 燈箱 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 18, 30, .88);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  opacity: 0;
  transition: opacity .2s;
}
.lightbox.is-open { display: flex; opacity: 1; }
.lightbox__img { max-width: 92vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox__cap { color: #e6ebf3; margin-top: 16px; font-size: .95rem; text-align: center; }
.lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .25); }

/* ===== 捲動淡入 ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ===== 尊重使用者「減少動態」偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
