/* ============================================================
   Dream Factory AI — Design System
   靈感來源：foodie BrandTheme 語義色彩系統
   ============================================================ */

/* ------------------------------------------
   1. Design Tokens
   ------------------------------------------ */
:root {
  /* Brand — 紫藍漸層 (保留原 dream-factory 識別) */
  --color-primary: #a78bfa;
  --color-primary-hover: #8b5cf6;
  --color-primary-subtle: rgba(167, 139, 250, 0.12);
  --color-secondary: #60a5fa;
  --color-accent: #34d399;
  --color-on-primary: #fff;

  /* Surface & Background — 深色基底 */
  --color-background: #130f24;
  --color-surface: #12121c;
  --color-surface-hover: #1a1a2e;
  --color-surface-elevated: #1e1e30;

  /* Text — 淺灰到白 */
  --color-text: #e8e8ed;
  --color-text-secondary: #94949e;
  --color-text-muted: #5c5c66;

  /* Border */
  --color-border: #1e1e2e;
  --color-border-light: #16161f;

  /* Semantic */
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-error: #ef4444;

  /* 觸控目標 (mobile-first) */
  --touch-target: 48px;
  --touch-target-lg: 52px;

  /* 圓角 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  /* 間距 (以手機為基準) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 80px;

  /* 字級 */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-lg: 1.05rem;
  --text-xl: 1.25rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;

  /* Banner (由 theme.js 動態覆蓋) */
  --banner-image: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(96, 165, 250, 0.08));

  /* 陰影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------
   2. Reset
   ------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC', sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ------------------------------------------
   3. 粒子背景 (保留原始)
   ------------------------------------------ */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------------------
   4. Layout — 手機優先容器
   ------------------------------------------ */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 640px) {
  .page {
    max-width: 600px;
  }
}

@media (min-width: 768px) {
  .page {
    max-width: 720px;
    padding: 0 var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .page {
    max-width: 960px;
    padding: 0 var(--space-xl);
  }
}

@media (min-width: 1280px) {
  .page {
    max-width: 1120px;
  }
}

/* ------------------------------------------
   5. Components
   ------------------------------------------ */

/* --- 5a. Nav --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 8, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  padding: 0 var(--space-md);
  border-radius: var(--radius);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn:active {
  background: var(--color-surface);
  color: var(--color-text);
}

.nav-btn--primary {
  color: var(--color-primary);
  background: var(--color-primary-subtle);
}

.nav-btn--primary:active {
  background: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.lang-switcher {
  position: relative;
}

.lang-switcher__trigger {
  font-size: var(--text-lg);
  background: none;
  border: none;
  cursor: pointer;
}

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  min-width: 140px;
  margin: 0;
  padding: var(--space-xs);
  list-style: none;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 20;
}

.lang-switcher.is-open .lang-switcher__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher__option {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}

.lang-switcher__option:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.lang-switcher__option.is-active {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-subtle);
}

/* --- 5b. Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  /* 下 padding 要蓋過 .hero-actions（絕對定位的蝦皮按鈕列）實際佔用的高度，
     避免 hero.subtitle 文字太短、hero 整體高度不夠而被按鈕遮住。
     所有螢幕尺寸統一用這個值，不因斷點而縮小。 */
  padding: var(--space-2xl) 0 96px;
  /* 給 banner 圖足夠高度，太扁的話 contain 會把圖縮得很小 */
  min-height: 300px;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  /* 橢圓半徑刻意小於容器寬高（水平 50%±36% = 14%~86%；垂直 38%±42% = 頂 -4% ~ 底 80%），
     讓光暈在碰到任何一側邊界前就淡出到透明，避免被 overflow: hidden 硬截斷出一條邊。
     不能用 circle 預設 farthest-corner——hero 寬扁，半徑會遠超出高度；
     水平半徑也不能取太大（如 60%），否則邊緣還沒淡完就被容器邊界切斷。 */
  background: radial-gradient(ellipse 36% 42% at 50% 38%, color-mix(in srgb, var(--color-primary) 35%, transparent), transparent);
  pointer-events: none;
}

