:root {
  --van-grid-item-content-padding: var(--van-padding-md) var(--van-padding-xs);
  --van-grid-item-content-background: var(--van-background-2);
  --van-grid-item-content-active-color: var(--van-active-color);
  --van-grid-item-icon-size: 28px;
  --van-grid-item-text-color: var(--van-text-color);
  --van-grid-item-text-font-size: var(--van-font-size-sm);
}

.van-grid-item {
  position: relative;
  box-sizing: border-box;

  &--square {
    height: 0;
  }

  &__icon {
    font-size: var(--van-grid-item-icon-size);
  }

  &__text {
    color: var(--van-grid-item-text-color);
    font-size: var(--van-grid-item-text-font-size);
    line-height: 1.5;
    // https://github.com/vant-ui/vant/issues/3894
    word-break: break-all;
  }

  &__icon + &__text {
    margin-top: var(--van-padding-xs);
  }

  &__content {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    padding: var(--van-grid-item-content-padding);
    background: var(--van-grid-item-content-background);

    &::after {
      z-index: 1;
      border-width: 0 var(--van-border-width) var(--van-border-width) 0;
    }

    &--square {
      position: absolute;
      top: 0;
      right: 0;
      left: 0;
    }

    &--center {
      align-items: center;
      justify-content: center;
    }

    &--horizontal {
      flex-direction: row;

      .van-grid-item__text {
        margin: 0 0 0 var(--van-padding-xs);
      }
    }

    &--reverse {
      flex-direction: column-reverse;

      .van-grid-item__text {
        margin: 0 0 var(--van-padding-xs);
      }
    }

    &--horizontal&--reverse {
      flex-direction: row-reverse;

      .van-grid-item__text {
        margin: 0 var(--van-padding-xs) 0 0;
      }
    }

    &--surround {
      &::after {
        border-width: var(--van-border-width);
      }
    }

    &--clickable {
      cursor: pointer;

      &:active {
        background-color: var(--van-grid-item-content-active-color);
      }
    }
  }
}
