/* ============================================================
   現代簡約風格 (Minimalist Modern) - 深綠與大地色系
   ============================================================ */
:root {
  --bg: #f4f7f6;
  /* 帶有微綠的大地淺灰底色 */
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-hover: #fcfdfd;
  --panel-2: #f8fafa;
  --input-bg: #ffffff;
  --border: #e8ede9;
  --border-strong: #d1d9d6;
  --shadow-sm: 0 2px 8px rgba(34, 56, 47, 0.04);
  --shadow: 0 12px 32px rgba(34, 56, 47, 0.06);
  --shadow-lg: 0 24px 48px rgba(34, 56, 47, 0.12);
  --r: 24px;
  --r-lg: 32px;
  --primary: #2c5e4f;
  /* 深綠色主調 */
  --earth: #8c6a4f;
  /* 大地色系 */
  --green: #2c8055;
  --up: #d83a3a;
  /* 紅色市場動態提醒 */
  --danger: #ef4444;
  /* 危險操作（註銷、刪除）按鈕底色 */
  --danger-strong: #dc2626;
  /* 必填星號等需要更深紅的場合 */
  --chart-line: #22c55e;
  /* 走勢圖等折線圖預設綠線 */
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --gold: #d68a2c;
  /* 金黃色股息 */
  --text-main: #1a2620;
  --text-muted: #7a8278;

  /* --- 字體系統 (Typography) ---
   * 2026-06-07：全站統一使用單一字型 token --base-font，
   * 中文 / 英文 / 數字 / 符號皆同源（首選 Noto Sans TC）。
   * 舊有 --num-font 已併入 --base-font，請勿再新增 --num-font。
   */
  --base-font:
    "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Noto Sans CJK TC", sans-serif;

  /* --- 字級階梯 (Type Scale) ---
   * 統一全站字級命名，新增/重構樣式時優先使用 token，
   * 舊代碼 (~376 處硬寫 px) 採漸進式遷移：碰到該段樣式才一併改，
   * 避免一次性替換造成 layout 退化（改 A 壞 B）。
   *
   * 使用建議（語意對應）：
   *   --fs-2xs (11px) 角落微標籤，盡量別用；對比度差、a11y 弱
   *   --fs-xs  (12px) 圖示說明、表單 hint、breadcrumb
   *   --fs-sm  (13px) 次要文字、tooltip、small label
   *   --fs-base (14px) 後台/法律頁正文、表單 label
   *   --fs-md  (15px) 按鈕、表單 input、卡片副標
   *   --fs-lg  (16px) Landing 正文、modal body
   *   --fs-xl  (17px) 卡片標題、表格主體
   *   --fs-2xl (18px) 小型 heading、面板標題
   *   --fs-3xl (20px) section heading
   *   --fs-4xl (24px) 主要 heading
   *   --fs-display-sm (28px) hero 小型
   *   --fs-display    (36px) hero 標準
   *   --fs-display-lg (44px) hero 大型
   *   --fs-display-xl (62px) 首頁總覽金額
   */
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 17px;
  --fs-2xl: 18px;
  --fs-3xl: 20px;
  --fs-4xl: 24px;
  --fs-display-sm: 28px;
  --fs-display: 36px;
  --fs-display-lg: 44px;
  --fs-display-xl: 62px;

  /* --- 輸入框基準 token（2026-06-07 收斂引入）---
   * 全站 input/textarea 共用基準，用於下方的全域選擇器規則。
   * 各場景僅在「真的需要」時覆寫差異屬性（字級、padding、radius），
   * 不再重複宣告 background/color/border 等共通屬性。
   * 採 19px 為基準（沿用既有 .form-row input 規格，動到最少頁面）。
   */
  --input-fs: 19px;
  --input-pad-y: 10px;
  --input-pad-x: 12px;
  --input-radius: 8px;
  --input-border: 1px solid var(--border-strong);

  /* --- 說明按鈕 (?) 基準 token（2026-06-07 全站收斂）---
   * 全站 (?) 說明鈕統一兩階層，字型/格式皆由 .term-tip-btn 單一規格控制：
   *   主階層 (--tip-*)    ：區段標題、主要指標旁的 (?)
   *   次階層 (--tip-*-sm) ：子指標 / 小標籤旁的 (?)（如 .dh-sub-label、.overview-main-top）
   * 嚴禁再用 inline style 覆寫尺寸；需要次階層請改掛對應 context class。
   */
  --tip-size: 20px;
  --tip-font: 13px;
  --tip-size-sm: 16px;
  --tip-font-sm: 11px;
}

