:root { --site-header-height: 76px; }
.site-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: var(--site-header-height);
  height: var(--site-header-height);
  padding: 0 28px;
  border-bottom: 1px solid #dce5dc;
  background: #fffefa;
  box-shadow: 0 3px 16px #163e3105;
}
.site-shell [hidden] { display: none !important; }
.site-shell .brand-wrap { display: flex; align-items: center; min-width: 0; gap: 8px; }
.site-shell .brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-shell .brand .brand-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; margin: 0; padding: 0; border-radius: 12px; background: #13766d; color: white; }
.site-shell .brand-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-shell .brand .brand-name { display: block; width: auto; height: auto; margin: 0; padding: 0; border-radius: 0; background: none; color: #203e36; font: 700 26px/1.05 var(--serif, "Songti SC", SimSun, serif); letter-spacing: 3px; }
.site-shell .brand-name > span { display: block; margin-top: 5px; font: 8px/1.2 var(--sans, sans-serif); letter-spacing: 2.1px; color: #718477; white-space: nowrap; }
.site-shell .section-navigation { display: flex; position: relative; align-items: center; justify-content: center; gap: 3px; width: auto; min-width: 0; margin: 0; padding: 0; overflow: visible; }
.site-shell .section-navigation > a { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 600; line-height: 1.4; color: #52695c; white-space: nowrap; }
.site-shell .section-navigation > a:hover { background: #eef4ec; color: #116f61; }
.site-shell .section-navigation > a[aria-current="page"] { background: #123f36; color: #fffefa; box-shadow: 0 3px 9px #123f3615; font-weight: 600; }
.site-shell-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; min-width: 0; }
.site-shell .site-account-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 12px; border: 1px solid #cfdfd3; border-radius: 8px; background: #f2f6ee; color: #265b49; font-size: 13px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.site-shell .site-account-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.site-shell .site-account-link[aria-current="page"] { border-color: #8ebaa4; background: #e4f0e7; color: #0e6656; }
.site-shell .help-button { display: inline-flex; align-items: center; gap: 7px; width: auto; padding: 8px 0; border: 0; background: transparent; color: #617366; font-size: 12px; white-space: nowrap; }
.site-shell .site-nav-toggle { display: none; }
.site-shell .teacher-header-note { display: none; }
.site-shell .site-back-button { flex: 0 0 36px; width: 36px; height: 38px; border: 1px solid #dce5d9; border-radius: 8px; }
.site-shell-simple { display: flex; justify-content: space-between; }
.site-shell-simple .header-label { margin-right: auto; border-color: #dce5dc; color: #617366; font-size: 13px; }
.site-shell-simple :is(.back, .back-link) { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #276b59; font-size: 13px; white-space: nowrap; }
.site-shell :is(a, button):focus-visible { outline: 3px solid #72ac99; outline-offset: 3px; }

@media (max-width: 1100px) {
  :root { --site-header-height: 68px; }
  .site-shell { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr; gap: 12px; height: var(--site-header-height); padding: 0 18px; }
  .site-shell > .brand-wrap { grid-column: 1; grid-row: 1; }
  .site-shell-actions { grid-column: 2; grid-row: 1; gap: 8px; }
  .site-shell .site-nav-toggle { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border: 1px solid #d3e0d3; border-radius: 8px; background: #fffefa; color: #2a5e4a; }
  .site-shell .site-nav-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .site-shell .site-nav-toggle[aria-expanded="true"] { border-color: #13766d; background: #e6f1e8; }
  .site-shell .section-navigation { position: absolute; grid-area: auto; top: calc(var(--site-header-height) - 1px); right: 18px; display: grid; grid-template-columns: 1fr; justify-content: stretch; gap: 5px; width: min(350px, calc(100vw - 36px)); max-height: calc(100dvh - var(--site-header-height) - 20px); overflow: auto; padding: 14px; border: 1px solid #cfdfd2; border-radius: 0 0 13px 13px; background: #fffefa; box-shadow: 0 16px 34px #123f3624; }
  .site-shell:not([data-shell-ready]) .section-navigation { display: none; }
  .site-shell .section-navigation > a { justify-content: flex-start; min-height: 46px; max-width: none; width: 100%; padding: 12px 15px; font-size: 14px; }
  .site-shell .section-navigation .help-button { justify-content: flex-start; min-height: 44px; padding: 12px 15px; margin-top: 5px; border-top: 1px solid #e1e9de; font-size: 13px; }
  .site-shell .brand .brand-icon { flex-basis: 36px; width: 36px; height: 36px; border-radius: 10px; }
  .site-shell .brand-icon svg { width: 30px; height: 30px; }
  .site-shell .brand .brand-name { font-size: 23px; letter-spacing: 2px; }
  .site-shell .brand-name > span { font-size: 7px; letter-spacing: 1.4px; }
  .sidebar, .nav-backdrop { top: var(--site-header-height); }
}

@media (max-width: 600px) {
  .site-shell { padding: 0 14px; gap: 10px; }
  .site-shell .brand-wrap { gap: 6px; }
  .site-shell .site-back-button { display: none; }
  .site-shell .brand { gap: 8px; }
  .site-shell .site-account-link { gap: 0; padding: 9px 10px; min-height: 42px; font-size: 12px; }
  .site-shell .site-account-link svg { display: none; }
  .site-shell .section-navigation { right: 14px; width: calc(100vw - 28px); }
  .site-shell-simple .header-label { display: none; }
  .site-shell-simple :is(.back, .back-link) { font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .site-shell[data-nav-open="true"] .section-navigation { animation: site-nav-arrive 160ms ease-out; }
  @keyframes site-nav-arrive { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
}
