@import "var";
@import "init";
@import "common";
@import "animation";
@import "markdown";

body {
  background-color: var(--pk-bg-body);
  color: var(--pk-c-font);
}

#header, .p-block, .sub-menu, #header-box, .widget,
#index-company #prod-items .prod-item .icon, #post-menus {
  background-color: var(--pk-bg-box);
  box-shadow: none;
}

body.puock-dark {
  background-blend-mode: darken;
}

.toastify {
  font-size: 14px;
  background-color: var(--pk-c-dark);
  color: #fff;

  &.t-primary {
    background: var(--pk-c-primary);
  }

  &.t-info {
    background: var(--pk-c-info);
  }

  &.t-warning {
    background: var(--pk-c-warning);
  }

  &.t-danger {
    background: var(--pk-c-danger);
  }

  &.t-success {
    background: var(--pk-c-success);
  }

  .toast-close {
    font-size: 12px;
    opacity: .2;
  }
}

.progress {
  background-color: var(--pk-bg-body);
}

.progress-bar {
  background-color: var(--pk-c-primary);
}

.modal-content {
  background-color: var(--pk-bg-box);
}

.layui-layer {
  color: var(--pk-c-font) !important;
  background-color: var(--pk-bg-box) !important;
  border-radius: 6px !important;

  .layui-layer-title {
    color: var(--pk-c-font) !important;
    border-bottom-color: var(--pk-c-border) !important;
  }

  .layui-layer-close1 {
    background: none !important;
    font-family: var(--fa-style-family, "Font Awesome 6 Free");
    font-weight: var(--fa-style, 900);
    -webkit-font-smoothing: antialiased;
    display: var(--fa-display, inline-block);
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
    font-size: 16px;
    transition: all .3s;

    &:before {
      content: "\f00d";
    }
  }

  .layui-layer-btn {
    font-size: 14px;

    .layui-layer-btn0, .layui-layer-btn0:hover {
      background-color: var(--pk-c-primary) !important;
      color: var(--pk-c-light);
      border: 1px solid var(--pk-c-primary) !important;
    }

    [class^=layui-layer-btn] {
      padding: 0 10px;
      transition: all .3s;
      border-radius: 4px;

      &:not(.layui-layer-btn0):hover {
        color: var(--pk-c-dark) !important;
        opacity: .6;
      }
    }
  }

  &.layui-layer-prompt .layui-layer-input {
    background-color: var(--pk-bg-box-content) !important;
    border: none !important;
    color: var(--pk-c-font);
    border-radius: var(--pk-g-box-radius);
    font-size: 14px;
  }
}

.layui-layer-loading {
  background-color: transparent !important;

  .layui-layer-content {
    height: 60px !important;
  }
}

.tooltip {
  --bs-tooltip-zindex: 99999999;
}

//覆盖样式结束
#page-read-progress {
  z-index: 1000;
  position: fixed;
  top: 0;
  width: 100%;
  height: 2px;
}

.ahfff, .ahfff:hover, .ahfff-box:hover a {
  color: var(--pk-c-light) !important;
}

.swiper {
  height: 100%;
  --swiper-theme-color: var(--pk-c-primary);
  --swiper-navigation-size: 30px;

  &:hover {
    .swiper-button-next, .swiper-button-prev {
      opacity: 1;
    }
  }

  .swiper-button-next, .swiper-button-prev {
    opacity: 0;
    padding: 15px;
    width: auto;
    height: auto;
    color: var(--pk-c-light);
    transition: all .2s;

    &.swiper-button-disabled {
      opacity: 0;
    }

    &:after {
      font-size: 16px;
    }

    &:hover {
      background-color: rgba(0, 0, 0, 0.09);
    }

    &.swiper-button-next {
      right: 0;
    }

    &.swiper-button-prev {
      left: 0;
    }
  }

  .swiper-wrapper {
    img {
      height: 100%;
      object-fit: cover;
    }

    .swiper-title {
      position: absolute;
      bottom: 10px;
      width: 100%;
      display: flex;
      justify-content: center;
      padding: 0 20px;
      .fs12;

      & > .swiper-title-text {
        display: inline-block;
        background-color: rgba(0, 0, 0, 0.2);
        padding: 3px 16px;
        border-radius: 3px;
        transition: all .3s;
        cursor: pointer;
        color: var(--pk-c-light);
        .t-line-1;

        &:hover {
          opacity: .6;
        }
      }
    }
  }

  &:has(.swiper-pagination) {
    .swiper-wrapper {
      .swiper-title {
        bottom: 25px;
      }
    }
  }
}

#cms-four-grid {
  display: grid;
  grid-template-columns: repeat(var(--cms-four-grid-mobile-columns, 2), minmax(0, 1fr));
  gap: .75rem .5rem;

  @media (min-width: 768px) {
    grid-template-columns: repeat(var(--cms-four-grid-columns, 4), minmax(0, 1fr));
    gap: 1rem;
  }

  @media (max-width: 767.98px) {
    .cms-four-grid-item:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }

  .cms-four-grid-item {
    display: block;
    position: relative;
    overflow: hidden;
    height: 100%;
    aspect-ratio: 2.5 / 1;
    border-radius: var(--pk-g-box-radius);
    background-color: var(--pk-bg-box);
    transform: translateZ(0);
    transition: transform .3s ease, box-shadow .3s ease;
  }

  .cms-four-grid-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
    transition: transform .35s ease, opacity .35s ease;
  }

  .cms-four-grid-link:hover,
  .cms-four-grid-link:focus-visible {
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
    transform: translateY(-2px);

    .cms-four-grid-img {
      transform: var(--pk-g-list-img-hover);
    }
  }

  .cms-four-grid-link:focus-visible {
    outline: 2px solid var(--pk-c-primary);
    outline-offset: 2px;
  }
}


