/* 外壳：玻璃侧栏 + 顶栏 + 工作区 */
.sidebar {
  position: fixed; inset: 12px auto 12px 12px; width: calc(var(--rail-w) - 12px);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
  background: var(--rail-bg);
  border: 1px solid var(--glass-line); border-radius: var(--r-xl);
  box-shadow: var(--e2);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  z-index: 20; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, #fff, #e9f5df 42%, #b9e88a 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 4px 12px rgba(88, 160, 33, .28); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: grid; line-height: 1.2; }
.brand-tag { font-size: 11px; color: var(--ink-faint); font-weight: 500; letter-spacing: .04em; }
.nav-caption { color: var(--ink-faint); font-size: 11px; letter-spacing: .08em; padding: 14px 12px 6px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a, .sidebar nav span {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--ink-muted); font-weight: 520;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.sidebar nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.sidebar nav a:hover { color: var(--ink); background: var(--surface-sunk); }
.sidebar nav a[aria-current] { color: var(--ink); background: var(--pill-bg); border: 1px solid var(--glass-line); box-shadow: var(--e1); font-weight: 640; }
.sidebar nav a[aria-current]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.sidebar nav a[aria-current] svg { color: var(--leaf-text); opacity: 1; }
.nav-disabled { color: var(--ink-faint) !important; cursor: default; }
.nav-disabled em { margin-left: auto; font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--surface-sunk); }
.sidebar-footer { margin-top: auto; padding: 12px; font-size: 11.5px; color: var(--ink-soft); }
.sidebar-footer .spec { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--plate-bg); color: var(--plate-soft); font-family: var(--font-mono); font-size: 11px; }
.sidebar-footer .spec b { color: var(--plate-ink); font-weight: 600; }
.sidebar-footer a { color: var(--ink-soft); }

.workspace { margin-left: var(--rail-w); min-width: 0; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  min-height: var(--topbar-h); padding: 12px 28px 12px 24px;
  background: linear-gradient(180deg, var(--page) 55%, transparent);
}
.topbar > button#nav-toggle { width: 36px; padding: 0; font-size: 15px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.crumbs b { color: var(--ink); font-weight: 650; }
.topbar .spacer { flex: 1; }
.top-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; color: var(--ink-muted); background: var(--pill-bg); border: 1px solid var(--glass-line); box-shadow: var(--e1); white-space: nowrap; }
.clock { font-variant-numeric: tabular-nums; }
.clock .tz { color: var(--ink-faint); font-size: 11px; }
.clock time { color: var(--ink); font-family: var(--font-mono); font-size: 12.5px; }
.sound::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); box-shadow: 0 0 0 3px rgba(var(--shade), .06); }
.connection[data-state="open"] { color: var(--leaf-text); border-color: rgba(130, 221, 45, .45); box-shadow: var(--e1), 0 0 0 3px var(--lime-soft); animation: pulse-ring 2.6s infinite; }
.connection[data-state="closed"] { color: var(--red-text); border-color: rgba(255, 90, 80, .35); }
.connection[data-state="pending"] { color: var(--amber-text); }
@keyframes pulse-ring { 50% { box-shadow: var(--e1), 0 0 0 6px transparent; } }
.theme-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.theme-label select { height: 32px; min-height: 32px; border-radius: 999px; padding: 0 28px 0 12px; font-size: 12px; }
.topbar form { margin: 0; }
.topbar form button { height: 32px; min-height: 32px; border-radius: 999px; font-size: 12px; }

main { padding: 8px 28px 48px 24px; }
.page-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 6px 0 4px; }
.page-heading .actions { margin-left: auto; display: flex; gap: 8px; }
.source-label { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; color: var(--ink-muted); background: var(--surface-sunk); border: 1px solid var(--line); }
.description { color: var(--ink-soft); font-size: 13px; margin: 6px 0 22px; max-width: 1100px; }
.hint { color: var(--ink-soft); font-size: 12.5px; margin: 14px 2px; }
.section-label { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-label h2 { margin: 0; }
.section-label span { color: var(--ink-faint); font-size: 12px; }

body.nav-collapsed .sidebar { display: none; }
body.nav-collapsed .workspace { margin-left: 0; }
.nav-scrim { display: none; }

@media (max-width: 1240px) {
  .theme-label > span, .clock .tz { display: none; }
}
@media (max-width: 1080px) {
  .sound, .crumbs > span { display: none; }
}
@media (max-width: 820px) {
  .sidebar { display: none; inset: 8px auto 8px 8px; width: min(78vw, 260px); box-shadow: var(--e3); }
  body.nav-open .sidebar { display: flex; animation: rail-in var(--dur) var(--ease-out); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(var(--shade), .28); backdrop-filter: blur(2px); }
  .workspace { margin-left: 0; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .crumbs, .sound, .theme-label > span { display: none; }
  .clock .tz { display: none; }
  main { padding: 6px 12px 40px; }
}
.top-password svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 560px) {
  .topbar .clock { display: none; }
  .top-password { width: 32px; padding: 0; }
  .top-password span { display: none; }
  .theme-label select { width: 92px; padding-right: 24px; }
  .page-heading .actions { margin-left: 0; width: 100%; }
}
@keyframes rail-in { from { transform: translateX(-16px); opacity: 0; } }
