/* 共用版面元件：頁首、手機選單、頁尾、浮動 WebChat 按鈕。 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--slate-200);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-950);
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name strong {
  font-size: 1.1875rem;
  letter-spacing: 0.06em;
}

.brand-name small {
  color: var(--slate-500);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--slate-100);
  color: var(--blue-900);
}

.main-nav a[aria-current='page'] {
  color: var(--blue-700);
  box-shadow: inset 0 -2px 0 var(--blue-700);
  border-radius: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--blue-950);
  font-size: 1.25rem;
  cursor: pointer;
}

.mobile-drawer {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 39;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 16px var(--gutter) 32px;
  background: var(--white);
  overflow-y: auto;
}

.mobile-drawer.is-open {
  display: flex;
}

.mobile-drawer a {
  padding: 14px 8px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--blue-950);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-drawer .btn {
  margin-top: 16px;
}

.site-footer {
  padding: 56px 0 32px;
  background: var(--blue-950);
  color: var(--blue-100);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.site-footer h2 {
  margin-bottom: 12px;
  color: var(--white);
  font-size: 1rem;
}

/* 頁尾的書法標誌：深藍底上反白（墨色與印章一律轉白） */
.footer-logo {
  display: block;
  width: auto;
  height: 112px;
  margin-bottom: 2px;
  filter: brightness(0) invert(1);
}

.site-footer a {
  color: var(--blue-100);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.site-footer .btn-link {
  color: var(--white);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 0.15);
  color: var(--blue-200);
  font-size: 0.8125rem;
}

.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--blue-700);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.chat-launcher:hover {
  background: var(--blue-800);
}

.chat-launcher[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .main-nav,
  .header-actions .hide-mobile {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-actions .btn-primary {
    padding: 10px 14px;
    font-size: 0.875rem;
  }

  .brand-name small {
    display: none;
  }

  .chat-launcher {
    right: 12px;
    bottom: 12px;
    padding: 12px 16px;
  }
}

/* 手機版方案頁：Plan Finder 的「下一題」固定在底部，浮動按鈕會蓋住它，所以隱藏（頁首仍有申請試用） */
@media (max-width: 720px) {
  body[data-page='pricing'] .chat-launcher {
    display: none;
  }
}