pre {
  padding: 10px;
  border-bottom-left-radius: var(--pk-g-box-radius);
  border-bottom-right-radius: var(--pk-g-box-radius);
  font-size: inherit;
  white-space:pre-wrap; /* css3.0 */
  white-space:-moz-pre-wrap; /* Firefox */
  white-space:-pre-wrap; /* Opera 4-6 */
  white-space:-o-pre-wrap; /* Opera 7 */
  word-wrap:break-word; /* Internet Explorer 5.5+ */
}

body.pre-mac pre {
  font-size: 100%;
  border-radius: 4px;
  position: relative;
  margin: 20px 0 20px 0;
  padding-top: 31px !important;
  border: none;
  overflow: hidden;
  max-height: unset;

  &:before {
    content: " ";
    z-index: 10;
    position: absolute;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    background: #fc625d;
    @wh: 10px;
    width: @wh;
    height: @wh;
    left: @wh;
    top: @wh;
    -webkit-box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
    box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
  }
}

.navbar, #header {
  padding: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
}

#menus {
  @h: 65px;
  height: @h;

  & > ul > li {
    .--pk-after-bottom-border(@h);

    &:hover, &.menu-current {
      &:after {
        opacity: 1;
      }
    }

    .menu-sub-icon {
      .ta3-fun();
      display: inline-block;
    }

    &.menu-current, &:hover {
      .menu-sub-icon {
        transform: rotate(-90deg);
      }
    }
  }

  ul {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;

    & > li > a {
      display: inline-block;
    }

    li {
      position: relative;
      display: inline-block;
      height: @h;
      line-height: @h;

      a {
        .ta3-fun();
        vertical-align: middle;
        padding: 0 .5rem;
      }

      &:hover .sub-menu {
        display: block;
      }
    }

    .sub-menu {
      display: none;
      min-width: 160px;
      position: absolute;
      z-index: 999;
      top: 60px;
      left: -40px;
      border-radius: 6px;
      box-shadow: 0 0 10px rgb(0 0 0 / 10%);
      .ta3-fun();

      li {
        display: block;
        text-align: center;
        margin-bottom: 0;
        @subHeight: (@h / 1.2);
        height: auto;
        min-height: @subHeight;
        line-height: @subHeight;
        white-space: nowrap;

        &.menu-current, &:hover {
          background-color: var(--pk-c-primary);
          border: none;

          &:first-child {
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
          }

          &:last-child {
            border-bottom-left-radius: 6px;
            border-bottom-right-radius: 6px;
          }

          a {
            color: var(--pk-c-light) !important;
          }
        }

        a {
          transition: all .3s;
          vertical-align: middle;
          display: inline-block;
          width: 100%;
        }
      }
    }
  }
}

#mobile-menu {
  width: 340px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  overflow-y: scroll;
  height: 100vh;
  background-color: var(--pk-bg-box);

  .p-block {
    box-shadow: none !important;
  }

  .menus {
    padding: 40px 20px 20px 20px;

    ul {
      list-style: none;
      padding: 0;

      li:not(:last-child) {
        margin-bottom: 15px;
      }

      li {
        a {
          .ta3-fun();
        }

        &.menu-current a {
          color: var(--pk-c-primary);
        }
      }

      .sub-menu {
        margin-top: 15px;
        padding-left: 15px;
      }
    }
  }
}

//文章目录
#post-menus {
  user-select: none;
  position: fixed;
  left: auto;
  right: 45px;
  bottom: 166px;
  top: auto;
  z-index: 999;
  
  &.show {
    #post-menu-content {
      transform: translateX(0) scale(1);
      opacity: 1;
      pointer-events: auto;
    }
    
    #post-menu-state {
      border-radius: 0 10px 10px 0; // 展开时改变按钮圆角，只保留左侧圆角
      border-left: none; // 去掉右边框
      right: 0; // 保持在左侧
      box-shadow: none; // 去掉阴影
      border-color: transparent; // 边框透明
    }
  }

  #post-menu-state {
    @w: 34px;
    position: absolute; // 使用绝对定位
    left: 0; // 按钮位于左侧
    bottom: 0; // 底部对齐
    width: @w;
    height: @w;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    background-color: var(--pk-bg-box);
    box-sizing: border-box;
    box-shadow: 2px 2px 5px var(--pk-c-block-shadow);
    z-index: 0; // 确保按钮始终在最上层
    
    i {
      font-size: 16px;
      transition: all 0.3s ease;
    }
    
    &:hover {
      opacity: 0.9;
    }
  }

  #post-menu-content {
    position: absolute;
    bottom: 0; // 底部对齐
    left: -260px; // 位于按钮右侧
    width: 260px;
    max-height: 400px;
    height: auto;
    padding: 15px;
    overflow-y: auto;
    border-radius: 10px 10px 0 10px;
    background-color: var(--pk-bg-box);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateX(-20px) scale(0.9);
    transform-origin: bottom left;
    opacity: 0;
    pointer-events: none; // 隐藏时不可点击
    transition: all 0.3s ease;
    z-index: 1000;

    [class^=post-menu-sub] {
      display: none;
      margin-top: 8px;
      padding-left: 10px;
    }

    ul {
      list-style: none;
      padding: 0;
      margin: 0;

      li {
        &:not(:last-child) {
          margin-bottom: 10px;
        }
        
        a {
          display: block;
          padding: 5px 0;
          transition: all 0.2s;
          border-radius: 4px;
          padding-left: 5px;
          
          &:hover, &.active {
            color: var(--pk-c-primary);
            background-color: var(--pk-bg-box-content);
            padding-left: 8px;
          }
        }

        i {
          margin-right: 5px;
          width: 16px;
          text-align: center;
        }
      }
    }
  }
}

