/* ==========================================
   操作導覽（S13，客戶 2026-08-26）— 遮罩／聚光高亮／說明卡
   與 js/tour.js 成對，兩邊要一起看。
   ========================================== */

/* 🔴 z-index 必須壓過 sticky header（.site-header 是 50、整疊高 166px）
   與手機選單（.mobile-nav 是 999）——否則捲到頂時高亮框會被 header 蓋住。
   ⚠️ 也高於 SweetAlert2 的 1060，但導覽與彈窗刻意不同時出現
      （未登入不在報名流程／會員專區啟動導覽，見 js/tour.js 的 requireLogin）。
   ⚠️ 這裡刻意不宣告 display：`hidden` 屬性靠 style.css 的 [hidden][hidden] (0,2,0) 生效，
      在這裡寫 display 會把它蓋掉（CLAUDE.md 五節 2-2 那個坑）。 */
.tour-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

/* 背景層本身透明，只負責攔截點擊；暗化由 .tour-spot 的超大 box-shadow 做。
   ⚠️ 點背景不關閉導覽（避免誤觸中斷），所以這一層沒有事件處理。 */
.tour-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

/* 聚光高亮：用一個 9999px 的外擴陰影把「洞」以外的畫面壓暗。
   pointer-events: none 讓它不擋住卡片與量測。 */
.tour-spot {
  position: fixed;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(26, 26, 26, 0.60);
  outline: 3px solid var(--gold-from);
  outline-offset: 0;
  pointer-events: none;
  transition: top 0.2s ease-out, left 0.2s ease-out, width 0.2s ease-out, height 0.2s ease-out;
}

/* 🔴 卡片所有字級一律 rem：全站有 18／20／22px 三段字級切換，
   這個功能存在的理由就是長輩使用者，寫死 px 等於把字級切換排除在外。 */
.tour-card {
  position: fixed;
  width: 21rem;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background-color: var(--color-surface, #FFFFFF);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.125rem 0.875rem;
}

.tour-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.tour-card-close {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  color: var(--color-muted);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.tour-card-close:hover,
.tour-card-close:focus-visible {
  background-image: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  color: var(--color-on-gold);
}

.tour-card-title {
  margin: 0 2rem 0.375rem 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-heading);
}

.tour-card-body {
  margin: 0 0 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--color-text);
}

.tour-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.tour-card-progress {
  font-size: 0.8125rem;
  color: var(--color-muted);
  flex-shrink: 0;
}

.tour-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tour-btn {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  min-height: 2.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
}

.tour-btn-ghost {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.tour-btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

/* 全站互動狀態的標準是金色漸層 ＋ 深色字（style.css 七之二節）。
   🔴 金底上絕對不用白字。 */
.tour-btn:hover,
.tour-btn:focus-visible {
  background-image: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  color: var(--color-on-gold);
  border-color: transparent;
}

/* ⚠️ 導覽進行中**刻意不鎖背景捲動**（沒有 `overflow: hidden`）。
   鎖住的話捲軸消失會讓版面橫向位移 15px，量到的高亮框位置就整組偏掉，
   使用者看到的是「框沒對準」——比讓他捲動更糟。
   使用者自己捲動由 js/tour.js 的 scroll 監聽重新量測，框會跟著走。 */

/* 右下角浮動鈕：沿用 .float-fab 的外觀，只補一個與社群鈕不同的辨識度。
   ⚠️ 位置由 js/tour.js 決定（插在 #float-actions 的第一個子節點＝社群按鈕上方）。 */
.float-tour {
  background-color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {

  .tour-spot,
  .tour-btn {
    transition: none;
  }
}
