

// http://stackoverflow.com/a/13611748/3040605
// 设置数字的字体
@font-face {
  font-family: "Helvetica Neue For Number";
  src: local("Helvetica Neue");
  unicode-range: U+30-39;
}

// 设置盒模型模式
page,
view, text,
scroll-view,
swiper,
rich-text,
icon,
form, label, input, textarea, button,
radio, checkbox,
picker, picker-view, slider, switch,
image, video, audio, camera,
map, canvas,
block {
  color: inherit;
  font-size: inherit;
  box-sizing: border-box;
  font-family: inherit;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

// css 自定义属性
// .text-white {
//   color: var(--cc-color-white, #ffffff);
// }

// page {
//   --cc-color-white: #fafafa;
// }

page {
  width: 100vw;
  // height: 100vh;
  font-family: PingFangSC-Regular, -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
  font-size: 28rpx;
  line-height: 1.3;
  color: #212121;
  background-color: #f9f9f7;
  overflow-x: hidden;
  overflow-y: scroll;
}
view {
  line-height: inherit;
}
form{
  width: 100%;
}
checkbox,
radio{
  margin-right: 10rpx;
}
input{
  background: transparent;
  border: none;
}

// .tab-bar { bottom: calc(var(--window-bottom) + 10px) }

// TODO: 微信默认 button 有个伪类实现的边框，需要干掉
button.border {
  position: relative;

  &::after {
    content: '';
    width: 200%;
    height: 200%;
    position: absolute;
    top: 0;
    left: 0;
    border: 1px solid rgba(0,0,0,.2);
    -webkit-transform: scale(.5);
    transform: scale(.5);
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    box-sizing: border-box;
    border-radius: 10px;
  }
}

.btn-normal {
  display: block;
  margin: 0;
  padding: 0;
  line-height: normal;
  background: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
  font-size: unset;
  text-align: unset;
  overflow: visible;
  color: inherit;
}

.btn-normal:after {
  border: none;
}

.btn-normal.button-hover {
  color: inherit;
}

button:after {
  content: none;
  border: none;
}


// image{
//   vertical-align: middle;
// }


// css变量 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f
// --status-bar-height    系统状态栏高度  25px
// --window-top           内容区域距离顶部的距离（NavigationBar 的高度）
// --window-bottom        内容区域距离底部的距离 （TabBar 的高度）

// safe-area-inset-top 44px
// safe-area-inset-bottom 34px
// env 函数 必须在 ios >= 11.2 才支持
// constant 函数 必须 ios < 11.2 支持
// 兼容需都写 env 在后 env(safe-area-inset-top)

.fixed-top {
  position: fixed;
  top: var(--window-top);
  left: 0;
  width: 100%;
}
.fixed-bottom {
  position: fixed;
  bottom: var(--window-bottom);
  left: 0;
  width: 100vw;
}

// TIP: wxapp 要隐藏滚动条，需要设置到全局 (针对某 class 隐藏滚动条，wxIDE 没效果，但真机有效)
// ::-webkit-scrollbar,
.hide-scrollbar::-webkit-scrollbar {
  display: none;
  // width: 0;
  // height: 0;
  // color: transparent;
}


.page{
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

.clearfix:after{
  content: "";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
  zoom: 1;
}

.ellipsis,
.max-line-1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.max-line-2,
.max-line-3 {
  word-break: break-all;
  white-space: normal;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
/* 必须自己设定 max-height 并指定单位，不同字体大小高度不同，这里无法计算max-height */
.max-line-2 {
  -webkit-line-clamp: 2;
  /* max-height: 2.6; */
}
.max-line-3 {
  -webkit-line-clamp: 3;
  /* max-height: 3.9; */
}

// 细线
[class*='cc-hairline']::after {
  content: ' ';
  width: 200%;
  height: 200%;
  position: absolute;
  bottom: 0;
  right: 0;
  transform: scale(0.5);
  transform-origin: right bottom;
  box-sizing: border-box;
  pointer-events: none;
  border: 0 solid #ebedf0;
  // border: 1px solid rgba(0,0,0,.2);
}

.cc-hairline {
  &,
  &--top,
  &--left,
  &--right,
  &--bottom,
  &--border,
  &--surround,
  &--top-bottom {
    position: relative;
  }
  &--top::after {
    border-top-width: 1px;
  }
  &--left::after {
    border-left-width: 1px;
  }
  &--right::after {
    border-right-width: 1px;
  }
  &--bottom::after {
    border-bottom-width: 1px;
  }
  &--top-bottom::after,
  &-unset--top-bottom::after {
    border-width: 1px 0;
  }
  &--border::after,
  &--surround::after {
    border-width: 1px;
  }
}

.human {
  position: relative;
  &:before {
    content: '';
    position: absolute;
    top: -10px; bottom: -10px; left: -10px; right: -10px;
    // background: rgba(0,0,0,0.1);
  };
}

.round {
  border-radius: 100%;
}

.block {
  display: block;
  width: 100%;
}

.fr {
  float: right;
}
.fl {
  float: left;
}
.text-center {
  text-align: center;
}

.pr {
  position: relative;
}

.nowrap {
  white-space: nowrap;
}

.B {
  font-weight: bold;
}

.f12 {
  font-size: 12px;
}
.f11 {
  font-size: 12px;
  transform: scale(0.91667);
}
.f10 {
  font-size: 12px;
  transform: scale(0.834);
}
.f8 {
  font-size: 12px;
  transform: scale(0.75);
}

.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

.full-100 {
  width: 100%;
  height: 100%;
}


// 新引入 row column 布局
// flex-row 横向排版 垂直居中对齐
// flex-column 竖向排版
.flex {
  display: flex;
}
.flex-end {
  display: flex;
  justify-content: flex-end;
}
.flex-1 {
  flex: 1;
}
.flex-middle {
  display: flex;
  align-items: center;
}
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.flex-column {
  display: flex;
  flex-direction: column;
}
.flex-v {
  display: flex;
  flex-direction: column;
}
.flex-v-middle {
  display: flex;
  align-items: center;
  flex-direction: column;
}
.flex-1 {
  flex: 1;
  overflow: hidden;
}
.flex-between {
  justify-content: space-between;
}
.flex-around {
  justify-content: space-around;
}
.flex-middle-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-middle-around {
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.flex-wrap {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
}
.flex-nowrap {
  flex-wrap: nowrap;
}
.flex-shrink {
  flex-shrink: 0;
}
.flex-grow {
  flex-shrink: 0;
}
