:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #1e3a8a;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
body.app-shell {
  height: 100vh;
  overflow: hidden;
}
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  height: 100vh;
}
.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}
.brand {
  display: grid;
  gap: 6px;
}
.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 12px;
  color: rgba(249, 250, 251, 0.7);
}
.nav {
  display: grid;
  gap: 8px;
}
.nav a {
  text-decoration: none;
  color: rgba(249, 250, 251, 0.82);
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  cursor: pointer;
}
.nav a:hover {
  color: #ffffff;
  background: rgba(249, 250, 251, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
}
.nav a.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.content {
  padding: 32px 36px 48px;
  display: grid;
  gap: 22px;
  max-width: 1200px;
  width: min(100%, 1200px);
  justify-self: center;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}
.tool-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  background: transparent;
}
@media (max-width: 960px) {
  body.app-shell { overflow: auto; height: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .sidebar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: auto;
    position: static;
  }
  .nav { grid-auto-flow: column; grid-auto-columns: max-content; }
  .content {
    padding: 24px;
    height: auto;
    overflow: visible;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
  .tool-frame {
    height: 80vh;
  }
}
