body.has-shell {
  margin: 0;
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.app-nav {
  width: var(--nav-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(15, 118, 110, 0.04) 42%, transparent),
    var(--card);
  border-right: 1px solid var(--border);
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.app-nav .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  font-size: 1.05rem;
  font-weight: 750;
  padding: 0.3rem 0.45rem 1.1rem;
  color: var(--text);
}
.app-nav .brand::before {
  content: "品";
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: transparent;
  background:
    url("/static/assets/images/brand-mark.svg") center / cover no-repeat,
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}
.app-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.55rem 0.72rem;
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 560;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.app-nav a:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  transform: translateX(2px);
}
.app-nav a.on {
  background: var(--accent-dim);
  color: var(--step-on-fg);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
  padding: 0.75rem clamp(1rem, 2.4vw, 2rem);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
}
.app-topbar-title {
  font-size: 1rem;
  font-weight: 720;
  color: var(--text);
}
.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.shell-logout {
  font-size: 0.8rem;
  padding: 0.42rem 0.78rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.shell-logout:hover {
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}
.quota-pill {
  font-size: 0.8rem;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--step-on-fg);
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.quota-pill.warn { background: #fff4e0; color: #8a5a00; }
.app-content { flex: 1; overflow: auto; }
@media (max-width: 768px) {
  body.has-shell { flex-direction: column; }
  .app-nav {
    position: static;
    height: auto;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
  }
  .app-nav .brand { width: 100%; padding-bottom: 0.35rem; }
  .app-nav a { flex: 1 1 auto; justify-content: center; }
  .app-nav a:hover { transform: none; }
  .app-topbar { top: 0; }
}
