:root,
html[data-theme="light"] {
    --bg: #f5f7fb;
    --panel: rgba(255, 255, 255, 0.92);
    --bg-panel: #ffffff;
    --panel-soft: #f1f5f9;
    --text: #0f172a;
    --text-soft: #64748b;
    --muted: #94a3b8;
    --line: #d8e1ee;
    --line-soft: #e8edf5;
    --primary: #2563eb;
    --primary-2: #7c3aed;
    --success: #16a34a;
    --danger: #dc2626;
    --warn: #d97706;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
    --soft: rgba(37, 99, 235, 0.08);
}

html[data-theme="dark"],
body[data-theme="dark"] {
    --bg: #0b1220;
    --panel: rgba(15, 23, 42, 0.86);
    --bg-panel: #111827;
    --panel-soft: #172033;
    --text: #e5eefc;
    --text-soft: #93a4c4;
    --muted: #64748b;
    --line: rgba(148, 163, 184, 0.24);
    --line-soft: rgba(148, 163, 184, 0.16);
    --primary: #60a5fa;
    --primary-2: #a78bfa;
    --success: #4ade80;
    --danger: #f87171;
    --warn: #fbbf24;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --soft: rgba(96, 165, 250, 0.12);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    min-height: 100vh;
}

.shell-root {
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: 100vh;
    background: var(--bg);
}
.shell-sidebar {
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    backdrop-filter: blur(16px);
}
.shell-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
}
.shell-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}
.shell-brand-text { font-weight: 700; font-size: 18px; color: var(--text); }
.shell-nav { display: grid; gap: 8px; }
.shell-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    transition: background .16s ease, transform .16s ease, border-color .16s ease;
    border: 1px solid transparent;
}
.shell-nav-item:hover { background: var(--soft); transform: translateX(2px); }
.shell-nav-item.active {
    background: color-mix(in srgb, var(--primary) 12%, var(--bg-panel));
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}
.shell-nav-icon { width: 24px; text-align: center; }
.shell-nav-text { font-weight: 700; }
.shell-theme-inline { margin-top: 4px; }
.shell-toolbar { margin-top: auto; display: grid; gap: 12px; padding-top: 10px; }
.shell-theme-group { display: flex; gap: 8px; }
.theme-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-panel) 94%, transparent);
    cursor: pointer;
    color: var(--text);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.theme-icon-btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 58%, var(--line)); }
.theme-icon-btn.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.shell-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
    background: color-mix(in srgb, var(--bg-panel) 94%, transparent);
    font-weight: 700;
}
.shell-main { min-width: 0; }

@media (max-width: 960px) {
    .shell-root { grid-template-columns: 1fr; }
    .shell-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}

.shell-root { height: 100vh; min-height: 100vh; overflow: hidden; }
.shell-sidebar { height: 100vh; box-sizing: border-box; }
.shell-main { min-width: 0; height: 100vh; overflow: hidden; }
.shell-logout-btn { width: 100%; font: inherit; cursor: pointer; }
