@font-face {
  font-family: YouSheBiaoTiHei;
  font-style: normal;
  font-weight: normal;
  src: url('@/assets/font/YouSheBiaoTiHei.ttf') format('truetype');
  font-display: swap;
}

.bg {
  --fvs-theme-color-1-2: #f5f9ff;

  background: url('@/assets/kb/bg.png') center center / 100% 100% no-repeat;
  background-color: #fff;
}

.header {
  height: calc(52px * var(--kb-scale, 1));
  font-family: YouSheBiaoTiHei, sans-serif;
  font-size: calc(32px * var(--kb-scale, 1));
  color: var(--fvs-theme-color-1-2);
  text-align: center;
  background: url('@/assets/kb/header.png') center center / 100% 100% no-repeat;
}

.panel {
  background: linear-gradient(180deg, rgb(235 243 255 / 76%) 0%, rgb(221 233 251 / 58%) 100%);
  border: 1px solid rgb(255 255 255 / 58%);
  border-radius: calc(20px * var(--kb-scale, 1));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 72%),
    0 18px 36px rgb(46 90 164 / 12%);
  backdrop-filter: blur(12px);
}

.panel-title {
  position: relative;
  display: flex;
  height: calc(36px * var(--kb-scale, 1));
  padding: 0 calc(16px * var(--kb-scale, 1)) 0 calc(36px * var(--kb-scale, 1));
  font-family: YouSheBiaoTiHei, sans-serif;
  font-size: calc(24px * var(--kb-scale, 1));
  letter-spacing: 1px;
  color: #03409b;
  align-items: center;

  &::after {
    position: absolute;
    right: calc(10px * var(--kb-scale, 1));
    bottom: 0;
    left: calc(10px * var(--kb-scale, 1));
    height: calc(2px * var(--kb-scale, 1));
    background: linear-gradient(
      to right,
      rgb(3 64 155 / 15%) 0%,
      rgb(3 64 155 / 15%) calc(100% - 80px),
      #03409b calc(100% - 80px),
      #03409b 100%
    );
    content: '';
  }

  &::before {
    position: absolute;
    right: calc(10px * var(--kb-scale, 1));
    bottom: 0;
    z-index: 1;
    width: calc(80px * var(--kb-scale, 1));
    height: calc(4px * var(--kb-scale, 1));
    background: #03409b;
    border-radius: calc(2px * var(--kb-scale, 1)) calc(2px * var(--kb-scale, 1)) 0 0;
    content: '';
  }

  .icon-decorator {
    position: absolute;
    left: calc(14px * var(--kb-scale, 1));
    display: flex;
    align-items: center;
    gap: calc(3px * var(--kb-scale, 1));

    span {
      width: calc(4px * var(--kb-scale, 1));
      height: calc(18px * var(--kb-scale, 1));
      background: #03409b;
      border-radius: calc(2px * var(--kb-scale, 1));

      &:last-child {
        height: calc(12px * var(--kb-scale, 1));
        opacity: 0.5;
      }
    }
  }
}

.panel-title--lg {
  height: calc(48px * var(--kb-scale, 1));
}

.panel-title--md {
  height: calc(40px * var(--kb-scale, 1));
}

.kb-panel-title-text {
  font-family: YouSheBiaoTiHei, sans-serif;
  font-size: calc(24px * var(--kb-scale, 1));
  font-weight: normal;
  line-height: 1;
  letter-spacing: 1px;
  color: #03409b;
}

.summary-panel {
  height: calc(112px * var(--kb-scale, 1));
}

.summary-panel__title {
  height: calc(32px * var(--kb-scale, 1));
}

.summary-panel__grid {
  padding: calc(6px * var(--kb-scale, 1)) calc(10px * var(--kb-scale, 1));
  gap: calc(10px * var(--kb-scale, 1));
}

.summary-card {
  gap: calc(8px * var(--kb-scale, 1));
  padding: calc(8px * var(--kb-scale, 1));
}

.device-list-panel {
  height: calc(280px * var(--kb-scale, 1));
  margin-top: calc(12px * var(--kb-scale, 1));
}

.device-list-panel__body {
  padding: calc(8px * var(--kb-scale, 1)) calc(16px * var(--kb-scale, 1));
}