/* --- 全站輸入框基準樣式（2026-06-07 收斂引入）---
 * 套用範圍：所有純文字類 input + textarea（含 date / datetime-local / time）。
 *
 * ⚠️ 用 :where() 把特異性壓成 (0,0,0)，使本基準成為「最低優先的兜底」：
 *   - 任何既有 class（.form-group input / .goal-modal-input / .tm-date-input /
 *     .admin-modal input / .form-row input）特異性都 > 0，必定勝過基準 →
 *     既有樣式完全不受影響，且不受 CSS 載入順序左右（login/dashboard 的
 *     theme.css 後載入也不會反蓋）。
 *   - class-less 的 <input> 只有基準匹配 → 自動取得統一外觀。
 *   - 各 class 未宣告的共通屬性（bg/color/border）仍由基準補上 → 達到 DRY。
 * a11y：鍵盤焦點環由 :focus-visible 統一處理（見下方）；此處 :focus 僅改
 *   border-color 作為滑鼠點擊的輕量回饋。
 */
:where(
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  textarea
) {
  font-size: var(--input-fs);
  padding: var(--input-pad-y) var(--input-pad-x);
  background: var(--input-bg);
  color: var(--text-main);
  border: var(--input-border);
  border-radius: var(--input-radius);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  font-family: inherit;
}

:where(
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  textarea
):focus {
  border-color: var(--primary);
}

/* 專屬深色模式的高對比、深邃色調 */
[data-theme="dark"] {
  --bg: #0f1315;
  /* 更深邃的背景底色 */
  --panel: #181d1f;
  /* 卡片背景 */
  --panel-solid: #181d1f;
  --panel-hover: #1e2426;
  --panel-2: #202628;
  /* 提示區塊與次要背景 */
  --input-bg: #202628;
  /* 輸入框背景 */
  --border: #283236;
  /* 邊框提亮，增加卡片邊界清晰度 */
  --border-strong: #3a474d;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.6);
  --primary: #4fb395;
  /* 深色模式下，主色調需調亮確保高辨識度 */
  --earth: #c79e7f;
  /* 大地色提亮 */
  --green: #46b880;
  /* 跌幅綠提亮 */
  --up: #f05a5a;
  /* 上漲紅提亮 */
  --danger: #f87171;
  /* 深色模式危險紅提亮 */
  --danger-strong: #ef4444;
  --chart-line: #4ade80;
  /* 深色模式折線提亮 */
  --blue: #60a5fa;
  --purple: #a78bfa;
  --gold: #f2ae4b;
  /* 金黃色提亮 */
  --text-main: #f0f5f2;
  /* 主文字改為極淺的灰白色，確保極高清晰度 */
  --text-muted: #a3b3aa;
  /* 次要文字也相應提高明度 */
}

body {
  font-family: var(--base-font);
  font-size: 25px;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 大量留白與圓角設計 (Card-based layout) --- */
.block,
.overview-main,
.rank-card,
.holding-card,
.activity-item,
.ds-profit-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition:
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s ease,
    background 0.3s ease,
    filter 0.3s ease,
    border-color 0.3s ease;
}

.block {
  padding: 32px;
}

.overview-main {
  padding: 36px;
}

.holding-card {
  padding: 24px;
  border: 1px solid var(--border);
  opacity: 0;
  animation: fadeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- 1. 互動小卡與大型區塊懸停 (穩重微浮 + 陰影擴散) --- */
.rank-card:hover,
.activity-item:hover,
.ds-profit-box:hover,
.block:hover,
.overview-main:hover,
.ds-mini-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

/* 專屬「資產」卡片的綠色發光特效 */
.holding-card:hover {
  transform: translateY(-3px);
  /* 疊加一層淡淡的綠色光暈 */
  box-shadow:
    var(--shadow-lg),
    0 8px 24px rgba(44, 128, 85, 0.15);
  border-color: rgba(44, 128, 85, 0.3);
  background: var(--panel-hover);
}

/* --- 資訊階層明確 (Typography) --- */
.ov-label {
  color: var(--text-muted);
  font-size: 21px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ov-value {
  color: var(--primary);
  font-size: 62px;
  font-family: var(--base-font);
  font-variant-numeric: tabular-nums;
  /* 金融重點：讓數字等寬，上下對齊不亂跳 */
  /* 頂部大字級 */
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 8px;
  margin-bottom: 24px;
}

.ov-sub-label {
  color: var(--text-muted);
}

.ov-sub-value {
  color: var(--text-main);
  font-family: var(--base-font);
  font-size: 26px;
  font-weight: 700;
}

.ov-sub-value.up {
  color: var(--up);
}

.ov-sub-value.down {
  color: var(--down);
}

/* 成本降低百分比 Pill */
.ov-sub-pill {
  background: #eaf0ee;
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
}

[data-theme="dark"] .ov-sub-pill {
  background: #1a2d27;
}

/* 首頁總損益數字發光特效 */
#ov-profit,
#ov-realized-profit {
  font-size: 38px;
  font-family: var(--base-font);
  font-variant-numeric: tabular-nums;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

#ov-profit.up,
#ov-realized-profit.up {
  text-shadow: 0 4px 24px rgba(216, 58, 58, 0.45);
}

#ov-profit.down,
#ov-realized-profit.down {
  text-shadow: 0 4px 24px rgba(44, 128, 85, 0.45);
}

