/* 奕境 DMS · PC 固定外壳 */
html,
body.pc-shell-host {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg-page);
  color: var(--text-primary);
}

body.pc-shell-host {
  --dms-shell-topbar-height: 56px;
  --dms-shell-sidebar-width: 224px;
  --dms-prd-width: 420px;
  font-family: var(--font-family-base);
}

.pc-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--dms-shell-sidebar-width) minmax(0, 1fr) 1px minmax(300px, var(--dms-prd-width));
  grid-template-rows: var(--dms-shell-topbar-height) minmax(0, 1fr);
  background: var(--bg-page);
}

body.pc-shell-prd-collapsed .pc-shell {
  grid-template-columns: var(--dms-shell-sidebar-width) minmax(0, 1fr) 0 0;
}

.pc-shell-sidebar {
  grid-column: 1;
  grid-row: 1 / 3;
  width: var(--dms-shell-sidebar-width);
  min-width: var(--dms-shell-sidebar-width);
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border-light);
  background: var(--sidebar-bg);
}

.pc-shell-sidebar .sidebar-brand {
  height: var(--dms-shell-topbar-height);
  border-bottom: 1px solid var(--border-light);
}

.pc-shell-sidebar .sidebar-menu {
  height: calc(100vh - var(--dms-shell-topbar-height));
}

.pc-shell-main {
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--dms-shell-topbar-height) minmax(0, 1fr) 32px;
  overflow: hidden;
}

.pc-shell-topbar {
  grid-row: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--dms-shell-topbar-height);
  min-height: var(--dms-shell-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  box-sizing: border-box;
}

