/* 独立样式域；功能区沿用统一高度与 SVG 精灵，不测量切换时的 DOM。 */
.smartart-ribbon .smartart-options {
  display: grid;
  gap: 6px;
  align-content: center;
  height: 72px;
}
.smartart-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.smartart-options select {
  width: 132px;
  height: 27px;
}
.smartart-options input {
  width: 72px;
  height: 27px;
}
.smartart-dialog {
  width: min(870px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid #b9c4d5;
  border-radius: 0;
  box-shadow: none;
}
.smartart-dialog form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.smartart-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #dde3eb;
  background: #f5f7fb;
}
.smartart-dialog-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.smartart-dialog-heading button {
  border: 0;
  background: transparent;
  font-size: 22px;
  padding: 0 5px;
}
.smartart-chooser {
  display: grid;
  grid-template-columns: 126px minmax(240px, 1fr) 248px;
  height: min(402px, calc(100dvh - 174px));
  min-height: 200px;
}
#smartart-categories {
  border-right: 1px solid #dde3eb;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
#smartart-categories button {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  height: 33px;
  min-height: 33px;
  padding: 5px 10px;
  border-radius: 0;
  color: #3e4b5e;
}
#smartart-categories button[aria-pressed="true"] {
  background: #e5edfc;
  border-color: #b6c9ed;
  color: #2552ae;
}
.smartart-layouts {
  padding: 13px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.smartart-layouts h3 {
  font-size: 13px;
  color: #627188;
  margin: 0 0 10px;
  font-weight: 600;
}
#smartart-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#smartart-gallery button {
  display: block;
  text-align: center;
  white-space: normal;
  line-height: 1.4;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 0;
  color: #415065;
  font-size: 12px;
}
#smartart-gallery button:hover {
  background: #f0f4fb;
  border-color: #d0dbec;
}
#smartart-gallery button[aria-selected="true"] {
  border-color: #7598df;
  background: #e7efff;
  color: #224d9c;
}
#smartart-gallery svg {
  width: 100%;
  height: 66px;
  display: block;
  margin-bottom: 5px;
}
.smartart-detail {
  padding: 18px 16px;
  border-left: 1px solid #dde3eb;
  background: #fbfcff;
  overflow-y: auto;
}
#smartart-preview {
  height: 178px;
  display: grid;
  place-items: center;
}
#smartart-preview svg {
  width: 100%;
  height: 100%;
  max-height: 178px;
  display: block;
}
.smartart-detail h3 {
  font-size: 15px;
  margin: 17px 0 8px;
  font-weight: 600;
}
.smartart-detail p {
  font-size: 13px;
  line-height: 1.7;
  color: #637086;
  margin: 0;
}
.smartart-dialog footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid #dde3eb;
  background: #f7f9fc;
}
.smartart-dialog footer span {
  margin-right: auto;
  font-size: 12px;
  color: #748096;
}
.smartart-dialog footer button {
  min-width: 74px;
  border-radius: 0;
}
.smartart-error {
  color: #ab3131;
  font-size: 13px;
  margin: 0;
  padding: 5px 14px;
}
.smartart-pane {
  width: 280px;
  min-width: 240px;
  max-width: 34vw;
  border-left: 1px solid #d5dce8;
  border-right: 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}
.smartart-pane .sidebar-title,
.smartart-pane .sidebar-caption,
.smartart-node-actions,
.smartart-pane-status {
  flex-shrink: 0;
}
.smartart-pane .sidebar-caption {
  font-size: 12px;
  line-height: 1.6;
  margin-block: 8px;
}
.smartart-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1e6ee;
}
.smartart-node-actions button {
  font-size: 12px;
  padding: 3px 5px;
  min-height: 25px;
  border-radius: 0;
}
#smartart-nodes {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 7px 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.smartart-node {
  display: flex;
  align-items: flex-start;
  padding: 3px 3px 3px calc(3px + var(--level, 0) * 14px);
  border: 1px solid transparent;
}
.smartart-node::before {
  content: "•";
  color: #6d7f99;
  width: 12px;
  flex: 0 0 12px;
  padding-top: 6px;
}
.smartart-node:focus-within,
.smartart-node.selected {
  border-color: #b8ccee;
  background: #f0f5ff;
}
.smartart-node textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  min-height: 32px;
  max-height: 128px;
  border: 0;
  border-radius: 0;
  padding: 6px 3px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  background: transparent;
  box-shadow: none;
}
.smartart-node textarea:focus {
  outline: 1px solid #8eaae1;
  outline-offset: 0;
}
.smartart-pane-status {
  padding-block: 7px;
  color: #66768e;
  border-top: 1px solid #e1e6ee;
  font-size: 12px;
}
/* 桌面停靠在编辑区右侧；窄屏沿用侧栏浮层，避免挤压正文或遮住左侧导航入口。 */
@media (max-width: 900px) {
  .smartart-pane {
    position: absolute;
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    min-width: 0;
    max-width: 100%;
  }
}
@media (max-width: 740px) {
  .smartart-chooser {
    grid-template-columns: 94px minmax(190px, 1fr);
  }
  .smartart-detail {
    display: none;
  }
  #smartart-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .smartart-dialog footer span {
    display: none;
  }
}
