/*
 * 比比 3C 品牌基礎（2.2 的 apps/web 會沿用本檔）
 * - 橘/藍/黃只做裝飾、底色、邊框，不當文字色（白底對比度不足）
 * - 文字一律用 --text / --text-muted，皆通過 WCAG AA（4.5:1）
 * - 只用系統字，不載入任何外部資源（CSP default-src 'self'）
 */

:root {
  color-scheme: light dark;

  /* 品牌色（裝飾用，淺深色主題相同） */
  --brand-orange: #ff7b00;
  --brand-blue: #00b4d8;
  --brand-yellow: #ffd166;
  --brand-navy: #0b2545;

  /* 語意色（2.2 起使用） */
  --price-down: #0e7c3a;
  --price-up: #c62828;

  /* 淺色主題 */
  --bg: #ffffff;
  --surface: #f4f8fb;
  --soft: #fff1dc;
  --text: #0b2545;
  --text-muted: #4a5a6a;
  --border: #d5e0ea;
  --focus: #0b2545;

  /* 字體 */
  --font: system-ui, -apple-system, "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", sans-serif;

  /* 動態：慢而小，符合「理性分析師」；--ease-pop 只用在比比進場的小 overshoot */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur: 500ms;

  /* 形狀與間距（4px 為單位） */
  --radius: 12px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1622;
    --surface: #12212f;
    --soft: #15283a;
    --text: #e8eef5;
    --text-muted: #a9b7c6;
    --border: #274055;
    --focus: #ffd166;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}

img,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}

a:hover {
  text-decoration-color: var(--brand-orange);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 跳到主要內容：鍵盤聚焦時才出現 */
.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 10;
  padding: var(--s3) var(--s4);
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--s2);
}

/* 通用版心 */
.wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--s4);
}

/* 揭露區塊（CLAUDE.md 規則 4）：頁面最頂端 */
.disclosure {
  background: var(--brand-yellow);
  color: var(--brand-navy);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: var(--s3) 0;
}

/* 圖片 Logo（淺色 logo.svg／深色 logo-reverse.svg）；點擊區塊 ≥ 44px，圖高 30px（手機）／38px（≥640px） */
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.logo img {
  width: auto;
  height: 30px;
}

@media (min-width: 640px) {
  .logo img {
    height: 38px;
  }
}
