
:root{
  --bg:#f5f7fb;
  --surface:#ffffff;
  --text:#172033;
  --muted:#64748b;
  --line:#e5e7eb;
  --accent:#2856d6;
  --accent-soft:#eaf0ff;
  --shadow:0 14px 40px rgba(15,23,42,.08);
  --radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.75;
}
img{max-width:100%;height:auto;border-radius:14px;display:block;margin:1rem auto}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.site-header{
  position:sticky;top:0;z-index:100;
  display:flex;align-items:center;gap:18px;
  padding:12px clamp(16px,4vw,48px);
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(226,232,240,.9);
}
.brand{display:flex;align-items:center;gap:10px;color:var(--text);min-width:max-content}
.brand:hover{text-decoration:none}
.brand-mark{
  width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;
  color:white;background:linear-gradient(145deg,#2856d6,#1d4ed8);
  font-weight:800;
}
.brand span:last-child{display:flex;flex-direction:column;line-height:1.15}
.brand small{font-weight:500;color:var(--muted);font-size:.72rem;margin-top:4px}
.site-nav{display:flex;gap:4px;overflow:auto;margin-left:auto;white-space:nowrap}
.site-nav a{padding:8px 10px;border-radius:10px;color:#334155;font-size:.9rem}
.site-nav a:hover{background:var(--accent-soft);text-decoration:none}
.site-nav .nav-level-1{display:block}
.site-nav .nav-level-2{display:none}
.menu-btn{display:none;margin-left:auto;border:1px solid var(--line);background:white;border-radius:10px;padding:8px 12px}
.hero{
  background:
    radial-gradient(circle at 84% 20%,rgba(255,255,255,.22),transparent 28%),
    linear-gradient(135deg,#173a9c,#2856d6 55%,#4b6ee7);
  color:white;
  padding:clamp(56px,9vw,110px) 20px;
}
.hero-inner{max-width:1100px;margin:auto}
.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-weight:700;opacity:.82;font-size:.82rem}
.hero h1{font-size:clamp(2.4rem,7vw,5.4rem);line-height:1.02;margin:.25rem 0 .5rem}
.hero-cn{font-size:clamp(1.25rem,3vw,2rem);margin:0 0 1rem;font-weight:650}
.hero-copy{max-width:740px;font-size:clamp(1rem,2.1vw,1.18rem);opacity:.92}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}
.button{display:inline-flex;padding:11px 16px;border-radius:12px;font-weight:700}
.button:hover{text-decoration:none}
.button.primary{background:white;color:#173a9c}
.button.ghost{border:1px solid rgba(255,255,255,.45);color:white}
.layout{
  max-width:1240px;margin:0 auto;
  display:grid;grid-template-columns:240px minmax(0,1fr);
  gap:32px;padding:34px 20px 70px;
}
.toc{
  position:sticky;top:84px;align-self:start;
  max-height:calc(100vh - 104px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);
}
.toc-title{font-weight:800;margin-bottom:9px}
.toc a{display:block;padding:8px 9px;border-radius:9px;color:#475569;font-size:.91rem}
.toc a:hover,.toc a.active{background:var(--accent-soft);color:var(--accent);text-decoration:none}
.toc .toc-level-1{font-weight:750;color:#334155;margin-top:4px}
.toc .toc-level-2{padding-left:20px;font-size:.86rem;color:#64748b}
.toc::-webkit-scrollbar{width:7px}
.toc::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
.toc::-webkit-scrollbar-track{background:transparent}
.content{
  min-width:0;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:clamp(20px,4vw,46px);
  box-shadow:var(--shadow);
}
.notice{
  padding:16px 18px;border:1px solid #bfdbfe;background:#eff6ff;
  border-radius:14px;margin-bottom:30px;color:#1e3a8a;
}
.content h1,.content h2,.content h3{scroll-margin-top:96px;line-height:1.3}
.content h1{font-size:2rem;margin:2rem 0 1rem}
.content h2{
  margin:2.8rem 0 1rem;padding-top:1rem;border-top:1px solid var(--line);
  font-size:1.55rem;
}
.content h3{font-size:1.16rem;margin:2rem 0 .75rem}
.content p{margin:.75rem 0}
.content ul,.content ol{padding-left:1.35rem}
.content table{
  width:100%;border-collapse:collapse;display:block;overflow-x:auto;
  border:1px solid var(--line);border-radius:12px;margin:1rem 0 1.5rem;
}
.content th,.content td{border-bottom:1px solid var(--line);padding:10px 12px;text-align:left;vertical-align:top}
.content th{background:#f8fafc}
.content blockquote{margin:1rem 0;padding:12px 16px;border-left:4px solid var(--accent);background:#f8fafc}
.content figure{margin:1.5rem 0}
.content figcaption{text-align:center;color:var(--muted);font-size:.9rem;margin-top:.5rem}
footer{max-width:1240px;margin:auto;padding:0 20px 46px;color:#475569}
footer p{margin:.25rem 0}
.muted{color:var(--muted);font-size:.9rem}
.to-top{
  position:fixed;right:18px;bottom:18px;width:44px;height:44px;border:0;border-radius:50%;
  background:#172033;color:white;box-shadow:var(--shadow);font-size:1.1rem;
  opacity:0;pointer-events:none;transition:.2s;
}
.to-top.show{opacity:1;pointer-events:auto}
@media (max-width:900px){
  .site-nav{
    display:none;
    position:absolute;
    left:12px;
    right:12px;
    top:68px;
    flex-direction:column;
    background:#fff;
    border:1px solid var(--line);
    padding:10px;
    border-radius:14px;
    box-shadow:var(--shadow);
    max-height:70vh;
    overflow-y:auto;
    overscroll-behavior:contain;
    z-index:200;
  }
  .site-nav.open{display:flex}
  .site-nav .nav-level-1{
    display:block;
    font-weight:750;
    color:#334155;
    padding:10px 12px 6px;
  }
  .site-nav .nav-level-2{
    display:block;
    padding:7px 12px 7px 28px;
    font-size:.88rem;
    color:#64748b;
  }
  .menu-btn{display:block}
  .layout{grid-template-columns:1fr;padding:16px 12px 50px}
  .toc{
    display:block;
    position:relative;
    top:auto;
    max-height:42vh;
    overflow-y:auto;
    overscroll-behavior:contain;
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:14px;
    box-shadow:var(--shadow);
    margin-bottom:14px;
  }
  .toc-title{
    position:sticky;top:0;z-index:2;
    background:#fff;padding-bottom:8px;
  }
  .toc .toc-level-1{display:block;font-weight:750;color:#334155}
  .toc .toc-level-2{display:block;padding-left:20px;font-size:.88rem;color:#64748b}
  .content{padding:20px 17px}
  .hero{padding:52px 18px}
}
@media (max-width:520px){
  body{font-size:15px}
  .brand small{display:none}
  .brand b{font-size:.96rem}
  .hero h1{font-size:2.55rem}
  .content table{font-size:.9rem}
}
@media print{
  .site-header,.toc,.to-top,.hero-actions{display:none!important}
  body{background:white}
  .hero{color:black;background:white;padding:20px 0}
  .layout{display:block;padding:0}
  .content{border:0;box-shadow:none;padding:0}
}


/* ExplorerMemo homepage contact footer */
.site-footer{
  max-width:1240px;
  margin:0 auto;
  padding:0 20px 46px;
  color:#475569;
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding-top:26px;
  border-top:1px solid var(--line);
}
.footer-brand{
  margin:0 0 4px;
  font-weight:800;
  color:var(--text);
}
.footer-contact{
  display:flex;
  align-items:center;
  gap:12px;
}
.footer-label{
  color:var(--muted);
  font-size:.9rem;
}
.footer-linktree{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-weight:750;
  box-shadow:0 6px 20px rgba(15,23,42,.06);
}
.footer-linktree:hover{
  text-decoration:none;
  background:var(--accent-soft);
  color:var(--accent);
}

/* Aberdeen back-to-home control */
.home-back{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:40px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:#334155;
  font-weight:750;
  white-space:nowrap;
}
.home-back:hover{
  text-decoration:none;
  background:var(--accent-soft);
  color:var(--accent);
}
.home-back-icon{
  font-size:1.05rem;
  line-height:1;
}

@media (max-width:900px){
  .footer-inner{
    align-items:flex-start;
    flex-direction:column;
  }
  .footer-contact{
    width:100%;
    justify-content:space-between;
  }
  .footer-linktree{
    min-width:112px;
  }
  .home-back{
    margin-left:auto;
  }
  .home-back-text{
    display:none;
  }
  .home-back{
    width:42px;
    padding:8px;
    justify-content:center;
  }
}


.footer-copy{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.86rem;
}
.global-footer{
  margin-top:18px;
}

/* Aberdeen photographic hero */
.aberdeen-visual-hero{background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%);color:var(--text);padding:clamp(36px,6vw,72px) 20px;overflow:hidden}
.aberdeen-hero-grid{width:min(1240px,100%);margin:auto;display:grid;grid-template-columns:minmax(0,.9fr) minmax(520px,1.35fr);gap:clamp(28px,5vw,64px);align-items:center}
.hero-kicker{margin:0 0 12px;font-size:.78rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--accent)}
.aberdeen-visual-hero h1{margin:.1rem 0 .45rem;font-size:clamp(2.5rem,5.6vw,5.2rem);line-height:.98;color:#122033}
.aberdeen-visual-hero .hero-cn{margin:0 0 1rem;font-size:clamp(1.2rem,2.5vw,1.85rem);font-weight:700;color:#334155}
.aberdeen-visual-hero .hero-copy{max-width:650px;color:#536176;opacity:1}
.aberdeen-visual-hero .button.primary{background:var(--accent);color:white;box-shadow:0 10px 24px rgba(40,86,214,.22)}
.aberdeen-visual-hero .button.ghost{border:1px solid #cbd5e1;background:white;color:#334155}
.aberdeen-hero-collage{position:relative;min-height:480px}
.hero-photo{margin:0;overflow:hidden;background:white;box-shadow:0 24px 60px rgba(15,23,42,.16)}
.hero-photo img{width:100%;height:100%;object-fit:cover;margin:0;border-radius:0}
.hero-photo-main{position:absolute;inset:0 18% 9% 0;border-radius:26px;transform:rotate(-1deg)}
.hero-photo-secondary{position:absolute;width:47%;height:46%;right:0;bottom:0;border:8px solid white;border-radius:20px;transform:rotate(1.5deg)}
@media(max-width:1000px){.aberdeen-hero-grid{grid-template-columns:1fr}.aberdeen-hero-collage{min-height:420px}}
@media(max-width:700px){.aberdeen-visual-hero{padding:28px 14px 34px}.aberdeen-hero-grid{gap:24px}.aberdeen-hero-collage{min-height:330px}.hero-photo-main{inset:0 8% 14% 0;border-radius:20px}.hero-photo-secondary{width:50%;height:43%;border-width:5px;border-radius:16px}}

/* Language switch */
.lang-switch{display:flex;align-items:center;gap:4px;padding:4px;border:1px solid var(--line);background:#fff;border-radius:12px;white-space:nowrap}.lang-option{display:inline-flex;align-items:center;min-height:34px;padding:6px 10px;border-radius:9px;color:#64748b;font-size:.84rem;font-weight:700}.lang-option:hover{text-decoration:none;background:#f8fafc;color:var(--text)}.lang-option.active{background:var(--accent-soft);color:var(--accent)}@media(max-width:900px){.lang-switch{margin-left:auto}.lang-option{font-size:.8rem;padding:6px 8px}.home-back + .lang-switch{margin-left:0}}@media(max-width:560px){.lang-switch{gap:2px;padding:3px}.lang-option{font-size:.75rem;padding:5px 7px}}


/* Mobile secondary-page header fix:
   keep brand visible while putting language + contents on a second row */
@media (max-width:900px){
  .site-header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:
      "brand back"
      "language menu";
    gap:10px 12px;
    padding:10px 12px;
    overflow:visible;
  }

  .site-header > .brand{
    grid-area:brand;
    min-width:0;
    overflow:hidden;
  }

  .site-header > .brand > span:last-child{
    min-width:0;
  }

  .site-header > .brand b,
  .site-header > .brand small{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .site-header > .home-back{
    grid-area:back;
    margin-left:0;
    justify-self:end;
  }

  .site-header > .lang-switch{
    grid-area:language;
    margin-left:0;
    justify-self:start;
    max-width:100%;
  }

  .site-header > .menu-btn{
    grid-area:menu;
    display:block;
    margin-left:0;
    justify-self:end;
    min-height:42px;
  }

  .site-header > .site-nav{
    top:calc(100% + 8px);
    left:12px;
    right:12px;
    max-height:min(68vh,560px);
  }
}

@media (max-width:520px){
  .site-header{
    grid-template-columns:minmax(0,1fr) auto;
    gap:9px 10px;
  }

  .site-header > .brand small{
    display:none;
  }

  .site-header > .brand b{
    font-size:.95rem;
  }

  .site-header > .lang-switch .lang-option{
    font-size:.72rem;
    padding:5px 7px;
  }

  .site-header > .menu-btn{
    padding:8px 10px;
  }
}


/* Compact mobile secondary-page controls */
@media (max-width:900px){
  .site-header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto auto;
    grid-template-areas:"brand back language menu";
    align-items:center;
    gap:8px;
    padding:10px 12px;
  }

  .site-header > .brand{grid-area:brand;min-width:0}
  .site-header > .home-back{grid-area:back;margin:0}
  .site-header > .lang-switch{grid-area:language;margin:0}
  .site-header > .menu-btn{grid-area:menu;margin:0}

  .site-header > .lang-switch{
    padding:0;
    border:0;
    background:transparent;
  }

  .site-header > .lang-switch .lang-current{
    display:none;
  }

  .site-header > .lang-switch .lang-other{
    display:inline-flex;
    width:42px;
    height:42px;
    min-height:42px;
    padding:0;
    align-items:center;
    justify-content:center;
    border:1px solid var(--line);
    border-radius:11px;
    background:#fff;
    color:var(--accent);
    font-size:.82rem;
    font-weight:800;
    box-shadow:none;
  }

  .site-header > .home-back{
    width:42px;
    height:42px;
    min-height:42px;
    padding:0;
    justify-content:center;
  }

  .site-header > .menu-btn{
    min-height:42px;
    height:42px;
    padding:0 11px;
    white-space:nowrap;
  }

  .site-header > .site-nav{
    top:calc(100% + 8px);
  }
}

@media (max-width:560px){
  .site-header{
    grid-template-columns:minmax(0,1fr) 42px 42px auto;
    gap:7px;
  }

  .site-header > .brand b{
    font-size:.92rem;
  }

  .site-header > .menu-btn{
    padding:0 10px;
    font-size:.82rem;
  }
}

/* End-of-guide return-home control */
.end-home{
  margin-top:3rem;
  padding-top:1.4rem;
  border-top:1px solid var(--line);
}
.end-home-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 15px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:#334155;
  font-weight:750;
}
.end-home-link:hover{
  text-decoration:none;
  background:var(--accent-soft);
  color:var(--accent);
}


/* Homepage mobile language control */
@media (max-width:900px){
  .home-header{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    overflow:visible;
  }

  .home-header > .brand{
    min-width:0;
    flex:1 1 auto;
  }

  .home-header > .site-nav{
    display:none;
  }

  .home-header > .home-lang-switch{
    flex:0 0 auto;
    margin-left:auto;
    padding:0;
    border:0;
    background:transparent;
  }

  .home-header > .home-lang-switch .lang-current{
    display:none;
  }

  .home-header > .home-lang-switch .lang-other{
    display:inline-flex;
    width:46px;
    height:42px;
    min-height:42px;
    padding:0;
    align-items:center;
    justify-content:center;
    border:1px solid var(--line);
    border-radius:11px;
    background:#fff;
    color:var(--accent);
    font-size:.82rem;
    font-weight:800;
  }
}

@media (max-width:520px){
  .home-header > .brand b{
    font-size:.96rem;
  }
  .home-header > .brand small{
    display:none;
  }
}


/* Light / dark theme */
:root{
  color-scheme:light;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0f1720;
  --surface:#151e29;
  --text:#edf2f7;
  --muted:#9aa8ba;
  --line:#2a3645;
  --accent:#7aa2ff;
  --accent-soft:#1d2a44;
  --shadow:0 14px 40px rgba(0,0,0,.28);
}
html[data-theme="dark"] body{
  background:var(--bg);
  color:var(--text);
}
html[data-theme="dark"] .site-header{
  background:rgba(15,23,32,.92);
  border-bottom-color:var(--line);
}
html[data-theme="dark"] .brand,
html[data-theme="dark"] .site-nav a,
html[data-theme="dark"] .home-back,
html[data-theme="dark"] .menu-btn,
html[data-theme="dark"] .lang-option,
html[data-theme="dark"] .theme-toggle{
  color:var(--text);
}
html[data-theme="dark"] .home-back,
html[data-theme="dark"] .menu-btn,
html[data-theme="dark"] .lang-switch,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .footer-linktree,
html[data-theme="dark"] .end-home-link{
  background:var(--surface);
  border-color:var(--line);
}
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .toc,
html[data-theme="dark"] .content,
html[data-theme="dark"] .menu-card{
  background:var(--surface);
  border-color:var(--line);
}
html[data-theme="dark"] .toc-title{
  background:var(--surface);
}
html[data-theme="dark"] .toc .toc-level-1,
html[data-theme="dark"] .site-nav .nav-level-1,
html[data-theme="dark"] .menu-card{
  color:var(--text);
}
html[data-theme="dark"] .toc .toc-level-2,
html[data-theme="dark"] .site-nav .nav-level-2,
html[data-theme="dark"] .menu-card p,
html[data-theme="dark"] .section-lead,
html[data-theme="dark"] .muted{
  color:var(--muted);
}
html[data-theme="dark"] .notice{
  background:#17243a;
  border-color:#2f4b73;
  color:#d7e5ff;
}
html[data-theme="dark"] .aberdeen-visual-hero{
  background:linear-gradient(180deg,#101925 0%,#152033 100%);
}
html[data-theme="dark"] .aberdeen-visual-hero h1,
html[data-theme="dark"] .aberdeen-visual-hero .hero-cn{
  color:var(--text);
}
html[data-theme="dark"] .aberdeen-visual-hero .hero-copy{
  color:var(--muted);
}
html[data-theme="dark"] .aberdeen-visual-hero .button.ghost{
  background:var(--surface);
  color:var(--text);
  border-color:var(--line);
}
html[data-theme="dark"] .hero-photo-secondary{
  border-color:var(--surface);
}
html[data-theme="dark"] .content th{
  background:#1a2532;
}
html[data-theme="dark"] .content blockquote{
  background:#17202c;
}
html[data-theme="dark"] footer{
  color:var(--muted);
}
html[data-theme="dark"] .footer-brand{
  color:var(--text);
}

.theme-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  min-width:42px;
  min-height:42px;
  padding:0;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:#334155;
  cursor:pointer;
  font:inherit;
}
.theme-toggle:hover{
  background:var(--accent-soft);
  color:var(--accent);
}
.theme-icon{
  font-size:1.05rem;
  line-height:1;
}
.theme-icon-moon{display:none}
html[data-theme="dark"] .theme-icon-sun{display:none}
html[data-theme="dark"] .theme-icon-moon{display:inline}

@media (max-width:900px){
  /* Secondary pages: brand | back | language | theme | menu */
  .site-header:not(.home-header){
    grid-template-columns:minmax(0,1fr) 42px 42px 42px auto;
    grid-template-areas:"brand back language theme menu";
    gap:7px;
  }
  .site-header:not(.home-header) > .theme-toggle{
    grid-area:theme;
    margin:0;
  }

  /* Homepage: brand | language | theme */
  .home-header{
    display:flex;
    align-items:center;
    gap:8px;
  }
  .home-header > .theme-toggle{
    flex:0 0 42px;
    margin:0;
  }
}


/* Unified hamburger contents menu for Aberdeen pages */
.hamburger-btn{
  display:inline-flex;
  width:42px;
  height:42px;
  min-width:42px;
  min-height:42px;
  padding:0;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:4px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
}
.hamburger-line{
  display:block;
  width:18px;
  height:2px;
  border-radius:999px;
  background:currentColor;
  transition:transform .18s ease, opacity .18s ease;
}
.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(1){
  transform:translateY(6px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(2){
  opacity:0;
}
.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(3){
  transform:translateY(-6px) rotate(-45deg);
}

/* On secondary pages, use the hamburger menu on desktop and mobile alike */
.site-header:not(.home-header) > .menu-btn{
  display:inline-flex;
}
.site-header:not(.home-header) > .site-nav{
  display:none;
  position:absolute;
  right:clamp(16px,4vw,48px);
  top:calc(100% + 8px);
  left:auto;
  width:min(390px,calc(100vw - 24px));
  max-height:min(72vh,640px);
  overflow-y:auto;
  overscroll-behavior:contain;
  flex-direction:column;
  white-space:normal;
  padding:10px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:var(--shadow);
  z-index:220;
}
.site-header:not(.home-header) > .site-nav.open{
  display:flex;
}
.site-header:not(.home-header) > .site-nav .nav-level-1,
.site-header:not(.home-header) > .site-nav .nav-level-2{
  display:block;
}
.site-header:not(.home-header) > .site-nav .nav-level-1{
  font-weight:750;
  padding:10px 12px 6px;
}
.site-header:not(.home-header) > .site-nav .nav-level-2{
  padding:7px 12px 7px 28px;
  font-size:.88rem;
  color:var(--muted);
}

html[data-theme="dark"] .hamburger-btn{
  background:var(--surface);
  border-color:var(--line);
  color:var(--text);
}

@media (max-width:900px){
  .site-header:not(.home-header) > .site-nav{
    left:12px;
    right:12px;
    width:auto;
    top:calc(100% + 8px);
  }
}


/* Secondary page controls: hamburger left, search right */
.search-btn{
  display:inline-flex;
  width:42px;
  height:42px;
  min-width:42px;
  min-height:42px;
  padding:0;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
}
.search-btn svg,
.search-box-icon{
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
}
.search-btn:hover{
  background:var(--accent-soft);
  color:var(--accent);
}

.site-header:not(.home-header){
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto auto auto 42px;
  grid-template-areas:"menu brand back language theme search";
  align-items:center;
  gap:10px;
}
.site-header:not(.home-header) > .hamburger-btn{
  grid-area:menu;
  margin:0;
}
.site-header:not(.home-header) > .brand{
  grid-area:brand;
  min-width:0;
}
.site-header:not(.home-header) > .home-back{grid-area:back;margin:0}
.site-header:not(.home-header) > .lang-switch{grid-area:language;margin:0}
.site-header:not(.home-header) > .theme-toggle{grid-area:theme;margin:0}
.site-header:not(.home-header) > .search-btn{grid-area:search;margin:0}

.site-header:not(.home-header) > .site-nav{
  left:clamp(16px,4vw,48px);
  right:auto;
  top:calc(100% + 8px);
  width:min(390px,calc(100vw - 24px));
}

.search-panel{
  position:absolute;
  right:clamp(16px,4vw,48px);
  top:calc(100% + 8px);
  width:min(460px,calc(100vw - 24px));
  max-height:min(70vh,620px);
  overflow:hidden;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:var(--shadow);
  z-index:230;
}
.search-panel[hidden]{display:none}
.search-box{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px;
  border-bottom:1px solid var(--line);
}
.search-box-icon{
  flex:0 0 auto;
  color:var(--muted);
}
.search-input{
  min-width:0;
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-size:.95rem;
}
.search-input::placeholder{color:var(--muted)}
.search-close{
  width:34px;
  height:34px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  font-size:1.35rem;
  cursor:pointer;
}
.search-close:hover{
  background:var(--accent-soft);
  color:var(--accent);
}
.search-results{
  max-height:min(58vh,520px);
  overflow-y:auto;
  padding:8px;
}
.search-empty{
  margin:0;
  padding:16px 12px;
  color:var(--muted);
  font-size:.9rem;
}
.search-result{
  display:block;
  width:100%;
  padding:10px 12px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.search-result:hover{
  background:var(--accent-soft);
}
.search-result-title{
  display:block;
  font-weight:750;
  margin-bottom:3px;
}
.search-result-snippet{
  display:block;
  color:var(--muted);
  font-size:.86rem;
  line-height:1.45;
}
.search-result mark{
  background:var(--accent-soft);
  color:var(--accent);
  padding:0 1px;
}

html[data-theme="dark"] .search-btn,
html[data-theme="dark"] .search-panel{
  background:var(--surface);
  border-color:var(--line);
}

@media (max-width:900px){
  .site-header:not(.home-header){
    grid-template-columns:42px minmax(0,1fr) 42px 42px 42px 42px;
    gap:7px;
    padding:10px 12px;
  }
  .site-header:not(.home-header) > .site-nav{
    left:12px;
    right:12px;
    width:auto;
  }
  .search-panel{
    left:12px;
    right:12px;
    width:auto;
  }
}

@media (max-width:520px){
  .site-header:not(.home-header){
    grid-template-columns:42px minmax(0,1fr) 38px 38px 38px 38px;
    gap:5px;
  }
  .site-header:not(.home-header) > .home-back,
  .site-header:not(.home-header) > .lang-switch .lang-other,
  .site-header:not(.home-header) > .theme-toggle,
  .site-header:not(.home-header) > .search-btn{
    width:38px;
    min-width:38px;
    height:38px;
    min-height:38px;
  }
  .site-header:not(.home-header) > .brand b{
    font-size:.88rem;
  }
}





/* Dismissible work-in-progress notice below the header */
.inline-notice{
  position:relative;
  z-index:20;
  width:min(1180px, calc(100% - 24px));
  margin:10px auto 0;
  background:#eaf4ff;
  border:1px solid #c7dbef;
  border-radius:14px;
  color:#23415f;
  box-shadow:0 8px 24px rgba(15,23,42,.05);
}
.site-notice-inner{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:10px 14px;
}
.site-notice-icon{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  margin-top:1px;
  color:#315b86;
  font-size:1.05rem;
  font-weight:700;
}
.site-notice-text{
  flex:1 1 auto;
  font-size:.93rem;
  line-height:1.45;
}
.site-notice-text strong{
  font-weight:800;
}
.site-notice-close{
  flex:0 0 auto;
  width:32px;
  height:32px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#54708f;
  font-size:1.35rem;
  line-height:1;
  cursor:pointer;
}
.site-notice-close:hover{
  background:rgba(49,91,134,.09);
  color:#23415f;
}
.site-notice.is-hidden{
  display:none;
}

html[data-theme="dark"] .inline-notice{
  background:#112130;
  border-color:#22384e;
  color:#d9e7f8;
}
html[data-theme="dark"] .site-notice-icon{
  color:#97b4da;
}
html[data-theme="dark"] .site-notice-close{
  color:#9db3cc;
}
html[data-theme="dark"] .site-notice-close:hover{
  background:rgba(151,180,218,.1);
  color:#e9f2ff;
}

@media (max-width:700px){
  .inline-notice{
    width:calc(100% - 16px);
    margin-top:8px;
    border-radius:12px;
  }
  .site-notice-inner{
    gap:10px;
    padding:8px 10px;
  }
  .site-notice-text{
    font-size:.84rem;
    line-height:1.38;
  }
  .site-notice-close{
    width:28px;
    height:28px;
  }
}
