:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --workspace-rail: 92px;
  --workspace-bottom: 0px;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --active: #4338ca;
  --active-soft: #eef2ff;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #f7f8fa;
  color: var(--ink);
}

button,
iframe { font: inherit; }

button { letter-spacing: 0; }

.workspace-shell {
  display: grid;
  grid-template-columns: var(--workspace-rail) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 520px;
}

.workspace-rail {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.workspace-brand {
  position: relative;
  display: inline-flex;
  align-self: center;
  align-items: flex-start;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 0 14px;
  border: 0;
  border-radius: 7px;
  background: #3158c7;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(49, 88, 199, 0.24);
}

.workspace-brand span {
  margin-top: 8px;
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1;
}

.workspace-brand sup {
  margin-top: 6px;
  font-size: 12px;
  color: #fbbf24;
}

.workspace-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.workspace-nav button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 64px;
  padding: 7px 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.workspace-nav button:hover { background: #f7f8fa; color: var(--ink); }

.workspace-nav button[aria-current="page"] {
  background: var(--active-soft);
  color: var(--active);
}

.workspace-nav button[aria-current="page"]::before {
  position: absolute;
  left: -8px;
  width: 3px;
  height: 30px;
  border-radius: 0 3px 3px 0;
  background: var(--active);
  content: "";
}

.workspace-nav svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.nav-label,
.nav-label-short {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-label-short { display: none; }

.workspace-unread {
  position: absolute;
  top: 11px;
  right: 18px;
  display: none;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e11d48;
}

.workspace-unread.visible { display: block; }

.workspace-stage {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #f7f8fa;
}

.workspace-live-region {
  position: fixed;
  top: -200px;
  left: -200px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.workspace-panel,
.workspace-memory-view,
.workspace-memory-frames {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.workspace-panel[hidden],
.workspace-memory-view[hidden] { display: none; }

.workspace-panel iframe,
.workspace-memory-view iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.workspace-frame-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #475467;
  font-size: 13px;
}

.workspace-frame-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid #d0d5dd;
  border-top-color: var(--active);
  border-radius: 50%;
  animation: workspace-spin 800ms linear infinite;
}

.workspace-frame-loading.done {
  visibility: hidden;
  opacity: 0;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.workspace-memory-panel {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
}

.workspace-memory-switch {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.workspace-memory-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 120px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.workspace-memory-switch button:hover { background: #f7f8fa; color: var(--ink); }

.workspace-memory-switch button[aria-selected="true"] {
  border-color: #c7d2fe;
  background: var(--active-soft);
  color: var(--active);
}

.workspace-memory-switch svg { width: 16px; height: 16px; }

@keyframes workspace-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  :root {
    --workspace-rail: 0px;
    --workspace-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .workspace-shell {
    display: block;
    height: 100dvh;
    padding-bottom: var(--workspace-bottom);
  }

  .workspace-rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: block;
    height: var(--workspace-bottom);
    padding: 4px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    border-right: 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  }

  .workspace-brand { display: none; }

  .workspace-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: 62px;
    gap: 0;
  }

  .workspace-nav button {
    min-height: 58px;
    padding: 5px 1px;
    border-radius: 5px;
  }

  .workspace-nav button[aria-current="page"]::before {
    inset: -4px auto auto;
    width: 26px;
    height: 3px;
    border-radius: 0 0 3px 3px;
  }

  .workspace-nav svg { width: 18px; height: 18px; }
  .nav-label { display: none; }
  .nav-label-short { display: block; font-size: 10px; }
  .workspace-unread { top: 7px; right: calc(50% - 17px); }

  .workspace-stage { height: calc(100dvh - var(--workspace-bottom)); }

  .workspace-memory-panel { grid-template-rows: 45px minmax(0, 1fr); }
  .workspace-memory-switch { justify-content: stretch; padding: 5px 6px; }
  .workspace-memory-switch button { flex: 1; min-width: 0; padding: 0 5px; font-size: 11px; }
}

@media (max-width: 390px) {
  .nav-label-short { font-size: 9.5px; }
  .workspace-memory-switch button { gap: 4px; font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: 1ms !important; }
}