#ov-profit.gold {
  color: var(--gold);
  text-shadow: 0 4px 24px rgba(214, 138, 44, 0.45);
}

/* --- 總覽主卡片上半部 30% 縮小 (排除下方次要指標) --- */
.overview-main-top .ov-label {
  font-size: 15px;
  margin-bottom: 4px;
}

.overview-main-top .ov-value {
  font-size: 43px;
  margin-top: 6px;
  margin-bottom: 16px;
}

.overview-main-top #ov-profit {
  font-size: 27px;
}

/* .overview-main-top .term-tip-btn 的尺寸已併入 .term-tip-btn.is-sub 規格（見下方說明鈕區塊） */

/* --- 亮點成就卡片 (Highlight Cards) --- */
.rank-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px;
  flex: 1;
}

.rank-icon {
  width: 42px;
  height: 42px;
  font-size: 26px;
  margin-bottom: 12px;
}

.rank-title {
  font-size: 20px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rank-main {
  font-size: 21px;
  margin-top: 8px;
  font-family: var(--base-font);
}

.rank-amount {
  font-size: 24px;
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--base-font);
  font-variant-numeric: tabular-nums;
}

/* --- 複合排行小卡 --- */
.rank-sub-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.rank-sub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

/* --- 持股細節卡片 --- */
.hc-cost-box {
  background: var(--panel-2);
  /* 區分淨成本與不含息成本 */
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.hc-symbol {
  color: var(--primary);
  font-size: 25px;
}

/* --- 按鈕與直觀互動暗示 --- */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  border-radius: 999px;
  /* 圓潤按鈕 */
  padding: 10px 24px;
  box-shadow: 0 4px 12px rgba(44, 94, 79, 0.2);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #1e4538;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44, 94, 79, 0.3);
}

/* --- 分割股票與刪除按鈕互動回饋 --- */
#splitStockBtn,
#deleteStockBtn {
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#splitStockBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: var(--panel);
  border-color: var(--primary);
  color: var(--primary);
}

#deleteStockBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(216, 58, 58, 0.25);
}

#splitStockBtn:active,
#deleteStockBtn:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* --- 空狀態設計 (當 Grid 沒資料時顯示黑熊) --- */
#holdingsGrid:empty::before {
  content: "◩ 您的存股籃子空空的...\A 趕快點擊右上角「＋ 新增股票」，種下第一棵小樹苗吧！";
  white-space: pre-wrap;
  grid-column: 1 / -1;
  display: block;
  padding: 100px 20px;
  text-align: center;
  line-height: 1.8;
  background: var(--panel-solid);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  font-weight: 500;
  color: var(--text-muted);
  font-size: 28px;
}

.modal-box {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  #ov-profit,
  #ov-realized-profit {
    font-size: 32px;
  }

  .overview-main-top .ov-value {
    font-size: 24px;
  }

  .overview-main-top #ov-profit {
    font-size: 22px;
  }

  .hide-on-mobile {
    display: none;
  }
}

/* --- 讓切換按鈕在手機版可以水平滑動，不會凸出去 --- */
.seg-toggle {
  max-width: 100%;
  overflow-x: auto;
  /* 用 mask 在左右兩側做漸層淡出，暗示可橫向滑動 */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 16px,
    #000 calc(100% - 16px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 16px,
    #000 calc(100% - 16px),
    transparent 100%
  );
  scrollbar-width: none; /* Firefox */
}

.seg-toggle::-webkit-scrollbar {
  display: none;
}

/* --- 3. 佔比明細清單懸停 (向右微滑動，增加閱讀指引) --- */
.ratio-legend-row {
  transition: transform 0.2s ease;
}

.ratio-legend-row:hover {
  transform: translateX(6px);
}

/* --- 表格表頭統一粗體，並與內容對齊 --- */
.sub-table th {
  font-size: 16px;
  font-weight: 700;
}

.btn,
.goal-modal-confirm,
.seg,
.ratio-legend-row,
.detail-name,
.ds-label,
.ds-pill,
.sub-table,
.toast {
  font-size: 18px;
}

/* --- 詳細資訊內的三個大分頁 (+2) --- */
.main-tab {
  font-size: 20px;
}