.device-list-panel__picker {
  display: flex;
  width: calc(260px * var(--kb-scale, 1));
  align-items: center;
}

.device-list-panel__picker-input {
  width: calc(260px * var(--kb-scale, 1)) !important;

  :deep(.el-input__wrapper) {
    min-height: calc(28px * var(--kb-scale, 1));
    padding: 0 calc(10px * var(--kb-scale, 1));
  }

  :deep(.el-range-input),
  :deep(.el-range-separator) {
    font-size: calc(12px * var(--kb-scale, 1));
  }

  :deep(.el-range__icon),
  :deep(.el-range__close-icon) {
    font-size: calc(14px * var(--kb-scale, 1));
  }
}

.kb-inline-picker {
  display: flex;
  width: var(--kb-picker-width);
  align-items: center;
}

.kb-inline-picker--260 {
  --kb-picker-width: calc(260px * var(--kb-scale, 1));
}

.kb-inline-picker__input {
  width: var(--kb-picker-width) !important;

  :deep(.el-input__wrapper) {
    min-height: calc(28px * var(--kb-scale, 1));
    padding: 0 calc(10px * var(--kb-scale, 1));
  }

  :deep(.el-range-input),
  :deep(.el-range-separator) {
    font-size: calc(12px * var(--kb-scale, 1));
  }

  :deep(.el-range__icon),
  :deep(.el-range__close-icon) {
    font-size: calc(14px * var(--kb-scale, 1));
  }
}

.summary-card {
  position: relative;
  cursor: default;
  background: linear-gradient(180deg, rgb(255 255 255 / 52%) 0%, rgb(213 227 249 / 38%) 100%);
  border: 1px solid rgb(255 255 255 / 74%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 78%),
    0 6px 14px rgb(63 103 171 / 7%);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
  isolation: isolate;
}

.summary-card::before {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgb(255 255 255 / 0%) 0%,
    rgb(255 255 255 / 0%) 58%,
    rgb(255 255 255 / 18%) 100%
  );
  content: '';
  inset: 0;
}

.summary-card::after {
  position: absolute;
  right: calc(-16px * var(--kb-scale, 1));
  bottom: calc(-28px * var(--kb-scale, 1));
  z-index: 0;
  width: calc(84px * var(--kb-scale, 1));
  height: calc(84px * var(--kb-scale, 1));
  pointer-events: none;
  background: radial-gradient(circle, var(--card-glow) 0%, rgb(255 255 255 / 0%) 70%);
  content: '';
  opacity: 0.86;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
}

.summary-card:hover {
  background: linear-gradient(180deg, rgb(255 255 255 / 72%) 0%, rgb(219 233 255 / 46%) 100%);
  border-color: rgb(255 255 255 / 90%);
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 85%),
    0 10px 18px rgb(41 89 164 / 13%);
}

.summary-card:hover::after {
  opacity: 1;
  transform: scale(1.08);
}

.summary-card__shine {
  position: absolute;
  top: 0;
  left: -130%;
  z-index: 1;
  width: 60%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgb(255 255 255 / 0%) 0%,
    rgb(255 255 255 / 18%) 45%,
    rgb(255 255 255 / 45%) 50%,
    rgb(255 255 255 / 18%) 55%,
    rgb(255 255 255 / 0%) 100%
  );
  transform: skewX(-22deg);
}

.summary-card:hover .summary-card__shine {
  left: 150%;
  transition: left 0.8s ease;
}

.summary-card__icon {
  position: relative;
  z-index: 2;
  display: flex;
  width: calc(48px * var(--kb-scale, 1));
  height: calc(48px * var(--kb-scale, 1));
  background: linear-gradient(180deg, rgb(255 255 255 / 96%) 0%, rgb(242 247 255 / 92%) 100%);
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: calc(12px * var(--kb-scale, 1));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 95%),
    0 6px 12px rgb(152 181 230 / 15%);
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.summary-card__icon::after {
  position: absolute;
  right: calc(-3px * var(--kb-scale, 1));
  bottom: calc(-3px * var(--kb-scale, 1));
  width: calc(15px * var(--kb-scale, 1));
  height: calc(15px * var(--kb-scale, 1));
  background: radial-gradient(
    circle at 30% 30%,
    rgb(255 255 255 / 96%) 0%,
    var(--card-glow) 58%,
    rgb(255 255 255 / 0%) 75%
  );
  border-radius: 999px;
  content: '';
  opacity: 0.95;
}

