/* layout.css — 应用骨架：侧栏、顶栏、内容区 */
/* ------------------------------------------------------------------ layout */

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--canvas-subtle);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.team-switch {
  margin: 12px 10px 10px; padding: 9px 10px;
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--canvas); cursor: pointer; width: calc(100% - 20px);
  color: var(--fg); font: inherit; text-align: left;
}
.team-switch:hover { border-color: var(--fg-subtle); }
.team-switch .ts-avatar {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--accent-subtle); color: var(--accent-fg);
}
.team-switch .ts-body { min-width: 0; flex: 1; }
.team-switch .ts-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-switch .ts-meta { font-size: 11px; color: var(--fg-subtle); }
.team-switch .chev { color: var(--fg-subtle); flex: none; }

.nav { padding: 4px 8px; display: flex; flex-direction: column; gap: 1px; }
.nav-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--fg-subtle); padding: 12px 8px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius);
  color: var(--fg-muted); font-size: 13px; cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--canvas-overlay); color: var(--fg); text-decoration: none; }
.nav-item.active { background: var(--canvas-overlay); color: var(--fg); font-weight: 600; }
.nav-item.active svg { color: var(--accent-fg); }
.nav-item svg { width: 16px; height: 16px; flex: none; color: var(--fg-subtle); }
.nav-count {
  margin-left: auto; font-size: 11px; color: var(--fg-subtle);
  background: var(--canvas); border: 1px solid var(--border-muted);
  padding: 0 6px; border-radius: 20px; line-height: 16px;
}

.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); }
.who { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--radius); }
.who:hover { background: var(--canvas-overlay); }
.who-body { min-width: 0; flex: 1; }
.who-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-meta { font-size: 11px; color: var(--fg-subtle); }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  line-height: 1; white-space: nowrap; overflow: hidden;
  background: hsla(var(--h, 210), 72%, 52%, 0.18);
  color: hsl(var(--h, 210), 72%, 72%);
  border: 1px solid hsla(var(--h, 210), 72%, 60%, 0.28);
}
[data-theme="light"] .avatar {
  background: hsla(var(--h, 210), 72%, 45%, 0.12);
  color: hsl(var(--h, 210), 62%, 36%);
  border-color: hsla(var(--h, 210), 62%, 50%, 0.22);
}
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }
.avatar.has-img { padding: 0; background: var(--canvas-overlay); }
.avatar.has-img img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; display: block;
}
.who-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-row .select { flex: 1; min-width: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 26px; border-bottom: 1px solid var(--border-muted);
  background: var(--canvas); position: sticky; top: 0; z-index: 30;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-muted); min-width: 0; }
.crumbs a { color: var(--fg-muted); }
.crumbs a:hover { color: var(--accent-fg); }
.crumbs .sep { color: var(--fg-subtle); }
.crumbs strong { color: var(--fg); font-weight: 600; }
.topbar .spacer { flex: 1; }

.content { padding: 22px 26px 60px; max-width: 1440px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.2px; }
.page-head p { margin: 0; color: var(--fg-muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
