/* 门户和挂载的 Ready 共用外壳尺寸，禁止按页面另设侧栏或顶栏。 */
html[data-theme] { --shell-rail:84px; --shell-header:86px; --shell-gutter:40px; --portal-rail:var(--shell-rail); --rail-width:var(--shell-rail); }
html[data-theme] :is(.campus-rail,.ready-portal-rail) { width:var(--shell-rail); padding:23px 10px; box-sizing:border-box; gap:0; }
html[data-theme] :is(.campus-logo,.ready-portal-logo) { width:34px; height:34px; margin:0 0 37px; flex-shrink:0; }
html[data-theme] :is(.campus-rail nav,.ready-portal-rail nav) { display:flex; flex-direction:column; width:100%; gap:13px; }
html[data-theme] :is(.rail-link,.ready-portal-rail nav a) { min-height:72px; padding:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size:12px; font-weight:400; line-height:1.55; }
html[data-theme] :is(.rail-link,.ready-portal-rail nav a) svg { width:25px; height:25px; }
html[data-theme] :is(.campus-topbar,.ready-portal-top) { position:fixed; z-index:470; left:var(--shell-rail); right:0; top:0; height:var(--shell-header); padding:0 var(--shell-gutter); max-width:none; margin:0; display:flex; align-items:center; justify-content:space-between; background:var(--bg,var(--portal-bg)); gap:16px; box-sizing:border-box; }
html[data-theme] .campus-body { margin-left:var(--shell-rail); padding-top:var(--shell-header); }
html[data-theme] .campus-main { padding-inline:var(--shell-gutter); }
html.ready-hosted .app-shell.is-hosted { padding:var(--shell-header) var(--shell-gutter) 100px calc(var(--shell-rail) + var(--shell-gutter)) !important; }
html.ready-hosted .app-shell.is-hosted.is-map { padding:var(--shell-header) 0 0 var(--shell-rail) !important; }
html[data-theme] :is(.campus-wordmark,.ready-portal-wordmark) { display:flex; align-items:center; width:190px; height:32px; gap:1px; margin:0; }
html[data-theme] .ready-portal-wordmark .wordmark-anything { width:110px; height:30px; }
html[data-theme] .ready-portal-wordmark .wordmark-buaa { width:76px; height:30px; }
html[data-theme] :is(.rail-profile,.ready-portal-profile) { width:34px; height:34px; margin-top:auto; flex-shrink:0; }
html[data-theme] :is(.campus-topbar-actions,.ready-portal-top > div) { display:flex; align-items:center; gap:5px; }
html[data-theme] :is(.ready-portal-top button,.ready-portal-search) { width:35px; height:35px; display:grid; place-items:center; padding:0; border:0; border-radius:8px; }
html[data-theme] :is(.ready-portal-top button,.ready-portal-search) svg { width:19px; height:19px; }
html.ready-hosted .assistant-panel.is-docked { top:var(--shell-header); height:calc(100dvh - var(--shell-header)); }
html.ready-hosted .reader-column-resizer.is-assistant { top:var(--shell-header); height:calc(100dvh - var(--shell-header)); }
@media(min-width:761px) and (max-width:1672px) {
  html[data-theme] { --shell-rail:clamp(64px,5.02vw,84px); --shell-header:clamp(66px,5.15vw,86px); --shell-gutter:clamp(24px,2.39vw,40px); }
  html[data-theme] :is(.campus-rail,.ready-portal-rail) { padding-top:clamp(18px,1.38vw,23px); }
  html[data-theme] :is(.campus-logo,.ready-portal-logo) { width:clamp(27px,2.03vw,34px); height:clamp(27px,2.03vw,34px); margin-bottom:clamp(28px,2.21vw,37px); }
  html[data-theme] :is(.campus-rail nav,.ready-portal-rail nav) { gap:clamp(9px,.78vw,13px); }
  html[data-theme] :is(.rail-link,.ready-portal-rail nav a) { min-height:clamp(56px,4.31vw,72px); }
  html[data-theme] :is(.rail-link,.ready-portal-rail nav a) svg { width:clamp(20px,1.5vw,25px); height:clamp(20px,1.5vw,25px); }
}
@media(max-width:760px) {
  html[data-theme] {
    --shell-rail:0px;
    --shell-header:calc(64px + env(safe-area-inset-top));
    --shell-gutter:16px;
    --shell-bottom:calc(64px + env(safe-area-inset-bottom));
    --portal-rail:0px;
    --rail-width:0px;
    scroll-padding-block:var(--shell-header) var(--shell-bottom);
  }
  /* 移动端共用底部导航，给内容和输入框留出真实空间。 */
  html[data-theme] :is(.campus-rail,.ready-portal-rail) {
    inset:auto 0 0;
    width:100%;
    height:var(--shell-bottom);
    padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    border-right:0;
    border-top:1px solid var(--line);
    background:var(--bg);
    overflow:visible;
    z-index:480;
  }
  html[data-theme] :is(.campus-logo,.ready-portal-logo) { display:none; }
  html[data-theme] :is(.campus-rail nav,.ready-portal-rail nav) { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; height:100%; }
  html[data-theme] :is(.rail-link,.ready-portal-rail nav a) { min-height:0; gap:3px; font-size:11px; }
  html[data-theme] :is(.rail-link,.ready-portal-rail nav a) svg { width:22px; height:22px; }
  html[data-theme] :is(.rail-profile,.ready-portal-profile) { position:fixed; top:calc(10px + env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); width:44px; height:44px; margin:0; background:var(--surface); color:var(--ink); }
  html[data-theme] :is(.campus-topbar,.ready-portal-top) { min-height:0; flex-wrap:nowrap; gap:4px; padding:env(safe-area-inset-top) max(60px,calc(env(safe-area-inset-right) + 48px)) 0 max(16px,env(safe-area-inset-left)); }
  html[data-theme] :is(.campus-wordmark,.ready-portal-wordmark) { width:clamp(100px,calc(100vw - 216px),180px); height:32px; flex-shrink:0; }
  html[data-theme] .brand-wordmark-art { width:100%; }
  html[data-theme] :is(.brand-wordmark-art,.ready-portal-wordmark) .wordmark-anything { width:59%; height:auto; }
  html[data-theme] :is(.brand-wordmark-art,.ready-portal-wordmark) .wordmark-buaa { width:40%; height:auto; }
  html[data-theme] :is(.campus-topbar-actions,.ready-portal-top > div) { gap:0; margin-left:auto; }
  html[data-theme] :is(.campus-topbar .icon-button,.ready-portal-top button,.ready-portal-search) { width:44px; height:44px; flex-shrink:0; }
  /* 与学习中心一致，手机顶栏收起文字入口，给操作按钮和头像留出空间。 */
  html[data-theme] .campus-topbar :is(.topbar-link,.beta-badge) { display:none; }
  html[data-theme] .campus-topbar [aria-label^='搜索'] { display:none; }
  html[data-theme] .ready-portal-top > div > a:not(.ready-portal-search) { display:none; }
  html[data-theme] .campus-main { padding-bottom:calc(var(--shell-bottom) + 24px); }
  html.ready-hosted .app-shell.is-hosted { padding:var(--shell-header) var(--shell-gutter) calc(var(--shell-bottom) + 24px) !important; }
  html.ready-hosted .app-shell.is-hosted.is-map { padding:var(--shell-header) 0 var(--shell-bottom) !important; }
  html.ready-hosted .app-shell.is-hosted.is-assistant-docked { padding-left:var(--shell-gutter) !important; }
  html.ready-hosted .assistant-panel.is-docked { left:0; width:100%; }
  html.ready-hosted :is(.assistant-panel.is-docked,.assistant-panel.is-floating) { top:calc(var(--visual-viewport-top,0px) + var(--shell-header)); height:calc(var(--visual-viewport-height,100dvh) - var(--shell-header) - var(--shell-bottom)); }
  html.ready-hosted .reader-column-resizer.is-assistant { display:none; }
}
