Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

65.7 KB
Raw Blame
.av__lunar-editor {
  width: 340px;
  max-width: 100%;
}

.av__lunar-date {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 8px 8px;
}

.av__lunar-date-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  .b3-select {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }
}

// 单字段条件编辑器供筛选和条件颜色菜单共用。
@mixin av-filter-editor {
  .b3-menu__item.av__filter-row {
    margin: 6px 0;
    gap: 6px;
    align-items: center;
  }

  .av__filter-rowinner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 28px;
    gap: 6px;
  }

  .av__filter-group-children .b3-menu__item.av__filter-row,
  .av__filter-group-children .av__filter-group-item {
    margin-top: 0;
    margin-bottom: 0;
  }

  // 筛选面板内的下拉/输入控件统一为描边卡片样式(与字段选择器一致)
  .av__filter-row .b3-select,
  .av__filter-row .b3-text-field--text,
  .av__filter-group-left .b3-select {
    border: 1px solid var(--b3-theme-surface-lighter);
    border-radius: var(--b3-border-radius);
    background-color: var(--b3-menu-background);
    box-shadow: none;

    &:hover,
    &:focus {
      box-shadow: none;
    }
  }

  .av__filter-field {
    max-width: 120px;
  }

  .av__filter-num {
    width: 50px;
  }

  .av__field-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 28px;
    border: 1px solid var(--b3-theme-surface-lighter);
    border-radius: var(--b3-border-radius);
    padding: 0 4px 0 6px;
    gap: 2px;
    box-sizing: border-box;
    background-color: var(--b3-menu-background);
  }

  // 字段选择器嵌入描边容器内,去掉自身描边避免双重描边
  .av__field-wrapper .b3-select {
    border: 0;
    box-shadow: none;
    background-color: transparent;

    &:hover,
    &:focus {
      box-shadow: none;
    }
  }

  .av__field-wrapper .b3-menu__icon {
    margin-right: 0;
    width: 16px;
    height: 16px;
  }

  .b3-menu__item.av__filter-row:hover {
    background-color: transparent;
  }

  .av__filter-value {
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 60px;
  }

  .av__filter-date-controls {
    display: inline-flex;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 60px;
  }

  .av__filter-date-config {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  &.av__filter-panel {
    min-width: 340px;
    max-width: 80vw;
    width: fit-content;
  }

  .av__filter-date-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .av__filter-date-col {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
  }

  .av__select-trigger {
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 60px;
    cursor: pointer;
    overflow: hidden;
    gap: 4px;
    color: var(--b3-theme-on-surface);

    .ft__on-surface {
      font-size: 14px;
    }

    &-arrow {
      flex-shrink: 0;
      width: 10px;
      height: 10px;
    }
  }

  .av__select-dropdown {
    position: fixed;
    width: fit-content;
    min-width: 120px;
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px;
    box-shadow: var(--b3-dialog-shadow);
    border-radius: var(--b3-border-radius);
    background-color: var(--b3-menu-background);
  }

  .av__select-options {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
  }

  [data-type="selectDropdown"] .av__select-option .fn__ellipsis {
    white-space: nowrap;
  }

  // 触发器内已选 chip
  .av__select-chip {
    margin: 1px 2px;
  }

  // 下拉面板内的选项
  .av__select-option {
    margin: 2px 0;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--b3-border-radius);
    background-color: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;

    &:hover {
      background-color: var(--b3-list-hover);
    }

    &-check {
      width: 12px;
      height: 12px;
      flex-shrink: 0;
    }

    .b3-chip {
      max-width: calc(100% - 18px);
      overflow: hidden;
    }

    .b3-chip .fn__ellipsis {
      min-width: 0;
    }
  }

  // 下拉内搜索框,复用 input 的外观但占满宽度
  .av__select-dropdown .b3-text-field {
    margin: 0 0 4px 0;
    height: 28px;
    font-size: 14px;
    width: 100%;
  }

  .av__relation-filter-trigger {
    max-width: 280px;

    .av__relation-filter-chip {
      max-width: 112px;
    }
  }

  .av__relation-filter-dropdown {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow: hidden;
  }

  .av__relation-filter-selected {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 4px;

    &:empty {
      display: none;
    }
  }

  .av__relation-filter-selected-chips {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 88px;
    overflow-y: auto;
  }

  .av__relation-filter-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 180px;
    gap: 4px;
    background-color: var(--b3-list-hover);
    color: var(--b3-theme-on-background);
  }

  .av__relation-filter-id,
  .av__relation-filter-option-id {
    flex-shrink: 0;
    color: var(--b3-theme-on-surface);
    font-size: 11px;
  }

  .av__relation-filter-remove {
    display: inline-flex;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--b3-theme-on-surface);
    cursor: pointer;

    svg {
      width: 12px;
      height: 12px;
    }
  }

  .av__relation-filter-clear {
    flex-shrink: 0;
    padding: 2px 4px;
  }

  .av__relation-filter-count {
    flex-shrink: 0;
  }

  .av__relation-filter-options {
    display: flex;
    flex-direction: column;
    min-height: 28px;
    max-height: 180px;
    overflow-y: auto;
  }

  .av__relation-filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 30px;
    padding: 4px 6px;
    border: 0;
    border-radius: var(--b3-border-radius);
    background: transparent;
    color: var(--b3-theme-on-background);
    font: inherit;
    text-align: left;
    cursor: pointer;

    &:hover {
      background-color: var(--b3-list-hover);
    }
  }

  .av__relation-filter-option-icon,
  .av__relation-filter-option-check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .av__relation-filter-option-check {
    margin-left: auto;
  }
}