.post-menus-box {
  .ta3-fun();
  display: none;
}

#logo {
  padding: 10px;
  max-width: 200px;
  display: inline-block;
  @height: 45px;
  position: relative;
  overflow: hidden;

  img {
    height: @height;
  }

  .txt-logo {
    color: var(--pk-c-font);
    line-height: @height;
  }

  &.logo-loop-light:before {
    content: "";
    position: absolute;
    width: 180px;
    height: 8px;
    background-color: rgba(255, 255, 255, .4);
    -webkit-transform: rotate(-45deg);
    -webkit-animation: logo-loop-light 4s ease-in 0s infinite;
    transform: rotate(-45deg);
    animation: logo-loop-light 4s ease-in 0s infinite;
  }
}

@media (max-width: 600px) {
  #mobile-menu {
    width: 80%;
  }
}

//最大区域元素不会变动
@media (min-width: 1420px) {
  .post-action-panel {
    .post-action-content {
      position: fixed;
      margin-left: -6rem;
      top: 40%;
      z-index: 9;

      .ls {
        display: block !important;
      }

      & > div {
        flex-direction: column;
      }

      .circle-button {
        background-color: var(--pk-bg-box);

        &:first-child {
          position: relative;
          left: 6px;
        }

        &:not(:last-child) {
          margin-bottom: 10px;
        }
      }
    }
  }
}

@media (min-width: 1360px) {
  .container, .container-lg, .container-md, .container-sm {
    max-width: 1240px;
  }
}

.min-height-container {
  min-height: 70vh;
}

.modal {
  &.modal-no-title {
    .modal-header {
      display: none;
    }
  }

  &.modal-no-padding {
    .modal-body {
      padding: 0 !important;
    }

    .modal-content {
      width: auto !important;
    }
  }

  &.modal-transparent {
    .modal-content {
      background-color: rgb(255 255 255 / 0%);
    }
  }

  .modal-content {
    border: none;
    border-radius: 5px;

    .modal-header {
      .modal-title {
        .fs16;
      }

      & > button {
        border: none;
        background: transparent;
      }

      .close {
        i {
          display: inline-block;
          .ta3-fun();

          &:hover {
            transform: rotate(180deg);
          }
        }
      }
    }
  }

  .modal-body {
    padding: .3rem 1rem 1rem 1rem;
  }

  .modal-header, .modal-footer {
    border: none;
  }
}

.modal-backdrop, .mobile-menu-backdrop, .layui-layer-shade {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.53) !important;
}

a:hover {
  text-decoration: none;
}

.btn:hover,
.btn:focus, .form-control:hover, .form-control:focus, button:focus, .abc-checkbox label:focus, .form-check-input:focus, .layui-layer-input, .layui-layer-input:focus {
  outline: none;
  box-shadow: none;
}

.form-control, .form-control:focus {
  background-color: var(--pk-c-input-bg);
  border: var(--pk-c-input-bg);
  color: var(--pk-c-font);
  border-radius: 2px;
}

.form-control:disabled, .form-control[readonly] {
  background-color: var(--pk-c-input-bg);
  opacity: .8;
}

.pd-links a:not(.btn), a:not(.btn) {
  color: var(--pk-c-font);

  &:hover {
    color: var(--pk-c-primary);
  }
}

.link-hover:hover {
  color: var(--pk-c-primary) !important;
}

#header, #header-box {

  &#header.blur {
    background-color: var(--pk-bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  &#header {
    & > .navbar > .container {
      flex-wrap: nowrap;

      #menus {
        & > ul {
          display: flex;
          flex-wrap: nowrap;

          & > li {
            flex-shrink: 0;
          }
        }
      }
    }
  }

  height: 65px;

  nav a {
    .ta3-fun();
    .fs14;

    &:hover {
      text-decoration: none;
      .c-primary;
    }
  }

  .colorMode {
    &.fa-moon, .fa-moon {
      color: var(--pk-c-yellow);
    }
  }
}

.carousel-control-next {
  justify-content: flex-end;
  padding-right: 30px;
}

.carousel-control-prev {
  padding-left: 30px;
  justify-content: flex-start;
}

.badge {
  position: relative;
  top: -1px;
  border-radius: .1rem;
  font-weight: normal;
  color: #fff;
}