.block-title,
.chart-legend,
.ds-row {
  font-size: 19px;
}

/* 2026-06-07：input 屬性已由全域基準涵蓋（見上方 input[type=...]）；
   此處只負責 .form-row 內的 select（select 不在全域基準範圍內）。
   保留 .form-row input 是因 select 與 input 共用同一規則，且字級必須與全域基準對齊。 */
.form-row input,
.form-row select {
  font-size: 19px;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

/* --- 數字與日期輸入框優化 --- */
.form-row input[type="number"],
.form-row input[type="date"] {
  font-family: var(--base-font);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 隱藏瀏覽器原生的上下增減按鈕 (Spinner)，讓畫面更簡潔 */
.form-row input[type="number"]::-webkit-inner-spin-button,
.form-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-row input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 強制股票代號輸入框自動轉大寫 */
#newSymbol {
  text-transform: uppercase;
}

.block h2,
.ds-unit,
.modal-header h3 {
  font-size: 21px;
}

/* --- SVG 圖示置中微調 --- */
.hc-delete,
.btn-icon-round {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* --- 增加詳細頁小卡片的導圓角 --- */
.ds-mini-card {
  border-radius: 16px;
  transition:
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s ease,
    background 0.3s ease,
    filter 0.3s ease,
    border-color 0.3s ease;
}

.ds-mini-card .muted {
  font-size: 15px;
  /* 中文標籤改小 */
}

.ds-mini-card .val {
  font-size: 24px;
  /* 數字改大 */
}

/* --- 漢堡選單 (Dropdown) --- */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 17px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--panel-2);
  color: var(--primary);
}

/* --- 視圖切換的平滑過場動畫 --- */
main:not(.hidden) {
  animation: viewFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 確認刪除按鈕按壓特效 --- */
#confirmYesBtn {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

#confirmYesBtn:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: 0 2px 6px rgba(216, 58, 58, 0.2);
}

/* --- 名詞說明「?」按鈕 --- */
/* (?) 說明鈕 — 全站單一規格（主階層）。字型鎖 var(--base-font)，
   不再 inherit 父層（避免落到數字字體 / 不同 family 造成 ? 形狀不一）。 */
.term-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tip-size);
  height: var(--tip-size);
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-family: var(--base-font);
  font-size: var(--tip-font);
  font-weight: 700;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.15s;
  flex-shrink: 0;
  padding: 0;
}

/* 次階層：子指標 / 小標籤旁的 (?)，比主階層小一號。
   需要次階層時掛 .term-tip-btn.is-sub，或沿用既有 context class。 */
.term-tip-btn.is-sub,
.overview-main-top .term-tip-btn,
.dh-sub-label .term-tip-btn {
  width: var(--tip-size-sm);
  height: var(--tip-size-sm);
  font-size: var(--tip-font-sm);
  margin-left: 4px;
}

.term-tip-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.15);
}

/* --- 動效減免：尊重使用者系統偏好（前庭敏感、效能考量） --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- 鍵盤焦點環：滑鼠點不顯示，鍵盤 Tab 才顯示，提升可用性 --- */
:where(
  a,
  button,
  input,
  select,
  textarea,
  [tabindex],
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-icon,
  .btn-icon-round,
  .btn-back,
  .seg,
  .dropdown-item,
  .term-tip-btn,
  .holding-card,
  .rank-card,
  .rank-sub-card,
  .activity-item,
  .ds-mini-card,
  .ds-profit-box,
  .ds-theme-toggle
):focus {
  outline: none;
}

:where(
  a,
  button,
  input,
  select,
  textarea,
  [tabindex],
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-icon,
  .btn-icon-round,
  .btn-back,
  .seg,
  .dropdown-item,
  .term-tip-btn,
  .holding-card,
  .rank-card,
  .rank-sub-card,
  .activity-item,
  .ds-mini-card,
  .ds-profit-box,
  .ds-theme-toggle
):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
  box-shadow: 0 0 0 5px rgba(44, 94, 79, 0.18);
  transition: outline-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] :where(
  a,
  button,
  input,
  select,
  textarea,
  [tabindex],
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-icon,
  .btn-icon-round,
  .btn-back,
  .seg,
  .dropdown-item,
  .term-tip-btn,
  .holding-card,
  .rank-card,
  .rank-sub-card,
  .activity-item,
  .ds-mini-card,
  .ds-profit-box,
  .ds-theme-toggle
):focus-visible {
  outline-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(79, 179, 149, 0.28);
}


/* ============================================================
   灰毛存股 官網首頁 (Landing Page) 樣式
   依賴 theme.css 的色彩 token
   ============================================================ */

