/* Approved split workbench: charcoal navigation, light working surfaces, mint actions.
   Layout layers: sidebar 80, mobile backdrop 90, mobile sidebar 100, mobile bar 110.
   Radius scale: 8px controls, 12px panels. Motion only acknowledges interactions. */
body.workbench-theme {
  --wb-sidebar: #223336;
  --wb-sidebar-text: #e5efec;
  --wb-sidebar-muted: #acbfbb;
  --wb-background: #f3f6f5;
  --wb-surface: #ffffff;
  --wb-ink: #213438;
  --wb-muted: #617471;
  --wb-border: #dce7e2;
  --wb-accent: #9ce8d0;
  --wb-accent-ink: #164d42;
  --wb-accent-soft: #edf7f2;
  min-width: 320px;
  background: var(--wb-background);
  color: var(--wb-ink);
  font-family: "PingFang SC", "Microsoft YaHei", "SF Pro Display", system-ui, sans-serif;
}

body.workbench-theme .page-shell {
  width: auto;
  max-width: none;
  min-height: 100dvh;
  margin: 0 0 0 240px;
  padding: 30px 36px 28px;
}

body.workbench-theme .workbench-mobile-bar,
body.workbench-theme .workbench-nav-backdrop { display: none; }

body.workbench-theme .portal-header.workbench-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 240px;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 27px 16px 22px;
  gap: 28px;
  overflow: auto;
  border: 0;
  border-right: 1px solid #314749;
  border-radius: 0;
  background: var(--wb-sidebar);
  box-shadow: none;
  backdrop-filter: none;
  scrollbar-color: #55706c transparent;
  scrollbar-width: thin;
}

body.workbench-theme .workbench-sidebar .portal-brand {
  width: 100%;
  gap: 10px;
  padding: 0 7px;
  border-radius: 6px;
}

body.workbench-theme .workbench-sidebar .portal-brand__mark {
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  border-radius: 7px;
  background: var(--wb-accent);
  color: #1a453c;
  box-shadow: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

body.workbench-theme .workbench-sidebar .portal-brand__copy { gap: 3px; }
body.workbench-theme .workbench-sidebar .portal-brand__copy strong {
  color: #f4faf7;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
}
body.workbench-theme .workbench-sidebar .portal-brand__copy small {
  display: block;
  color: var(--wb-sidebar-muted);
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 400;
}

body.workbench-theme .workbench-sidebar .portal-header__right {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}
body.workbench-theme .workbench-sidebar .portal-quick-nav {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

body.workbench-theme .workbench-sidebar :is(.portal-nav-direct, .portal-nav-group__trigger) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--wb-sidebar-text);
  box-shadow: none;
  text-align: left;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease;
}
body.workbench-theme .workbench-sidebar :is(.portal-nav-direct, .portal-nav-group__trigger) > .wb-icon {
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
}
body.workbench-theme .workbench-sidebar :is(.portal-nav-direct, .portal-nav-group__trigger):hover {
  background: #2c4445;
  color: #f2fbf7;
  transform: none;
}
body.workbench-theme .workbench-sidebar .portal-nav-direct.is-active {
  background: #365c56;
  color: #b6f3df;
  box-shadow: inset 2px 0 0 #9ce8d0;
}
body.workbench-theme .workbench-sidebar .portal-nav-group {
  display: block;
  position: relative;
  width: 100%;
  border-radius: 0;
  background: transparent;
}
body.workbench-theme .workbench-sidebar .portal-nav-group.is-active > .portal-nav-group__trigger,
body.workbench-theme .workbench-sidebar .portal-nav-group.is-open > .portal-nav-group__trigger {
  background: transparent;
  color: #f1f8f5;
  box-shadow: none;
}
body.workbench-theme .workbench-sidebar .portal-nav-group__trigger .workbench-nav-caret {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: #b6c9c3;
  transition: transform 160ms ease;
}
body.workbench-theme .workbench-sidebar .portal-nav-group.is-open .workbench-nav-caret { transform: rotate(180deg); }
body.workbench-theme .workbench-sidebar .portal-nav-group.is-open .portal-nav-group__trigger span { transform: none; }
body.workbench-theme .workbench-sidebar .portal-nav-menu {
  position: static;
  display: none;
  width: auto;
  min-width: 0;
  margin: 2px 0 10px 22px;
  padding: 1px 0 1px 8px;
  gap: 3px;
  border: 0;
  border-left: 1px solid #49615e;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
}
body.workbench-theme .workbench-sidebar .portal-nav-group.is-open .portal-nav-menu { display: grid; }
body.workbench-theme .workbench-sidebar .portal-nav-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 39px;
  gap: 10px;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  color: #d4e2dc;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}