.p-block, .widget {
  position: relative;
  margin: 0 0 15px 0;
  padding: 15px;
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 2px 2px 5px var(--pk-c-block-shadow);

  img {
    max-width: 100%;
  }
}

.title-l-c {
  position: absolute;
  top: 20px;
  left: -1px;
  width: 5px;
  height: 25px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}


#posts {

  .post-item {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;

    .ta3-fun();

    .post-item-block {
      padding: 10px;
    }

    .thumbnail {
      position: relative;
      height: auto;
      width: 200px;
      aspect-ratio: 7 / 4;
      transition-duration: .5s;
      margin: 0 10px 0 0;
      flex-shrink: 0;
      overflow: hidden;
      border-radius: var(--pk-g-box-radius);
      display: flex;
      justify-content: center;
      align-items: center;

      a {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;

          &.lazy:not(.loaded) {
            height: 100% !important;
            object-fit: contain;
          }
        }
      }

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: all .3s;
      }
    }

    &.post-item-card {
      .thumbnail {
        aspect-ratio: 2 / 1;
        margin: 0;
        width: 100%;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;

          &.lazy:not(.loaded) {
            width: 100%;
            object-fit: contain;
          }
        }
      }
      .post-tags{
        position: absolute;
        top:6px;
        left: 6px;
        display: flex;
        flex-wrap: nowrap;
        overflow: hidden;
        .badge{
          transition: all .3s;
          opacity: .8;
          &:not(:last-child){
            margin-right: 2px;
          }
          &:hover{
            opacity: 1;
          }
        }
      }
    }

    &.post-item-no-thumb {
      .post-info {
        width: 100%;
      }
    }

    &.post-item-list.post-item-no-thumb {
      min-height: 170px;

      .post-info {
        padding: 4px 2px 2px 0;
      }

      .info-title {
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box;
        white-space: normal;
      }

      .info-meta {
        margin-top: 10px;
      }
    }

    &.post-item-card.post-item-no-thumb {
      .post-item-block {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background: linear-gradient(135deg, rgba(28, 96, 243, 0.08), rgba(28, 96, 243, 0) 58%);
      }

      .post-tags-inline {
        margin-bottom: 10px;

        .badge:not(:last-child) {
          margin-right: 4px;
        }
      }

      .post-info {
        min-height: 170px;
      }

      .info-meta {
        margin: 10px 0 14px;
      }
    }

    &:hover {
      .thumbnail {
        img {
          .ts-fun();
        }
      }
    }

    .post-info {
      display: flex;
      flex: auto;
      overflow: hidden;
      flex-direction: column;
      justify-content: space-between;
      padding-left: 0;
      position: relative;

      .info-title {
        .fs16;
        .t-line-1;
      }

      .info-meta {
        .fs14;
        color: #393e46;

        p {
          .text-2line;
        }
      }

      .info-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
    }
  }

  .post-item-card {

    .post-item-card-box {
      & > .thumbnail {
        padding-bottom: 5px;
      }

      & > .post-info {
        padding-top: 5px;
      }
    }

    &:nth-child(even) {
      padding-right: 0;
      padding-left: 7px;
    }

    &:nth-child(odd) {
      padding-left: 0;
      padding-right: 7px;
    }

    // 修复 3/4 列时横向间距（odd/even 仅适用于 2 列）
    // 4列在 md 断点会变为 3 列（col-md-4），同样需要处理
    @media (min-width: 768px) {
      &.col-md-4:nth-child(3n+1) {
        padding-left: 0;
        padding-right: 7px;
      }

      &.col-md-4:nth-child(3n+2) {
        padding-left: 7px;
        padding-right: 7px;
      }

      &.col-md-4:nth-child(3n) {
        padding-left: 7px;
        padding-right: 0;
      }
    }

    @media (min-width: 992px) {
      // 3列（col-lg-4）：[L0 Rg] [Lg Rg] [Lg R0]
      &.col-lg-4:nth-child(3n+1) {
        padding-left: 0;
        padding-right: 7px;
      }

      &.col-lg-4:nth-child(3n+2) {
        padding-left: 7px;
        padding-right: 7px;
      }

      &.col-lg-4:nth-child(3n) {
        padding-left: 7px;
        padding-right: 0;
      }

      // 4列（col-lg-3）：[L0 Rg] [Lg Rg] [Lg Rg] [Lg R0]
      &.col-lg-3:nth-child(4n+1) {
        padding-left: 0;
        padding-right: 7px;
      }

      &.col-lg-3:nth-child(4n+2),
      &.col-lg-3:nth-child(4n+3) {
        padding-left: 7px;
        padding-right: 7px;
      }

      &.col-lg-3:nth-child(4n) {
        padding-left: 7px;
        padding-right: 0;
      }
    }

    .p-block {
      width: 100%;
    }

    .thumbnail {
      width: 100%;
    }

    .info-meta {
      .text-2line {
        height: 42px;
      }
    }

    .post-info {
      margin-top: 10px;

      .info-footer {
        padding-right: 0;
        position: relative;
      }
    }
  }
}

// 移动端
@media (max-width: 576px) {
  #posts {
    .post-item-card {
      padding-left: 0 !important;
      padding-right: 0 !important;
    }
  }

  .post-item-card .t-line-1 {
    white-space: normal;
  }

  #posts {
    .post-item {
      .thumbnail {
        width: 120px;
      }
    }
  }
}