.hero-banner {
  position: absolute;
  inset: 0;
  z-index: -2;
  /* 圖片是 1536x1024（比例 1.5），banner 橫幅比例遠寬於此。用 cover 會裁掉約 2/3 高度，
     不管錨點放哪都會切到雲或房子，所以改用 contain 讓整張圖完整顯示。
     疊兩層邊緣淡出漸層（水平一層、垂直一層，各自獨立），把圖片四邊都淡出成背景色，
     跟頁面無縫接合，中間圖片主體維持完整不透明。 */
  background-image:
    linear-gradient(to right, var(--color-background), transparent 12%, transparent 88%, var(--color-background)),
    linear-gradient(to bottom, var(--color-background), transparent 6%, transparent 94%, var(--color-background)),
    linear-gradient(rgba(10, 10, 25, 0.45), rgba(10, 10, 25, 0.45)),
    var(--banner-image);
  background-size: 100% 100%, 100% 100%, 100% 100%, contain;
  /* 往左偏移 20% hero 寬度，避開置中的 AI夢幻工廠標題文字 */
  background-position: center, center, center, 30% center;
  background-repeat: no-repeat;
  background-color: var(--color-background);
}

.hero-cta-wrap {
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  display: flex;
  justify-content: center;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-full, 9999px);
  text-decoration: none;
  min-height: var(--touch-target, 48px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.hero-cta:active {
  transform: translateY(0);
}

.hero-actions {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100% - var(--space-md) * 2);
  gap: var(--space-sm);
}

/* 062 批 1a §5.8：分店按鈕改由 products.js 動態渲染，API 失敗時用 hidden 屬性整列隱藏。
   作者樣式的 display:flex 會蓋掉瀏覽器預設的 [hidden] { display: none }，所以要明寫這條，
   否則 heroLinksEl.hidden = true 只是掛個屬性、實際沒有隱藏效果。 */
.hero-actions[hidden] {
  display: none;
}

.shopee-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  gap: 2px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.2;
  transition: opacity 0.2s;
}

.shopee-link:hover {
  opacity: 0.75;
}

.shopee-link img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.hero-tiktok {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  transition: border-color 0.2s;
}

.hero-tiktok:active {
  border-color: var(--color-primary);
}

.hero-tiktok img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.hero h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.hero .gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.hero-title-link:hover {
  opacity: 0.85;
}

.hero p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: var(--text-3xl);
  }
}

/* --- 5c. Buttons (touch-optimized) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
  padding: 0 var(--space-lg);
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  width: 100%;
}

.btn:active {
  transform: scale(0.97);
}

@media (min-width: 480px) {
  .btn {
    width: auto;
  }
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-on-primary);
  min-height: var(--touch-target-lg);
  box-shadow: 0 0 0 color-mix(in srgb, var(--color-primary) 0%, transparent);
}

.btn--primary:active {
  box-shadow: 0 0 24px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.btn--secondary {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

.btn--secondary:active {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.btn--ghost {
  color: var(--color-text-secondary);
}

.btn--ghost:active {
  background: var(--color-surface);
}

/* --- 5d. Section Headers --- */
.section-eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  padding-top: var(--space-3xl);
}

.section-title {
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--space-md);
}

.section-title--highlight {
  color: var(--color-warning);
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

/* --- 5f. GPU Checker (產品區整合 GPU 檢測) --- */
.gpu-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .gpu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .gpu-card--large {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .gpu-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .gpu-card--large {
    grid-column: 1 / -1;
  }
}

.gpu-filter-group {
  margin-bottom: var(--space-md);
}

.gpu-filter-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.gpu-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* 067 修復；068 修復：收合列（?card= 對上目標型號時顯示的一行摘要 + 更換鈕）。
   作者樣式的 display:flex 會蓋掉瀏覽器預設的 [hidden] { display: none }，比照
   .hero-actions[hidden] 既有寫法明寫這條，否則 collapsedEl.hidden = true 只是
   掛個屬性、實際沒有隱藏效果——沒帶 ?card= 的預設頁會單獨冒出一顆「更換」鈕。 */
.gpu-collapsed {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.gpu-collapsed[hidden] {
  display: none;
}

.gpu-collapsed__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* 沿用型號按鈕選中時的樣式（漸層底、深字），讓晶片一眼可辨識為目前選定值。 */
.gpu-collapsed__chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-on-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.gpu-collapsed__change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gpu-collapsed__change:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

/* 晶片品牌／VRAM／顯示卡三層現在都是單選 radio pill，機制相同，選中效果統一 */
.gpu-checkbox,
.gpu-model-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gpu-checkbox input,
.gpu-model-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.gpu-checkbox:has(input:checked),
.gpu-model-option:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-on-primary);
}