/* ---------- Reset / Base ---------- */
html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--base-font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- 共用按鈕 ---------- */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.lp-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(44, 94, 79, 0.28);
}

.lp-btn-primary:hover {
  /* 用 filter 自動依當前 primary 調暗，深淺色模式都對 */
  background: var(--primary);
  filter: brightness(0.88);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(44, 94, 79, 0.36);
}

.lp-btn-primary:active {
  transform: translateY(0);
}

[data-theme="dark"] .lp-btn-primary:hover {
  /* 深色模式主色已偏亮，hover 改成偏亮一點點 */
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(79, 179, 149, 0.32);
}

.lp-btn-secondary {
  background: var(--panel);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.lp-btn-secondary:hover {
  background: var(--panel-2);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.lp-btn-ghost {
  background: transparent;
  color: var(--text-main);
  border-color: transparent;
}

.lp-btn-ghost:hover {
  background: var(--panel-2);
  color: var(--primary);
}

.lp-btn-lg {
  font-size: 16px;
  padding: 16px 30px;
}

.lp-btn-block {
  width: 100%;
  padding: 14px 22px;
}

.lp-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

/* ---------- 頂部導覽列 ---------- */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 247, 246, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lp-nav.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(244, 247, 246, 0.95);
}

[data-theme="dark"] .lp-nav {
  background: rgba(15, 19, 21, 0.8);
}

[data-theme="dark"] .lp-nav.is-scrolled {
  background: rgba(15, 19, 21, 0.95);
}

.lp-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--primary);
}

.lp-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(44, 94, 79, 0.3);
}

.lp-brand-name {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.lp-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}

.lp-nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.lp-nav-links a:hover {
  background: var(--panel-2);
  color: var(--primary);
}

.lp-nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.lp-theme-toggle:hover {
  background: var(--panel-2);
  color: var(--primary);
  border-color: var(--primary);
}

.lp-theme-icon-sun { display: none; }
.lp-theme-icon-moon { display: block; }

[data-theme="dark"] .lp-theme-icon-sun { display: block; }
[data-theme="dark"] .lp-theme-icon-moon { display: none; }

.lp-theme-toggle-mobile {
  width: auto;
  border-radius: 8px;
  padding: 8px 14px;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.lp-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.lp-nav-toggle:hover {
  background: var(--panel-2);
}

.lp-nav-mobile {
  display: none;
  flex-direction: column;
  padding: 8px 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.lp-nav-mobile.is-open {
  display: flex;
}

.lp-nav-mobile a {
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
}

.lp-nav-mobile a:last-of-type {
  border-bottom: none;
}

.lp-nav-mobile-cta {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.lp-nav-mobile-cta .lp-btn {
  flex: 1;
}

/* ---------- 區塊容器 ---------- */
.lp-section {
  padding: 96px 24px;
  position: relative;
}

.lp-section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.lp-section-narrow {
  max-width: 820px;
}

.lp-section-head {
  text-align: center;
  margin-bottom: 64px;
}

.lp-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
  padding: 6px 14px;
  background: rgba(44, 94, 79, 0.08);
  border-radius: 999px;
}

.lp-section-title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 16px;
}

.lp-section-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- Hero ---------- */
.lp-hero {
  padding: 80px 24px 100px;
  position: relative;
  overflow: hidden;
}

.lp-hero::before {
  content: "";
  position: absolute;
  top: -200px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(44, 94, 79, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.lp-hero::after {
  content: "";
  position: absolute;
  bottom: -200px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(214, 138, 44, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.lp-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.lp-hero-text {
  max-width: 580px;
}

.lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.lp-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(44, 94, 79, 0.18);
  animation: lp-pulse 2s ease-in-out infinite;
}

@keyframes lp-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(44, 94, 79, 0.18);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(44, 94, 79, 0.08);
  }
}

.lp-hero-title {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.lp-grad {
  background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lp-hero-sub {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.lp-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.lp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.lp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.lp-meta-item svg {
  color: var(--primary);
}

/* Hero 視覺：示意儀表板 */
.lp-hero-visual {
  position: relative;
  height: 460px;
}

.lp-mock-card {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 24px 28px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.lp-mock-card-main {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  z-index: 3;
  animation: lp-float-main 6s ease-in-out infinite;
}

@keyframes lp-float-main {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - 8px));
  }
}

.lp-mock-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.lp-mock-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.lp-mock-up {
  color: var(--up);
}

.lp-mock-gold {
  color: var(--gold);
}

.lp-mock-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.lp-mock-bar {
  height: 8px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}

.lp-mock-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 999px;
  animation: lp-bar-grow 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes lp-bar-grow {
  from {
    width: 0 !important;
  }
}

.lp-mock-card-side {
  width: 220px;
  padding: 18px 22px;
  z-index: 2;
}

.lp-mock-card-side-1 {
  top: 16%;
  right: 0;
  animation: lp-float-side1 7s ease-in-out infinite;
}

@keyframes lp-float-side1 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.lp-mock-card-side-2 {
  bottom: 12%;
  left: 0;
  animation: lp-float-side2 8s ease-in-out infinite;
}

@keyframes lp-float-side2 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.lp-mock-mini-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.lp-mock-mini-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.lp-mock-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
}

.lp-mock-blob-1 {
  top: 0;
  left: 20%;
  width: 220px;
  height: 220px;
  background: rgba(44, 94, 79, 0.25);
}

.lp-mock-blob-2 {
  bottom: 0;
  right: 10%;
  width: 200px;
  height: 200px;
  background: rgba(214, 138, 44, 0.22);
}

/* ---------- 核心賣點 ---------- */
.lp-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.lp-value-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 30px;
  text-align: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease, border-color 0.3s ease;
}

.lp-value-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.lp-value-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #fff;
}

