/* ============================================================
   index.html 主框架(頂部 / iframe / 底部 / Cookie 條)
   ============================================================ */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Top toolbar ---------- */
.top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.left-section {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.02em;
  text-decoration: none;
}
.logo:hover { color: var(--color-text); }
.logo img,
.logo picture {
  display: inline-block;
  height: 28px;
  width: auto;       /* 維持 logo 長寬比 (NEW1024-202624.png 為 1:1) */
  object-fit: contain;
}
.logo picture img { height: 28px; width: auto; }

.boba-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: border-color var(--duration) var(--easing), color var(--duration) var(--easing);
}
.boba-button:hover { border-color: var(--color-text); color: var(--color-text); }
.boba-button img { width: 16px; height: 16px; }

.nav-links { display: flex; gap: var(--space-2); }

.nav-links a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.9375rem;
  color: var(--color-text-soft);
  border-radius: var(--radius);
  transition: color var(--duration) var(--easing);
  text-align: center;
  /* 中文 4 字若被擠到 2 行，平均斷成 2+2 而非預設的 3+1 */
  text-wrap: balance;
  -webkit-hyphens: none;
  hyphens: none;
}
.nav-links a:hover { color: var(--color-text); }
.nav-links a.active { color: var(--color-text); font-weight: 500; }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 1px;
  background: var(--color-accent);
}

/* ---------- Main content area(多頁直連架構,讓 main 撐滿剩餘空間) ---------- */
body > main { flex: 1; width: 100%; }

/* ---------- Site footer (資訊導覽 + App 下載) ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  margin-top: var(--space-7);
}

.footer-main {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr;
  gap: var(--space-6);
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-6) var(--space-7);
  justify-content: center;
}

/* footer 品牌區:左大 logo + 右文字/App badge,上下置中 */
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-start;
}
.footer-brand .footer-logo {
  flex-shrink: 0;
  display: block;
  line-height: 0;
}
.footer-brand .footer-logo img,
.footer-brand .footer-logo picture {
  display: block;
  height: 96px;
  width: auto;
}
.footer-brand-info {
  flex: 1;
  min-width: 0;
}
.footer-brand-info .footer-brand-name {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.02em;
}
.footer-brand-info .footer-tagline {
  font-size: 0.875rem; line-height: 1.6;
  color: var(--color-text-soft);
  margin: 0 0 var(--space-3); max-width: 320px;
}
.footer-app-badge { display: inline-block; }
.footer-app-badge img { height: 48px; width: auto; }

.footer-col .footer-h {
  font-size: 0.8125rem; font-weight: 500;
  color: var(--color-text-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 var(--space-3);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  font-size: 0.9375rem; color: var(--color-text-soft);
  text-decoration: none;
  transition: color var(--duration) var(--easing);
}
.footer-col a:hover { color: var(--color-text); }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-5);
  text-align: center;
}
.footer-bottom p { margin: 0; font-size: 0.8125rem; color: var(--color-text-muted); }

/* ---------- Cookie consent ---------- */
.cookie-consent {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: var(--space-3);
  max-width: 560px;
  width: calc(100% - var(--space-6));
  padding: var(--space-3) var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  z-index: 100;
}
.cookie-consent p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-bg);
  flex: 1;
}
.cookie-btn {
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--duration) var(--easing);
  white-space: nowrap;
}
.cookie-btn:hover { background: #f0f0f0; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .top-toolbar {
    padding: var(--space-2) var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .left-section { gap: var(--space-3); }
  /* 手機上 boba 改成圖示樣式（不要 display:none） */
  .boba-button {
    padding: 5px 9px;
    font-size: 0.75rem;
    gap: 4px;
  }
  .boba-button img { width: 14px; height: 14px; }
  .nav-links a { padding: 6px 10px; font-size: 0.875rem; }
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-3);
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand .footer-logo img,
  .footer-brand .footer-logo picture { height: 80px; }
  .footer-brand-info .footer-tagline { max-width: none; }
}
