/* =========================================================
   BiBi3 Plus 4G Pet GPS Tracker — Electronic User Manual
   Two-tab manual layout: header with Manual / Illustrated
   Guide switch, hero, image+text teaser, sticky TOC, section
   cards, FAQ accordion and a fully illustrated guide page.
   ALL-BLUE accent palette, LIGHT theme.
   Mobile-first, no external dependencies.
   ========================================================= */

:root {
  --bg: #eef7fb;
  --bg-soft: #f4f9fc;
  --card: #ffffff;
  --card-soft: #f7fbfe;
  --text: #1d2939;
  --ink: #1d2939;
  --ink-2: #3a4c5c;
  --muted: #5d6b7a;
  --line: #d7e3ea;
  --blue: #66acd2;
  --blue-dark: #155a99;
  --blue-deep: #0f4a80;
  --blue-wash: #e8f5fc;
  --blue-line: #b9d9e8;
  --red: #c0392b;
  --ok: #2f7fd1;
  --shadow: 0 12px 34px rgba(21, 90, 153, .10);
  --shadow-soft: 0 4px 14px rgba(21, 90, 153, .07);
  --radius: 18px;
  --font: Arial, "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-bottom: 24px;
  color: var(--text);
  background: linear-gradient(180deg, #e6f4fb 0, #f6fbfd 420px, var(--bg) 100%);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 3px; }

.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--blue-dark); color: #fff; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* ---------------- top bar ---------------- */
.topbar {
  position: relative;
  position: -webkit-sticky;
  position: sticky;
  top: 0; z-index: 50;
  border-bottom: 1px solid rgba(21, 90, 153, .16);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(1120px, 100%); min-height: 52px; margin: 0 auto; padding: 0 18px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue-dark); }
.brand-mark svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { color: var(--blue-dark); font-size: 1.0625rem; font-weight: 900; letter-spacing: -.015em; }
.top-note { color: var(--muted); font-size: 0.8125rem; }
.top-link { color: var(--blue-dark); font-size: 0.8125rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(21,90,153,.3); padding-bottom: 1px; }
.top-link:hover { color: var(--blue); }