.lp-icon-green {
  background: linear-gradient(135deg, var(--primary), #3a7a66);
  box-shadow: 0 8px 20px rgba(44, 94, 79, 0.3);
}

.lp-icon-gold {
  background: linear-gradient(135deg, var(--gold), #e3a14d);
  box-shadow: 0 8px 20px rgba(214, 138, 44, 0.3);
}

.lp-icon-earth {
  background: linear-gradient(135deg, var(--earth), #a88366);
  box-shadow: 0 8px 20px rgba(140, 106, 79, 0.3);
}

.lp-value-card h3 {
  font-size: 22px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.lp-value-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- 功能亮點 ---------- */
.lp-features {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lp-grid-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.lp-feature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease, box-shadow 0.3s ease;
}

.lp-feature:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(44, 94, 79, 0.12);
}

.lp-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(44, 94, 79, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.lp-feature:hover .lp-feature-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.lp-feature h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.lp-feature p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---------- 使用流程 ---------- */
.lp-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}

.lp-step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease;
}

.lp-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.lp-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(44, 94, 79, 0.1);
  border-radius: 16px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.lp-step h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.lp-step p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

.lp-step-arrow {
  font-size: 28px;
  /* Google Fonts 僅載入 400/500/600/700/800，原宣告 300 不會生效（fallback 至 400），改為 400 使宣告與實際一致 */
  font-weight: 400;
  color: var(--border-strong);
  user-select: none;
}

/* ---------- 安全與穩定性 ---------- */
.lp-security {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lp-grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}

.lp-security-text .lp-eyebrow {
  margin-bottom: 16px;
}

.lp-security-text .lp-section-title {
  text-align: left;
  margin-bottom: 18px;
}

.lp-security-text .lp-section-sub {
  text-align: left;
  margin: 0 0 28px;
}

.lp-security-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-security-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--text-main);
  font-weight: 500;
}

.lp-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(44, 94, 79, 0.28);
}

.lp-security-visual {
  position: relative;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lp-shield {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #3a7a66);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 50px rgba(44, 94, 79, 0.35);
  position: relative;
  z-index: 2;
}

.lp-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(44, 94, 79, 0.22);
  animation: lp-ring-pulse 4s ease-in-out infinite;
}

.lp-ring-1 {
  width: 240px;
  height: 240px;
  animation-delay: 0s;
}

.lp-ring-2 {
  width: 300px;
  height: 300px;
  animation-delay: 0.6s;
}

.lp-ring-3 {
  width: 360px;
  height: 360px;
  animation-delay: 1.2s;
}

@keyframes lp-ring-pulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.04);
  }
}

/* ---------- 方案 ---------- */
.lp-grid-plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}

/* 三方案模式（1m / 6m / 12m） */
.lp-grid-plans-3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1180px;
}

@media (max-width: 960px) {
  .lp-grid-plans-3 {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
}

.lp-plan {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lp-plan-current {
  border-color: var(--primary);
  box-shadow: 0 16px 40px rgba(44, 94, 79, 0.14);
}

.lp-plan-current:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 56px rgba(44, 94, 79, 0.22);
}

.lp-plan-soon {
  background: var(--panel-2);
}

.lp-plan-tag {
  position: absolute;
  top: -12px;
  left: 36px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}

.lp-plan-tag-soon {
  background: var(--earth);
}

.lp-plan-name {
  font-size: 24px;
  margin-bottom: 14px;
  color: var(--text-main);
}

.lp-plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.lp-plan-currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}

.lp-plan-num {
  font-size: 44px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.lp-plan-unit {
  font-size: 14px;
  color: var(--text-muted);
}

.lp-muted {
  color: var(--text-muted) !important;
}

.lp-plan-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.lp-plan-list li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.5;
}

