/* base.css — 全局骨架：布局 / Sidebar / Topbar / Tabbar */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--fg); }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

.app { display: flex; min-height: 100dvh; }

/* ---------- Sidebar（桌面 232px） ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.sidebar-logo {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
}
.logo-mark { color: var(--accent); display: flex; }
.logo-text { font-size: var(--text-lg); font-weight: 590; letter-spacing: 0.01em; }
.sidebar-nav { flex: 1; padding: var(--space-3) var(--space-2); display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--muted); font-weight: 510; font-size: var(--text-base);
  position: relative; text-align: left; width: 100%;
  transition: background-color var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard);
}
.nav-item:hover { background: var(--surface-sunken); color: var(--fg); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 2px; border-radius: var(--radius-pill); background: var(--accent);
}
.nav-item svg { flex-shrink: 0; }
.sidebar-foot { padding: var(--space-3) var(--space-2); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-1); }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: var(--text-lg); font-weight: 590; line-height: var(--leading-tight); }
.topbar-date { font-size: var(--text-sm); color: var(--meta); }
.content { flex: 1; padding: var(--space-6); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; }
.container-wide { max-width: var(--container-wide); margin: 0 auto; }
.container-full { max-width: var(--container-full); margin: 0 auto; }

/* ---------- 底部 Tabbar（<768px） ---------- */
.tabbar { display: none; }

/* ---------- <1024px：Sidebar 收成 56px 图标栏 ---------- */
@media (max-width: 1023px) {
  .sidebar { width: 56px; }
  .logo-text, .nav-item span, .sidebar-foot .btn span { display: none; }
  .sidebar-logo { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: -10px; }
  .sidebar-foot .btn { justify-content: center; padding: 0; }
}

/* ---------- <768px：底部 Tabbar ---------- */
@media (max-width: 767px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .content { padding: var(--space-4); padding-bottom: calc(var(--verdictbar-h) + 72px); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: var(--surface); border-top: 1px solid var(--border);
    height: 60px;
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--meta); font-size: 10px; font-weight: 510;
    min-height: 44px;
    transition: color var(--motion-base) var(--ease-standard);
  }
  .tabbar-item.active { color: var(--accent); }
  .topbar { padding: 0 var(--space-4); }
}
