.calendar {
  width: 100%;
}

//头部栏
.calendar-header {
  padding: $calendar-header-padding;
  font-size: $calendar-header-font-size;
  display: flex;
}

.calendar-header-caption {
  flex: 1;
  text-align: center;
}

.calendar-body {
  background: $calendar-body-bg;
}

//星期
.calendar-weekgroup {
  border: 1px solid $calendar-border-color;
  border-bottom: 0;
  background: $calendar-weekgroup-bg;
}

.calendar-weekgroup-item {
  width: percentage(1 / 7);
  display: inline-block;
  font-weight: bold;
  text-align: center;
  padding: $calendar-weekgroup-item-padding;

  j &:not(:last-child) {
    border-right: 1px solid $calendar-border-color;
  }
}

.calendar-daygroup {
  border: 1px solid $calendar-border-color;
  border-bottom: 0;
}

.calendar-daygroup-item {
  display: inline-flex;
  flex-direction: column;
  cursor: pointer;
  width: percentage(1 / 7);
  height: $calendar-daygroup-item-height;
  padding: $calendar-daygroup-item-padding;
  overflow: hidden;
  border-bottom: 1px solid $calendar-border-color;

  &:not(:nth-child(7n)) {
    border-right: 1px solid $calendar-border-color;
  }

  &.active {
    background: $calendar-daygroup-item-active-bg;

    > .calendar-daygroup-item-header {
      color: $brand-primary;
      font-weight: bold;
    }
  }
}

.calendar-daygroup-item-header {
  text-align: right;
}

.calendar-daygroup-item-body {
  flex: 1;
  overflow: auto;
}

.disabled {
  cursor: initial;

  > .calendar-daygroup-item-header {
    opacity: $calendar-daygroup-item-disable-opacity;
  }
}

// Size
.calendar-sm {
  .calendar-header {
    font-size: $calendar-sm-header-font-size;
    padding: $calendar-sm-header-padding;
  }

  .calendar-daygroup-item-header,
  .calendar-weekgroup-item {
    font-weight: initial;
    font-size: $calendar-sm-weekgroup-item-font-size;
  }

  .calendar-daygroup-item {
    height: $calendar-sm-daygroup-item-height;
  }
}
