/* 设计令牌 + 全局骨架 */
:root {
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef2ff;
    --accent: #0ea5e9;
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --text: #111827;
    --text-2: #4b5563;
    --text-3: #9ca3af;
    --line: #e5e7eb;
    --line-soft: #f1f3f7;
    --bg: #f6f7fb;
    --surface: #fff;
    --sidebar: #0f172a;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 8px 24px -12px rgba(16, 24, 40, .18);
    --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .28);
    --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
svg { display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 启动屏 */
.app-root { min-height: 100vh; }
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; }
.boot-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 16px 32px -16px rgba(79, 70, 229, .8); }
.boot-bar { width: 150px; height: 4px; border-radius: 999px; background: #e6e8f0; overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--brand); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 244px; flex: 0 0 244px; background: var(--sidebar); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px 16px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #6366f1, #0ea5e9); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; }
.brand-text b { display: block; color: #fff; font-size: 15px; }
.brand-text span { font-size: 10.5px; color: #64748b; letter-spacing: .14em; text-transform: uppercase; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-group:first-child .nav-label { padding-top: 6px; }
.nav-label { font-size: 10.5px; color: #64748b; padding: 14px 12px 6px; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; color: #cbd5e1; font-size: 13.5px; cursor: pointer; transition: background .18s, color .18s; }
.nav-item svg { width: 17px; height: 17px; opacity: .85; }
.nav-item:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(99, 102, 241, .95), rgba(79, 70, 229, .72)); color: #fff; }
.nav-item .badge-dot { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 6px; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(148, 163, 184, .14); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { background: rgba(148, 163, 184, .2); color: #e2e8f0; }
.sidebar-user b { color: #f1f5f9; font-size: 13px; display: block; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { font-size: 11.5px; color: #94a3b8; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 26px; position: sticky; top: 0; z-index: 30; }
.topbar > div { min-width: 0; }
.topbar h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; min-width: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.topbar-actions .select { max-width: 190px; }
.content { padding: 22px 26px 44px; max-width: 1440px; width: 100%; margin: 0 auto; }
.menu-btn { display: none; }

.scrim { display: none; }

@media (max-width: 1080px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .24s; }
    .sidebar.open { transform: none; }
    .menu-btn { display: grid; }
    .scrim.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }
    .content { padding: 18px 16px 36px; }
    .topbar { padding: 0 16px; }
}
