/* 图书/论文前台页与线上首页一致的顶栏导航（自包含样式，加载于 books.css 之后以覆盖其通用 nav/brand 规则） */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 71px;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(217, 223, 215, 0.86);
  background: rgba(251, 251, 247, 0.62);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: #1d2522;
  font: inherit;
  letter-spacing: 0;
  white-space: normal;
  text-decoration: none;
}

.topbar .brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #cbd8ce;
  border-radius: 50%;
  background: #fff;
  color: #1f6f5b;
  font-size: 16px;
  font-weight: 900;
}

.topbar .brand > span:not(.brand-mark) {
  min-width: 0;
}

.topbar .brand strong {
  display: block;
  color: #1d2522;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.topbar .brand small {
  display: block;
  max-width: min(48vw, 520px);
  margin-top: 3px;
  color: #607069;
  font-size: 12px;
  line-height: 1.2;
}

.topbar .topnav {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-self: center;
}

.topbar .topnav a {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #1d2522;
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
  align-items: center;
  border-bottom: 0;
}

.topbar .topnav a:hover,
.topbar .topnav a.active {
  background: #edf3ee;
  border-bottom: 0;
}

.topbar .topnav a.active {
  background: #e4efe8;
  color: #134c3c;
  font-weight: 800;
}

@media (max-width: 760px) {
  .topbar .topnav {
    display: flex;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .topbar .brand small {
    max-width: 100%;
  }
  .topbar .topnav {
    width: 100%;
    justify-content: space-between;
  }
  .topbar .topnav a {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
  }
}
