/* 全站顶栏导航（工具页只引这一份，不改工具自身配色） */
:root {
  --site-bg: #0b0d17;
  --site-border: rgba(255, 255, 255, 0.09);
  --site-text: #e8eaef;
  --site-muted: #8b92a5;
  --site-surface: rgba(255, 255, 255, 0.04);
  --site-accent: #f84a4b;
  --site-accent-soft: rgba(248, 74, 75, 0.14);
  --site-nav-height: 52px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: var(--site-nav-height);
  background: rgba(11, 13, 23, 0.96);
  border-bottom: 1px solid var(--site-border);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--site-text);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--site-accent);
  box-shadow: 0 0 12px rgba(248, 74, 75, 0.55);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--site-muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--site-text);
  background: var(--site-surface);
}

.site-nav a.is-active {
  color: #fff;
  background: var(--site-accent-soft);
  border: 1px solid rgba(248, 74, 75, 0.32);
}

.site-nav-back {
  margin-left: auto;
  color: var(--site-muted) !important;
  font-weight: 500 !important;
}

.site-nav-back:hover {
  color: var(--site-text) !important;
}

.site-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 顶栏已有联系方式；此项仅在手风琴菜单内显示，桌面端隐藏 */
.site-contact--mobile-nav {
  display: none;
}

.site-contact--footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--site-border, rgba(255, 255, 255, 0.09));
}

body.site-hub .site-contact--footer {
  border-top-color: rgba(255, 255, 255, 0.09);
}

.site-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--site-muted);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--site-border);
  background: var(--site-surface);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.site-contact-link:hover {
  color: var(--site-text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.site-contact-link--bilibili:hover {
  color: #fb7299;
  border-color: rgba(251, 114, 153, 0.45);
}

.site-contact-link--douyin:hover {
  color: #25f4ee;
  border-color: rgba(37, 244, 238, 0.35);
}

.site-contact-link--static {
  cursor: default;
  opacity: 0.88;
}

.site-contact-link--static:hover {
  color: var(--site-muted);
  border-color: var(--site-border);
  background: var(--site-surface);
}

.site-contact-link svg {
  display: block;
  flex-shrink: 0;
}

.site-contact-text {
  line-height: 1;
}

.site-tagline {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--site-muted);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-nav-toggle {
  display: none;
  padding: 6px 10px;
  border: 1px solid var(--site-border);
  border-radius: 8px;
  background: var(--site-surface);
  color: var(--site-text);
  font-size: 13px;
  cursor: pointer;
}

body.has-site-nav {
  padding-top: var(--site-nav-height);
}

body.has-site-icp {
  --site-icp-height: 28px;
  padding-bottom: var(--site-icp-height);
}

.site-icp-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  color: var(--site-muted);
  background: rgba(11, 13, 23, 0.94);
  border-top: 1px solid var(--site-border);
  backdrop-filter: blur(8px);
}

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

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

body.has-site-nav.tool-layout-fixed {
  box-sizing: border-box;
  height: 100vh;
  overflow: hidden;
}

body.has-site-nav.tool-layout-fixed > .sidebar,
body.has-site-nav.tool-layout-fixed > .main-view {
  height: calc(100vh - var(--site-nav-height) - var(--site-icp-height, 0px));
  box-sizing: border-box;
}

body.has-site-nav.tool-layout-flex {
  box-sizing: border-box;
  height: 100vh;
  overflow: hidden;
}

body.has-site-nav.tool-layout-flex > .sidebar-container,
body.has-site-nav.tool-layout-flex > .main-container {
  height: calc(100vh - var(--site-nav-height) - var(--site-icp-height, 0px));
  box-sizing: border-box;
}

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

  .site-nav {
    position: absolute;
    top: var(--site-nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    background: rgba(11, 13, 23, 0.98);
    border-bottom: 1px solid var(--site-border);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    border-radius: 10px;
  }

  .site-tagline {
    display: none;
  }

  .site-header-inner .site-contact--header {
    order: 3;
    margin-left: auto;
  }

  .site-contact--header .site-contact-text {
    display: none;
  }

  .site-contact--mobile-nav {
    display: none;
  }

  .site-nav.is-open .site-contact--mobile-nav {
    display: flex;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--site-border);
  }
}