#magazines {
  margin-right: 0;

  .magazine {
    display: flex;
    align-items: stretch;

    .img {
      flex-shrink: 0;
      margin-right: 10px;
      overflow: hidden;

      img {
        transition: all .3s;
      }
    }

    .magazine-media-item {
      display: flex;
      align-items: stretch;

      .img {
        width: 120px;
        height: 80px;
        flex: 0 0 120px;
        display: flex;
        justify-content: center;
        align-items: center;

        img {
          display: block;
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }

      &:hover {
        .img {
          img {
            transform: var(--pk-g-list-img-hover);
          }
        }
      }
    }

    & > div {
      width: 100%;
    }

    &:nth-child(even) {
      margin-right: 0;
    }
  }
}

.media-link {
  .ta3-fun();

  &:hover a {
    margin-left: 5px;
  }

  &.media-row-2 > div {
    margin-bottom: 10px;
  }
}

#links {
  padding: 15px;

  .link-item {
    display: inline-block;
    padding: 7px 15px;
    margin-right: 5px;
    cursor: pointer;

    a {
      .c-title;
    }

    &:hover {
      background-color: var(--pk-c-primary);

      a {
        color: #fff;
      }
    }
  }
}

.min-comments {
  .comment {
    &:not(:first-child) {
      margin-top: 10px;
    }

    img {
      @wh: 18px;
      width: @wh !important;
      height: @wh !important;
    }
  }
}

#breadcrumb {
  padding: 0 15px;

  .breadcrumb {
    background-color: rgba(255, 255, 255, 0);
    font-size: 14px;
    padding-left: 0;
  }
}

.post-action-panel {
  .post-action-content {
    .ls {
      display: none;
    }
  }
}

#post, #page, .block-content {
  .options {
    .option {
      display: inline-block;
      padding: 5px 10px;
      cursor: pointer;
      border-radius: 2px;
      background-color: var(--pk-bg-box-content);
      .c-sub();

      &:hover {
        background-color: var(--pk-c-primary);
        color: var(--pk-c-light) !important;
      }
    }
  }

  .title-l-c {
    top: 40%;
  }

  .entry-title {
    font-size: 20px;
  }
}

.post-relevant {
  padding: 0 10px;

  .post-relevant-item {
    padding: 0 5px;
    margin-bottom: 20px;

    & > div {
      .ta3-fun();
      width: 100%;
      border-radius: 6px;
      height: 140px;
      position: relative;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 10px;

      .title {
        z-index: 10;
        color: var(--light);
      }

      &:hover {
        transform: translateY(5px);

        &:before {
          backdrop-filter: blur(1px);
        }
      }

      &:before {
        display: block;
        content: ' ';
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 6px;
        height: 100%;
        background: linear-gradient(rgba(54, 62, 72, 0.58), rgba(71, 74, 78, 0.16));
        backdrop-filter: blur(3px);
        z-index: 9;
      }
    }
  }
}

#post-comments {
  .children {
    padding-left: 30px;
  }

  .post-comment {
    margin-top: 20px;

    .info {
      display: flex;
      align-items: center;
    }

    .hide-info {
      display: none;
    }

    pre {
      font-size: 14px;
    }

    .comment-os {
      font-size: 12px;

      img {
        width: 14px;
        position: relative;
        top: -2px;
        margin-right: 2px;
      }

      span {
        display: inline-block;
        margin-right: 3px;
      }
    }

    .content {
      .content-text, .comment-box-reply {
        margin-left: 42px;
        border-radius: 3px;
      }

      .comment-box-reply {
        margin-top: 10px;
      }

      .content-text {
        padding: 10px;
        background-color: var(--pk-bg-box-content);
      }

      p {
        margin-bottom: 0;
      }
    }

    &:hover .hide-info, .hide-info-show {
      display: inline-block;
    }
  }
}

.pagination {
  a, .page-numbers, .post-page-numbers {
    display: inline-block;
    padding: 6px 12px;
    .ta3-fun();
    border-radius: 2px;
    margin-left: 5px;
    .fs12();
    .c-sub();

    &:hover, &.cur, &.current {
      background-color: var(--pk-c-primary) !important;
      color: #fff !important;
    }
  }

  li {
    display: inline-block;
  }
}

.circle-button {
  cursor: pointer;
  @wh: 50px;
  .round(@wh);
  line-height: @wh;
  background-color: var(--pk-bg-box-content);
  .ta3-fun();

  &:not(:first-child) {
    margin-left: 6px;
  }

  &:hover {
    background-color: var(--pk-c-primary) !important;
    color: #fff !important;
  }
}

.circle-sm {
  @wh: 30px;
  .round(@wh);
  line-height: @wh;
}

.circle-hb {
  &:hover {
    box-shadow: 2px 3px 1px rgba(0, 0, 0, 0.17) !important;
  }
}

#footer {
  color: var(--pk-c-font);
  padding: 30px 0;
  background-color: var(--pk-bg-box);

  .info {
    color: var(--pk-c-font);

    a {
      transition: all .3s !important;

      &:hover {
        color: var(--pk-c-primary) !important;
      }
    }
  }

  a, .more-link a {
    color: var(--pk-c-font);
    .ta3-fun();

    &:not(:last-child) {
      margin-right: 5px;
    }

    &:hover {
      color: var(--pk-c-primary);
    }
  }

  .more-link a {
    color: var(--pk-c-light);
  }
}

