/* ══════════════════════════════════════════════════════════════════
   Shared sidebar — injected into #sidebar-mount via partials/sidebar.js
   改导航样式只改这一个文件。active 由 sidebar.js 按 pathname 自动加。
   兼容两套设计变量：market 系(--panel/--text2/--text3) + dashboard 系
   (--bg-subtle/--text-soft)，未定义时 fallback 到硬编码默认；深色模式
   由各页 html[data-theme="dark"] 重定义变量自动适配。
   ══════════════════════════════════════════════════════════════════ */

/* ── Shell layout (272px 侧栏 + 自适应主区) ── */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
@media (max-width: 1024px) { .shell { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ── Sidebar 容器 ── */
.sidebar {
    background: var(--panel, var(--bg-subtle, #ffffff));
    border-right: 1px solid var(--line, #e2e8f0);
    display: flex; flex-direction: column;
    /* 固定满屏不随主区滚动：plan badge 始终停在左下角 */
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}
.sidebar .brand { padding: 18px 20px; border-bottom: 1px solid var(--line, #e2e8f0); }
.sidebar .brand a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.sidebar .brand img { width: 28px; height: 28px; border-radius: 6px; }
.sidebar .brand .name { font-weight: 800; font-size: 17px; color: var(--text, #0f172a); }
.sidebar .brand .name span { color: var(--accent, #6366f1); }

/* ── Nav 列表 ── */
.nav { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text3, var(--text-muted, #94a3b8)); padding: 16px 16px 4px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 1rem;
    font-size: 14px; font-weight: 500; font-family: inherit;
    color: var(--text2, var(--text-soft, #475569));
    text-decoration: none;
    border: 1px solid transparent;       /* 预留 border，避免 active 时高度跳变 */
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.nav-item:hover { background: var(--hover, #f1f5f9); color: var(--text, #0f172a); }
.nav-item.active { background: var(--hover, #f1f5f9); color: var(--text, #0f172a); border-color: var(--line, #e2e8f0); font-weight: 600; }
.nav-item i { width: 20px; text-align: center; font-size: 13px; flex-shrink: 0; }

/* ── More Tools 折叠头 + 子项 ── */
.more-btn {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; width: 100%; text-align: left; cursor: pointer;
    background: none; font-family: inherit;
    border: 1px solid transparent;
}
.more-btn .chev { font-size: 10px; transition: transform .2s; flex-shrink: 0; }
.more-btn .chev.open { transform: rotate(180deg); }
.sub-items { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line, #e2e8f0); display: flex; flex-direction: column; gap: 2px; }
.sub-items .nav-item { padding: 9px 14px; font-size: 13px; }

/* ── Plan badge 卡片：把刺眼橙渐变改成柔和琥珀，融入界面 ── */
.vercel-promo { background: rgba(240,180,41,0.08) !important; border: 1px solid rgba(240,180,41,0.2) !important; color: var(--text, #0f172a) !important; }
.vercel-promo .bg-white\/25, .vercel-promo .bg-white\/20, .vercel-promo .bg-white\/30 { background: rgba(240,180,41,0.15) !important; color: #f0b429 !important; }
.vercel-promo .text-white, .vercel-promo .text-white\/85, .vercel-promo .text-white\/80, .vercel-promo .text-white\/60 { color: var(--text3, #9d9da8) !important; }
.vercel-promo a, .vercel-promo span, .vercel-promo div { border-color: var(--line, #e2e8f0) !important; }

/* 兜底：万一某页没定义 x-cloak */
[x-cloak] { display: none !important; }