.manual-nav {
  display: flex; width: calc(100% - 32px); max-width: 480px;
  margin: 0 auto 8px; padding: 2px;
  border: 1px solid #e3eaed; border-radius: 12px; background: #f1f5f6;
}
.manual-nav button {
  flex: 1 1 0; min-width: 0; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px; border: 0; border-radius: 9px;
  background: transparent; color: #5d6b7a; font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.manual-nav button + button { margin-left: 4px; }
.manual-nav button.active { background: #fff; color: var(--blue-dark); font-weight: 700; box-shadow: 0 2px 7px rgba(21, 90, 153, .14); }
.manual-nav button:focus-visible { outline: 2px solid var(--blue-dark); outline-offset: 2px; }
.manual-nav button:focus:not(:focus-visible) { outline: none; }
.manual-nav svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- shared ---------------- */
.container { width: min(1120px, 100%); margin: 0 auto; padding: 22px 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
#manualPage, #guidePage { overflow-anchor: none; }

/* ---------------- hero ---------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 24px; overflow: hidden; padding: 30px;
}
.hero-copy { align-self: center; }
.eyebrow { display: inline-flex; padding: 6px 12px; border-radius: 999px; color: var(--blue-dark); background: var(--blue-wash); font-size: 0.8125rem; font-weight: 700; }
.hero h1 { margin: 14px 0 10px; color: var(--blue-dark); font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.25; letter-spacing: -.02em; }
.tagline { margin: 0; color: var(--blue-dark); font-size: clamp(1.0625rem, 2.6vw, 1.25rem); line-height: 1.45; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; padding: 0; list-style: none; }
.hero-chips li { padding: 5px 11px; border: 1px solid var(--blue-line); border-radius: 999px; color: var(--blue-deep); background: var(--blue-wash); font-size: 0.75rem; font-weight: 700; }

.watch-stage {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: center; gap: 4px; min-height: 300px; padding: 10px 2px;
}
.watch-stage img { width: 128%; max-width: none; margin-left: -14%; filter: drop-shadow(0 14px 16px rgba(32, 49, 61, .14)); }
.watch-stage img:first-child { margin-left: -4%; }
.watch-stage img:nth-child(3) { margin-left: -22%; }

/* ---------------- image + text teaser ---------------- */
.guide-teaser {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: center;
  margin-top: 18px; padding: 20px 24px;
}
.teaser-copy h2 { margin: 0 0 8px; color: var(--text); font-size: clamp(1.25rem, 2.6vw, 1.5rem); }
.teaser-copy p { margin: 0 0 16px; color: var(--muted); font-size: 0.9375rem; line-height: 1.65; }
.guide-link {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  padding: 11px 18px; border: 0; border-radius: 999px;
  color: #fff; background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(21, 90, 153, .25);
}
.guide-link::after { content: "→"; font-size: 1.1rem; line-height: 1; }
.teaser-figure { margin: 0; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 14px; background: var(--blue-wash); }
.teaser-figure img { width: 100%; height: calc(100% - 30px); object-fit: cover; }
.teaser-figure figcaption { height: 30px; padding: 6px 10px; color: var(--blue-deep); background: #fff; font-size: 0.75rem; text-align: center; }
.ad-slot { width: 100%; min-height: 1px; margin: 16px 0 0; overflow: hidden; }

/* ---------------- layout + TOC ---------------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.toc { position: sticky; top: 108px; align-self: start; padding: 18px; }
.toc h2 { margin: 0 0 12px; font-size: 1.125rem; color: var(--text); }
.toc a { display: block; padding: 9px 11px; border-radius: 10px; border-left: 3px solid transparent; color: #385064; text-decoration: none; font-size: 0.875rem; line-height: 1.35; transition: background .2s, color .2s; }
.toc a:hover, .toc a:focus-visible { color: var(--blue-dark); background: var(--blue-wash); outline: none; }
.toc a.active { color: var(--blue-dark); background: var(--blue-wash); border-left-color: var(--blue-dark); font-weight: 700; }
.toc .toc-sub { padding-left: 25px; color: #61798b; font-size: 0.8125rem; }
.manual-content { display: grid; min-width: 0; gap: 18px; }
.section, .toc { min-width: 0; }
.section { padding: clamp(20px, 3.2vw, 34px); }
.section > h2 {
  margin: 0 0 22px; padding: 11px 18px; border-radius: 999px;
  color: #fff; background: linear-gradient(90deg, #4e9dc7, var(--blue-dark), #4e9dc7);
  text-align: center; font-size: clamp(1.375rem, 3vw, 1.875rem);
}
.section h3 { margin: 25px 0 10px; color: #16232d; font-size: 1.25rem; scroll-margin-top: 120px; }
.section h4 { margin: 20px 0 8px; font-size: 1.0625rem; }
.section p, .section li { color: #2b3945; font-size: 1rem; line-height: 1.82; }
.section p { margin: 8px 0; }
.section ol, .section ul { margin: 8px 0; padding-left: 24px; }

/* feature list */
.feature-list { display: grid; gap: 12px; }
.feature-item { padding: 15px 17px; border: 1px solid #dceaf1; border-radius: 14px; background: #f8fcfe; }
.feature-item strong { display: block; margin-bottom: 4px; color: var(--blue-dark); font-size: 1.0625rem; }
.feature-item p { margin: 0; }

/* diagrams */
.diagram-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.diagram-card { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; text-align: center; }
.diagram-card img { width: 100%; height: 200px; object-fit: contain; }
.diagram-card figcaption { margin-top: 8px; font-weight: 700; color: var(--blue-dark); }
.bracelet-main { display: block; width: min(460px, 100%); max-height: 380px; margin: 0 auto 18px; object-fit: contain; }

/* notes and warnings */
.warning { padding: 14px 16px; border-left: 4px solid var(--red); border-radius: 10px; color: #92202b !important; background: #fff4f5; }
.note-box { padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; background: #f4fafd; }

/* tables */
.table-wrap { width: 100%; margin: 18px 0; overflow-x: auto; border-radius: 12px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; background: #fff; }
th, td { padding: 11px 12px; border: 1px solid #b9c8d1; text-align: left; font-size: 0.9375rem; line-height: 1.45; }
th { color: #173b50; background: var(--blue-wash); }

/* spec list */
.spec-list { display: grid; grid-template-columns: 1fr 1.5fr; margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.spec-list dt, .spec-list dd { margin: 0; padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.6; }
.spec-list dt { font-weight: 700; background: #f4fafc; color: var(--text); }
.spec-list dd { color: var(--ink-2); }
.spec-list dt:last-of-type, .spec-list dd:last-of-type { border-bottom: 0; }

/* charging */
.charge-main { display: block; width: min(560px, 100%); margin: 14px auto; }
.charge-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.charge-pair figure { margin: 0; text-align: center; }
.charge-pair img { width: 100%; height: 240px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.charge-pair figcaption { margin-top: 8px; font-size: 1.0625rem; font-weight: 700; }
.ok { color: var(--ok); }
.bad { color: #a82631; }

/* ---------------- FAQ accordion ---------------- */
.faq-list { display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; overflow: hidden; }
.faq-item summary {
  display: flex; align-items: center; gap: 10px; min-height: 50px;
  padding: 13px 48px 13px 17px; cursor: pointer; list-style: none;
  color: var(--blue-dark); font-weight: 700; font-size: 1.0625rem; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  color: var(--blue-dark); background: var(--blue-wash); font-size: 1.125rem; line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0; padding: 0 17px 16px; color: #2b3945; font-size: 0.9375rem; line-height: 1.78; }

/* ---------------- illustrated guide page ---------------- */
.guide-page { min-height: calc(100vh - 180px); }
.guide-head { padding: 26px; text-align: center; }
.guide-head h1, .guide-head h2, .guide-title { margin: 12px 0 8px; color: var(--blue-dark); font-size: clamp(1.5rem, 3.4vw, 2rem); }
.guide-head p { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: 0.9375rem; line-height: 1.7; }
.guide-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.guide-jump a {
  padding: 8px 13px; border: 1px solid var(--blue-line); border-radius: 999px;
  color: var(--blue-deep); background: var(--blue-wash); text-decoration: none; font-size: 0.8125rem; font-weight: 700;
}
.guide-jump a:hover { color: #fff; background: var(--blue-dark); }
.guide-list { display: grid; gap: 18px; margin-top: 18px; }
.guide-step {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: center;
  padding: 22px; scroll-margin-top: 112px;
}
.guide-step:nth-child(even) .guide-media { order: 2; }
.guide-media { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--blue-wash); }
.guide-media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.guide-media figcaption { padding: 8px 12px; color: var(--blue-deep); background: #fff; font-size: 0.75rem; text-align: center; }
.step-badge { display: inline-flex; padding: 5px 11px; border-radius: 999px; color: #fff; background: var(--blue-dark); font-size: 0.75rem; font-weight: 700; }
.guide-copy h2, .guide-copy h3 { margin: 10px 0; color: var(--text); font-size: clamp(1.25rem, 2.6vw, 1.5rem); }
.guide-copy p { margin: 8px 0; color: #2b3945; font-size: 0.9375rem; line-height: 1.78; }

/* ---------------- footer ---------------- */
.site-footer { margin-top: 26px; border-top: 1px solid var(--line); background: var(--bg-soft); text-align: center; }
.site-footer p { margin: 0; padding: 7px 18px; color: var(--muted); font-size: 0.8125rem; }
.site-footer a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- more guides ---------------- */
.more-guides > p { margin-bottom: 16px; }
.guide-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.guide-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 17px; border: 1px solid #dceaf1; border-radius: 14px;
  background: #f8fcfe; text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.guide-card:hover { border-color: var(--blue-line); background: #f1f9fd; }
.guide-card-kicker {
  color: var(--muted); font-size: 0.6875rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.guide-card strong { color: var(--blue-dark); font-size: 1rem; line-height: 1.35; }
.guide-card span:last-child { color: #2b3945; font-size: 0.875rem; line-height: 1.6; }

/* ---------------- footer nav ---------------- */
.footer-nav {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center;
  padding: 13px 18px 3px;
}
.footer-nav a { color: var(--blue-dark); font-size: 0.8125rem; font-weight: 700; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

/* ---------------- cookie notice ---------------- */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: center;
  padding: 12px 18px; background: #0f2f4a; color: #eaf4fa; font-size: 0.8125rem;
  box-shadow: 0 -6px 24px rgba(15, 47, 74, .22);
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; max-width: 620px; line-height: 1.55; }
.cookie-bar a { color: #bcdcf0; text-decoration: underline; }
.cookie-bar button {
  flex: 0 0 auto; padding: 7px 16px; border: 1px solid #6fa8c9; border-radius: 999px;
  background: #1b4a70; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.cookie-bar button:hover { background: #256089; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  html { scroll-padding-top: 96px; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .hero-copy { text-align: center; }
  .hero-chips { justify-content: center; }
  .watch-stage { width: min(560px, 100%); min-height: 240px; margin: 0 auto; }
  .guide-teaser { grid-template-columns: 1fr; text-align: center; }
  .guide-link { margin: 0 auto; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .toc h2 { grid-column: 1 / -1; }
  .section h3 { scroll-margin-top: 110px; }
  .guide-step { grid-template-columns: 1fr; gap: 16px; }
  .guide-step:nth-child(even) .guide-media { order: 0; }
}

@media (max-width: 560px) {
  .top-note { display: none; }
  .container { padding: 14px 10px; }
  .topbar-inner { padding: 0 14px; }
  .brand-name { font-size: 0.9688rem; }
  .manual-nav { width: calc(100% - 20px); }
  .manual-nav button { gap: 5px; padding: 8px 6px; font-size: 0.8125rem; }
  .manual-nav svg { width: 17px; height: 17px; }
  .hero { gap: 8px; padding: 20px 14px; }
  .hero h1 { font-size: 1.6rem; }
  .watch-stage { min-height: 150px; }
  .guide-teaser { padding: 18px; }
  .guide-head { padding: 20px 14px; }
  .guide-step { padding: 16px; }
  .toc { grid-template-columns: 1fr; padding: 14px; }
  .section { padding: 18px 14px; border-radius: 14px; }
  .section > h2 { border-radius: 15px; }
  .diagram-grid, .charge-pair { grid-template-columns: 1fr; }
  .diagram-card img { height: 180px; }
  .charge-pair img { height: 210px; }
  .spec-list { grid-template-columns: minmax(105px, .75fr) 1.25fr; }
  .spec-list dt, .spec-list dd { padding: 11px 10px; font-size: 0.875rem; overflow-wrap: anywhere; }
  .section p, .section li { font-size: 0.9375rem; }
  .faq-item summary { font-size: 0.9375rem; padding-right: 42px; }
}

@media (max-width: 340px) {
  .hero h1 { font-size: 1.4rem; }
  .tagline { font-size: 0.9375rem; }
  .section { padding: 16px 12px; }
  .manual-nav button span { font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  body { background: #fff; }
  .topbar, .guide-link, .ad-slot, .guide-jump { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .container { width: 100%; padding: 0; }
  .faq-item:not([open]) > *:not(summary) { display: block; }
}

/* compact cookie notice on small screens */
@media (max-width: 560px) {
  .cookie-bar { padding: 10px 13px; gap: 8px 12px; font-size: 0.75rem; }
  .cookie-bar p { max-width: none; }
  .cookie-bar button { padding: 6px 14px; }
}