.gpu-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.gpu-model-empty {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* 068 修復：記憶體大小改選入口原本是純文字連結（沒有底線、字色跟內文一樣），
   使用者看不出能點；改成按鈕外觀，比照系列／型號按鈕未選中的樣式。展開狀態
   反映在 aria-expanded，箭頭方向（▾／▴）由 products.js 附加在文字尾端。 */
.gpu-toggle-vram {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  margin: var(--space-sm) 0;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gpu-toggle-vram:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.gpu-status {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.gpu-filter-toggle {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-warning);
  background: rgba(251, 191, 36, 0.12);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gpu-filter-toggle:hover {
  background: rgba(251, 191, 36, 0.2);
}

.gpu-filter-toggle input {
  width: 20px;
  height: 20px;
  /* 勾選時維持白色，避免跟 .is-checked 的綠色底色混在一起看不出是核選方塊 */
  accent-color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.gpu-filter-toggle.is-checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #063122;
}

.gpu-filter-toggle.is-checked:hover {
  background: var(--color-success);
}

/* 結果卡片（產品） */
.gpu-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  grid-column: 1 / -1;
}

@media (min-width: 540px) {
  .gpu-results {
    grid-template-columns: 1fr 1fr;
  }

  .gpu-results .product-result--featured {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .gpu-results {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.product-result {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.product-result:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.product-result:active {
  transform: scale(0.98);
}

/* Featured card — 一大：漸層描邊彰顯主打地位 */
.product-result--featured {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
    linear-gradient(135deg, var(--color-primary), var(--color-secondary)) border-box;
  text-decoration: none;
  color: inherit;
}

.product-result--featured:hover {
  border-color: transparent;
}

.product-result__img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-elevated);
}

.product-result__img--featured {
  width: 100px;
  height: auto;
  align-self: stretch;
  border-radius: 0;
}

@media (min-width: 1024px) {
  .product-result__img--featured {
    width: 128px;
  }
}

.product-result--featured .product-result__body {
  padding: var(--space-lg);
}

.product-result--featured .product-result__name {
  font-size: var(--text-base);
}

.product-result--featured .product-result__price {
  font-size: var(--text-lg);
}

/* N小 cards: full-bleed image + semi-transparent overlay */
.product-result:not(.product-result--featured) {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
}

.product-result:not(.product-result--featured) .product-result__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-result:not(.product-result--featured)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.80) 0%, rgba(0, 0, 0, 0.80) 20%, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.10) 60%, transparent 75%);
  pointer-events: none;
}

.product-result:not(.product-result--featured) .product-result__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: var(--space-md);
  -webkit-text-stroke: 0.4px rgba(0, 0, 0, 0.6);
  text-shadow:
    1px -1px 0 #000,
    1px 0px 0 #000,
    1px 1px 0 #000,
    0px -1px 0 #000,
    0px 1px 0 #000,
    -1px -1px 0 #000,
    -1px 0px 0 #000,
    -1px 1px 0 #000;
}

.product-result:not(.product-result--featured) .product-result__name {
  color: #fff;
  font-size: var(--text-base);
}

.product-result:not(.product-result--featured) .product-result__spec {
  margin-bottom: var(--space-xs);
}

.product-result:not(.product-result--featured) .product-result__tag {
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.product-result__body {
  flex: 1;
  min-width: 0;
}

.product-result__name {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-result__spec {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.product-result__tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
}

.tag-smooth {
  color: var(--color-success);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.tag-minimum {
  color: var(--color-warning);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.product-result__price {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-primary);
}

.show-more-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  border: none;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.show-more-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.80) 0%, rgba(0, 0, 0, 0.80) 20%, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.10) 60%, transparent 75%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

.show-more-text {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: var(--text-base);
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.show-more-card:hover {
  opacity: 0.85;
}

.show-more-card:active {
  opacity: 0.7;
}

/* AI 模型 chips */
.model-section {
  margin-top: var(--space-md);
}

.model-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
}

details.checker-details {
  margin-top: var(--space-md);
}

details.checker-details summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: var(--space-sm) 0;
  -webkit-tap-highlight-color: transparent;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}