.lp-plan-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.lp-plan-list.lp-muted li {
  color: var(--text-muted);
}

.lp-plan-list.lp-muted li::before {
  background-color: var(--text-muted);
  opacity: 0.6;
}

/* ---------- Free / Pro 方案卡片補強 ---------- */
.lp-plan-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: -16px 0 22px;
}

.lp-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-plan-features li {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.lp-plan-features li strong {
  color: var(--text-main);
  font-weight: 700;
}

.lp-plan-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 勾號改以 SVG mask 呈現（取代純文字勾號，跨平台渲染一致） */
.lp-plan-check::before {
  content: "";
  width: 11px;
  height: 11px;
  background-color: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
}

/* Pro 方案專屬樣式 */
.lp-plan-pro {
  background: linear-gradient(135deg, var(--panel) 0%, rgba(201, 168, 76, 0.06) 100%);
  border-color: #C9A84C;
  box-shadow: 0 16px 40px rgba(201, 168, 76, 0.18);
  position: relative;
}

.lp-plan-pro:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 56px rgba(201, 168, 76, 0.26);
}

.lp-plan-tag-pro {
  background: linear-gradient(135deg, #C9A84C, #A8893E);
}

.lp-plan-pro .lp-plan-check {
  background: linear-gradient(135deg, #C9A84C, #A8893E);
}

.lp-plan-pro .lp-plan-num {
  background: linear-gradient(135deg, #C9A84C, #A8893E);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lp-plan-name-badge {
  display: inline-block;
  font-size: 18px;
  margin-left: 4px;
  vertical-align: middle;
}

.lp-plans-note {
  margin: 36px auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 18px 22px;
  background: var(--panel-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.lp-plans-note strong {
  color: var(--text-main);
}

/* ---------- FAQ ---------- */
.lp-faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lp-faq-item[open] {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(44, 94, 79, 0.1);
}

.lp-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}

.lp-faq-item summary::-webkit-details-marker {
  display: none;
}

.lp-faq-item summary:hover {
  background: var(--panel-2);
}

.lp-faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.2s ease;
}

.lp-faq-item[open] .lp-faq-icon {
  background: var(--primary);
  color: #fff;
  transform: rotate(45deg);
}

.lp-faq-body {
  padding: 0 26px 24px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ---------- 最終 CTA ---------- */
.lp-final-cta {
  padding: 60px 24px 96px;
}

.lp-final-box {
  background: linear-gradient(135deg, var(--primary) 0%, #1e4538 100%);
  color: #fff;
  border-radius: 32px;
  padding: 64px 40px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(44, 94, 79, 0.35);
  position: relative;
  overflow: hidden;
}

.lp-final-box::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(214, 138, 44, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.lp-final-box::after {
  content: "";
  position: absolute;
  bottom: -120px;
  left: -100px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.lp-final-box h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.lp-final-box p {
  font-size: 17px;
  opacity: 0.88;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.lp-final-box .lp-btn-primary {
  background: #fff;
  color: var(--primary);
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.lp-final-box .lp-btn-primary:hover {
  background: var(--panel-2);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

/* ---------- Footer ---------- */
.lp-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 64px 24px 24px;
}

.lp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.lp-footer-brand .lp-brand {
  margin-bottom: 16px;
}

.lp-footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 320px;
}

.lp-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.lp-footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.lp-footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 0;
  transition: color 0.2s;
}

.lp-footer-col a:hover {
  color: var(--primary);
}

.lp-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- 關於我們 & 贊助 ---------- */
.lp-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.lp-about-text-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
}

.lp-about-text-card p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
}

.lp-sponsor-card {
  background: linear-gradient(135deg, #2c5e4f 0%, #1a3d33 100%);
  border-radius: 20px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #fff;
}

.lp-sponsor-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lp-sponsor-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.lp-sponsor-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.lp-sponsor-card p {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}

.lp-sponsor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #2c5e4f;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: flex-start;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.lp-sponsor-btn:hover {
  background: #f0faf5;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.lp-sponsor-btn:active {
  transform: translateY(0);
}

/* 贊助按鈕內的愛心 SVG（取代 inline color） */
.lp-sponsor-heart {
  flex-shrink: 0;
  color: #e05a7a;
  vertical-align: middle;
}

[data-theme="dark"] .lp-sponsor-heart {
  /* 深色模式下愛心微提亮，維持暖紅辨識度 */
  color: #ec7a96;
}

@media (max-width: 768px) {
  .lp-about-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 進場動畫 (intersection observer) ---------- */
.lp-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.lp-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 響應式 ---------- */
@media (max-width: 1024px) {
  .lp-grid-features {
    grid-template-columns: repeat(2, 1fr);
  }

  .lp-grid-3 {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin: 0 auto;
  }

  .lp-hero-inner {
    grid-template-columns: 1fr;
    gap: 80px;
  }

  .lp-hero-text {
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
  }

  .lp-hero-cta,
  .lp-hero-meta {
    justify-content: center;
  }

  .lp-hero-visual {
    max-width: 520px;
    margin: 0 auto;
  }

  .lp-grid-2 {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .lp-security-text .lp-section-title,
  .lp-security-text .lp-section-sub {
    text-align: center;
  }

  .lp-security-list {
    max-width: 480px;
    margin: 0 auto;
  }

  .lp-steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lp-step-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .lp-footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .lp-section {
    padding: 72px 20px;
  }

  .lp-hero {
    padding: 48px 20px 72px;
  }

  .lp-nav-links,
  .lp-nav-cta {
    display: none;
  }

  .lp-nav-toggle {
    display: inline-flex;
  }

  .lp-section-head {
    margin-bottom: 48px;
  }

  .lp-grid-features {
    grid-template-columns: 1fr;
  }

  .lp-grid-plans {
    grid-template-columns: 1fr;
  }

  .lp-hero-visual {
    height: 380px;
  }

  .lp-mock-card-main {
    width: 260px;
  }

  .lp-mock-card-side {
    width: 180px;
    padding: 14px 18px;
  }

  .lp-mock-value {
    font-size: 28px;
  }

  .lp-mock-mini-value {
    font-size: 18px;
  }

  .lp-security-visual {
    height: 300px;
  }

  .lp-shield {
    width: 120px;
    height: 120px;
  }

  .lp-shield svg {
    width: 60px;
    height: 60px;
  }

  .lp-ring-1 {
    width: 180px;
    height: 180px;
  }

  .lp-ring-2 {
    width: 230px;
    height: 230px;
  }

  .lp-ring-3 {
    width: 280px;
    height: 280px;
  }

  .lp-final-box {
    padding: 48px 24px;
    border-radius: 24px;
  }

  .lp-footer-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .lp-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .lp-hero-cta .lp-btn {
    width: 100%;
  }

  .lp-hero-meta {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}

/* ---------- 深色模式微調 ---------- */
[data-theme="dark"] .lp-eyebrow {
  background: rgba(79, 179, 149, 0.14);
}

[data-theme="dark"] .lp-feature-icon {
  background: rgba(79, 179, 149, 0.14);
}

[data-theme="dark"] .lp-step-num {
  background: rgba(79, 179, 149, 0.14);
}

[data-theme="dark"] .lp-hero::before {
  background: radial-gradient(circle, rgba(79, 179, 149, 0.18) 0%, transparent 70%);
}

[data-theme="dark"] .lp-hero::after {
  background: radial-gradient(circle, rgba(242, 174, 75, 0.14) 0%, transparent 70%);
}

[data-theme="dark"] .lp-final-box {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3d33 100%);
}

/* ============================================================
   灰毛存股 法律文件頁 (legal.css)
   依賴 theme.css 的色彩 token + landing.css 的導覽列 / Footer
   ============================================================ */

/* ---------- 部落格行內圖標 (SVG，取代 emoji) ---------- */
.ico {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}
.ico-check { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f9e6e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.ico-cross { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9534f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E"); }
.ico-book { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f9e6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.ico-arrow { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f9e6e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E"); }

/* ---------- 法律頁主體 ---------- */
.legal-main {
  min-height: calc(100vh - 72px);
  padding: 80px 24px 96px;
}

.legal-wrap {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- 頁面標題區 ---------- */
.legal-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 12px;
}

.legal-meta {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- 內容區塊 ---------- */
.legal-body h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.legal-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 28px 0 8px;
}

.legal-body p {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 14px;
}

.legal-body ul,
.legal-body ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.legal-body li {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 6px;
}

.legal-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover {
  opacity: 0.75;
}

/* ---------- 特殊區塊 ---------- */
.legal-note {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-contact-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.legal-contact-box .legal-contact-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.legal-contact-box h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
}

.legal-contact-box a {
  color: var(--primary);
  font-size: 14px;
  text-decoration: none;
}

.legal-contact-box a:hover {
  text-decoration: underline;
}

/* ---------- 頁面麵包屑 ---------- */
.legal-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legal-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-breadcrumb a:hover {
  color: var(--primary);
}

.legal-breadcrumb span {
  color: var(--border-strong, var(--border));
}

/* ---------- RWD ---------- */
@media (max-width: 600px) {
  .legal-main {
    padding: 60px 16px 72px;
  }

  .legal-contact-box {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 20px;
  }
}