.carousel-item {
  img {
    border-radius: 4px;
  }
}

#search {
  position: fixed;
  top: 90px;
  z-index: 9999;
  width: 100%;

  #search-main {
    position: relative;

    .search-close-btn {
      position: absolute;
      bottom: -50px;
      left: 0;
      text-align: center;
      width: 100%;
    }

    .search-layout {
      display: flex;

      .search-input {
        flex: 1;
        input{
          border-radius: 6px;
        }
      }

      .search-start {
        margin-left: 10px;
        width: 100px;
        flex-shrink: 0;
        position: relative;
        top: -2px;

        .btn {
          width: 100% !important;
        }
      }
    }
  }
}

.mobile-menus {
  .search-modal-btn {
    position: relative;
    top: -1px;
  }
}


/*页面-友情链接*/
#page-links {
  .links-main {
    .links-main-box {
      padding-top: 10px;
      padding-right: 15px;

      .link-item {
        &:hover > div {
          color: var(--pk-c-font);
          -webkit-transform: translateY(-5px);
        }

        img {
          float: left;
        }

        margin-bottom: 15px;
        padding-right: 0;

        & > div {
          transition: all .2s;
          -webkit-transform: translateY(0px);
          padding: 8px 10px;
          border-radius: 3px;
        }

        .info {
          float: left;
          margin-top: 3px;
          max-width: 70%;

          p {
            width: 100%;
            margin-bottom: 0;
          }
        }
      }
    }
  }
}

#page-cg{
  .chats{
    .chat-item{
      padding:15px;
      &.is-user{
        background-color: var(--pk-bg-box-content);
      }
      .content-box{
        padding-top: 10px;
        //white-space: pre-wrap;
      }
    }
  }
}

@media (max-width: 400px) {
  #page-links {
    .link-item {
      & > div {
        text-align: center
      }
    ;

      img {
        margin: 0 auto;
        float: none !important;
      }

      .info {
        max-width: 100% !important;
      }
    }
  }
}

//表情
#smiley {
  .smiley-item {
    display: inline-block;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all .2s;

    &:hover {
      opacity: 0.5;
    }
  }

  img {
    width: 25px;
  }
}

.wp-smiley {
  display: inline !important;
  height: 18px !important;
  max-height: 18px !important;
}

.table {
  color: var(--pk-c-font);

  &.table-bordered {
    border: 1px solid var(--pk-c-border);

    td, th {
      border: 1px solid var(--pk-c-border);
    }
  }
}

.widget {
  table {
    width: 100%;
  }

  & > h3 {
    .fs16();
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--pk-c-primary);
    display: inline-block;
  }

  ul {
    list-style: none;
    padding: 0;
  }
}

.widget-puock-author {
  padding: 0;
  border-radius: 0;

  .header {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    @height: 150px;
    height: @height;
    background-size: cover;
    position: relative;
    display: flex;
    justify-content: center;

    .avatar {
      @wh: 80px;
      width: @wh;
      height: @wh;
      border-radius: (@wh / 2);
      position: absolute;
      top: (@height - (@wh / 2));
    }
  }

  .content {
    min-height: 70px;
    padding: 40px 10px 10px 10px;
  }

}

//标签云小工具
.widget-puock-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  a {
    flex: 1;
    margin: 3px 3px;
    padding: .5rem .7rem;
  }
}

//一言小工具
.widget-puock-hitokoto {
  .fb {
    text-align: right;
    color: var(--pk-c-secondary);
    .fs14;
    margin-top: 6px;
  }
}

.pk-widget {
  .widget-common-media-post {
    display: flex;
    overflow: hidden;

    &:hover .img img {
      transform: var(--pk-g-list-img-hover);
    }

    .img {
      width: 120px;
      height: 80px;
      flex: 0 0 120px;
      margin-right: 10px;
      border-radius: 3px;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;

      img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 3px;
        transition: all .3s;
      }
    }

    .info {
      flex: 1;
      display: flex;
      flex-direction: column;
      .t-line-1;
    }
  }
}

.no-style ul {
  list-style: none;
}

.li-style-line {
  li {
    margin-bottom: 20px;

    & > ul {
      margin-top: 20px;
    }
  }

  li:before {
    content: '▫ ';
    .c-sub();
  }
}

.tooltip {
  .fs12();
}

//书籍推荐
#page-books {
  #books-main {
    list-style: none;

    li {
      display: inline-block;
      cursor: pointer;
      margin-bottom: 20px;
      text-align: center;

      &::before {
        content: none
      }

      a {
        box-shadow: 7px 7px 22px -7px rgba(66, 65, 64, 0.44);
        width: 120px;
        height: 160px;
        display: inline-block;
        .ta3-fun();

        img.cover {
          width: 100%;
          height: 100%;
        }

        &:hover {
          margin-top: -3px;
        }
      }
    }
  }
}

//返回顶部，返回底部
#rb-float-actions {
  position: fixed;
  right: 10px;
  bottom: 50px;
  z-index: 999;

  .p-block {
    .--pk-wh(34px, 34px);
    .primary-hover();
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;

    &:not(:last-child) {
      margin-bottom: 5px;
    }
  }
}