.pc-shell-title {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-breadcrumb-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.pc-shell-breadcrumb {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  white-space: nowrap;
}

.pc-shell-crumb,
.pc-shell-crumb-sep {
  flex: 0 0 auto;
}

.pc-shell-crumb.current {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-crumb-sep {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.pc-shell-tools {
  position: relative;
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pc-shell-tool-menu-toggle {
  display: none;
}

.pc-shell-tool-popover,
.pc-shell-tool-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-shell-tools .topbar-search {
  position: relative;
  width: 240px;
  flex: 0 1 240px;
  min-width: 168px;
}

.pc-shell-tools .topbar-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  z-index: 40;
}

.pc-shell-tools .topbar-search-panel.open {
  display: block;
}

.pc-shell-tools .topbar-search-result {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  text-align: left;
  cursor: pointer;
}

.pc-shell-tools .topbar-search-result em {
  max-width: 120px;
  overflow: hidden;
  color: var(--text-tertiary);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-shell-tools .topbar-search-result:hover,
.pc-shell-tools .topbar-search-result.active {
  background: var(--sidebar-active-bg);
  color: var(--brand-primary);
}

.pc-shell-tools .topbar-search-empty {
  padding: 10px;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
}

.pc-shell-tools .topbar-icon {
  width: 32px;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.pc-shell-tools .topbar-icon.active,
.pc-shell-tools .pc-shell-prd-toggle.active {
  border-color: rgba(134, 27, 47, 0.18);
  background: var(--sidebar-active-bg);
  color: var(--brand-primary);
}

.pc-shell-prd-toggle {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pc-shell-prd-toggle-icon {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.pc-shell-prd-toggle:hover {
  border-color: rgba(134, 27, 47, 0.24);
  color: var(--brand-primary);
}

.pc-shell-prd-toggle.active {
  border-color: rgba(134, 27, 47, 0.28);
  background: var(--sidebar-active-bg);
  color: var(--brand-primary);
}

.pc-shell-preview {
  position: relative;
  grid-row: 2;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-page);
}

.pc-shell-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background-image: var(--dms-watermark-image, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='168' viewBox='0 0 280 168'%3E%3Cg transform='translate(24 104) rotate(-24)'%3E%3Ctext fill='%23861B2F' fill-opacity='0.08' font-family='Arial,sans-serif' font-size='18' font-weight='400'%3E%E5%BC%A0%E4%B8%89%20EJ10001%3C/text%3E%3C/g%3E%3C/svg%3E"));
  background-repeat: repeat;
}

.pc-shell-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: var(--bg-page);
  opacity: 1;
  transition: opacity 120ms ease;
}

.pc-shell-frame.is-loading {
  opacity: 1;
}

.pc-shell-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  display: none;
  min-width: 112px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, -50%);
  z-index: 10;
}

.pc-shell-preview.is-loading .pc-shell-loading {
  display: inline-flex;
}

.pc-shell-preview.is-pending .pc-shell-locator-layer,
.pc-shell-preview.is-loading .pc-shell-locator-layer {
  display: none;
}

.pc-shell-prd {
  grid-column: 4;
  grid-row: 1 / 3;
  position: relative;
  z-index: 8;
  min-width: 0;
  width: min(100%, var(--dms-prd-width));
  height: 100vh;
  overflow: hidden;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
}

body.pc-shell-prd-collapsed .pc-shell-prd {
  display: none;
}

.pc-shell-prd-resizer {
  grid-column: 3;
  grid-row: 1 / 3;
  position: relative;
  justify-self: center;
  width: 9px;
  cursor: col-resize;
  background: transparent;
  border-left: 0;
  border-right: 0;
  z-index: 9;
}

.pc-shell-prd-resizer::before {
  content: "";
  position: absolute;
  inset: 0;
}

.pc-shell-prd-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  border-radius: 0;
  background: var(--border-light);
  opacity: 1;
  transform: translateX(-50%);
  transition: opacity 0.15s, background 0.15s;
}

.pc-shell-prd-resizer:hover::after,
body.pc-shell-resizing .pc-shell-prd-resizer::after {
  background: var(--brand-primary);
  opacity: 1;
}

body.pc-shell-prd-collapsed .pc-shell-prd-resizer {
  display: none;
}

body.pc-shell-resizing,
body.pc-shell-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

@media (max-width: 1440px) {
  body.pc-shell-host {
    --dms-prd-width: min(380px, 28vw);
  }

  .pc-shell-topbar {
    gap: 10px;
    padding: 0 12px;
  }

  .pc-shell-title .muted {
    max-width: 360px;
  }

  .pc-shell-tools {
    gap: 6px;
  }

  .pc-shell-tools .topbar-search {
    width: 210px;
    flex-basis: 210px;
  }
}

@media (max-width: 1360px) {
  .pc-shell-title .muted,
  .topbar-user .topbar-name {
    display: none;
  }

  .pc-shell-tools .topbar-search {
    width: 180px;
    flex-basis: 180px;
    min-width: 148px;
  }

  .pc-shell-prd-toggle {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .pc-shell-prd-toggle span {
    display: none;
  }

  .pc-shell-prd-toggle-icon {
    display: block;
  }
}

@media (max-width: 1180px) {
  body.pc-shell-host {
    --dms-shell-sidebar-width: 200px;
  }

  .pc-shell-tools {
    flex: 0 0 auto;
  }

  .pc-shell-tool-menu-toggle {
    display: inline-flex;
  }

  .pc-shell-tools.is-open .pc-shell-tool-menu-toggle {
    border-color: rgba(134, 27, 47, 0.18);
    background: var(--sidebar-active-bg);
    color: var(--brand-primary);
  }

  .pc-shell-tool-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, max(180px, calc(100vw - var(--dms-shell-sidebar-width) - var(--dms-prd-width) - 24px)));
    min-width: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    z-index: 70;
  }

  .pc-shell-tools.is-open .pc-shell-tool-popover {
    display: flex;
  }

  .pc-shell-tool-row {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .pc-shell-tools .topbar-search {
    width: 32px;
    min-width: 32px;
    flex: 0 0 32px;
    height: 32px;
    justify-content: center;
    gap: 0;
    padding: 0;
    overflow: visible;
  }

  .pc-shell-tools .topbar-search input {
    width: 0;
    min-width: 0;
    flex: 0 0 0;
    opacity: 0;
    pointer-events: none;
  }

  .pc-shell-tools .topbar-search.is-expanded {
    position: fixed;
    top: calc(var(--dms-shell-topbar-height) + 10px);
    left: calc(var(--dms-shell-sidebar-width) + 12px);
    width: min(320px, calc(100vw - var(--dms-shell-sidebar-width) - var(--dms-prd-width) - 40px));
    min-width: 220px;
    height: 38px;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 12px;
    box-shadow: var(--shadow-md);
    z-index: 50;
  }

  .pc-shell-tools .topbar-search.is-expanded input {
    flex: 1 1 auto;
    width: auto;
    opacity: 1;
    pointer-events: auto;
  }

  .pc-shell-tools .topbar-search.is-expanded .topbar-search-panel {
    right: auto;
    width: 100%;
  }

  .pc-shell-tool-popover .topbar-search,
  .pc-shell-tool-popover .topbar-search.is-expanded {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    height: 38px;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 12px;
    overflow: visible;
    box-shadow: none;
    z-index: auto;
  }

  .pc-shell-tool-popover .topbar-search input,
  .pc-shell-tool-popover .topbar-search.is-expanded input {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    opacity: 1;
    pointer-events: auto;
  }

  .pc-shell-tool-popover .topbar-search-panel,
  .pc-shell-tool-popover .topbar-search.is-expanded .topbar-search-panel {
    right: auto;
    width: 100%;
  }

  .pc-shell-tool-popover .topbar-user {
    height: 32px;
    padding-right: 8px;
  }

  .pc-shell-tool-popover .topbar-user .topbar-name {
    display: inline;
  }

  .pc-shell-tool-popover .pc-shell-prd-toggle {
    width: auto;
    min-width: 0;
    padding: 0 12px;
  }

  .pc-shell-tool-popover .pc-shell-prd-toggle span {
    display: inline;
  }

  .pc-shell-tool-popover .pc-shell-prd-toggle-icon {
    display: block;
  }

  .pc-shell-title strong {
    max-width: 128px;
  }
}

@media (max-width: 1024px) {
  .pc-shell-tools .topbar-search.is-expanded {
    width: min(320px, calc(100vw - var(--dms-shell-sidebar-width) - 32px));
  }
}

.pc-shell-prd .dms-prd-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 0;
  flex-basis: auto;
  background: var(--bg-card);
  color: var(--text-primary);
}

.pc-shell-prd .dms-prd-resizer {
  display: none;
}

.pc-shell-prd .dms-prd-head {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "tabs";
  gap: 10px;
  align-items: center;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.pc-shell-prd .dms-prd-head:not(:has(.dms-prd-tabs)) {
  min-height: 64px;
  overflow: hidden;
}

.pc-shell-prd .dms-prd-head:has(.dms-prd-tabs) {
  min-height: 88px;
}

.pc-shell-prd .dms-prd-title-row {
  grid-area: title;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pc-shell-prd .dms-prd-eyebrow {
  display: none;
}

.pc-shell-prd .dms-prd-title {
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-shell-prd .dms-prd-updated {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  line-height: 1.45;
  white-space: nowrap;
}

.pc-shell-prd .dms-prd-badge {
  display: none;
}

.pc-shell-prd .dms-prd-tabs {
  grid-area: tabs;
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
}

.pc-shell-prd .dms-prd-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.pc-shell-prd .dms-prd-tabs button.active {
  background: var(--bg-card);
  color: var(--brand-primary);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 3px rgba(20, 27, 39, 0.08);
}

.pc-shell-prd .dms-prd-current {
  display: none;
}

.pc-shell-prd .dms-prd-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 24px;
  background: var(--bg-card);
}

.pc-shell-prd .dms-prd-meta {
  margin-bottom: 12px;
  padding: 12px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.pc-shell-prd .dms-prd-meta p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-shell-prd .dms-prd-meta strong {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .dms-prd-empty,
.pc-shell-prd .prd-feature-empty {
  padding: 22px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  text-align: center;
  font-size: var(--font-size-sm);
}

.pc-shell-prd .dms-prd-doc {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.72;
}

.pc-shell-prd .prd-md h1,
.pc-shell-prd .prd-md h2,
.pc-shell-prd .prd-md h3,
.pc-shell-prd .prd-md h4 {
  margin: 18px 0 8px;
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  letter-spacing: 0;
}

.pc-shell-prd .prd-md h1:first-child,
.pc-shell-prd .prd-md h2:first-child,
.pc-shell-prd .prd-md h3:first-child {
  margin-top: 0;
}

.pc-shell-prd .prd-md h1 { font-size: var(--font-size-xl); }
.pc-shell-prd .prd-md h2 { font-size: var(--font-size-lg); }
.pc-shell-prd .prd-md h3 { font-size: var(--font-size-md); }
.pc-shell-prd .prd-md h4 { font-size: var(--font-size-base); }

.pc-shell-prd .prd-md p,
.pc-shell-prd .prd-md ul,
.pc-shell-prd .prd-md ol,
.pc-shell-prd .prd-md blockquote,
.pc-shell-prd .prd-md .prd-md-table-wrap,
.pc-shell-prd .prd-md .prd-md-diagram,
.pc-shell-prd .prd-md .prd-md-code {
  margin: 8px 0;
}

.pc-shell-prd .prd-md p {
  color: var(--text-secondary);
}

.pc-shell-prd .prd-md ul,
.pc-shell-prd .prd-md ol {
  padding-left: 18px;
  color: var(--text-secondary);
}

.pc-shell-prd .prd-md li + li {
  margin-top: 4px;
}

.pc-shell-prd .prd-md blockquote {
  padding: 10px 12px;
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-md);
  background: var(--brand-50, #fdf3f3);
  color: var(--text-secondary);
}

.pc-shell-prd .prd-md code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-page);
  color: var(--func-id-color);
  font-family: var(--font-mono);
  font-size: 12px;
}

.pc-shell-prd .prd-md .prd-md-code {
  overflow-x: auto;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.5;
}

.pc-shell-prd .prd-md .prd-md-table-wrap,
.pc-shell-prd .prd-feature-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.pc-shell-prd .prd-md table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.pc-shell-prd .prd-md th,
.pc-shell-prd .prd-md td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.pc-shell-prd .prd-md th {
  background: var(--bg-table-header);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-md tr:last-child td {
  border-bottom: none;
}

.pc-shell-prd .prd-md .prd-md-diagram {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
}

.pc-shell-prd .prd-md .prd-md-diagram-title {
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-md .prd-md-flow-canvas {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.pc-shell-prd .prd-md .prd-md-flow-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.pc-shell-prd .prd-md .prd-md-flow-head strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-md .prd-md-flow-head span,
.pc-shell-prd .prd-md .prd-md-flow-hint {
  color: var(--text-tertiary, var(--text-secondary));
  font-size: var(--font-size-xs);
}

.pc-shell-prd .prd-md .prd-md-flow-tools {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.pc-shell-prd .prd-md .prd-md-flow-tools button {
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-md .prd-md-flow-viewport {
  height: 380px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background:
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px),
    var(--bg-page);
  background-size: 24px 24px;
}

.pc-shell-prd .prd-md .prd-md-flow-viewport.is-panning {
  cursor: grabbing;
}

.pc-shell-prd .prd-md .prd-md-flow-board {
  width: 880px;
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 18px;
  transform-origin: 0 0;
}

.pc-shell-prd .prd-md .prd-md-flow-lane {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.92);
}

.pc-shell-prd .prd-md .prd-md-flow-lane h4 {
  margin: 0 0 2px;
  color: var(--brand-primary);
  font-size: var(--font-size-xs);
}

.pc-shell-prd .prd-md .prd-md-flow-node {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.pc-shell-prd .prd-md .prd-md-flow-node strong {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.pc-shell-prd .prd-md .prd-md-flow-node span {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}

.pc-shell-prd .prd-md .prd-md-flow-node.start,
.pc-shell-prd .prd-md .prd-md-flow-node.end {
  border-color: var(--brand-primary);
  background: var(--brand-50, #F4E7EA);
}

.pc-shell-prd .prd-md .prd-md-flow-hint {
  padding: 8px 12px 10px;
}

.pc-shell-prd .prd-feature-doc {
  display: grid;
  gap: 12px;
}

.pc-shell-prd .prd-current-adjustments {
  display: grid;
  counter-reset: current-section;
  gap: 12px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--bg-card);
  color: var(--text-primary);
}

.pc-shell-prd .prd-current-hero {
  display: none;
}

.pc-shell-prd .prd-current-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: 22px;
  margin-bottom: 8px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-active-bg);
  color: var(--brand-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.pc-shell-prd .prd-current-hero h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
}

.pc-shell-prd .prd-current-hero p {
  margin: 9px 0 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.72;
}

.pc-shell-prd .prd-current-section {
  position: relative;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.pc-shell-prd .prd-current-section::before {
  content: none;
}

.pc-shell-prd .prd-current-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.pc-shell-prd .prd-current-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-table-header);
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.pc-shell-prd .prd-current-section h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1.45;
}

.pc-shell-prd .prd-current-card-head p {
  margin: 4px 0 0;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.pc-shell-prd .prd-current-card-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.pc-shell-prd .prd-current-block {
  display: grid;
  gap: 8px;
}

.pc-shell-prd .prd-current-block + .prd-current-block {
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.pc-shell-prd .prd-current-block h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.45;
}

.pc-shell-prd .prd-current-block p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.68;
}

.pc-shell-prd .prd-current-subgroup {
  display: grid;
  gap: 6px;
}

.pc-shell-prd .prd-current-subgroup h5 {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.45;
}

.pc-shell-prd .prd-current-summary {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.68;
}

.pc-shell-prd .prd-current-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.62;
}

.pc-shell-prd .prd-current-list li {
  position: relative;
  padding-left: 14px;
}

.pc-shell-prd .prd-current-list li::before {
  content: "";
  position: absolute;
  top: .7em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
}

.pc-shell-prd .prd-current-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.pc-shell-prd .prd-current-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  table-layout: fixed;
}

.pc-shell-prd .prd-current-table th,
.pc-shell-prd .prd-current-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  text-align: left;
  word-break: break-word;
}

.pc-shell-prd .prd-current-table th {
  background: var(--bg-table-header);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-current-table th + th,
.pc-shell-prd .prd-current-table td + td {
  border-left: 1px solid var(--border-light);
}

.pc-shell-prd .prd-current-table tbody tr:last-child td {
  border-bottom: 0;
}

.pc-shell-prd .prd-current-flow {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.pc-shell-prd .prd-current-flow .prd-md-flow-head {
  min-height: 44px;
  padding: 9px 10px;
}

.pc-shell-prd .prd-current-flow .prd-md-flow-viewport {
  height: 260px;
}

.pc-shell-prd .prd-current-flow .prd-md-flow-board {
  width: 760px;
  min-height: 320px;
  gap: 12px;
  padding: 14px;
}

.pc-shell-prd .prd-current-flow .prd-md-flow-lane {
  gap: 10px;
  padding: 10px;
}

.pc-shell-prd .prd-current-flow .prd-md-flow-node {
  min-height: 72px;
}

.pc-shell-prd .prd-md .prd-md-flow-board.is-drawio-board,
.pc-shell-prd .prd-current-flow .prd-md-flow-board.is-drawio-board {
  width: 1720px;
  min-height: 980px;
  display: block;
  gap: 0;
  padding: 0;
  background: #fff;
}

.pc-shell-prd .prd-md .prd-md-drawio-svg {
  width: 1720px;
  height: 980px;
  display: block;
}

.pc-shell-prd .prd-md .prd-md-drawio-reference {
  width: 760px;
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 24px;
  background: #fff;
}

.pc-shell-prd .prd-md .prd-md-drawio-reference strong {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
}

.pc-shell-prd .prd-md .prd-md-drawio-reference span,
.pc-shell-prd .prd-md .prd-md-drawio-reference p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.pc-shell-prd .prd-current-flow-asset {
  margin: 0;
  display: grid;
  gap: 8px;
}

.pc-shell-prd .prd-current-flow-asset img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.pc-shell-prd .prd-current-flow-asset figcaption,
.pc-shell-prd .prd-current-flow-link {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.pc-shell-prd .prd-current-flow-asset a,
.pc-shell-prd .prd-current-flow-link a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-feature-intro {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.pc-shell-prd .prd-feature-intro strong {
  color: var(--text-primary);
}

.pc-shell-prd .prd-feature-card {
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pc-shell-prd .prd-feature-card.is-located {
  border-color: var(--brand-primary);
  background: var(--brand-50, #fdf3f3);
  box-shadow: 0 0 0 2px rgba(134, 27, 47, 0.08);
}

.pc-shell-prd .prd-feature-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pc-shell-prd .prd-feature-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.pc-shell-prd .prd-feature-seq {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #ff6700ba;
  color: #ffffff;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  flex-shrink: 0;
}

.pc-shell-prd .prd-feature-level {
  color: var(--brand-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
}

.pc-shell-prd .prd-feature-card h3,
.pc-shell-prd .prd-feature-meta h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-shell-prd .prd-feature-back {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}

.pc-shell-prd .prd-feature-back:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.pc-shell-prd .prd-feature-back.is-disabled,
.pc-shell-prd .prd-feature-back.is-disabled:hover {
  border-color: var(--border-light);
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: .55;
}

.pc-shell-prd .prd-feature-ref {
  margin: 6px 0 0;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.pc-shell-prd .prd-feature-summary {
  margin: 8px 0 12px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.65;
}

.pc-shell-prd .prd-feature-groups {
  display: grid;
  gap: 12px;
}

.pc-shell-prd .prd-feature-group h4 {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.pc-shell-prd .prd-feature-group summary {
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  list-style: none;
}

.pc-shell-prd .prd-feature-group summary::-webkit-details-marker {
  display: none;
}

.pc-shell-prd .prd-feature-group ul {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.65;
}

.pc-shell-prd .prd-feature-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  table-layout: fixed;
}

.pc-shell-prd .prd-feature-table th,
.pc-shell-prd .prd-feature-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  text-align: left;
  word-break: break-word;
}

.pc-shell-prd .prd-feature-table th {
  background: var(--bg-table-header);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-feature-table th + th,
.pc-shell-prd .prd-feature-table td + td {
  border-left: 1px solid var(--border-light);
}

.pc-shell-prd .prd-feature-table tbody tr:last-child td {
  border-bottom: 0;
}

.pc-shell-prd .prd-feature-field-table th:first-child,
.pc-shell-prd .prd-feature-field-table td:first-child {
  width: 96px;
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.pc-shell-prd .prd-feature-field-table th:last-child,
.pc-shell-prd .prd-feature-field-table td:last-child {
  width: 96px;
  color: var(--text-tertiary);
}

.pc-shell-locator-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  pointer-events: none;
}

.pc-shell-locator-layer.show {
  display: block;
}

.pc-shell-locator-layer .prd-locator-dot {
  position: absolute;
  width: auto;
  max-width: fit-content;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  border-radius: 5px;
  background: #ff6700ba;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transform: none;
}

.pc-shell-locator-layer .prd-locator-dot span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.pc-shell-locator-layer .prd-locator-dot em {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  min-width: max-content;
  max-width: 180px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: var(--font-size-xs);
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity .15s ease, transform .15s ease;
  white-space: nowrap;
}

.pc-shell-locator-layer .prd-locator-dot.is-target-left {
  border-radius: 5px;
}

.pc-shell-locator-layer .prd-locator-dot.is-tooltip-left em {
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%) translateX(4px);
}

.pc-shell-locator-layer .prd-locator-dot.is-action {
  background: #ff6700ba;
}

.pc-shell-locator-layer .prd-locator-dot:hover em,
.pc-shell-locator-layer .prd-locator-dot:focus-visible em {
  opacity: 1;
  transform: translateY(-50%);
}

.prd-target-flash {
  outline: 2px solid var(--brand-primary) !important;
  outline-offset: 3px;
  transition: outline-color 0.2s ease;
}

.pc-shell-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
}

/* Bottom open-tabs bar */
.pc-shell-main > .bottom-tabbar {
  grid-row: 3;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

.pc-shell-main > .bottom-tabbar .open-tab {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border-light);
  font: inherit;
  font-size: var(--font-size-sm);
  flex: 0 0 auto;
  min-width: 100px;
  max-width: 180px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-secondary);
  background: var(--bg-card);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}

.pc-shell-main > .bottom-tabbar .open-tab:hover {
  background: var(--bg-page);
}

.pc-shell-main > .bottom-tabbar .open-tab.active {
  background: var(--brand-primary);
  color: #fff;
}

.pc-shell-main > .bottom-tabbar .open-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-shell-main > .bottom-tabbar .open-tab-close {
  width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  flex: 0 0 auto;
}

.pc-shell-main > .bottom-tabbar .open-tab-close:hover {
  background: rgba(93, 101, 114, 0.12);
  opacity: 1;
}

.pc-shell-main > .bottom-tabbar .open-tab.active .open-tab-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.pc-shell-main > .bottom-tabbar .open-tab-close .dms-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 1280px) {
  body.pc-shell-host {
    --dms-shell-sidebar-width: 208px;
    --dms-prd-width: 380px;
  }

  .pc-shell-tools .topbar-search {
    width: 200px;
  }
}
