/**
 * HK Bug Buster / 滅絕師傅 — 多頁官網樣式
 * 方向：沿用 logo 的白底、深海軍藍、藍綠與柔和綠；減少大面積漸層與「SaaS 模板」感
 */

:root {
  --color-page: #f7fbfa;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-muted: #4d6670;
  --color-border: #dbe7e6;
  --color-navy: #022a50;
  --color-primary: #154b7b;
  --color-primary-hover: #022a50;
  --color-accent: #2f7d72;
  --color-accent-hover: #16788d;
  --color-accent-soft: #d8eee8;
  --color-logo-green: #49a271;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "Noto Sans SC", "PingFang HK", "Microsoft JhengHei", sans-serif;
  --max-width: 1080px;
  --max-prose: 42rem;
  --header-height: 60px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-page);
}

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

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

a:hover {
  color: var(--color-accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.65rem 1rem;
  background: var(--color-navy);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--color-navy);
}

.brand:hover {
  color: var(--color-navy);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  background: #fff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--color-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.45rem 0.55rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent-soft);
}

.site-nav a.is-active {
  color: var(--color-navy);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 1rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--color-border);
}

.lang-switch a {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-muted);
  border-bottom: none;
}

.lang-switch a[aria-current="true"] {
  background: var(--color-navy);
  color: #fff;
}

.lang-switch a:hover:not([aria-current="true"]) {
  background: #edf7f4;
  color: var(--color-text);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  background: var(--color-page);
  color: var(--color-primary);
}

/* ----- Page shell ----- */
.page-wrap {
  min-height: 60vh;
}

.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

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

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

.page-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 1.25rem 2.25rem;
}

.page-hero--tint {
  background: linear-gradient(180deg, #edf7f4 0%, #ffffff 58%);
  border-bottom-color: var(--color-accent-soft);
}

.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 3.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-navy);
  line-height: 1.2;
}

.page-hero .lead {
  margin: 0;
  max-width: 40rem;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.page-hero .hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Home: compact intro row */
.home-intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

.home-intro h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: var(--color-navy);
}

.home-intro p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.home-aside {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.home-aside h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--color-navy);
}

.home-aside ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* About page */
.about-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
  padding: 2rem 1.25rem;
}

.about-panel-main {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.about-facts {
  display: grid;
  gap: 0.75rem;
}

.about-facts div {
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem;
}

.about-facts strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}

.about-facts span {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-accent-soft);
  font-size: 0.8rem;
}

.commitment-grid,
.sector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.commitment-card,
.sector-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.commitment-card h3,
.sector-card h3 {
  margin: 0 0 0.5rem;
  color: var(--color-navy);
  font-size: 1rem;
}

.commitment-card p,
.sector-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Reference clients / logo wall */
.client-sections {
  display: grid;
  gap: 1.05rem;
}

.client-section {
  background: var(--color-surface);
  border: 1px solid #d8e4e7;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: none;
}

.client-category-title {
  display: block;
  margin: 0;
  padding: 0.36rem 0.75rem;
  background: #076a9f;
  border-bottom: 1px solid #075d8b;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.client-logo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem 1.6rem;
  padding: 1.45rem 1.3rem 1.6rem;
  background: #fff;
}

.client-logo-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: #fff;
  padding: 0.45rem 0.35rem;
}

.client-logo-img {
  width: 100%;
  max-width: 150px;
  height: 72px;
  object-fit: contain;
}

.client-logo-card span {
  color: #6b7a80;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

/* Service cards on home */
.section {
  padding: 2.5rem 1.25rem;
}

.section-muted {
  background: #eef6f3;
  border-block: 1px solid var(--color-border);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.photo-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem auto;
}

.photo-row--overlap {
  margin-top: -1.25rem;
  position: relative;
  z-index: 2;
  padding: 0 1.25rem;
}

.photo-card {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.photo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.photo-card figcaption {
  padding: 0.65rem 0.85rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.photo-card--wide img {
  height: 260px;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-navy);
}

.section-head p {
  margin: 0;
  color: var(--color-muted);
  max-width: 46rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.service-card:hover {
  border-color: var(--color-logo-green);
  box-shadow: var(--shadow-md);
}

.service-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}

.service-card-body {
  padding: 1.1rem 1.15rem 1.2rem;
}

.service-card-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--color-navy);
}

.service-card-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.service-card-body .more {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ----- Document layout (service pages) ----- */
.doc-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2.5rem;
  align-items: start;
}

.doc-main {
  min-width: 0;
}

.doc-aside {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  background: var(--color-surface);
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
}

.doc-aside h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--color-navy);
}

.doc-aside .btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

.doc-aside p {
  margin: 0 0 0.75rem;
  color: var(--color-muted);
}

.toc {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.75rem;
  background: var(--color-page);
}

.toc strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toc ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.875rem;
}

.toc a {
  color: var(--color-muted);
  text-decoration: none;
}

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

.special-points {
  border: 1px solid var(--color-accent-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #edf7f4 0%, #ffffff 100%);
  padding: 1rem;
  margin: 0 0 1.5rem;
}

.special-points h2 {
  margin-top: 0;
}

.special-point-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.special-point {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.special-point strong {
  display: block;
  color: var(--color-navy);
  margin-bottom: 0.3rem;
}

.special-point p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.prose {
  max-width: var(--max-prose);
}

.prose > h2 {
  margin: 2rem 0 0.6rem;
  font-size: 1.25rem;
  color: var(--color-navy);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose > h3 {
  margin: 1.35rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--color-text);
}

.prose p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--color-muted);
}

.prose li + li {
  margin-top: 0.25rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0 0 1rem;
}

.prose th,
.prose td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.prose th {
  background: var(--color-page);
  color: var(--color-navy);
  font-weight: 600;
}

.callout {
  border-left: 4px solid var(--color-accent);
  background: #edf7f4;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.callout strong {
  color: var(--color-navy);
}

.direct-answer {
  border: 1px solid rgba(47, 125, 114, 0.28);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #edf7f4 100%);
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
  box-shadow: var(--shadow-sm);
}

.direct-answer h2 {
  margin: 0 0 0.4rem;
  color: var(--color-navy);
  font-size: 1.05rem;
}

.direct-answer p {
  margin: 0;
  color: var(--color-primary);
  font-weight: 600;
}

/* FAQ */
.faq-list details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--color-surface);
}

.faq-list summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
}

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

.faq-list summary::after {
  content: "+";
  float: right;
  color: var(--color-accent);
  font-weight: 800;
}

.faq-list details[open] summary::after {
  content: "\2212";
}

.faq-list .faq-a {
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 2rem 1.25rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
}

.footer-brand {
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 0.35rem;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--color-muted);
  text-decoration: none;
}

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

.footer-copy {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
}

/* Mobile CTA bar */
.cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: none;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.06);
  gap: 0.5rem;
  justify-content: center;
}

.cta-bar .btn {
  flex: 1;
  max-width: 200px;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.25rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .lang-switch {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
  }

  .home-intro {
    grid-template-columns: 1fr;
  }

  .about-panel,
  .commitment-grid,
  .sector-grid,
  .special-point-grid,
  .photo-row {
    grid-template-columns: 1fr;
  }

  .client-logo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-aside {
    position: static;
  }

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

  .cta-bar {
    display: flex;
  }

  body {
    padding-bottom: 72px;
  }
}

@media (max-width: 560px) {
  .client-logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 1rem 0.8rem 1.1rem;
  }

  .client-logo-card {
    min-height: 118px;
  }

  .client-logo-img {
    max-width: 132px;
    height: 62px;
  }
}
