/* 官网主功能页面共用顶部导航。页面内容主题可以不同，导航结构与视觉保持一致。 */
.portal-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}
.portal-header.is-scrolled,
body.practice-page .portal-header {
  border-color: rgba(143, 190, 222, .16);
  background: rgba(5, 11, 20, .96);
  backdrop-filter: blur(20px);
}
.portal-header__inner {
  width: min(calc(100% - 48px), 1880px);
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.portal-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #eff7ff;
  text-decoration: none;
}
.portal-brand__mark {
  position: relative;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(72, 230, 255, .34);
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 0 28px rgba(72, 230, 255, .12);
  overflow: hidden;
}
.portal-brand__mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.portal-brand__copy { display: flex; flex-direction: column; line-height: 1.1; }
.portal-brand__copy strong { color: #eff7ff; font: 700 18px "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", sans-serif; letter-spacing: .06em; }
.portal-brand__copy small { margin-top: 6px; color: #6f8ba4; font: 600 12px "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", sans-serif; letter-spacing: .2em; }
.portal-navigation { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.portal-navigation a,
.portal-navigation button {
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  color: #9aacc0;
  background: transparent;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease;
}
.portal-navigation a::after,
.portal-navigation button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: #48e6ff;
  box-shadow: 0 0 10px #48e6ff;
  transform: translateX(-50%);
  transition: width 180ms ease;
}
.portal-navigation a:hover,
.portal-navigation button:hover,
.portal-navigation .is-active { color: #f2fbff; background: transparent; }
.portal-navigation a:hover::after,
.portal-navigation button:hover::after,
.portal-navigation .is-active::after { width: 20px; }
.portal-header__actions { display: flex; align-items: center; gap: 10px; }
.header-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 150px;
  overflow: hidden;
  border: 0;
  padding: 9px 13px;
  color: #a9b9ca;
  background: transparent;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.header-login__avatar { display: grid; width: 28px; height: 28px; flex: none; overflow: hidden; place-items: center; color: #d9fff5; border: 1px solid rgba(112, 224, 196, .55); border-radius: 50%; background: linear-gradient(145deg, #096b59, #183b5a); font-size: 13px; font-weight: 800; line-height: 1; }
.header-login__avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-login__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-account { position: relative; }
.header-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 188px;
  padding: 8px 0;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  color: #344054;
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
}
.header-account-menu[hidden] { display: none !important; }
.header-account-menu::before { content: ""; position: absolute; top: -9px; left: 0; right: 0; height: 9px; }
.header-account-menu [role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 0;
  color: #344054;
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 24px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.header-account-menu [role="menuitem"]:hover,
.header-account-menu [role="menuitem"]:focus-visible { color: #2469dc; background: #f0f5ff; outline: none; }
.header-account-menu [aria-disabled="true"] { opacity: .55; cursor: wait; }
.header-account-menu svg { flex: none; width: 18px; height: 18px; }
.header-account-menu__status { margin: 4px 14px; color: #b42318; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.header-start {
  padding: 9px 15px;
  border: 1px solid rgba(72, 230, 255, .45);
  border-radius: 0;
  color: #8df1ff;
  background: rgba(72, 230, 255, .07);
  font-size: 15px;
  text-decoration: none;
  box-shadow: inset 0 0 18px rgba(72, 230, 255, .04);
}
.header-start span { margin-left: 7px; }
.header-start:hover { border-color: #48e6ff; color: #8df1ff; background: rgba(72, 230, 255, .13); }
.mobile-nav-button { display: none; }
.account-modal {
  inset: 76px 0 0;
  padding: 22px;
}
.account-panel { max-height: calc(100dvh - 120px); }
.system-modal {
  inset: 76px 0 0;
  padding: 28px;
}
.system-modal__panel { max-height: calc(100dvh - 132px); }
body.practice-page main { padding-top: 76px; }
body.practice-page .practice-hero .judge-status { margin-top: 12px; color: #667085; }
body.practice-page .practice-hero .judge-status i { width: 7px; height: 7px; border-radius: 50%; }
body.practice-page .admin-course-entry {
  width: max-content;
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 6px;
  color: #3478f6;
  background: #f4f8ff;
  font-size: 14px;
  text-decoration: none;
}

@media (max-width: 1050px) {
  .portal-header__inner { width: min(calc(100% - 32px), 1880px); gap: 18px; }
  .portal-navigation a,
  .portal-navigation button { padding: 10px 8px; font-size: 12px; }
  .portal-brand__copy small { display: none; }
}

@media (max-width: 820px) {
  .portal-header__inner { height: 66px; }
  .portal-brand__mark { width: 37px; height: 37px; }
  .portal-brand__copy strong { font-size: 15px; }
  .mobile-nav-button {
    position: relative;
    margin-left: auto;
    width: 43px;
    height: 42px;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 4px;
    border: 1px solid rgba(143, 190, 222, .16);
    border-radius: 0;
    padding: 0 11px;
    background: rgba(10, 22, 35, .8);
    cursor: pointer;
  }
  .mobile-nav-button span { display: block; height: 1px; background: #94abbc; transition: transform 180ms ease, opacity 180ms ease; }
  .mobile-nav-button em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .mobile-nav-button[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
  .mobile-nav-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .mobile-nav-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  .portal-navigation {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 12px 20px 20px;
    border-bottom: 1px solid rgba(143, 190, 222, .16);
    background: rgba(5, 11, 20, .98);
    box-shadow: none;
    backdrop-filter: blur(18px);
  }
  .portal-navigation.is-open { display: flex; }
  .portal-navigation a,
  .portal-navigation button { padding: 13px 4px; color: #9aacc0; text-align: left; }
  .portal-navigation a::after,
  .portal-navigation button::after { display: none; }
  .portal-header .portal-header__actions { display: flex; flex: none; }
  .portal-header__actions .header-start { display: none; }
  .header-login { max-width: 72px; padding: 7px 4px; }
  .header-login__name { display: none; }
  .account-modal { inset: 66px 0 0; padding: 10px; }
  .account-panel { max-height: calc(100dvh - 86px); }
  .system-modal { inset: 66px 0 0; padding: 10px; }
  .system-modal__panel { max-height: calc(100dvh - 86px); }
  body.practice-page main { padding-top: 66px; }
}

@media (max-width: 560px) {
  .portal-header__inner { width: calc(100% - 24px); }
}
