#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
#topnav {
  position: sticky; top: 0; z-index: 20; height: var(--nav-h);
  background: rgba(7,7,11,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--page-max); margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.04em; font-size: 18px; flex: none; }
.brand i { width: 22px; height: 22px; border-radius: 7px; background: var(--yellow); color: #111; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 900; }
.nav-links { display: flex; gap: 16px; font-size: 14px; font-weight: 600; }
.nav-links a { color: var(--muted); }
.nav-links a.on { color: var(--yellow); }
.searchbar {
  margin-left: auto; height: 36px; min-width: 180px; border-radius: 999px;
  background: rgba(255,255,255,.08); display: flex; align-items: center; padding: 0 12px;
  color: var(--muted); font-size: 13px;
}
.lang-switch { font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; }

#main { flex: 1; overflow: auto; }
#main .page { max-width: var(--page-max); margin: 0 auto; padding: 18px var(--gutter) 40px; }
#app.is-mobile #main { padding-bottom: var(--tab); }
#app.is-mobile.is-watch #main { padding-bottom: 0; }

#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  height: var(--tab); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(12,12,18,.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
#tabbar a { color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; gap: 2px; }
#tabbar a.on { color: var(--yellow); }
#tabbar svg { width: 22px; height: 22px; }

#app.is-desktop #tabbar { display: none; }
#app.is-mobile:not(.is-watch) #topbar-mobile { display: flex; }
#topbar-mobile {
  display: none; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  position: sticky; top: 0; z-index: 8;
  background: linear-gradient(to bottom, rgba(7,7,11,.92), rgba(7,7,11,0));
}

.site-foot {
  max-width: var(--page-max); margin: 24px auto 0; padding: 16px var(--gutter);
  display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 639px) {
  .nav-links, .searchbar { display: none; }
  #app.is-mobile #tabbar { display: grid; }
}
