/* ============================================================
   SHELL 2026 — AppShell 布局令牌与侧边栏结构
   与 app-shell.css 并存；新页面优先引用本文件 + components
   ============================================================ */

@import url('./tokens-2026.css');

/* ── App shell wrapper ── */
#cz-app-shell,
.cz-app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

body.app-shell {
  padding-left: var(--sidebar-w);
  transition: padding-left 0.32s var(--shell-ease);
}

body.app-shell.sidebar-collapsed {
  padding-left: var(--sidebar-w-collapsed);
}

@media (max-width: 1024px) {
  body.app-shell,
  body.app-shell.sidebar-collapsed {
    padding-left: 0;
  }
}

body.app-shell .container {
  animation: none;
}

/* ── Sidebar (structure; visual polish in app-shell.css) ── */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  background: var(--shell-glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-right: 1px solid var(--shell-border);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
  transition: width 0.32s var(--shell-ease), transform 0.32s var(--shell-ease);
  overflow: hidden;
}

body.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-w-collapsed);
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--shell-border);
  white-space: nowrap;
}

.app-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 20px;
}

.app-shell-foot {
  flex-shrink: 0;
  padding: 14px 12px 18px;
  border-top: 1px solid var(--shell-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile drawer */
.app-fab {
  display: none;
}

.app-sidebar-backdrop {
  display: none;
}

@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-fab {
    display: flex;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1300;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--shell-border);
    background: var(--shell-glass);
    color: var(--gold-400);
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--app-shadow);
  }

  .app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1199;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  body.sidebar-open .app-sidebar-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
  }
}

/* Page head helper */
.cz-page-head,
.page-head {
  margin-bottom: 24px;
}

.cz-page-head h1,
.page-head h1 {
  font-size: var(--fluid-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
