body.ws-page {
  background:
    linear-gradient(180deg, #e8eef5 0%, var(--bg) 28%, var(--bg) 100%);
}
body.ws-page .site-footer {
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.site-header-workspace {
  background: rgba(255, 255, 255, 0.92);
}
.site-header-workspace .site-header-inner {

  grid-template-columns: minmax(0, 1fr) auto;
  max-width: none;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}
.ws-header-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  white-space: nowrap;
}
.ws-header-back svg { width: 14px; height: 14px; flex-shrink: 0; transform: rotate(180deg); }
.ws-header-back:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.ws-mainframe { min-height: calc(100vh - 64px); }

.ws-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  align-items: stretch;
}

.ws-rail {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 22px 14px 20px;
  background: #0f172a;
  color: #e2e8f0;
  border-right: 1px solid #1e293b;
  overflow: hidden;
}
.ws-rail-head {
  padding: 0 10px 18px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.ws-rail-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5eead4;
}
.ws-rail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.ws-rail-meta {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
}

.ws-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 4px 8px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.ws-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}
.ws-nav-group:last-child { margin-bottom: 8px; }
.ws-nav-title {
  margin: 0 0 6px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.ws-nav-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
  border: 1px solid transparent;
}
.ws-nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}
.ws-nav-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-nav-link:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #f8fafc;
}
.ws-nav-link[aria-current="true"] {
  background: rgba(13, 148, 136, 0.18);
  border-color: rgba(45, 212, 191, 0.35);
  color: #ccfbf1;
}
.ws-nav-link[aria-current="true"] .ws-nav-index { color: #5eead4; }

.ws-sidebar-note {
  flex-shrink: 0;
  margin: 10px 6px 0;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
  font-size: 12px;
  color: #64748b;
  line-height: 1.55;
}
.ws-sidebar-note a {
  color: #5eead4;
  font-weight: 700;
}
.ws-sidebar-note a:hover { text-decoration: underline; }

.ws-stage {
  min-width: 0;
  padding: 20px 28px 72px;
}

.ws-category {
  margin-bottom: 36px;
}
.ws-category:last-child { margin-bottom: 0; }

.ws-category-bar {
  position: sticky;
  top: 64px;
  z-index: 30;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 0 10px;
  background: linear-gradient(180deg, rgba(232, 238, 245, 0.96) 60%, rgba(232, 238, 245, 0));
  border-bottom: 1px solid transparent;
}
.ws-category-bar h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ws-category-bar span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.ws-panel {
  scroll-margin-top: 108px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.ws-panel:last-child { margin-bottom: 0; }
.ws-panel + .ws-panel { border-top-width: 0; }

.ws-panel-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.ws-panel-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.ws-panel-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 4px;
}
.ws-panel-mark svg { width: 17px; height: 17px; }
.ws-panel-copy { min-width: 0; }
.ws-panel-copy h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.3;
}
.ws-panel-copy p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 52rem;
  line-height: 1.5;
}
.ws-panel-open {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-secondary);
  background: var(--surface);
  white-space: nowrap;
}
.ws-panel-open svg { width: 12px; height: 12px; }
.ws-panel-open:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.ws-demo-host {
  padding: 18px 18px 20px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}
.ws-demo-host .tool-demo { max-width: 100%; }

.ws-demo-host .convert-actions {
  background: transparent;
}

@media (max-width: 1100px) {
  .ws-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .ws-stage { padding: 18px 20px 64px; }
}

@media (max-width: 900px) {
  .ws-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .ws-rail {
    position: sticky;
    top: 64px;
    z-index: 40;
    height: auto;
    width: 100%;
    padding: 0;
    background: #0f172a;
    border-right: 0;
    border-bottom: 1px solid #1e293b;
    overflow: visible;
  }
  .ws-rail-head {
    display: none;
  }
  .ws-sidebar-note { display: none; }
  .ws-nav-group { display: contents; }
  .ws-nav-title { display: none; }

  .ws-sidebar-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .ws-sidebar-nav::-webkit-scrollbar { display: none; }

  .ws-nav-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    grid-template-columns: none;
    padding: 8px 12px;
    border: 1px solid #334155;
    background: #1e293b;
    white-space: nowrap;
    border-radius: 999px;
  }
  .ws-nav-link[aria-current="true"] {
    border-color: #2dd4bf;
    background: rgba(13, 148, 136, 0.28);
  }

  .ws-stage { padding: 16px 16px 56px; }
  .ws-category-bar {
    top: 120px;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.97) 55%, rgba(241, 245, 249, 0));
  }
  .ws-panel { scroll-margin-top: 132px; }
}

@media (max-width: 640px) {
  .site-header-workspace .site-header-inner { padding-left: 16px; padding-right: 16px; }
  .ws-panel-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }
  .ws-panel-open { align-self: flex-start; }
  .ws-demo-host { padding: 12px 12px 16px; }
  .ws-category-bar { top: 112px; }
}

@media (max-width: 480px) {
  .ws-rail { top: 56px; }
  .ws-category-bar { top: 104px; }
  .ws-panel { scroll-margin-top: 120px; }
}

@media (max-width: 420px) {
  .ws-header-back span { display: none; }
  .ws-header-back { padding: 8px; }
  .ws-nav-index { display: none; }
}