//标签概览
#page-tags {
  #tags-main-index {
    li.a {
      display: inline-block;

      & a {
        color: var(--pk-c-primary);
      }
    }

    li.a a, li.t {
      .primary-hover();
    }
  }

  li.a a, li.t, #tags-main-box li a {
    padding: 5px 10px;
    cursor: pointer;
    display: inline-block;
    margin: 0 5px 5px 0;
  }

  #tags-main-box {
    li {
      margin-bottom: 10px;

      a {
        .fs12();
        .primary-hover();
      }
    }
  }
}

//分类页顶部信息栏
.cat-top-info {
  background-color: var(--pk-bg-box);
  padding: 20px 0 10px 0;

  #breadcrumb {
    box-shadow: none;
  }

  .child-cat .a-link {
    box-shadow: none;
    border: 1px dashed var(--pk-c-border);
  }
}

//上一篇or下一篇
.single-next-or-pre {
  a > div {
    padding: 15px;
    display: block;

    p {
      margin-bottom: 5px;
    }
  }
}

// 全局顶部公告
.global-top-notice {
  @wh: 22px;

  .swiper {
    height: @wh;
  }

  .notice-icon {
    background-color: var(--pk-c-primary);
    width: @wh;
    height: @wh;
    line-height: @wh;
    display: inline-block;
    text-align: center;
    color: #fff;
    border-radius: 50%;

    i {
      .fs12;
    }
  }
}

//文章归档
.timeline {
  position: relative;
  padding: 15px 0;

  &:before {
    content: '';
    position: absolute;
    background-color: var(--pk-bg-box-content);
    top: 0;
    left: 25px;
    height: 100%;
    width: 2px;
  }

  .timeline-item {
    position: relative;
    margin: 2em 0;

    &:after {
      content: "";
      display: table;
      clear: both;
    }

    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  .timeline-content {
    .ta3-fun();
    background-color: var(--pk-bg-box-content);
    padding: 20px 10px 10px 10px;
    position: relative;
    margin-left: 60px;
    border-radius: 2px;

    ul {
      padding-left: 0;
    }

    li {
      .ta3-fun();

      :before {
        content: '-';
        color: var(--pk-c-secondary);
        margin-right: 2px;
      }

      &:not(:last-child) {
        margin-bottom: 15px;
      }

      &:hover {
        transform: translateX(2px);
      }
    }

    &:before {
      content: ' ';
      position: absolute;
      top: 9px;
      right: 100%;
      border-right: 8px solid var(--pk-bg-box-content);
    }

    &:hover {
      transform: translateX(5px);
    }
  }

  .timeline-location {
    @wh: 14px;
    position: absolute;
    top: 8px;
    left: 19px;
    width: @wh;
    height: @wh;
    border-radius: 50%;
    background-color: var(--pk-bg-box-content);
  }
}

#author {
  margin-bottom: 15px;

  @avatar-wh: 150px;

  & > .bg {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    height: 280px;
    background-size: cover;
    position: relative;

    .avatar {
      position: absolute;
      left: 10px;
      bottom: -(@avatar-wh/4);
      .--pk-wh(@avatar-wh, @avatar-wh);

      img {
        border-radius: 50%;
        background-color: var(--pk-bg-box);
        border: 4px solid var(--pk-bg-box-content);
      }
    }
  }

  & > .info {
    padding-left: @avatar-wh + 30px;
    padding-top: var(--pk-g-basic-distance);
    height: 100px;
    background-color: var(--pk-bg-box);
  }

  .author-tab-data {
    background-color: var(--pk-bg-box);
    padding: var(--pk-g-basic-distance);

    .data-header {
      display: flex;
      align-items: center;
      border-bottom: 1px solid var(--pk-c-border);
      padding-bottom: var(--pk-g-basic-distance);

      .item {
        cursor: pointer;
        position: relative;
        padding: 0 10px;

        &:not(:last-child) {
          margin-right: var(--pk-g-basic-distance);
        }

        .--pk-after-bottom-border(40px);

        &:hover, &.cur {
          .ta3-fun();
          color: var(--pk-c-primary);

          &:after {
            opacity: 1;
          }
        }
      }
    }

    .data-content {
      padding-top: var(--pk-g-basic-distance);

      #posts {
        .post-item, .post-item-card-box {
          box-shadow: none !important;
        }
      }
    }
  }
}

#user-center {
  .form-control {
    .fs14;
  }

  .user-center-menus {
    .sub-title {
      .fs12;
      color: var(--pk-c-secondary);
    }

    .list-group-item:hover, .current {
      background-color: var(--pk-c-primary);
      color: #fff;

      .sub-title {
        color: #fff !important;
      }
    }
  }
}

#page-moments {
  .moments-item {
    .meta {
      display: flex;
      justify-content: center;
      flex-direction: column;
    }

    .moment-content-box {
      position: relative;

      .al {
        position: absolute;
        width: 0;
        height: 0;
        top: 4px;
        left: -16px;
        border: 8px solid;
        border-color: var(--pk-bg-box) transparent transparent transparent;
        transform: rotate(90deg);
      }
    }
  }
}

