@import "util/keyframes";
@import "util/mixin";
@import "util/function";
@import "business/history";
@import "component/chip";
@import "component/slider";
@import "component/switch";
@import "util/scroll";
@import "component/tooltips";
@import "component/dialog";
@import "component/button";
@import "component/snackbar";
@import "component/form";
@import "node_modules/@simonwep/pickr/src/scss/themes/nano.scss";
@import "component/text-field";
@import "component/select";
@import "component/list";
@import "business/graph";
@import "business/layout";
@import "business/block";
@import "util/reset";
@import "component/card";
@import "component/menu";
@import "business/color";
@import "protyle/protyle";
@import "component/typography";
@import "pdf/pdf";
@import "business/config";
@import "business/search";
@import "pickr/pcr";
@import "viewerjs/viewer";
@import "business/export";
@import "business/card";

/*
.status: 3

// 需小于 .block__popover
// 需小于 ctrl+p https://github.com/siyuan-note/siyuan/issues/7174
.protyle-util: 4

// 引用提示需小于 .block__popover
.protyle-hint: 201

// 需小于 .block__popover https://github.com/siyuan-note/siyuan/issues/3515
// 需大于 .protyle-hint https://github.com/siyuan-note/siyuan/pull/7247
ctrl+p 搜索: 202

// 需小于 .b3-menu 悬浮窗点击更多
// 需小于 .b3-dialog https://ld246.com/article/1637204682648
.block__popover: 205
.block__popover--top: 206

// 需大于 .block__popover
.b3-menu: 210

// 需小于 .side-panel
#transactionTip & #keyboardToolbar: 212

// 需小于 .b3-dialog 关于中的锁屏密码设置
.side-panel: 220

// 需小于 #windowControls
// 需大于 .protyle-util https://github.com/siyuan-note/siyuan/issues/5069
.b3-dialog: 305

// 历史中切换笔记本需临时大于 .b3-dialog https://github.com/siyuan-note/siyuan/issues/5107
// 移动端排序和菜单需临时大于 .side-panel https://github.com/siyuan-note/siyuan/issues/5254
.b3-menu: 310

// 需大于 .b3-dialog
progressLoading: 400

#windowControls: 502

.b3-snackbar: 503
*/

html {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
}

.inbox {
  &__details {
    position: absolute;
    background: var(--b3-theme-surface);
    left: 0;
    top: 30px;
    bottom: 0;
    overflow: auto;
    z-index: 1;
    right: 0;
    padding: 4px 8px;
    word-break: break-all;
    user-select: text;
  }

  &__list {
    label {
      height: 28px;
    }
  }
}

.fullscreen {
  position: fixed;
  top: 0;
  width: 100% !important;
  left: 0;
  height: 100vh !important;
  z-index: 90;
  border-radius: 0;

  & > .protyle-breadcrumb,
  & > .block__icons { // 关系图
    padding-left: 69px;
    height: 32px;
  }

  .protyle-breadcrumb > .protyle-breadcrumb__space {
    -webkit-app-region: drag;
    min-width: 32px;

    &:hover {
      border-radius: 16px;
      background-color: var(--b3-theme-surface-light);
    }
  }
}

