/* 初始 HTML 即预留账号和管理入口；权限与资料返回只改变内容，不改变导航宽度。 */
.nav-submenu-toggle{display:none}
@media(max-width:980px){
  #mainNav .nav-item{position:relative}
  #mainNav .nav-item>a{padding-right:48px;box-sizing:border-box}
  #mainNav .nav-item>a>.nav-caret{display:none}
  #mainNav .nav-item>.nav-dropdown{transform:none}
  #mainNav .nav-submenu-toggle{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:48px;height:48px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}
  #mainNav .nav-submenu-toggle:focus-visible{outline:2px solid currentColor;outline-offset:-4px}
  #mainNav .nav-submenu-toggle .nav-caret{margin:0;transform:rotate(45deg)}
  #mainNav .is-expanded>.nav-submenu-toggle .nav-caret{transform:rotate(225deg) translateY(-2px)}
  #mainNav .nav-item:has(>.nav-submenu-toggle):not(.is-expanded)>.nav-dropdown{display:none}
}
#academyAccount{display:flex;align-items:center;justify-content:flex-end;flex:0 0 176px;width:176px;height:40px}
#academyAccount[data-academy-manager]{flex-basis:222px;width:222px}
body:not(.academy-account-visible) #academyAccount{display:none}
@media(min-width:981px){
 body:not(.academy-account-visible) .header-inner:has(#academyAccount){display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:20px}
 body:not(.academy-account-visible) .header-inner .main-nav{display:contents}
 body:not(.academy-account-visible) .header-inner .nav-links{grid-column:2;grid-row:1;flex:none}
 body:not(.academy-account-visible) .header-inner .nav-actions{grid-column:3;grid-row:1;justify-self:end;margin-left:0}
}
.footer-bottom>[data-academy-admin]{color:inherit;font-size:12px;justify-self:center}
@media(min-width:981px){#mainNav [data-academy-admin][hidden]{display:inline-flex!important;visibility:hidden;pointer-events:none}}
@media(max-width:1100px){#academyAccount{flex-basis:82px;width:82px}}
@media(max-width:1100px){#academyAccount[data-academy-manager]{flex-basis:124px;width:124px}}
/* 中等桌面宽度保持所有导航操作完整可见。 */
@media (min-width: 981px) and (max-width: 1200px) {
  .header-inner:has([data-academy-admin]) { gap: 20px; }
  .main-nav:has([data-academy-admin]) { font-size: 14px; }
  .main-nav:has([data-academy-admin]) .nav-links { gap: 12px; }
  .main-nav:has([data-academy-admin]) .nav-actions {
    margin-left: 16px;
    transform: none;
    flex-shrink: 0;
  }
  .main-nav:has([data-academy-admin]) .header-cta { white-space: nowrap; }
}
.header-inner:has(#academyAccount){width:calc(100% - 48px);max-width:1920px;gap:20px}
.header-inner:has(#academyAccount) .brand{flex-shrink:0}
.header-inner:has(#academyAccount) .nav-actions{transform:none;margin-left:20px;gap:8px;flex-shrink:0}
.header-inner:has(#academyAccount) .header-cta{white-space:nowrap;flex-shrink:0}
.header-inner:has(#academyAccount) .nav-links{gap:26px}
@media(min-width:981px) and (max-width:1200px){.header-inner:has(#academyAccount){gap:14px}.header-inner:has(#academyAccount) .brand-wordmark{width:110px}.header-inner:has(#academyAccount) .main-nav{font-size:13px}.header-inner:has(#academyAccount) .nav-links{gap:10px}.header-inner:has(#academyAccount) .nav-actions{margin-left:12px}.header-inner:has(#academyAccount) .header-cta{font-size:12px;padding:8px 10px}}
@media(min-width:981px) and (max-width:1100px){.header-inner:has(#academyAccount) .brand{gap:10px}.header-inner:has(#academyAccount) .brand-symbol{width:36px;height:42px}.header-inner:has(#academyAccount) .brand-wordmark{width:90px}.header-inner:has(#academyAccount) .nav-links{gap:8px}}
@media(max-width:980px){.header-inner:has(#academyAccount){width:calc(100% - 24px);gap:12px}.header-inner:has(#academyAccount) .brand{margin-right:auto}.header-inner:has(#academyAccount) .brand-wordmark{width:96px}.header-inner:has(#academyAccount) .nav-actions{margin:12px 0 0}}
@media (max-width: 980px) {
  #mainNav.main-nav {
    bottom: 0;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    max-height: none;
    justify-content: flex-start;
    overflow: hidden;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  #mainNav .nav-links {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #mainNav .nav-actions {
    flex: 0 0 auto;
    margin: 0;
    padding-top: 12px;
    background: var(--blue-900);
  }
  #mainNav .nav-service {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--blue-900);
  }
}
