/*
 * Shared top header shell + primary nav (main site, community, chat).
 * Keep nav typography and spacing identical across sub-apps.
 */

.scholar-top-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: 61px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(12px);
}

.scholar-top-header--with-rail {
  padding-left: 72px;
}

.scholar-top-header__brand {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.scholar-top-header__logo {
  height: 32px;
  width: auto;
  display: block;
}

.scholar-top-header__nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 12px;
  white-space: nowrap;
}

.scholar-top-header__nav-link {
  color: #0f172a;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}

.scholar-top-header__nav-link:hover {
  color: #4f46e5 !important;
  background: #f1f5ff;
  text-decoration: none !important;
}

.scholar-top-header__nav-link.active {
  color: #4f46e5 !important;
  font-weight: 700 !important;
  background: #eef2ff;
}

.scholar-top-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.scholar-top-header__search {
  width: 220px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #94a3b8;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #f8fbff;
}

.scholar-top-header__search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #1e293b;
  font-size: 13px;
}

.scholar-top-header__search input::placeholder {
  color: #9aa9bd;
}

.scholar-top-header__calendar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: #fffaf0;
  text-decoration: none;
  transition: all 0.2s ease;
}

.scholar-top-header__calendar:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 158, 11, 0.42);
  background: #fff4e6;
  color: #d97706;
  text-decoration: none;
}

.scholar-top-header__avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.scholar-top-header__github {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.scholar-top-header__github:hover {
  transform: translateY(-1px);
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}

@media (max-width: 900px) {
  .scholar-top-header__nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .scholar-top-header__search {
    display: none;
  }
}