details.checker-details summary:active {
  color: var(--color-text);
}

details.checker-details[open] summary {
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

/* --- 5g. Download Section --- */
.download-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

@media (min-width: 768px) {
  .download-card {
    flex-direction: row;
    align-items: flex-start;
  }
}

.download-preview {
  flex-shrink: 0;
}

.download-tool-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-sm);
}

.download-preview p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.download-screenshot-wrap {
  position: relative;
}

.download-screenshot {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: block;
}

@media (min-width: 768px) {
  .download-screenshot {
    width: 320px;
  }
}

.download-cta {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) var(--space-xl);
  line-height: 1.3;
}

.download-info {
  flex: 1;
  min-width: 0;
}

.download-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  transition: border-color 0.2s;
}

.download-icon:active {
  border-color: var(--color-primary);
}

.download-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.download-screenshare-note {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-md);
}

.screenshare-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.screenshare-step {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.screenshare-step img {
  width: 100%;
  display: block;
}

.screenshare-step figcaption {
  text-align: center;
  padding: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}

.download-cta-note {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-on-primary);
}

/* --- 5g2. Free Tool Section --- */
.tool-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  align-self: flex-start;
}

.download-card .tool-tag {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 1;
}

.tool-icon-wrap {
  position: relative;
  flex-shrink: 0;
}

.tool-icon-wrap .tool-tag {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 1;
}

.tool-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

@media (min-width: 768px) {
  .tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .tool-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) * 2);
  min-height: var(--touch-target-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.tool-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tool-card:active {
  transform: scale(0.98);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: var(--text-2xl);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
}

.tool-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
}

.tool-card-arrow {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.tool-card-arrow svg {
  width: 16px;
  height: 16px;
}

.tool-card:hover .tool-card-arrow {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: transparent;
  color: var(--color-on-primary);
}

/* --- 5g3. TopMediai Promo --- */
.promo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

@media (min-width: 768px) {
  .promo-card {
    flex-direction: row;
    align-items: flex-start;
  }
}

.promo-screenshot {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: block;
}

@media (min-width: 768px) {
  .promo-screenshot {
    width: 340px;
    flex-shrink: 0;
  }
}

.promo-info {
  flex: 1;
  min-width: 0;
}

.promo-info p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--space-md);
}

.promo-info p.promo-cta-line {
  color: var(--color-text);
  font-weight: 600;
}

/* --- 5h. Footer --- */
.footer {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-lg);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2xl);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.footer a {
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.footer a:active {
  color: var(--color-primary);
}

/* ------------------------------------------
   6. Utilities
   ------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- 6a. 骨架屏（2026-09-03，商品知識庫／營運總覽首屏用）---
   資料到達前先佔位，避免空白／版面跳動；渲染函式清空容器時骨架自然被移除，
   不需要額外的「清除骨架」程式碼。高度用固定值（不靠內容撐開），跟真實內容
   一屏內的高度接近即可，不用逐像素對齊。 */
.skeleton {
  display: block;
  border-radius: var(--radius, 12px);
  background: var(--color-surface-elevated, #1e1e30);
  animation: skeleton-breathe 1.6s ease-in-out infinite;
}

@keyframes skeleton-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    opacity: 0.75;
  }
}

.skeleton--title {
  height: 1.1em;
  width: 40%;
  margin-bottom: var(--space-sm, 8px);
}

.skeleton--line {
  height: 0.9em;
  width: 100%;
  margin-bottom: var(--space-sm, 8px);
}

.skeleton--line:last-child {
  margin-bottom: 0;
  width: 70%;
}

.skeleton--card {
  height: 96px;
  margin-bottom: var(--space-md, 16px);
}

.skeleton--card:last-child {
  margin-bottom: 0;
}