/* 左侧侧边栏：添加数据图元 / 添加装饰（图元预览）+ 保存 */
.pisell-floor-map-layout-toolbar {
  &.pisell-floor-map-layout-toolbar-sidebar {
    position: relative;
    width: 248px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    z-index: 10;
  }

  &-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 10px;
  }

  &-section {
    margin-bottom: 16px;

    &:last-of-type {
      margin-bottom: 0;
    }
  }

  &-section-title {
    margin: 0 0 8px 0;
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #262626;
    line-height: 20px;
  }

  &-preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  &-preview-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  &-preview-group-label {
    padding: 0 4px;
    font-size: 12px;
    color: #8c8c8c;
    line-height: 18px;
  }

  &-preview-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }

  &-preview-card {
    display: block;
    width: 100%;
    padding: 6px;
    text-align: center;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: grab;
    transition: border-color 0.2s, background 0.2s;

    &:hover {
      background: #f0f7ff;
      border-color: #91caff;
    }

    &.pisell-floor-map-layout-toolbar-preview-card-active {
      background: color-mix(in srgb,
      var(--fmap-primary, #1677ff) 12%,
      #fff);
      border-color: var(--fmap-primary, #1677ff);
      box-shadow: 0 0 0 1px var(--fmap-primary, #1677ff);
    }

    &.pisell-floor-map-layout-toolbar-preview-card-deco {
      .pisell-floor-map-layout-toolbar-preview-cell {
        margin: 0 auto;
      }
    }
  }

  &-preview-card-label {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #262626;
    line-height: 18px;
  }

  &-preview-cell {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 4px;
    box-sizing: border-box;
  }

  &-preview-content {
    pointer-events: none;
  }

  &-preview-cell {
    .pisell-floor-map-layout-toolbar-preview-content {
      overflow: hidden;
    }
  }

  &-preview-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 40px;
    font-size: 12px;
    color: #8c8c8c;
  }

  &-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px 16px;
    font-size: 15px;
    min-height: 40px;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    cursor: pointer;

    &:hover {
      color: var(--fmap-primary, #1677ff);
      border-color: var(--fmap-primary, #1677ff);
      background: color-mix(in srgb,
      var(--fmap-primary, #1677ff) 12%,
      #fff);
    }

    &.cancel {
      color: #8c8c8c;
      margin-top: 12px;
    }

    &.cancel-inline {
      margin-top: 0;
      padding: 8px 12px;
      font-size: 14px;
      min-height: 40px;
      color: #8c8c8c;
    }

    &.primary {
      color: #fff;
      background: var(--fmap-primary, #1677ff);
      border-color: var(--fmap-primary, #1677ff);

      &:hover:not(:disabled) {
        background: color-mix(in srgb,
        var(--fmap-primary, #1677ff) 88%,
        #fff);
        border-color: color-mix(in srgb,
        var(--fmap-primary, #1677ff) 88%,
        #fff);
      }

      &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }
    }
  }

  &-footer {
    flex-shrink: 0;
    padding: 12px 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  &-dirty-hint {
    font-size: 12px;
    line-height: 1.45;
    color: #d48806;
    padding: 6px 8px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
  }

  &-save-dirty {
    box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.35);
  }

  &-error {
    font-size: 12px;
    color: #ff4d4f;
  }

  &-record-pick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    margin-top: 4px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
  }

  &-record-pick-label {
    font-size: 12px;
    font-weight: 600;
    color: #434343;
  }

  &-record-pick-hint {
    font-size: 11px;
    color: #8c8c8c;
    line-height: 1.45;
  }

  &-record-hint {
    font-size: 11px;
    color: #8c8c8c;
    padding: 6px 8px;
    margin-top: 4px;
    line-height: 1.45;
    background: #fafafa;
    border-radius: 4px;
  }
}