.custom-attr {
  .b3-text-field {
    border: 0;
  }

  &__add {
    overflow: auto;
    height: 30vh;
    padding: 4px 0 4px 4px;

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

.svg {
  fill: currentColor;
  display: inline-block;
  stroke-width: 0;
  stroke: currentColor;
  width: 14px;
  height: 14px;

  &--mid {
    width: 16px;
    height: 16px;
  }

  &--small {
    width: 12px;
    height: 12px;
  }
}

.toolbar {
  background-color: var(--b3-toolbar-background);
  box-sizing: border-box;
  height: 32px;
  line-height: 32px;
  padding: 0 5px 0 69px;
  border-bottom: .5px solid var(--b3-border-color);

  &--browser {
    padding-left: 0;
  }

  #windowControls {
    top: 0;
    z-index: 502;
    right: 0;
    position: relative;

    .toolbar__item svg {
      width: 13px;
    }
  }

  #drag {
    -webkit-app-region: drag;
    color: var(--b3-toolbar-color);
    user-select: none;
    text-align: center;
    white-space: nowrap;
    align-self: center;
    font-size: 12px;
  }

  &__item {
    flex-shrink: 0;
    cursor: pointer;
    color: var(--b3-toolbar-color);
    padding: 9px;
    box-sizing: border-box;
    transition: var(--b3-transition);
    display: flex;
    align-self: center;
    background-color: transparent;
    border: 0;
    line-height: 13.5px;

    &:not(.toolbar__item--disabled):not(.toolbar__item--close):hover,
    &--active {
      background-color: var(--b3-toolbar-hover);
    }

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

    svg.toolbar__svg {
      width: 8px;
      height: 13.5px;
      margin-left: 4px;
      opacity: .54;
    }

    &--disabled {
      opacity: .54;
      cursor: not-allowed;
    }

    &--close {
      padding: 9px 16px;

      svg {
        width: 10px !important;
      }

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

  &__window {
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    z-index: 502;

    .toolbar__item {
      padding: 14.25px;

      &:not(.toolbar__item--disabled):not(.toolbar__item--close):hover,
      &--active {
        background-color: var(--b3-theme-background-light);
      }
    }
  }

  &__text {
    font-size: 12px;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
    color: #ebecf0;
  }
}

.status {
  background-color: var(--b3-theme-surface);
  box-sizing: border-box;
  z-index: 2;
  height: 32px;
  line-height: 32px;
  border-top: .5px solid var(--b3-border-color);
  padding: 0 5px;

  .toolbar__item {
    color: var(--b3-theme-on-surface);

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

  &__msg {
    color: var(--b3-theme-on-surface);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding-left: 5px;
    font-size: 12px;
  }

  &__counter {
    display: flex;
    flex-shrink: 0;
    font-size: 12px;
  }

  &__backgroundtask {
    display: flex;
    color: var(--b3-theme-on-surface);
    font-size: 12px;

    & > div {
      height: 4px;
      border-radius: 4px;
      overflow: hidden;
      background-color: #fff;
      width: 64px;
      align-self: center;
      margin: 0 8px 0 4px;
      cursor: pointer;

      & > div {
        background-color: var(--b3-theme-primary-light);
        height: 4px;
        background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
        animation: stripMove 450ms linear infinite;
        background-size: 50px 50px;
      }
    }
  }

  .fn__space:last-child {
    width: 5px;
  }
}

.asset {
  overflow: auto;
  box-sizing: border-box;
  margin: 16px;

  &--pdf {
    margin: 0;
    height: 100%;
  }

  img, video, audio, canvas {
    max-width: 100%;
  }
}

.file-tree {
  .dragover {
    background-color: var(--b3-theme-primary-lightest);

    &__top {
      background-color: var(--b3-theme-primary-lightest);
      box-shadow: 0 -2px 0 var(--b3-theme-primary-lighter), inset 0 2px 0 var(--b3-theme-primary-lighter);
    }

    &__bottom {
      background-color: var(--b3-theme-primary-lightest);
      box-shadow: 0 2px 0 var(--b3-theme-primary-lighter), inset 0px -2px 0 var(--b3-theme-primary-lighter);
    }
  }

  &:hover .block__icons .block__icon:not([disabled]) {
    opacity: 1;
  }

  &:hover .block__icons .block__icon[disabled] {
    opacity: .68;
  }

  .block__icons .block__icon[disabled] {
    opacity: 0;
  }

  &__close {
    min-height: auto;
    transition: var(--b3-transition);
  }

  &__sliderDown {
    height: 0;
    overflow: hidden;
    transition: var(--b3-transition);
  }
}

.counter {
  margin-left: 4px;
  line-height: 22px;
  padding: 0 8px;
  color: var(--b3-theme-on-surface);
  border-radius: 2px;
  font-size: 12px;
  user-select: none;
  height: 22px;
}

.reveal {
  font-family: var(--b3-font-family);
}

.backlink--more {
  .b3-list-item__text {
    -webkit-line-clamp: initial;
  }

  .b3-list-item__graphic.popover__block {
    align-self: flex-start;
    margin-top: 7px;
  }
}

.switch-doc {
  max-height: 70vh;
  width: 520px;

  .b3-list:last-child {
    border-left: 1px solid var(--b3-theme-surface-lighter);
    max-height: calc(70vh - 35px)
  }

  &__path {
    padding: 4px 8px;
    border-top: 1px solid var(--b3-theme-surface-lighter);
    color: var(--b3-theme-on-surface);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 18px;
    min-height: 18px;
  }
}

// 需放置最后，否则 https://github.com/siyuan-note/siyuan/issues/7056
@import "util/responsive";