.summary-card:hover .summary-card__icon {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 95%),
    0 8px 14px rgb(120 158 221 / 20%);
}

.summary-card__icon-glyph {
  position: relative;
  z-index: 1;
  font-size: calc(25px * var(--kb-scale, 1));
  color: var(--card-accent);
  transition:
    transform 0.28s ease,
    filter 0.28s ease;
}

.summary-card:hover .summary-card__icon-glyph {
  filter: drop-shadow(0 4px 8px rgb(0 0 0 / 8%));
  transform: scale(1.08);
}

.summary-card__body {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(48px * var(--kb-scale, 1));
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.summary-card__label {
  overflow: hidden;
  font-size: calc(14px * var(--kb-scale, 1));
  font-weight: 600;
  color: #24364f;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    transform 0.28s ease,
    color 0.28s ease;
}

.summary-card__value {
  margin-top: calc(4px * var(--kb-scale, 1));
  font-family: YouSheBiaoTiHei, sans-serif;
  font-size: calc(19px * var(--kb-scale, 1));
  line-height: 1;
  letter-spacing: 1px;
  color: #1f5bb8;
  transition:
    transform 0.28s ease,
    text-shadow 0.28s ease;
}

.summary-card:hover .summary-card__label {
  color: #173b72;
  transform: translateX(1px);
}

.summary-card:hover .summary-card__value {
  text-shadow: 0 4px 10px rgb(31 91 184 / 16%);
  transform: translateX(1px);
}

.summary-card__corner {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: calc(36px * var(--kb-scale, 1));
  height: calc(36px * var(--kb-scale, 1));
  pointer-events: none;
  background: linear-gradient(135deg, rgb(255 255 255 / 30%) 0%, rgb(255 255 255 / 0%) 70%);
  opacity: 0.85;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.summary-card {
  animation: card-in 0.5s ease both;
}

.summary-card:nth-child(1) {
  animation-delay: 0.05s;
}

.summary-card:nth-child(2) {
  animation-delay: 0.1s;
}

.summary-card:nth-child(3) {
  animation-delay: 0.15s;
}

.summary-card:nth-child(4) {
  animation-delay: 0.2s;
}

.summary-card:nth-child(5) {
  animation-delay: 0.25s;
}

.summary-card:nth-child(6) {
  animation-delay: 0.3s;
}

.summary-card:nth-child(7) {
  animation-delay: 0.35s;
}

.summary-card:nth-child(8) {
  animation-delay: 0.4s;
}

.summary-card:nth-child(9) {
  animation-delay: 0.4s;
}

.summary-card:nth-child(10) {
  animation-delay: 0.4s;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-card__placeholder {
  display: inline-block;
  font-family: YouSheBiaoTiHei, sans-serif;
  font-size: calc(19px * var(--kb-scale, 1));
  line-height: 1;
  letter-spacing: 1px;
  color: rgb(31 91 184 / 45%);
}

.device-list-table,
.team-list-table {
  --el-table-border-color: rgb(31 91 184 / 12%);
  --el-table-border: 1px solid rgb(31 91 184 / 12%);
  --el-table-header-bg-color: rgb(255 255 255 / 82%);
  --el-table-tr-bg-color: transparent;
  --el-table-bg-color: transparent;
  --el-table-row-hover-bg-color: rgb(31 91 184 / 6%);
  --el-fill-color-lighter: rgb(255 255 255 / 55%);

  background: transparent;

  :deep(.el-table__inner-wrapper::before) {
    display: none;
  }

  :deep(.el-table__header-wrapper th.el-table__cell) {
    // font-family: YouSheBiaoTiHei, sans-serif;
    font-size: calc(20px * var(--kb-scale, 1));
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #03409b;
    background: linear-gradient(180deg, rgb(255 255 255 / 92%) 0%, rgb(231 240 255 / 82%) 100%);
    border-bottom: 1px solid rgb(31 91 184 / 16%);
  }

  :deep(.el-table__body td.el-table__cell) {
    padding: calc(8px * var(--kb-scale, 1)) 0;
    // font-family: YouSheBiaoTiHei, sans-serif;
    font-size: calc(16px * var(--kb-scale, 1));
    color: #24364f;
    background: rgb(255 255 255 / 16%);
    border-bottom: 1px solid rgb(31 91 184 / 8%);
  }

  :deep(.el-table__body tr:nth-child(2n) td.el-table__cell) {
    background: rgb(255 255 255 / 28%);
  }

  :deep(.el-table__row:hover > td.el-table__cell) {
    background: rgb(31 91 184 / 8%) !important;
  }

  :deep(.el-scrollbar__bar.is-vertical) {
    width: calc(8px * var(--kb-scale, 1));
  }

  :deep(.el-scrollbar__bar.is-horizontal) {
    height: calc(8px * var(--kb-scale, 1));
  }

  :deep(.el-scrollbar__thumb) {
    background: rgb(31 91 184 / 26%);
    border-radius: 999px;
  }
}

.device-list-table {
  :deep(.el-table__row) {
    cursor: pointer;
  }
}

.kb-stage-card {
  --panel-delay: 0s;
  --panel-glow: rgb(31 91 184 / 12%);

  position: relative;
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  animation: kb-panel-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--panel-delay);
  isolation: isolate;
  will-change: transform, opacity;
}

.kb-stage-card::before {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    rgb(255 255 255 / 0%) 0%,
    rgb(255 255 255 / 0%) 34%,
    rgb(255 255 255 / 26%) 48%,
    rgb(255 255 255 / 8%) 56%,
    rgb(255 255 255 / 0%) 68%,
    rgb(255 255 255 / 0%) 100%
  );
  border-radius: calc(20px * var(--kb-scale, 1));
  content: '';
  opacity: 0;
  transform: translateX(-140%) skewX(-22deg);
  animation: kb-panel-sheen 1.05s ease-out forwards;
  animation-delay: calc(var(--panel-delay) + 0.18s);
  inset: 0;
}

.kb-stage-card::after {
  position: absolute;
  right: calc(-24px * var(--kb-scale, 1));
  bottom: calc(-30px * var(--kb-scale, 1));
  z-index: 0;
  width: calc(120px * var(--kb-scale, 1));
  height: calc(120px * var(--kb-scale, 1));
  pointer-events: none;
  background: radial-gradient(circle, var(--panel-glow) 0%, rgb(255 255 255 / 0%) 72%);
  content: '';
  opacity: 0.88;
  transition:
    transform 0.32s ease,
    opacity 0.32s ease;
}

.kb-stage-card:hover {
  transform: translateY(-4px) scale(1.005);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.kb-stage-card:hover::after {
  opacity: 1;
  transform: scale(1.08);
}

.kb-stage-card--list {
  --panel-glow: rgb(45 124 248 / 14%);
}

.kb-stage-card--1 {
  --panel-delay: 0.02s;
}

.kb-stage-card--2 {
  --panel-delay: 0.08s;
}

.kb-stage-card--3 {
  --panel-delay: 0.14s;
}

.kb-stage-card--4 {
  --panel-delay: 0.2s;
}

.kb-stage-card--5 {
  --panel-delay: 0.26s;
}

.kb-stage-card--6 {
  --panel-delay: 0.32s;
}

.kb-stage-card--7 {
  --panel-delay: 0.38s;
}

.kb-stage-card--8 {
  --panel-delay: 0.44s;
}

.kb-stage-card--9 {
  --panel-delay: 0.5s;
}

.kb-stage-card--10 {
  --panel-delay: 0.56s;
}

@keyframes kb-panel-enter {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(22px) scale(0.985);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes kb-panel-sheen {
  0% {
    opacity: 0;
    transform: translateX(-140%) skewX(-22deg);
  }

  18% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: translateX(165%) skewX(-22deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kb-stage-card,
  .kb-stage-card::before,
  .kb-stage-card::after {
    animation: none;
    transition: none;
  }

  .kb-stage-card {
    opacity: 1;
    transform: none;
  }

  .kb-stage-card:hover {
    transform: none;
  }
}
