html,body { max-width: 100%; overflow-x: hidden; }
body { background: var(--color-canvas); color: var(--color-text); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: var(--font-base); line-height: var(--line-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; padding: 22px 16px 16px; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--color-sidebar), var(--color-sidebar-deep)); color: #fff; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--color-primary); font-weight: 850; box-shadow: 0 8px 22px rgba(37,99,235,.35); }
.sidebar-brand strong,.sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 14px; letter-spacing: .02em; }
.sidebar-brand small { margin-top: 3px; color: var(--color-sidebar-text); font-size: var(--font-xs); }
.primary-nav { padding-top: 18px; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 0; }
.nav-group-label { margin: 0 10px 8px; color: #75829a; font-size: var(--font-xs); font-weight: 750; letter-spacing: .1em; }
.nav-item { width: 100%; min-height: 42px; margin: 3px 0; padding: 9px 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--color-sidebar-text); text-align: left; font: inherit; font-size: var(--font-md); font-weight: 650; cursor: pointer; transition: var(--transition-fast); }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--color-sidebar-active); background: rgba(37,99,235,.24); box-shadow: inset 3px 0 var(--color-primary); }
.nav-glyph { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: rgba(255,255,255,.07); color: inherit; font-size: var(--font-xs); font-weight: 800; }
.nav-glyph svg { width: 15px; height: 15px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-glyph svg rect,.nav-glyph svg ellipse,.nav-glyph svg circle { fill: none; }
.nav-item.active .nav-glyph { background: var(--color-primary); }
.sidebar-user { margin-top: auto; padding: 14px 10px 2px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-role-switcher { margin-top: auto; padding: 12px 10px 10px; display: grid; gap: 6px; border-top: 1px solid rgba(255,255,255,.09); color: var(--color-sidebar-text); font-size: var(--font-xs); }
.sidebar-role-switcher[hidden] { display: none; }
.sidebar-role-switcher + .sidebar-user { margin-top: 0; }
.sidebar-role-switcher select { width: 100%; min-height: 36px; padding: 0 30px 0 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; }
.sidebar-role-switcher option { color: #17233b; }
.sidebar-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #dce7ff; color: #244ca2; font-size: 11px; font-weight: 800; }
.sidebar-user strong,.sidebar-user small { display: block; }
.sidebar-user strong { font-size: var(--font-sm); }
.sidebar-user small { max-width: 145px; margin-top: 2px; overflow: hidden; color: var(--color-sidebar-text); font-size: var(--font-xs); text-overflow: ellipsis; white-space: nowrap; }
.workspace { width: 100%; max-width: none; margin: 0; padding: 0 32px 48px; min-width: 0; }
.workspace > * { min-width: 0; }
.topbar { min-height: 84px; margin: 0 -32px 24px; padding: 18px 32px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--color-border); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.page-context { min-width: 250px; }
.page-context .kicker { margin-bottom: 4px; color: var(--color-primary); }
.page-context h1 { margin: 0; font-family: inherit; font-size: var(--font-2xl); font-weight: 760; line-height: 1.2; letter-spacing: -.02em; }
.page-context p:last-child { margin: 5px 0 0; color: var(--color-text-secondary); font-size: var(--font-sm); }
.context-controls { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.context-chip { min-height: 36px; padding: 7px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--color-border); border-radius: 9px; background: var(--color-surface); color: var(--color-text-secondary); font-size: var(--font-xs); }
.context-chip b { color: var(--color-text); font-size: var(--font-xs); }
.mobile-menu-button { display: none; width: 38px; height: 38px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; color: var(--color-text); }
.page-view { animation: page-in 180ms ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