.av {
  user-select: none;
  box-sizing: border-box;
  display: flex;
  max-width: 100%;
  margin-top: 4px !important;
  margin-bottom: 4px !important;

  &[data-av-type="list"] {
    width: 100%;

    > .av__container,
    .av__body {
      width: 100%;
    }

    .av__row--header,
    .av__row--footer,
    .av__freeze-drag,
    .av__drag-fill {
      display: none;
    }

    .av__row--util > .av__colsticky {
      width: 100%;
      flex-direction: column;

      > .fn__space {
        display: none;
      }

      > .av__button {
        margin: 5px 0;
        justify-content: flex-start;
      }
    }

    .av__row {
      border-bottom: 0;
      border-radius: var(--b3-border-radius);

      &[data-id] {
        border-top: 2px solid transparent;
        border-bottom: 2px solid transparent;
        background-clip: padding-box;
      }

      &:hover {
        background-color: var(--b3-list-hover);
      }

      &.av__row--select,
      &.av__row--hl {
        background-color: var(--b3-theme-primary-lightest);

        &::before {
          content: "";
          position: absolute;
          inset: 0;
          border-radius: var(--b3-border-radius);
          box-shadow: 0 1px 2px var(--b3-border-color);
          pointer-events: none;
        }

        > .av__cell {
          background-color: transparent;
        }
      }

      > .av__colsticky {
        background-color: transparent;
        flex-shrink: 0;

        > .av__firstcol {
          display: none;
        }
      }

      > .av__cell {
        border-right: 0;
        border-radius: inherit;
        flex: 0 1 auto;
        min-width: 2em;
        min-height: calc(1.625em + 10px);
        max-width: 30%;
        width: auto;

        &[data-dtype="block"] {
          flex: 1 1 12em;
          min-width: 8em;
          max-width: none;
        }
      }
    }
  }

  &--backlink {
    max-height: min(400px, 60vh);
    overflow: auto;
    overscroll-behavior: contain;
    align-items: flex-start;
  }

  &:hover {
    .av__group-icon--hover {
      opacity: 1;
    }
  }

  &--touch {
    .av__group-icon--hover,
    .av__row--footer .av__calc {
      opacity: 1;
    }

    .av__selection-toolbar {
      [data-type="av-selection-edit"],
      [data-type="av-selection-delete"] {
        display: none;
      }
    }
  }

  &__cursor {
    width: .1px;
    height: 0;
    opacity: 0;
  }

  &__container {
    overflow-x: auto;
    overflow-y: hidden;
    cursor: auto;

    &--grouped {
      width: 100%;
    }

    &.fn__block {
      overflow: visible;
    }
  }

  &__pulse {
    width: 70%;
    height: 22px;
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--b3-border-color);
    border-radius: var(--b3-border-radius);

    &::after {
      content: " ";
      border-radius: var(--b3-border-radius);
      position: absolute;
      z-index: 1;
      animation: 1s linear infinite keyframes-pulse;
      background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .4) 50%, transparent 100%);
      display: block;
      height: 100%;
      width: 100%;
    }
  }

  &--paste-loading {
    min-height: 194px;
    position: relative;
  }

  &__paste-skeleton {
    background-color: var(--b3-theme-background);
    border-radius: var(--b3-border-radius);
    cursor: wait;
    inset: 0;
    overflow: hidden;
    position: absolute;
    z-index: 5;

    .av__row {
      background-color: var(--b3-theme-background);
      min-height: 38px;
    }

    .av__cell {
      align-items: center;
      display: flex;
      flex-shrink: 0;
      padding: 8px;
    }
  }

  &__header {
    position: relative;

    .layout-tab-bar {
      background-color: transparent;

      .item__graphic {
        height: 1.25em;
        width: 1.25em;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        object-fit: contain;
        padding: 8px 0 8px 8px;
        font-size: inherit;
        text-align: center;
      }

      .item__text {
        line-height: normal;
      }
    }
  }

  &__views {
    align-items: center;
    box-shadow: 0 -1px inset var(--b3-theme-background-light);
    font-size: 87.5%;
    position: relative;

    &--fixed {
      background-color: var(--b3-parent-background);
      box-sizing: border-box;
      box-shadow: 0 -1px inset var(--b3-theme-background-light), 0 0 0 1px var(--b3-parent-background);
      position: fixed;
      z-index: 3;
    }

    .block__icon {
      opacity: 1;
    }

    > .fn__flex-1 {
      min-width: 8px;
    }

    .block__icon svg {
      height: 1em;
      width: 1em;
    }

    .b3-text-field {
      transition: var(--b3-width-transition);
      white-space: nowrap;
      overflow: auto;
      padding-right: 0;
      font-size: 1em;

      &::-webkit-scrollbar {
        display: none;
      }
    }
  }

  &__views--mobile {
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;

    > .layout-tab-bar,
    > .fn__space,
    > .fn__flex-1,
    > [data-type="av-add"],
    > [data-type="av-switcher"]:not(.av__mobile-view) {
      display: none;
    }

    > .av__mobile-view {
      flex: 0 1 auto;
      min-width: 64px;
      max-width: min(10em, 100%);
      overflow: hidden;
      gap: 4px;

      span {
        flex: 1;
        text-align: left;
      }
    }

    > .block__icon {
      min-height: 32px;
    }

    > [data-type="av-filter"] {
      margin-left: auto;
    }

    > .av__new {
      flex-shrink: 0;
    }

    > .av__search,
    > .av__search-close {
      display: none;
    }

    &.av__views--search {
      > .av__mobile-view,
      > [data-type="av-filter"],
      > [data-type="av-context-filter"],
      > [data-type="av-sort"],
      > [data-type="av-more"],
      > .av__new {
        display: none;
      }

      > .av__search {
        display: flex;
        flex: 1;
        min-width: 0;
        order: 2;

        [data-type="av-search"] {
          width: 100% !important;
          min-width: 0;
          margin-right: 0 !important;
          box-sizing: border-box;
          padding-right: 24px !important;
        }
      }

      > .av__search-close {
        display: flex;
        order: 3;
      }
    }
  }

  &__new {
    .b3-button {
      font-size: inherit;
      line-height: 1.625;
      min-height: 24px;
      transition: var(--b3-background-transition);

      &:hover,
      &:focus {
        background-color: var(--b3-theme-primary);
        background-color: color-mix(in srgb, var(--b3-theme-primary) 88%, black);
        box-shadow: none;
      }

      &:active {
        background-color: var(--b3-theme-primary);
        background-color: color-mix(in srgb, var(--b3-theme-primary) 80%, black);
        box-shadow: none;
      }

      &:first-child {
        border-radius: var(--b3-border-radius) 0 0 var(--b3-border-radius);
        padding: 0 .5em;
      }

      &:last-child {
        border-left: 1px solid rgba(255, 255, 255, .25);
        border-radius: 0 var(--b3-border-radius) var(--b3-border-radius) 0;
        padding: 0 .25em;

        svg {
          height: 1em;
          margin: 0;
          width: 1em;
        }
      }
    }
  }

  &__template-panels {
    @media (max-width: 750px) {
      flex-direction: column;
    }
  }

  &__template-list {
    --file-toggle-width: 0px;
    border-right: 1px solid var(--b3-border-color);
    box-sizing: border-box;
    flex-shrink: 0;
    list-style: none;
    margin: 0;
    overflow: auto;
    padding: 8px 0;
    width: 200px;

    .b3-list-item {
      line-height: 32px;
      margin: 8px;

      &__graphic {
        padding: 0 6px 0 4px;
      }
    }

    @media (max-width: 750px) {
      border-bottom: 1px solid var(--b3-border-color);
      border-right: 0;
      flex-shrink: 1;
      max-height: 30vh;
      width: auto;
    }
  }

  &__template-editor .custom-attr__avvalue.av__template-switch {
    cursor: default;
    flex: 1;
    min-width: 0;
    overflow: visible;

    &:hover {
      background-color: transparent;
    }
  }

  // 控件已为描边卡片,值容器不再叠加悬停底色
  &__template-editor .custom-attr__avvalue:hover {
    background-color: transparent;
  }

  &__template-editor .custom-attr .block__icons {
    @media (max-width: 750px) {
      flex-wrap: wrap;
      // 编辑器已有内边距,移动端不再叠加行内边距,避免内容过度内缩
      padding-left: 0;
      padding-right: 0;
    }
  }

  &__template-editor .custom-attr .block__logo:not(.popover__block) {
    cursor: default;

    @media (max-width: 750px) {
      align-self: auto;
      flex: 1 1 100%;
      margin-left: 0;
      padding-left: 0;
      width: auto;
    }

    &:hover {
      background-color: transparent;
    }
  }

  &__template-editor .custom-attr .custom-attr__avvalue {
    @media (max-width: 750px) {
      padding-left: 0;
      padding-right: 0;
    }
  }

  // 模板编辑器控件与筛选面板统一为描边卡片样式
  &__template-editor .custom-attr {
    .b3-text-field,
    .b3-select {
      border: 1px solid var(--b3-theme-surface-lighter);
      border-radius: var(--b3-border-radius);
      background-color: var(--b3-menu-background);
      box-shadow: none;
      outline: none;

      &:hover {
        background-color: var(--b3-menu-background);
        box-shadow: none;
      }

      &:focus {
        border-color: var(--b3-theme-primary-light);
        box-shadow: 0 0 0 .6px var(--b3-theme-primary-lighter);
      }
    }

    .b3-text-field {
      min-height: 0;
      padding: 4px 8px;
    }

    [data-role="field-mode"],
    input[type="date"],
    input[type="datetime-local"] {
      height: 30px;
      min-width: 0;
    }
  }

  &__sort-row {
    align-items: flex-start;

    > .b3-menu__icon,
    > .b3-menu__action {
      align-self: flex-start;
      flex-shrink: 0;
      margin-top: 10px;
    }

    > .b3-menu__action {
      margin-top: 7px;
    }
  }

  &__sort-controls {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;

    .b3-select {
      min-width: 0;
      max-width: 100%;
    }

    [data-type="sortColumn"] {
      flex: 1 1 120px;
    }
  }

  &__title {
    outline: none;
    font-weight: bold;

    &:empty::after {
      color: var(--b3-empty-color);
      content: attr(data-tip);
      cursor: text;
    }
  }

  &__selection-toolbar {
    align-items: center;
    display: none;
    gap: 4px;
    inset: 0;
    min-width: 0;
    position: absolute;

    .block__icon {
      opacity: 1;
    }
  }

  &__selection-count {
    color: var(--b3-theme-on-surface);
    flex-shrink: 0;
    padding: 0 5px;
    white-space: nowrap;
  }

  &__views--selection {
    > :not(.av__selection-toolbar),
    > :not(.av__selection-toolbar) * {
      transition: none;
      visibility: hidden;
    }

    > .av__selection-toolbar {
      display: flex;
    }
  }

  &__richtext-mask {
    background: rgba(0, 0, 0, .08);
  }

  &__richtext-editor {
    position: absolute;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    overflow: hidden;
    border: 1px solid var(--b3-border-color);
    border-radius: var(--b3-border-radius-b);
    background: var(--b3-theme-background);
    box-shadow: var(--b3-dialog-shadow);

    &--mobile {
      position: fixed;
      inset: env(safe-area-inset-top) 0 0;
      max-height: none;
      border: 0;
      border-radius: 0;
    }
  }

  &__richtext-host {
    min-height: 0;
    flex: 1;

    > .protyle,
    .protyle-content {
      height: 100%;
    }

    .protyle-content {
      overflow: auto;
    }

    .protyle-wysiwyg {
      min-height: 100%;
      padding: 12px;
      box-sizing: border-box;
      outline: none;
      font-size: var(--b3-font-size-editor);
    }
  }

  &__richtext-actions {
    display: flex;
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--b3-border-color);
    background: var(--b3-theme-surface);
  }

  &__scroll {
    overflow: auto hidden;
    position: relative;
    z-index: 2;
  }

  &__spacer {
    grid-column: 1 / -1;
    pointer-events: none;
  }

  &__row {
    display: flex;
    border-bottom: 1px solid var(--b3-theme-surface-lighter);
    position: relative;
    font-size: 87.5%;

    &.dragover__top::after,
    &.dragover__bottom::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: 4px;
      background-color: var(--b3-theme-primary-lighter);
      z-index: 3;
    }

    &.dragover__top::after {
      top: -2.5px;
    }

    &.dragover__bottom::after {
      bottom: -2.5px;
    }

    &:hover [data-type="block-more"] {
      display: block;
    }

    &--select,
    &--hl {
      &:not(.av__row--header) .av__cell,
      &:not(.av__row--header) .av__firstcol {
        background-color: var(--b3-theme-primary-lightest);
      }

      .av__firstcol svg {
        opacity: 1;
      }
    }

    &--header {
      z-index: 3;

      & > .block__icons > .block__icon svg {
        height: 1em;
        width: 1em;
      }
    }

    &--footer {
      display: flex;
      border-top: 1px solid var(--b3-theme-surface-lighter);
      color: var(--b3-theme-on-surface);
      position: relative;
      z-index: 2;

      &:hover .av__calc,
      &.av__row--show .av__calc {
        opacity: 1;
      }

      .av__calc {
        display: flex;
        align-items: center;
        padding: 5px 6px 5px 5px;
        border-right: 1px;
        flex-direction: row-reverse;
        box-sizing: border-box;
        opacity: 0;
        overflow: hidden;
        font-size: 87.5%;
        white-space: nowrap;
        line-height: 1.625em;
        cursor: pointer;

        &[data-dtype="lineNumber"] {
          cursor: inherit;
        }

        &:first-child {
          padding-left: calc(1.625em - 6px);
          box-sizing: initial;
        }

        &.av__calc--ashow {
          opacity: 1;
        }

        svg {
          margin-left: 5px;
          height: 1.625em;
          width: calc(1.625em - 14px);
        }

        span {
          color: var(--b3-theme-on-background);
          margin-left: 5px;
        }

        &:hover {
          background-color: var(--b3-list-hover);
        }
      }
    }

    &--header,
    &--footer {
      background-color: var(--b3-parent-background);

      &--fixed {
        position: fixed;
      }
    }

    &--util {
      display: flex;

      .b3-button {
        margin: 5px 0 5px 1.625em;
      }
    }
  }

  &__gallery {
    --b3-av-card-width: 260px;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--b3-av-card-width)), 1fr));
    gap: 16px;
    width: 100%;
    margin-top: 8px;

    &--top {
      margin-top: 16px;
    }

    &--small {
      --b3-av-card-width: 180px;
    }

    &--big {
      --b3-av-card-width: 320px;
    }

    &-item {
      box-shadow: var(--b3-av-gallery-shadow);
      border-radius: var(--b3-border-radius);
      display: flex;
      flex-direction: column;
      position: relative;

      &--empty {
        min-height: 32px;
      }

      &::before {
        transition: background 100ms ease-out;
        content: "";
        inset: 0;
        position: absolute;
        border-radius: inherit;
        background-color: var(--b3-av-item-background, var(--b3-theme-background));
      }

      &:hover {
        &:not(.av__gallery-item--select)::before {
          background-color: var(--b3-theme-surface-light);
        }

        .av__gallery-actions {
          opacity: .86;
        }
      }

      &--select::before {
        background-color: var(--b3-theme-primary-lightest) !important;
        opacity: 1 !important;
      }
    }

    &-cover {
      border-bottom: 1px solid var(--b3-border-color);
      border-radius: var(--b3-border-radius) var(--b3-border-radius) 0 0;
      overflow: hidden;
      position: relative;
      cursor: pointer;
      aspect-ratio: var(--b3-av-card-aspect-ratio, 16/9);

      &--0 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 16/9);
      }

      &--1 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 9/16);
      }

      &--2 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 4/3);
      }

      &--3 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 3/4);
      }

      &--4 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 3/2);
      }

      &--5 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 2/3);
      }

      &--6 {
        aspect-ratio: var(--b3-av-card-aspect-ratio, 1);
      }

      &--positioning {
        cursor: move;
        touch-action: none;
      }

      &-position-tip {
        background-color: var(--b3-theme-on-surface);
        border-radius: var(--b3-border-radius);
        color: var(--b3-theme-surface);
        font-size: 85%;
        left: 50%;
        line-height: 24px;
        padding: 0 8px;
        pointer-events: none;
        position: absolute;
        top: 8px;
        transform: translateX(-50%);
        white-space: nowrap;
        z-index: 2;
      }

      &-position-actions {
        bottom: 8px;
        display: flex;
        left: 50%;
        opacity: .86;
        position: absolute;
        transform: translateX(-50%);
        z-index: 2;
      }
    }

    &-img {
      height: 100%;
      object-fit: cover;
      width: 100%;
      object-position: center;
      pointer-events: none;

      &--fit {
        object-fit: contain;
        object-position: center !important;
      }
    }

    &-content {
      margin: 8px 8px 0;
      color: var(--b3-theme-on-surface);
      transform: scale(0.85);
      left: 0;
      right: 0;
      transform-origin: 0 0;
      width: calc(100% / 0.85 - 16px);

      & ~ div {
        position: absolute;
        content: "";
        left: 0;
        height: 100%;
        width: 100%;
        top: 0;
      }

      .render-node {
        overflow: hidden !important;
      }
    }

    &-fields {
      border-radius: 0 0 var(--b3-border-radius) var(--b3-border-radius);
      flex: 1;
      white-space: nowrap;
      font-size: 85%;
      min-height: calc(1.625em + 4px);
      padding: 5px 4px;

      &--compact {
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;

        & > .av__gallery-field {
          flex: 0 1 auto;
          min-width: 0;
          max-width: 100%;
        }

        & > .av__gallery-field--full-row {
          flex-basis: 100%;
          width: 100%;
        }

        & > .av__gallery-field:not(.av__gallery-field--name)[data-empty="true"] {
          .av__gallery-tip {
            overflow: hidden;
            pointer-events: none;
            position: relative;
            text-overflow: ellipsis;
            width: auto;
            z-index: 1;
          }

          .av__cell {
            inset: 0;
            position: absolute;
          }
        }
      }

      &:hover {
        .b3-chip[data-type="block-more"] {
          top: 4px;
          display: block;
          z-index: 1;
        }
      }

      .av__cell {
        padding: 2px 4px;
        border-right: 0;
        min-height: calc(1.625em + 4px);

        &:hover {
          background-color: var(--b3-list-hover);
          border-radius: var(--b3-border-radius);
        }

        .block__icon {
          display: none;
          top: 1px;
        }

        &[data-dtype="created"],
        &[data-dtype="updated"],
        &[data-dtype="lineNumber"] {
          cursor: default;
        }

        &[data-dtype="mAsset"] .av__cellassetimg:first-child,
        &[data-dtype="mAsset"] .b3-chip:first-child {
          margin-left: 0;
        }
      }

      &--edit .av__gallery-field[data-empty="true"] .av__gallery-tip,
      .av--display-empty-fields & .av__gallery-field[data-empty="true"] .av__gallery-tip {
        display: block;
      }

      .av:not(.av--display-empty-fields) &:not(.av__gallery-fields--edit) [data-empty="true"] {
        display: none;
      }
    }

    &-field {
      position: relative;
    }

    &-fieldicon {
      font-variant-emoji: emoji;
    }

    &-name {
      opacity: 0.38;
      padding: 2px 4px;
      width: 100%;
      white-space: normal;
      box-sizing: border-box;
    }

    &-tip {
      box-sizing: border-box;
      display: none;
      opacity: 0.38;
      padding: 2px 4px;
      width: 100%;
      position: absolute;
      top: 0;
    }

    &-tip,
    &-name {
      svg.ariaLabel {
        height: 1.625em;
        width: calc(1.625em - 10px);
        margin: 0 5px 0 0;
        font-size: 1em;
        vertical-align: bottom;
      }

      .av__gallery-fieldicon,
      svg:first-child {
        width: 1.25em;
        height: 1.25em;
        margin: 0 5px 0 0;
        font-size: inherit;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        object-fit: contain;
      }

      .av__gallery-fieldicon {
        vertical-align: middle;
      }

      svg:first-child {
        vertical-align: -0.25em;
      }
    }

    &-add {
      box-shadow: var(--b3-av-gallery-shadow);
      border-radius: var(--b3-border-radius);
      display: flex;
      justify-content: center;
      align-items: center;
      color: var(--b3-theme-on-surface);
      cursor: pointer;
      transition: background 100ms ease-out, color 100ms ease-out;
      position: relative;
      font-size: 85%;
      padding: 4px 0;

      &:hover {
        background-color: var(--b3-theme-surface-light);
        color: var(--b3-theme-on-background);
      }
    }

    &-load {
      border-top: 1px solid var(--b3-border-color);
      margin-top: 5px;
    }

    &-actions {
      position: absolute;
      right: 8px;
      top: -13px;
      display: flex;
      opacity: 0;
      transition: var(--b3-transition);
      z-index: 2;
    }

    &-item, &-add {
      &.dragover__left::after,
      &.dragover__right::after {
        top: 0;
        bottom: 0;
        width: 4px;
        content: '';
        position: absolute;
        background-color: var(--b3-theme-primary-lighter);
        z-index: 3;
      }

      &.dragover__left::after {
        left: -10px;
      }

      &.dragover__right::after {
        right: -10px;
      }


      &.dragover__top::after,
      &.dragover__bottom::after {
        left: 0;
        right: 0;
        height: 4px;
        content: '';
        position: absolute;
        background-color: var(--b3-theme-primary-lighter);
        z-index: 3;
      }

      &.dragover__top::after {
        top: -10px;
      }

      &.dragover__bottom::after {
        bottom: -10px;
      }
    }
  }

  &__layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 8px 0;

    &-item {
      border: 1px solid var(--b3-border-color);
      border-radius: var(--b3-border-radius);
      text-align: center;
      color: var(--b3-theme-on-surface);
      font-size: 12px;
      min-width: 0;
      white-space: normal;
      overflow-wrap: anywhere;
      cursor: pointer;
      transition: var(--b3-transition);
      display: flex;
      flex-direction: column;
      align-items: center;
      line-height: 1;
      padding: 8px;

      &:not(.av__layout-item--select):hover {
        color: var(--b3-theme-on-background);
      }

      svg {
        height: 14px;
        width: 14px;
      }

      &--select {
        color: var(--b3-theme-primary);
        border-color: var(--b3-theme-primary);
      }
    }
  }

  &__cell {
    box-sizing: border-box;
    position: relative;
    padding: 5px 8px;
    flex-shrink: 0;
    border-right: 1px solid var(--b3-theme-surface-lighter);
    overflow: hidden;
    cursor: pointer;
    //  display: flex; 不需要使用,否则 av__celltext 会占满单元格,导致链接列点击空白无法进行编辑

    &:not(.av__cell--header) {
      &[data-dtype="number"][data-align=""],
      &[data-align="right"] {
        text-align: right;
      }

      &[data-align="left"] {
        text-align: left;
      }

      &[data-align="center"] {
        text-align: center;
      }

      &[data-align="left"] > .fn__flex {
        justify-content: flex-start;
      }

      &[data-align="center"] > .fn__flex {
        justify-content: center;
      }

      &[data-align="right"] > .fn__flex {
        justify-content: flex-end;
      }

      &[data-dtype="number"]:not([data-align]) > .av__cell-action[data-type="copy"],
      &[data-dtype="number"][data-align=""] > .av__cell-action[data-type="copy"],
      &[data-align="right"] > .av__cell-action[data-type="copy"] {
        right: auto;
        left: 4px;
      }

      &[data-align="right"] > [data-type="block-more"] {
        right: auto;
        left: 5px;
      }

      &[data-align="right"] > .av__row-actions {
        right: auto;
        left: 4px;
      }
    }

    [data-type="block-more"] {
      display: none;
      position: absolute;
      right: 5px;
      font-size: 85% !important;
      top: 7.5px;
    }

    .popover__block {
      color: var(--b3-protyle-inline-blockref-color);
    }

    &[data-wrap="true"] {
      white-space: pre-wrap;

      .av__cell--relation {
        display: inline-flex;
        max-width: 100%;
        vertical-align: top;

        > :first-child {
          flex-shrink: 0;
          align-self: flex-start;
        }

        > .av__celltext {
          min-width: 0;
          overflow-wrap: anywhere;
        }
      }
    }

    &[data-wrap="false"] {
      white-space: nowrap;
    }

    &[data-dtype="block"] > .av__cell-action[data-type="copy"] {
      display: none;
    }

    &.dragover__left::after,
    &.dragover__right::after {
      top: 0;
      bottom: 0;
      width: 4px;
      content: '';
      position: absolute;
      background-color: var(--b3-theme-primary-lighter);
      z-index: 3;
    }

    &.dragover__left::after {
      left: -2.5px;
    }

    &.dragover__right::after {
      right: -2.5px;
    }

    &--select {
      background-color: var(--b3-theme-primary-lightest);

      &::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        right: 2px;
        bottom: 2px;
        border-radius: var(--b3-border-radius-s);
        box-shadow: 0 0 0 2px var(--b3-theme-primary-lighter);
        pointer-events: none;
      }
    }

    &--active {
      background-color: var(--b3-theme-primary-lightest);
    }

    &--header {
      padding: 5px 8px;
      display: flex;
      align-items: center;
      overflow: inherit; // 保证列宽和顺序调整的拖拽点样式
      border-right-color: transparent;

      &[data-align="right"] {
        justify-content: flex-end;
      }

      &[data-align="center"] {
        justify-content: center;
      }

      &[data-align="left"] {
        justify-content: flex-start;
      }

      &[data-align="center"] .av__celltext,
      &[data-align="right"] .av__celltext {
        flex: 0 1 auto;
      }

      &:hover {
        background-color: var(--b3-list-hover);
      }

      .av__celltext {
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      .av__cellheadericon {
        height: 1.25em;
        width: 1.25em;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        object-fit: contain;
        // 与相邻的单元格文字使用同一行高模型,字形才不会相对文字偏高
        line-height: inherit;
        color: var(--b3-theme-on-surface);
        margin: 0 5px 0 0;
        flex-shrink: 0;
        font-size: inherit;
        font-family: var(--b3-font-family-emoji);
        font-variant-emoji: emoji;

        &--pin {
          margin: 0 0 0 5px;
        }
      }

    }

    &--relation {
      margin-right: 12px;

      &:last-child {
        margin-right: 0;
      }

      svg {
        height: 1.625em;
        width: 1em;
        vertical-align: bottom;
        color: var(--b3-theme-on-surface-light);
      }
    }

    .block__icon {
      position: absolute;
      right: 5px;
      top: 5px;
    }

    & > .av__cell-action[data-type="copy"] {
      opacity: 0;
      position: absolute;
      right: 4px;
      top: 50%;
      transform: translateY(-50%);
    }

    &:hover .block__icon {
      opacity: 1;
      background-color: var(--b3-theme-background-light) !important;
    }

    &:hover > .av__cell-action[data-type="copy"],
    &:focus-within > .av__cell-action[data-type="copy"] {
      opacity: 1;
    }
  }

  &__cell .b3-chip,
  &__calendar-field .b3-chip {
    margin: 1px 2px;
    padding: 2px 6px;
    line-height: calc(1.625em - 6px);
    font-size: inherit;
  }

  &__cell,
  &__calendar-field {
    &[data-dtype="select"],
    &[data-dtype="mSelect"] {
      > .b3-chip {
        display: inline-block;
        margin: 1px 4px 1px 0;
        vertical-align: top;
      }

      &[data-wrap="true"] > .b3-chip {
        max-width: calc(100% - 4px);
        word-break: break-all;
      }
    }
  }

  &__drag-fill {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 9px;
    height: 9px;
    border: 2px solid var(--b3-theme-primary-lighter);
    border-radius: 50%;
    box-sizing: border-box;
    cursor: ns-resize;
    touch-action: none;
  }

  &__celltext {
    overflow: hidden;

    &--rich {
      display: block;
      width: 100%;
      overflow: hidden;
      font: inherit;

      li.vditor-task {
        list-style: none;
        position: relative;

        > input[type="checkbox"] {
          position: absolute;
          left: -1.5em;
          top: .3125em;
          width: 1em;
          height: 1em;
          margin: 0;
        }

        > input + p {
          margin: 0;
          padding: 0;
        }
      }

      .av__cell[data-wrap="true"] &,
      .av__calendar-field[data-wrap="true"] & {
        white-space: normal;

        p:empty::after {
          content: "\200b";
        }

        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        li,
        pre,
        .render-node {
          min-height: 0;
          margin: 0;
          padding: 0;
          font-size: inherit;
          line-height: inherit;
        }

        blockquote,
        ul,
        ol {
          margin: 0;
        }

        ul,
        ol {
          padding-left: 1.5em;
        }

        > :not(:first-child) {
          margin-top: .25em;
        }
      }

      .av__cell:not([data-wrap="true"]) &,
      .av__calendar-field:not([data-wrap="true"]) & {
        max-height: 1.625em;
        white-space: nowrap;
        text-overflow: ellipsis;

        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        blockquote,
        ul,
        ol,
        li,
        pre,
        .render-node {
          display: inline;
          min-height: 0;
          margin: 0;
          padding: 0;
          font-size: inherit;
          line-height: inherit;
          list-style: none;
        }

        > :not(:first-child),
        li + li,
        li > :not(:first-child),
        blockquote > :not(:first-child) {
          margin-left: .5em;
        }

        li.vditor-task > input[type="checkbox"] {
          position: static;
          margin: 0 .4em 0 0;
          vertical-align: -.125em;
        }

        li.vditor-task > input + p {
          margin-left: 0;
        }
      }
    }

    &--plain {
      white-space: pre-wrap;
    }

    &--url,
    &--ref {
      border-bottom: .5px solid var(--b3-border-color);
    }

    &--url.b3-chip {
      max-width: 120px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      display: inline-block;
      vertical-align: top;
      border-bottom: 0;
    }

    & > .av__cellicon {
      margin: 0 5px;
      height: 10px;
      width: 10px;
    }
  }

  &__checkbox {
    color: var(--b3-theme-on-surface);
    height: 1.625em;
    width: 1.25em;
    box-sizing: border-box;
    padding: .1875em 0;
    display: block;

    &:hover {
      color: var(--b3-theme-on-background);
    }
  }

  &__firstcol {
    svg {
      @extend .av__checkbox;
      opacity: 0;
      margin: 5px;
      cursor: pointer;
    }

    &:hover svg {
      opacity: 1;
    }
  }

  &__body--unfreeze .av__colsticky--freeze {
    position: relative;
  }

  &__colsticky {
    position: sticky;
    left: 0;
    z-index: 2; // 需大于 av__widthdrag,否则横行滚动后,拖拽会悬浮于 stick 列上
    display: flex;
    background-color: var(--b3-parent-background);

    &--freeze {
      box-shadow: inset -1px 0 0 var(--b3-border-color);
    }
  }

  &__freeze-drag {
    bottom: 0;
    cursor: col-resize;
    position: absolute;
    right: -5px;
    top: 0;
    touch-action: none;
    width: 10px;
    z-index: 3;

    &::after {
      background-color: transparent;
      border-radius: 1px;
      content: '';
      height: 20px;
      left: 4px;
      position: absolute;
      top: calc(50% - 10px);
      width: 2px;
    }

    &:hover::after {
      background-color: var(--b3-theme-primary);
    }
  }

  &__freeze-preview {
    box-shadow: inset -2px 0 0 var(--b3-theme-primary) !important;
  }

  &__widthdrag {
    position: absolute;
    cursor: col-resize;
    width: 5px;
    height: 100%;
    right: -2.5px;
    transition: var(--b3-background-transition);
    z-index: 1;
    touch-action: none;

    &:hover,
    &--active {
      background-color: var(--b3-theme-primary);
    }
  }

  &__width-guide {
    background-color: var(--b3-theme-primary);
    pointer-events: none;
    position: fixed;
    transform: translateX(-50%);
    width: 1px;
    z-index: 1000;
  }

  &__width-scroll-spacer {
    height: 1px;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
  }

  &__width-tip {
    background-color: var(--b3-tooltips-background);
    border-radius: var(--b3-border-radius);
    color: var(--b3-tooltips-color);
    font-size: 12px;
    line-height: 20px;
    padding: 0 6px;
    pointer-events: none;
    position: fixed;
    transform: translate(-50%, calc(-100% - 6px));
    user-select: none;
    white-space: nowrap;
    z-index: 1001;
  }

  &__panel {
    position: relative;

    .b3-menu {
      min-width: 290px;
      max-width: 290px;

      &.av__conditional-panel:not(.b3-menu--fullscreen) {
        width: 420px;
        min-width: min(340px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
      }

      &.av__automation-panel:not(.b3-menu--fullscreen) {
        width: 520px;
        min-width: min(340px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        max-height: var(--av-automation-max-height, calc(100vh - 60px));
        display: flex;
        flex-direction: column;

        > .b3-menu__items {
          min-height: 0;
          max-height: none;
        }
      }

      &__items {
        max-height: calc(100vh - 60px);
      }

      &__item .b3-chip {
        max-width: 100%;
        margin: 3px 0;
        padding-top: 4px;
        padding-bottom: 4px;
        float: left;

        .icon {
          width: 12px;
          flex-shrink: 0;
          margin-right: 6px;
          margin-left: -5px;
        }
      }

      .b3-chips {
        padding: 0;

        input {
          outline: none;
          border: 0;
          background-color: var(--b3-menu-background);
          flex: 1;
          height: 32px;
          color: var(--b3-theme-on-background);
        }
      }

      .block__icon:not([data-conditional-drag]) {
        line-height: 20px;
        font-size: 12px;
        align-self: center;
        opacity: 1;

        &:not(.block__icon--menu-back) {
          padding: 0 4px;
        }
      }

      &__label {
        overflow: hidden;
        min-height: 28px;
      }

      &__item {
        transition: margin .2s cubic-bezier(0, 0, .2, 1) 0ms;

        &[disabled] {
          opacity: .38;
          cursor: not-allowed;
        }
      }

      &__item,
      .av__conditional-rule {
        &.dragover__top::after,
        &.dragover__bottom::after {
          content: '';
          position: absolute;
          left: 0;
          right: 0;
          height: 4px;
          background-color: var(--b3-theme-primary-lighter);
          z-index: 3;
        }

        &.dragover__top::after {
          top: -2.5px;
        }

        &.dragover__bottom::after {
          bottom: -2.5px;
        }
      }

      &__item:hover .b3-menu__action {
        opacity: 1;
      }

      .av__filter-group-item {
        padding: 0 8px;
        margin: 6px 0;
        gap: 6px;
        display: flex;
        align-items: center;

        &:hover > .b3-menu__action {
          opacity: 1;
        }
      }

      // “当/且/或”只读标签,盒模型与 b3-select 对齐以保证垂直居中一致
      .av__filter-label {
        flex-shrink: 0;
        height: 28px;
        line-height: 20px;
        padding: 4px 0;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .av__filter-group-left {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        min-height: 28px;
      }

      .av__filter-group-children {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 6px 0;
        border-radius: var(--b3-border-radius);
        border: 1px solid var(--b3-theme-surface-lighter);

        &--depth1 {
          background-color: var(--b3-theme-surface);
          background-color: color-mix(in srgb, var(--b3-theme-on-background) 1%, transparent);
        }

        &--depth2 {
          background-color: var(--b3-theme-surface);
          background-color: color-mix(in srgb, var(--b3-theme-on-background) 2%, transparent);
        }

        &--depth3 {
          background-color: var(--b3-theme-surface);
          background-color: color-mix(in srgb, var(--b3-theme-on-background) 3%, transparent);
        }
      }

      .av__filter-group-children .b3-menu__item {
        background-color: transparent;
      }

      .av__filter-group-actions {
        display: flex;
        justify-content: flex-start;
        gap: 6px;
        padding-left: 8px;

        .block__icon {
          font-size: 14px;
          cursor: pointer;
          display: inline-flex;
          align-items: center;
          gap: 2px;
          padding: 0;

          svg {
            width: 10px;
            height: 10px;
            flex-shrink: 0;
          }
        }
      }

      // 分组行尾“更多”按钮与底部下拉箭头统一尺寸
      .av__filter-group-item > .b3-menu__action {
        flex-shrink: 0;
        align-self: center;
      }

      .av__filter-arrow {
        width: 10px;
        height: 10px;
        flex-shrink: 0;
        align-self: center;
        margin-left: 4px;
      }

      // “添加筛选条件”按钮:label 按内容宽度,使下拉箭头紧跟文案而非被推到最右
      .av__filter-add-label {
        flex: none;
      }

      &__item[data-type="nobg"] {
        cursor: auto;
      }

      &__item:not([data-type="nobg"]):hover,
      &__item--current:not([data-type="nobg"]) {
        background-color: var(--b3-list-hover);
      }

      @include av-filter-editor;
    }
  }

  &__field-visibility {
    .b3-menu__label {
      min-height: 0;
    }

    &-title {
      align-items: center;
    }

    & > .b3-menu__item:not([data-type="nobg"]):hover {
      background-color: var(--b3-list-hover);
    }

    .block__icon:not([data-conditional-drag]) {
      line-height: 20px;
      font-size: 12px;
      align-self: center;
      opacity: 1;

      &:not(.block__icon--menu-back) {
        padding: 0 4px;
      }
    }
  }

  &__button {
    margin: 5px;
    color: var(--b3-theme-on-surface);
    background-color: transparent;
    font-size: 75%;

    &:hover,
    &:focus {
      background-color: var(--b3-list-hover);
      box-shadow: none;
    }

    svg {
      height: 1.625em;
      width: calc(1.625em - 8px);

      &[data-type="set-page-size"] {
        margin: 0 0 0 4px;
        border-radius: var(--b3-border-radius);
        padding: 0 4px;

        &:hover {
          background-color: var(--b3-list-icon-hover);
        }
      }
    }
  }

  &__group {
    &-title {
      position: sticky;
      left: 0;
      clear: both;
      padding: 16px 0 8px 0;
      display: flex;
      align-items: center;

      .b3-chip {
        padding: 0 6px;
        line-height: 1.625;
        font-size: 1em;
        float: left;
        margin-right: 8px;

        &:last-child {
          margin-right: 0;
        }
      }

      & + .av__body .av__gallery {
        margin-top: 0;
      }
    }

    &-counter {
      font-size: 87.5%;
      color: var(--b3-theme-on-surface-light);
      margin: 0 8px 0 16px;
    }

    &-icon {
      cursor: pointer;
      color: var(--b3-theme-on-surface-light);
      transition: var(--b3-transition), opacity 0.3s cubic-bezier(0, 0, 0.2, 1) 0ms;
      border-radius: var(--b3-border-radius);

      &:hover {
        color: var(--b3-theme-on-background);
        background-color: var(--b3-list-icon-hover);
      }

      svg {
        padding: 5px;
        float: left;
        width: calc(1.625em - 12px);
        height: calc(1.625em - 12px);
        transition: transform 0.15s cubic-bezier(0, 0, 0.2, 1);
        font-size: 87.5%;
      }

      &--hover {
        opacity: 0;

        svg {
          padding: 4px;
          width: calc(1.625em - 10px);
          height: calc(1.625em - 10px);
        }
      }
    }

    &-arrow--open {
      transform: rotate(90deg);
    }
  }

  &__kanban {
    overflow: auto;
    gap: 16px;
    padding: 16px 1px;
    display: flex;
    align-items: flex-start;

    .av__gallery {
      grid-template-columns: minmax(0, 1fr);
    }

    &--bg {
      .av__kanban-group::before {
        content: "";
        position: absolute;
        inset: 0;
        background-color: var(--b3-av-kanban-background);
        opacity: 0.16;
        border-radius: inherit;
      }

      .av__gallery-item {
        position: relative;
        box-shadow: rgba(0, 0, 0, 0.04) 0 2px 4px 0, var(--b3-av-kanban-background) 0 0 0 1px;

        &::before {
          background-color: var(--b3-av-item-background, var(--b3-av-kanban-background));
          opacity: var(--b3-av-item-opacity, 0.26);
        }

        &:hover:not(.av__gallery-item--select)::before {
          background-color: var(--b3-av-item-background, var(--b3-av-kanban-background));
          opacity: var(--b3-av-item-opacity, 0.38);
        }
      }

      .av__gallery-cover {
        border-bottom-color: var(--b3-av-kanban-background);
      }

      .av__gallery-add {
        box-shadow: rgba(0, 0, 0, 0.04) 0 2px 4px 0, var(--b3-av-kanban-background) 0 0 0 1px;

        &::before {
          content: "";
          position: absolute;
          inset: 0;
          background-color: var(--b3-av-kanban-background);
          border-radius: inherit;
          opacity: 0.26;
        }

        &:hover {
          background-color: transparent;

          &::before {
            background-color: var(--b3-av-kanban-background);
            opacity: 0.38;
          }
        }
      }
    }

    &-group {
      width: var(--b3-av-card-width, 260px);
      padding: 8px;
      border-radius: var(--b3-border-radius);
      position: relative;
      flex-shrink: 0;

      &.dragover__left::after,
      &.dragover__right::after {
        content: "";
        position: absolute;
        top: 0;
        height: var(--b3-av-kanban-drag-height, 100%);
        width: 4px;
        background-color: var(--b3-theme-primary-lighter);
        z-index: 3;
      }

      &.dragover__left::after {
        left: -10px;
      }

      &.dragover__right::after {
        right: -10px;
      }

      &:first-child.dragover__left::after {
        left: 0;
      }

      &:last-child.dragover__right::after {
        right: 0;
      }

      &--small {
        width: var(--b3-av-card-width, 180px);
      }

      &--big {
        width: var(--b3-av-card-width, 320px);
      }

      .av__group-title {
        padding-top: 0;

        &[draggable="true"] {
          cursor: grab;

          &:active {
            cursor: grabbing;
          }
        }
      }
    }
  }
}

img.av__cellassetimg {
  max-height: calc(1.625em - 2px);
  border-radius: var(--b3-border-radius);
  margin: 1px 2px;
  max-width: none;
  vertical-align: top;
  font-size: inherit;
  cursor: zoom-in;
}

.av__cell,
.custom-attr__avvalue {
  .b3-menu__avemoji {
    font-size: 1em;
    line-height: 1.625;
    height: 1.625em;
    width: 1.25em;
    margin: 0 5px 0 -4px;
    vertical-align: top;

    svg,
    img {
      height: 1.25em;
      font-size: 1em;
      width: 1.25em;
      margin: 0;
      object-fit: contain;
    }
  }
}

.b3-menu[data-name="av-new-item-template-field-value"] {
  &:not(.b3-menu--fullscreen) {
    min-width: 290px;
    max-width: 290px;
  }

  .b3-menu__item .b3-chip {
    max-width: 100%;
    margin: 3px 0;
    padding-top: 4px;
    padding-bottom: 4px;
    float: left;
  }

  .b3-chips {
    padding: 0;

    input {
      outline: none;
      border: 0;
      background-color: var(--b3-menu-background);
      flex: 1;
      height: 32px;
      color: var(--b3-theme-on-background);
    }
  }
}

.b3-menu[data-name="av-new-item-template"] [data-template-id] {
  &.dragover__top::after,
  &.dragover__bottom::after {
    background-color: var(--b3-theme-primary-lighter);
    content: '';
    height: 4px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    z-index: 3;
  }

  &.dragover__top::after {
    top: -3px;
  }

  &.dragover__bottom::after {
    bottom: -2px;
  }
}

.av__relation-panel {
  padding-bottom: 0;

  .av__relation {
    min-width: 0;
  }

  .av__relation-table {
    border-radius: 0 0 var(--b3-border-radius-b) var(--b3-border-radius-b);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0;
  }

  .av__relation-table-header,
  .av__relation-table-row {
    display: grid;
    min-width: 100%;
    width: max-content;
  }

  .av__relation-table-header {
    background-color: var(--b3-menu-background);
    border-bottom: 1px solid var(--b3-border-color);
    color: var(--b3-theme-on-surface);
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 4;
    white-space: nowrap;

    .av__relation-table-cell {
      font-weight: 600;
      position: relative;

      &.av__relation-table-primary {
        position: sticky;
      }

      .av__widthdrag {
        right: 0;
      }

      > .av__relation-header-icon,
      > svg {
        flex-shrink: 0;
        height: 14px;
        margin-right: 6px;
        width: 14px;
      }

      .av__relation-header-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        object-fit: contain;
        line-height: 1;
        font-family: var(--b3-font-family-emoji);
        font-variant-emoji: emoji;
      }

      .av__relation-sort {
        flex-shrink: 0;
        margin-left: auto;
      }
    }
  }

  .av__relation-table-row {
    border-bottom: 1px solid var(--b3-border-color);
    border-radius: 0;
    height: auto;
    margin: 0;
    padding: 0;
    position: relative;
    text-align: left;

    &:hover,
    &.b3-menu__item--current {
      background-color: var(--b3-list-hover);

      .av__relation-table-check,
      .av__relation-table-primary {
        box-shadow: inset 0 0 0 9999px var(--b3-list-hover);
      }

      .av__relation-row-open {
        opacity: 1;
      }
    }

    &[data-relation-type="selected"],
    &[data-relation-type="selected"]:hover,
    &[data-relation-type="selected"].b3-menu__item--current {
      background-color: var(--b3-theme-primary-lightest);

      .av__relation-table-check,
      .av__relation-table-primary {
        box-shadow: inset 0 0 0 9999px var(--b3-theme-primary-lightest);
      }
    }

    .av__relation-table-cell > :not(.fn__grab):not(.av__relation-row-open),
    .av__relation-table-check > * {
      pointer-events: none;
    }
  }

  .av__relation-table-check,
  .av__relation-table-cell {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    min-height: 34px;
    min-width: 0;
    overflow: hidden;
    padding: 4px 8px;
  }

  .av__relation-table-row > .av__relation-table-cell,
  .av__relation-table-row > .av__relation-table-check {
    height: max(34px, calc(1.625em + 8px));
    white-space: nowrap;
  }

  .av__relation-table-check {
    background-color: var(--b3-menu-background);
    left: 0;
    padding: 8px;
    position: sticky;
    z-index: 2;

    svg {
      height: 16px;
      width: 16px;
    }
  }

  .av__relation-table-primary {
    background-color: var(--b3-menu-background);
    left: 32px;
    position: sticky;
    z-index: 2;

    .fn__grab {
      cursor: grab;
      flex: 0 0 auto;
      height: 14px;
      margin: 0 6px 0 0;
      width: 14px;
    }

    .b3-menu__label {
      flex: 1;
      min-width: 0;
    }
  }

  .av__relation-row-icon {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
    height: 20px;
    width: 20px;
    margin-right: 6px;
    font-size: 16px;

    svg,
    img {
      height: 16px;
      width: 16px;
      object-fit: contain;
    }
  }

  .av__relation-row-open {
    align-items: center;
    background-color: transparent;
    border: 0;
    border-radius: var(--b3-border-radius);
    color: var(--b3-theme-on-surface);
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    height: 26px;
    justify-content: center;
    margin-left: 4px;
    opacity: .54;
    padding: 5px;
    width: 26px;

    &:hover {
      background-color: var(--b3-list-hover);
      opacity: 1;
    }

    svg {
      height: 14px;
      width: 14px;
    }
  }

  .av__relation-table-cell {
    border-right: 1px solid var(--b3-border-color);

    &[data-dtype="relation"] {
      gap: 4px 12px;

      > .av__cell--relation {
        flex-shrink: 0;
        margin-right: 0;
      }

      .av__celltext {
        min-width: 0;
      }

      &[data-wrap="true"] {
        flex-wrap: wrap;

        .av__celltext {
          overflow-wrap: anywhere;
          white-space: normal;
        }
      }
    }

    &:last-child {
      border-right: 0;
    }

    .av__cell--relation {
      display: inline-flex;
      align-items: center;
      min-width: 0;
      max-width: 100%;

      > :first-child {
        flex-shrink: 0;
      }
    }

    .av__celltext,
    .b3-menu__label {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .av__row-actions,
    .block__icon {
      display: none;
    }
  }

  .av__relation-table-selected,
  .av__relation-table-candidates {
    display: contents;
  }

  .av__relation-table-selected:empty + .b3-menu__separator {
    display: none;
  }

  .av__relation-table-footer {
    border-radius: 0;
    margin: 0;

    &.b3-list--empty {
      padding-bottom: 8px;
    }
  }

  .av__relation-table-row.dragover__top::after,
  .av__relation-table-row.dragover__bottom::after {
    background-color: var(--b3-theme-primary-lighter);
    content: '';
    height: 4px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    z-index: 5;
  }

  .av__relation-table-row.dragover__top::after {
    top: -2px;
  }

  .av__relation-table-row.dragover__bottom::after {
    bottom: -2px;
  }
}

.av__option-colors {
  width: 238px;
  max-width: 100%;
  max-height: 238px;
  overflow: auto;
}

.b3-menu--fullscreen {
  .b3-menu__custom.av__option-custom {
    padding: 0;
  }

  .av__option-colors {
    width: 100%;
  }
}

.av__relation-drag-ghost {
  align-items: center;
  background-color: var(--b3-menu-background);
  border: 1px solid var(--b3-border-color);
  border-radius: var(--b3-border-radius);
  box-shadow: var(--b3-dialog-shadow);
  box-sizing: border-box;
  color: var(--b3-theme-on-background);
  display: flex;
  height: 34px;
  overflow: hidden;
  padding: 4px 8px;
  position: fixed;
  width: 240px;

  .fn__grab {
    flex: 0 0 auto;
    height: 14px;
    margin-right: 6px;
    width: 14px;
  }

  .b3-menu__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

// 条件背景使用变量传递,保留选中、聚焦、拖拽和冻结列的反馈层。
.av__row--conditional:not(.av__row--select):not(.av__row--hl) {
  background-color: var(--b3-av-item-background);

  .av__cell {
    background-color: var(--b3-av-cell-background, var(--b3-av-item-background, var(--b3-theme-background)));
  }

  .av__firstcol {
    background-color: var(--b3-av-item-background, var(--b3-theme-background));
  }
}

.av__panel .av__conditional-colors {
  padding: 8px;

  .av__conditional-hint {
    line-height: 16px;
    margin-bottom: 8px;
  }

  [data-rules] {
    display: grid;
    gap: 12px;
    margin-bottom: 8px;
  }

  .av__conditional-rule {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: start;
    gap: 8px 6px;
    min-width: 0;
    padding: 8px;
    border-radius: var(--b3-border-radius);
    background-color: var(--b3-theme-surface);

    > [data-action="remove"] {
      align-self: start;
      margin-top: 3px;
      margin-left: 0;
    }

    > [data-conditional-drag] {
      position: absolute;
      top: 10px;
      left: -16px;
      margin: 0;
      opacity: 0;
      pointer-events: none;
    }

    &:hover > [data-conditional-drag],
    &:focus-within > [data-conditional-drag] {
      opacity: 1;
      pointer-events: auto;
    }
  }

  .av__conditional-condition {
    min-width: 0;
  }

  .av__conditional-controls {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;

    [data-action="color"] {
      margin-left: auto;
      max-width: 100%;
      white-space: normal;
    }
  }

  .av__conditional-swatch {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    margin-right: 8px;
  }

  @media (hover: none), (any-pointer: coarse) {
    .av__conditional-rule {
      grid-template-columns: 24px minmax(0, 1fr) 22px;

      > [data-conditional-drag] {
        position: static;
        align-self: start;
        margin-top: 2px;
        opacity: 1;
        pointer-events: auto;
      }
    }

    .av__conditional-controls {
      grid-column: 2 / -1;
    }
  }
}
.av__panel .av__conditional-colors,
.av__panel .av__automation-filter {
  .av__filter-rowinner,
  .av__filter-date-config {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .av__filter-date-controls {
    display: contents;
  }

  .av__field-wrapper {
    width: 128px;
    max-width: 100%;
    min-width: 0;
  }

  .b3-select {
    max-width: 100%;
  }
}

.av__panel .av__conditional-colors {
  .av__filter-date-config {
    order: 1;
    flex-basis: 100%;
  }

  .av__filter-value {
    order: 2;
    flex-basis: 100%;
    min-width: 0;
  }
}

.av__panel .av__automation-filter {
  flex: 0 1 auto;
  min-width: 0;

  .av__filter-value {
    flex-basis: auto;
    min-width: 0;
  }
}

.av__automation {
  display: flex;
  flex-direction: column;
  min-height: 0;

  &-filter {
    @include av-filter-editor;
  }

  &-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    min-height: 0;
  }

  &-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--b3-border-color);
    min-width: 0;
  }

  &-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 12px;
    min-width: 0;
  }

  &-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }

  &-source-action {
    align-self: flex-start;
    justify-content: flex-start;
    max-width: 100%;
    text-align: left;
  }

  &-source-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  &-chips .b3-chip {
    max-width: 100%;
  }

  &-rule-warning {
    max-width: min(260px, calc(100vw - 32px));
    margin: 0 8px 8px;
    white-space: normal;
  }

  &-enabled,
  &-tools {
    align-self: flex-end;
    flex-shrink: 0;
    justify-content: flex-end;
    min-height: 28px;
    width: 52px;
  }

  &-remove {
    pointer-events: none;
  }

  &-row[data-condition]:hover > .av__automation-remove,
  &-row[data-condition]:focus-within > .av__automation-remove,
  &-action[data-index]:hover > .av__automation-row > .av__automation-remove,
  &-action[data-index]:focus-within > .av__automation-row > .av__automation-remove,
  &-field[data-field-id]:hover > .av__automation-remove,
  &-field[data-field-id]:focus-within > .av__automation-remove {
    opacity: 1;
    pointer-events: auto;
  }

  @media (hover: none), (any-pointer: coarse) {
    &-remove {
      opacity: 1;
      pointer-events: auto;
    }
  }

  [data-conditions] {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  [data-conditions]:not(:empty) + [data-add-condition] {
    margin-top: 12px;
  }

  &-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;

    > .b3-menu__action {
      flex-shrink: 0;
      margin-left: 0;
    }
  }

  &-source-row {
    flex-wrap: nowrap;
    column-gap: 0;
    min-height: 24px;
  }

  &-row[data-condition] {
    flex-wrap: nowrap;
    align-items: flex-start;

    > .b3-menu__action {
      align-self: flex-start;
      margin-left: auto;
      margin-top: 3px;
    }
  }

  &-action,
  &-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    min-width: 0;
  }

  &-action:last-child,
  &-field:last-child {
    margin-bottom: 0;
  }

  &-field[data-field-id] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) max-content;
    align-items: center;

    > .b3-menu__action {
      margin-left: 0;
    }
  }

  &-field-name {
    white-space: nowrap;
  }

  &-field[data-template-assignment] {
    > .av__automation-value {
      grid-column: 1 / -1;
    }
  }

  &-template,
  &-template-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }

  &-template-data {
    margin-top: 8px;
  }

  &-template-toggle {
    justify-content: flex-start;
    list-style: none;

    &::-webkit-details-marker {
      display: none;
    }
  }

  &-template-result {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  &-assignment {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;

    > .av__automation-value {
      flex-basis: 160px;
      min-width: 0;
      align-self: center;

      &:empty {
        display: none;
      }
    }
  }

  &-action[data-index] {
    padding: 12px;
    border: 1px solid var(--b3-border-color);
    border-radius: var(--b3-border-radius);
  }

  &-filter,
  &-value {
    flex: 1;
    min-width: 160px;
    max-width: 100%;
  }

  &-value {
    display: flex;
    flex-wrap: wrap;
    align-self: flex-end;
  }

  .b3-select,
  .b3-text-field {
    min-width: 0;
    max-width: 100%;
  }
}

.av__collection-preview {
  max-height: 60vh;
  overflow: auto;
}

.av__automation-menu {
  > .b3-text-field {
    flex-shrink: 0;
    margin: 0 0 4px;
  }
}

.av__automation-menu-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;

  > .b3-list-item {
    flex-shrink: 0;
    margin-inline: 0;
  }
}

.b3-menu:not(.b3-menu--fullscreen) .av__automation-menu--types {
  width: 14em;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
}

.av__collection-manager {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.av__collection-tabs {
  flex-shrink: 0;

  .item {
    min-width: 0;

    .item__text {
      white-space: normal;
      overflow-wrap: anywhere;
    }
  }
}

.av__collection-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;

  > .b3-button {
    flex-shrink: 0;
    max-width: 40%;
  }
}