.yee-calendarLeftArrow() {
  height: 100%;

  &::before,
  &::after {
    position: relative;
    top: -1px;
    display: inline-block;
    width: 8px;
    height: 8px;
    vertical-align: middle;
    border: 0 solid #aaa;
    border-width: 1.5px 0 0 1.5px;
    border-radius: 1px;
    transform: rotate(-45deg) scale(0.8);
    transition: all 0.3s;
    content: '';
  }

  &:hover::before,
  &:hover::after {
    border-color: @yee-text-color;
  }

  &::after {
    display: none;
  }
}

.yee-calendarLeftDoubleArrow() {
  .yee-calendarLeftArrow;

  &::after {
    position: relative;
    left: -3px;
    display: inline-block;
  }
}

.yee-calendarRightArrow() {
  .yee-calendarLeftArrow;

  &::before,
  &::after {
    transform: rotate(135deg) scale(0.8);
  }
}

.yee-calendarRightDoubleArrow() {
  .yee-calendarRightArrow;

  &::before {
    position: relative;
    left: 3px;
  }

  &::after {
    display: inline-block;
  }
}

.yee-calendarPanelHeader(@yee-calendar-prefix-cls) {
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-bottom: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
  user-select: none;

  a:hover {
    color: @yee-link-hover-color;
  }

  .@{yee-calendar-prefix-cls}-century-select,
  .@{yee-calendar-prefix-cls}-decade-select,
  .@{yee-calendar-prefix-cls}-year-select,
  .@{yee-calendar-prefix-cls}-month-select {
    display: inline-block;
    padding: 0 2px;
    color: @yee-heading-color;
    font-weight: 500;
    line-height: 40px;
  }

  .@{yee-calendar-prefix-cls}-century-select-arrow,
  .@{yee-calendar-prefix-cls}-decade-select-arrow,
  .@{yee-calendar-prefix-cls}-year-select-arrow,
  .@{yee-calendar-prefix-cls}-month-select-arrow {
    display: none;
  }

  .@{yee-calendar-prefix-cls}-prev-century-btn,
  .@{yee-calendar-prefix-cls}-next-century-btn,
  .@{yee-calendar-prefix-cls}-prev-decade-btn,
  .@{yee-calendar-prefix-cls}-next-decade-btn,
  .@{yee-calendar-prefix-cls}-prev-month-btn,
  .@{yee-calendar-prefix-cls}-next-month-btn,
  .@{yee-calendar-prefix-cls}-prev-year-btn,
  .@{yee-calendar-prefix-cls}-next-year-btn {
    position: absolute;
    top: 0;
    display: inline-block;
    padding: 0 5px;
    color: @yee-text-color-secondary;
    font-size: 16px;
    font-family: Arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'Microsoft Sans Serif', sans-serif;
    line-height: 40px;
  }

  .@{yee-calendar-prefix-cls}-prev-century-btn,
  .@{yee-calendar-prefix-cls}-prev-decade-btn,
  .@{yee-calendar-prefix-cls}-prev-year-btn {
    left: 7px;
    .yee-calendarLeftDoubleArrow;
  }

  .@{yee-calendar-prefix-cls}-next-century-btn,
  .@{yee-calendar-prefix-cls}-next-decade-btn,
  .@{yee-calendar-prefix-cls}-next-year-btn {
    right: 7px;
    .yee-calendarRightDoubleArrow;
  }

  .@{yee-calendar-prefix-cls}-prev-month-btn {
    left: 29px;
    .yee-calendarLeftArrow;
  }

  .@{yee-calendar-prefix-cls}-next-month-btn {
    right: 29px;
    .yee-calendarRightArrow;
  }
}

.yee-calendar-selected-cell() {
  .@{yee-calendar-prefix-cls}-date {
    color: @yee-text-color-inverse;
    background: @yee-primary-color;
    border: @yee-border-width-base @yee-border-style-base transparent;

    &:hover {
      background: @yee-primary-color;
    }
  }
}