//企业风格
#index-company {
  .bgimg {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
  }

  @title-font-size: 24px;
  @desc-font-size: 15px;
  padding-bottom: 30px;

  .tin2 {
    text-indent: 2rem;
  }

  #do-items {
    .do-item {
      padding-top: 15px;

      &:not(:last-child) {
        margin-bottom: 30px;
      }

      display: flex;
      @wh: 100px;

      .icon {
        width: @wh;
        height: @wh;
        border-radius: (@wh / 2);
        background-color: var(--pk-c-primary);
        text-align: center;

        [class^='fa'] {
          font-size: (@wh / 2);
          color: var(--pk-c-font);
          line-height: @wh;
        }
      }

      .info {
        width: ~"calc(100% - 110px)";
        padding-left: 10px;

        .title {
          font-size: @title-font-size;
          position: relative;
        }

        .desc {
          font-size: @desc-font-size;
        }
      }
    }
  }

  #prod-items {
    .prod-item {
      .p-block {
        min-height: 400px;
        position: relative;
        padding-top: 40px;
        padding-bottom: 20px;
        transition: all 0.3s ease;

        // 深色渐变背景遮罩，提升文字可读性
        &::before {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0.5) 20%,
            rgba(0, 0, 0, 0.3) 50%,
            rgba(20, 20, 20, 0.4) 80%,
            rgba(40, 40, 40, 0.5) 100%);
          z-index: 1;
          transition: background 0.3s ease;
        }

        // 悬停时增强遮罩效果
        &:hover::before {
          background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.75) 0%,
            rgba(0, 0, 0, 0.6) 25%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(20, 20, 20, 0.5) 75%,
            rgba(40, 40, 40, 0.6) 100%);
        }

        // 确保文字在遮罩层之上
        a, .go, .desc {
          position: relative;
          z-index: 2;
        }
      }

      margin-top: 60px;

      a {
        color: #ffffff !important;
        transition: all .3s;
      }

      .go {
        color: #ffffff !important;
        margin-top: 30px;
        text-align: center;
        font-size: @title-font-size;
        font-weight: bold;
        // 添加文字阴影增强可读性
        text-shadow:
          -1px -1px 0 #000,
          1px -1px 0 #000,
          -1px 1px 0 #000,
          1px 1px 0 #000,
          0 0 6px rgba(0, 0, 0, 0.9),
          0 0 10px rgba(0, 0, 0, 0.7);
      }

      .desc {
        color: #f5f5f5 !important;
        font-size: @desc-font-size;
        margin-bottom: 0;
        text-align: center;
        line-height: 1.5;
        // 添加文字阴影增强可读性
        text-shadow:
          -0.5px -0.5px 0 #000,
          0.5px -0.5px 0 #000,
          -0.5px 0.5px 0 #000,
          0.5px 0.5px 0 #000,
          0 0 5px rgba(0, 0, 0, 0.8);
      }
    }
  }
}

//首页友情链接
.index-links {
  a {
    margin: 3px;
    padding: 0.5rem 0.7rem;
  }

  .index-links-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    &:nth-of-type(2)::after {
      content: '';
      flex: auto;
    }
  }

  .links-item {
    background-color: var(--pk-bg-box-content);
    color: var(--pk-c-font);
    transition: all .2s;
    margin-bottom: 8px;

    &:hover {
      background-color: var(--pk-c-primary);
      color: var(--pk-c-light);
    }
  }

  .badge {
    font-size: 85%;
  }
}

//短代码模块
//github短代码
.github-card {
  padding: 15px;
  margin: 15px 0;

  &.loaded {
    border: 1px solid var(--pk-c-border);
    background-color: var(--pk-bg-card);
    border-radius: 5px;

    a {
      color: var(--pk-c-font);
    }
  }

  .card-header, .card-body {
    margin-bottom: 15px;
  }

  .card-header, .card-footer {
    a {
      color: var(--pk-c-font) !important;
      display: inline-block;
      margin-left: 3px;
      transition: all .3s;
      cursor: pointer;

      &:hover {
        color: var(--pk-c-primary) !important;
      }

      &:before {
        display: none !important;
      }
    }
  }
}


//响应式处理
//最小
@media (max-width: 575px) {
  #comment-form .comment-info .col-12 {
    margin-bottom: 15px;
  }

  .pagination {
    a, .page-numbers, .post-page-numbers {
      padding: 6px 8px;
      margin-bottom: 10px;
    }

    display: block;
  }
}

.sidebar-position {
  position: fixed;
  z-index: 1;
}

#sidebar {
  padding-left: 0;
}

#post-main, #sidebar {
  animation-fill-mode: none !important;
}

.comment-captcha {
  cursor: pointer;
  height: 28px;
  width: 100px;
}

.post-poster {
  display: flex;
  justify-content: center;

  .post-poster-main {
    width: 320px;
    overflow-x: hidden;
    position: relative;
    background-color: #fff;
    color: var(--pk-c-dark);
    border-radius: var(--pk-g-box-radius);

    .cover {
      width: 100%;
      height: 160px;
      overflow: hidden;
      display: flex;
      align-content: center;
      justify-content: center;

      img {
        width: 100%;
        height: 100%;
      }
    }

    .result {
      width: 100%;
    }

    .content {
      padding: 10px;

      .info {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .qrcode {
          @wh: 120px;
          width: @wh;
          height: @wh;
        }

        .logo {
          width: 130px;
          height: auto;
        }
      }
    }
  }
}


@import "screen";
