: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; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
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: 22px 14px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(148, 163, 184, 0.28);
}
.brand {
  display: grid;
  gap: 4px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.brand-sub {
  font-size: 12px;
  color: rgba(249, 250, 251, 0.64);
  line-height: 1.35;
}
.nav {
  display: grid;
  gap: 6px;
  align-content: start;
}
.nav a {
  text-decoration: none;
  color: rgba(249, 250, 251, 0.8);
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.005em;
  transition: background 150ms ease, color 150ms ease;
  cursor: pointer;
}
.nav a:hover {
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.07);
}
.nav a.active {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-weight: 700;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 12px;
  color: rgba(226, 232, 240, 0.66);
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: normal;
}
.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: column;
    align-items: stretch;
    height: auto;
    position: static;
    gap: 12px;
  }
  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 6px;
  }
  .sidebar-footer {
    margin-top: 0;
    padding-top: 10px;
  }
  .content {
    padding: 24px;
    height: auto;
    overflow: visible;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
  .tool-frame {
    height: 80vh;
  }
}