.@{yee-calendar-prefix-cls} {
  position: relative;
  width: 280px;
  font-size: @yee-font-size-base;
  line-height: @yee-line-height-base;
  text-align: left;
  list-style: none;
  background-color: @yee-component-background;
  background-clip: padding-box;
  border: @yee-border-width-base @yee-border-style-base @yee-border-color-inverse;
  border-radius: @yee-border-radius-base;
  outline: none;
  box-shadow: @yee-box-shadow-base;

  &-input-wrap {
    height: 34px;
    padding: 6px @yee-control-padding-horizontal - 2px;
    border-bottom: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
  }

  &-input {
    width: 100%;
    height: 22px;
    color: @yee-input-color;
    background: @yee-input-bg;
    border: 0;
    outline: 0;
    cursor: auto;
    .yee-placeholder;
  }

  &-week-number {
    width: 286px;

    &-cell {
      text-align: center;
    }
  }

  &-header {
    .yee-calendarPanelHeader(@yee-calendar-prefix-cls);
  }

  &-body {
    padding: 8px 12px;
  }

  table {
    width: 100%;
    max-width: 100%;
    background-color: transparent;
    border-collapse: collapse;
  }

  table,
  th,
  td {
    text-align: center;
    border: 0;
  }

  &-calendar-table {
    margin-bottom: 0;
    border-spacing: 0;
  }

  &-column-header {
    width: 33px;
    padding: 6px 0;
    line-height: 18px;
    text-align: center;
    .@{yee-calendar-prefix-cls}-column-header-inner {
      display: block;
      font-weight: normal;
    }
  }

  &-week-number-header {
    .@{yee-calendar-prefix-cls}-column-header-inner {
      display: none;
    }
  }

  &-cell {
    height: 30px;
    padding: 3px 0;
  }

  &-date {
    display: block;
    width: 24px;
    height: 24px;
    margin: 0 auto;
    padding: 0;
    color: @yee-text-color;
    line-height: 22px;
    text-align: center;
    background: transparent;
    border: @yee-border-width-base @yee-border-style-base transparent;
    border-radius: @yee-border-radius-sm;
    transition: background 0.3s ease;

    &-panel {
      position: relative;
      outline: none;
    }

    &:hover {
      background: @yee-item-hover-bg;
      cursor: pointer;
    }

    &:active {
      color: @yee-text-color-inverse;
      background: @yee-primary-5;
    }
  }

  &-today &-date {
    color: @yee-primary-color;
    font-weight: bold;
    border-color: @yee-primary-color;
  }

  &-selected-day &-date {
    background: @yee-primary-2;
  }

  &-last-month-cell &-date,
  &-next-month-btn-day &-date {
    &,
    &:hover {
      color: @yee-disabled-color;
      background: transparent;
      border-color: transparent;
    }
  }

  &-disabled-cell &-date {
    position: relative;
    width: auto;
    color: @yee-disabled-color;
    background: @yee-disabled-bg;
    border: @yee-border-width-base @yee-border-style-base transparent;
    border-radius: 0;
    cursor: not-allowed;

    &:hover {
      background: @yee-disabled-bg;
    }
  }

  &-disabled-cell&-selected-day &-date::before {
    position: absolute;
    top: -1px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: @yee-border-radius-sm;
    content: '';
  }

  &-disabled-cell&-today &-date {
    position: relative;
    padding-right: 5px;
    padding-left: 5px;
    &::before {
      position: absolute;
      top: -1px;
      left: 5px;
      width: 24px;
      height: 24px;
      border: @yee-border-width-base @yee-border-style-base @yee-disabled-color;
      border-radius: @yee-border-radius-sm;
      content: ' ';
    }
  }

  &-disabled-cell-first-of-row &-date {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }

  &-disabled-cell-last-of-row &-date {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  &-footer {
    padding: 0 12px;
    line-height: 38px;
    border-top: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
    &:empty {
      border-top: 0;
    }
    &-btn {
      display: block;
      text-align: center;
    }
    &-extra {
      text-align: left;
    }
  }

  .@{yee-calendar-prefix-cls}-today-btn,
  .@{yee-calendar-prefix-cls}-clear-btn {
    display: inline-block;
    margin: 0 0 0 8px;
    text-align: center;
    &-disabled {
      color: @yee-disabled-color;
      cursor: not-allowed;
    }
    &:only-child {
      margin: 0;
    }
  }

  .@{yee-calendar-prefix-cls}-clear-btn {
    position: absolute;
    top: 7px;
    right: 5px;
    display: none;
    width: 20px;
    height: 20px;
    margin: 0;
    overflow: hidden;
    line-height: 20px;
    text-align: center;
    text-indent: -76px;
  }

  .@{yee-calendar-prefix-cls}-clear-btn::after {
    display: inline-block;
    width: 20px;
    color: @yee-disabled-color;
    font-size: @yee-font-size-base;
    line-height: 1;
    text-indent: 43px;
    transition: color 0.3s ease;
  }

  .@{yee-calendar-prefix-cls}-clear-btn:hover::after {
    color: @yee-text-color-secondary;
  }

  .@{yee-calendar-prefix-cls}-ok-btn {
    .yee-btn;
    .yee-btn-primary;
    .yee-button-size(@yee-btn-height-sm; @yee-btn-padding-sm; @yee-font-size-base; @yee-border-radius-base);

    line-height: @yee-btn-height-sm - 2px;

    .yee-button-disabled();
  }
}