body.workbench-theme .workbench-sidebar .portal-nav-menu button b { font-size: 15px; line-height: 1.5; font-weight: 400; }
body.workbench-theme .workbench-sidebar .portal-nav-menu button .wb-icon { flex: 0 0 18px; width: 18px; height: 18px; }
body.workbench-theme .workbench-sidebar .portal-nav-menu button:hover { background: #2d4747; color: #f0faf5; }
body.workbench-theme .workbench-sidebar .portal-nav-menu button.is-active { background: #365c56; color: #b6f3df; }

body.workbench-theme .workbench-sidebar__external {
  margin: auto 8px 0;
  padding-top: 20px;
  border-top: 1px solid #45605c;
}
body.workbench-theme .workbench-sidebar__external-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e4eeea;
  font-size: 15px;
}
body.workbench-theme .workbench-sidebar__external-title .wb-icon { width: 20px; height: 20px; }
body.workbench-theme .workbench-sidebar__external nav {
  display: grid;
  gap: 1px;
  margin: 12px 0 0 9px;
  padding-left: 19px;
  border-left: 1px solid #49615e;
}
body.workbench-theme .workbench-sidebar__external a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  color: #c9dbd4;
  font-size: 14px;
  text-decoration: none;
}
body.workbench-theme .workbench-sidebar__external a .wb-icon { width: 14px; height: 14px; transform: rotate(-45deg); opacity: .7; }
body.workbench-theme .workbench-sidebar__external a:hover { color: #b6f3df; }
body.workbench-theme .workbench-sidebar :is(button, a):focus-visible { outline: 2px solid #9ce8d0; outline-offset: 3px; }

body.workbench-theme .tool-breadcrumb {
  max-width: 1440px;
  gap: 10px;
  margin: 0 auto 18px;
  color: #8c9a96;
  font-size: 14px;
  line-height: 1.6;
}
body.workbench-theme .tool-breadcrumb button { padding: 0; color: #5b716b; font-size: 14px; font-weight: 400; }
body.workbench-theme .tool-breadcrumb button:hover { color: #1d6c58; }
body.workbench-theme .tool-breadcrumb strong { color: #344c45; font-size: 14px; font-weight: 500; }

body.workbench-theme .portal-home {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
body.workbench-theme .portal-home::before,
body.workbench-theme .portal-home::after { display: none; }
body.workbench-theme .workbench-welcome { margin-bottom: 24px; }
body.workbench-theme .workbench-welcome > p { margin: 0 0 12px; color: var(--wb-muted); font-size: 14px; }
body.workbench-theme .workbench-welcome h1 { margin: 0 0 9px; color: #213438; font-size: 32px; line-height: 1.3; font-weight: 650; letter-spacing: -.035em; }
body.workbench-theme .workbench-welcome > span { display: block; color: var(--wb-muted); font-size: 18px; line-height: 1.7; }

body.workbench-theme .workbench-guide-entry {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 118px;
  margin-bottom: 22px;
  padding: 24px 28px;
  gap: 24px;
  border: 1px solid #d4e5dc;
  border-radius: 12px;
  background: #eaf4ef;
}
body.workbench-theme .workbench-guide-entry > .wb-icon { width: 43px; height: 43px; color: #3d8872; }
body.workbench-theme .workbench-guide-entry h2 { margin: 0 0 6px; color: #25443c; font-size: 23px; line-height: 1.4; font-weight: 650; }
body.workbench-theme .workbench-guide-entry p { margin: 0; color: #5e786d; font-size: 16px; line-height: 1.6; }
body.workbench-theme .workbench-guide-entry button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 14px;
  padding: 10px 22px;
  border: 1px solid #84cdb3;
  border-radius: 8px;
  color: #19483b;
  background: var(--wb-accent);
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease;
}
body.workbench-theme .workbench-guide-entry button:hover { background: #8ddfc3; }
body.workbench-theme .workbench-guide-entry button .wb-icon { width: 18px; height: 18px; }

body.workbench-theme .workbench-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body.workbench-theme .workbench-tool-group {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--wb-border);
  border-radius: 12px;
  background: var(--wb-surface);
}
body.workbench-theme .workbench-tool-group > header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
body.workbench-theme .workbench-tool-group__icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #28775f;
  background: #eaf5ee;
}
body.workbench-theme .workbench-tool-group__icon .wb-icon { width: 25px; height: 25px; }
body.workbench-theme .workbench-tool-group h2 { margin: 0 0 5px; color: #273b37; font-size: 23px; line-height: 1.4; font-weight: 650; }
body.workbench-theme .workbench-tool-group p { margin: 0; color: var(--wb-muted); font-size: 16px; line-height: 1.65; }
body.workbench-theme .workbench-tool-group__links { display: grid; gap: 8px; }
body.workbench-theme .workbench-tool-group__links button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  gap: 16px;
  padding: 12px 15px;
  border: 1px solid #e0eae5;
  border-radius: 8px;
  color: #314d43;
  background: #f8fbf9;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
body.workbench-theme .workbench-tool-group__links button:hover { border-color: #acd3c1; background: #edf7f1; }
body.workbench-theme .workbench-tool-group__links button .wb-icon { flex: 0 0 22px; width: 22px; height: 22px; color: #347e65; }
body.workbench-theme .workbench-tool-group__links button .wb-icon:last-child { width: 16px; height: 16px; flex-basis: 16px; margin-left: auto; color: #769c8b; }

body.workbench-theme .workbench-external {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 20px 24px;
  gap: 24px;
  border: 1px solid var(--wb-border);
  border-radius: 12px;
  background: var(--wb-surface);
}
body.workbench-theme .workbench-external__heading { display: flex; align-items: center; gap: 14px; }
body.workbench-theme .workbench-external__heading .workbench-tool-group__icon { width: 42px; height: 42px; flex-basis: 42px; }
body.workbench-theme .workbench-external h2 { margin: 0 0 4px; color: #2c453c; font-size: 17px; line-height: 1.4; font-weight: 650; }
body.workbench-theme .workbench-external p { margin: 0; color: var(--wb-muted); font-size: 14px; line-height: 1.6; }
body.workbench-theme .workbench-external__links { display: flex; flex-wrap: wrap; gap: 10px; }
body.workbench-theme .workbench-external__links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 14px;
  padding: 9px 16px;
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  color: #415d51;
  background: #f8fbf9;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
body.workbench-theme .workbench-external__links a:hover { border-color: #acd3c1; background: #edf7f1; }
body.workbench-theme .workbench-external__links a .wb-icon { width: 16px; height: 16px; transform: rotate(-45deg); }
body.workbench-theme .workbench-home-footer { padding-top: 24px; color: #738a7e; font-size: 13px; text-align: center; }
body.workbench-theme .portal-home :is(button, a):focus-visible { outline: 3px solid #4c9b7c; outline-offset: 3px; }

@media (min-width: 1600px) {
  body.workbench-theme .page-shell { padding-right: 52px; padding-left: 52px; }
}

@media (max-width: 1120px) and (min-width: 900px) {
  body.workbench-theme .page-shell { padding: 25px 24px; }
  body.workbench-theme .workbench-tool-group { padding: 19px; }
  body.workbench-theme .workbench-tool-group > header { align-items: flex-start; gap: 11px; }
  body.workbench-theme .workbench-tool-group h2 { font-size: 21px; }
  body.workbench-theme .workbench-tool-group__icon { flex-basis: 40px; width: 40px; height: 40px; }
  body.workbench-theme .workbench-external { align-items: flex-start; flex-direction: column; gap: 17px; }
}

@media (max-width: 899px) {
  body.workbench-theme .page-shell { margin-left: 0; padding: 88px 22px 24px; }
  body.workbench-theme .workbench-mobile-bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid #36504e;
    background: var(--wb-sidebar);
    color: #edf8f2;
  }
  body.workbench-theme .workbench-mobile-bar__brand { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 5px; color: #edf8f2; background: transparent; font-size: 16px; font-weight: 650; }
  body.workbench-theme .workbench-mobile-bar__brand span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; color: #214b3e; background: var(--wb-accent); font-size: 13px; }
  body.workbench-theme #workbenchNavToggle { display: grid; width: 40px; height: 40px; padding: 8px; place-items: center; border: 1px solid #4e6b62; border-radius: 7px; color: #edf8f2; background: transparent; cursor: pointer; }
  body.workbench-theme #workbenchNavToggle .wb-icon { width: 23px; height: 23px; }
  body.workbench-theme .portal-header.workbench-sidebar { inset: 64px auto 0 0; z-index: 100; width: 260px; height: calc(100dvh - 64px); padding-top: 18px; visibility: hidden; transform: translateX(-100%); transition: transform 200ms ease, visibility 200ms ease; }
  body.workbench-theme .workbench-sidebar .portal-brand { display: none; }
  body.workbench-theme .workbench-nav-backdrop { position: fixed; inset: 64px 0 0; z-index: 90; display: block; visibility: hidden; background: rgb(23 45 40 / 34%); opacity: 0; transition: opacity 200ms ease, visibility 200ms ease; }
  body.workbench-theme.is-nav-open { overflow: hidden; }
  body.workbench-theme.is-nav-open .workbench-sidebar { visibility: visible; transform: translateX(0); }
  body.workbench-theme.is-nav-open .workbench-nav-backdrop { visibility: visible; opacity: 1; }
  body.workbench-theme .workbench-mobile-bar button:focus-visible { outline: 2px solid #9ce8d0; outline-offset: 3px; }
  body.workbench-theme .workbench-welcome h1 { font-size: 28px; }
  body.workbench-theme .workbench-library { gap: 15px; }
  body.workbench-theme .workbench-tool-group { padding: 20px; }
  body.workbench-theme .workbench-tool-group > header { align-items: flex-start; gap: 11px; }
  body.workbench-theme .workbench-tool-group h2 { font-size: 21px; }
  body.workbench-theme .workbench-tool-group__icon { width: 40px; height: 40px; flex-basis: 40px; }
  body.workbench-theme .workbench-external { flex-direction: column; align-items: flex-start; gap: 17px; }
}

@media (max-width: 639px) {
  body.workbench-theme .page-shell { padding: 83px 16px 24px; }
  body.workbench-theme .workbench-welcome { margin-bottom: 20px; }
  body.workbench-theme .workbench-welcome > p { margin-bottom: 10px; }
  body.workbench-theme .workbench-welcome h1 { font-size: 26px; }
  body.workbench-theme .workbench-welcome > span { font-size: 16px; }
  body.workbench-theme .workbench-guide-entry { grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 20px; margin-bottom: 16px; }
  body.workbench-theme .workbench-guide-entry > .wb-icon { width: 33px; height: 33px; }
  body.workbench-theme .workbench-guide-entry h2 { font-size: 20px; }
  body.workbench-theme .workbench-guide-entry p { font-size: 15px; }
  body.workbench-theme .workbench-guide-entry button { grid-column: 1 / -1; width: 100%; margin-top: 2px; }
  body.workbench-theme .workbench-library { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.workbench-theme .workbench-tool-group > header { align-items: center; margin-bottom: 17px; }
  body.workbench-theme .workbench-tool-group { padding: 20px; }
  body.workbench-theme .workbench-external { padding: 20px; margin-top: 16px; }
  body.workbench-theme .workbench-external__links { display: grid; grid-template-columns: 1fr; width: 100%; gap: 8px; }
  body.workbench-theme .workbench-external__links a { justify-content: space-between; }
  body.workbench-theme .tool-breadcrumb { gap: 7px; margin-bottom: 16px; font-size: 13px; }
  body.workbench-theme .tool-breadcrumb :is(button, strong) { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  body.workbench-theme :is(.workbench-sidebar, .workbench-nav-backdrop, .workbench-nav-caret, .workbench-guide-entry button, .workbench-tool-group__links button) { transition: none !important; }
}
