/*  右侧在线客服 pl_service2 + 移动端 pl_service
   基线：npublic/libs/widget/services/pl_service.css
   品牌覆盖：site.css 中 .nuoan-service-panel--secondary / .nuoan-service-default-icon 的 #19479d */

.nuoan-service-popup {
  width: 320px;
  padding: 20px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 0 4px rgb(0 0 0 / 35%);
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  text-align: center;
  z-index: 999;
}

.nuoan-service-popup img {
  width: 240px;
  height: 240px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.nuoan-service-popup p {
  font-size: 16px;
}

/* ---- Desktop：效果 2 ---- */
.nuoan-service-panel--secondary {
  position: fixed;
  right: 2px;
  /* 相对垂直中线上移，避开右下角回到顶部（bottom-8 + h-10） */
  top: calc(50% - 4.5rem);
  transform: translateY(-50%);
  z-index: 99;
}

/* 首项热线面板：CSS 隐藏直接子级 .nuoan-service-item */
.nuoan-service-panel--secondary > .nuoan-service-item {
  display: none;
}

.nuoan-service-panel--secondary .nuoan-service-item {
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
  background-color: #19479d;
  color: #fff;
  box-shadow: 0 0 8px 0 rgb(0 0 0 / 12%);
  border-radius: 3px;
  transition: all 0.5s ease;
}

.nuoan-service-panel--secondary .nuoan-service-item:hover {
  background-color: #19479d;
  color: #fff;
}

.nuoan-service-panel--secondary .nuoan-service-icon-alt {
  width: 45px;
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.nuoan-service-panel--secondary .nuoan-service-icon-alt .icon {
  width: 50%;
  height: 50%;
  margin: 0;
  fill: currentColor;
  display: block;
}

.nuoan-service-panel--secondary .nuoan-service-value-content {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.5s ease;
}

.nuoan-service-panel--secondary .nuoan-service-value-content .nuoan-service-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 20px;
  height: 20px;
}

.nuoan-service-panel--secondary .nuoan-service-value-content .nuoan-service-icon .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nuoan-service-panel--secondary .nuoan-service-item:hover .nuoan-service-value-content {
  opacity: 1;
  width: 220px;
  padding-right: 10px;
}

.nuoan-service-panel--secondary .nuoan-service-value {
  width: 100%;
  min-height: 20px;
  line-height: 20px;
  background-color: #19479d;
  color: #fff;
  padding: 10px;
  border-radius: 4px;
  position: relative;
}

.nuoan-service-panel--secondary .nuoan-service-value.nuoan-service-phone {
  padding-left: 35px;
}

.nuoan-service-panel--secondary .nuoan-service-value p {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin: 0;
}

.nuoan-service-panel--secondary .nuoan-service-value a {
  color: inherit;
  text-decoration: none;
}

.nuoan-service-panel--secondary .nuoan-service-image {
  width: 130px;
  height: 130px;
  padding: 5px;
  position: absolute;
  right: calc(100% + 230px);
  top: 50%;
  transform: translateY(-50%);
  background-color: #fff;
  box-shadow: 2px 6px 15px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
  display: none;
}

.nuoan-service-panel--secondary .nuoan-service-item:hover .nuoan-service-image {
  display: block;
}

.nuoan-service-panel--secondary .nuoan-service-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nuoan-service-panel--secondary .nuoan-service-value .icon {
  width: 20px;
  height: 20px;
}

.nuoan-service-panel--secondary .nuoan-service-value::after {
  content: " ";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-left: 6px solid #19479d;
  border-bottom: 6px solid transparent;
}

/* ---- Mobile：默认圆形入口 ---- */
.nuoan-service-panel {
  display: none;
}

@media only screen and (max-width: 768px) {
  .nuoan-service-panel--secondary {
    display: none;
  }

  .nuoan-service-panel {
    display: block;
    position: fixed;
    right: 0;
    bottom: 92px;
    z-index: 999;
  }

  .nuoan-service-default-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    color: #fff;
    background: #19479d;
    overflow: hidden;
    cursor: pointer;
  }

  .nuoan-service-default-icon .icon {
    width: 60%;
    height: 60%;
    margin: 0;
    fill: currentColor;
  }

  .nuoan-service-background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 99;
    background-color: #333;
    opacity: 0.5;
    display: none;
  }

  .nuoan-service-content {
    position: absolute;
    top: auto;
    bottom: 55px;
    left: auto;
    right: -100vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 300px;
    max-width: 100vw;
    padding: 10px;
    transition: all 0.5s ease;
    color: #333;
    background-color: #fff;
    z-index: 999;
    max-height: 375px;
    border-radius: 10px;
  }

  .nuoan-service-content.show {
    right: 0;
  }

  .nuoan-service-body {
    flex-grow: 1;
    overflow-y: auto;
  }

  .nuoan-service-panel .nuoan-service-item {
    display: flex;
    margin-bottom: 5px;
    width: 100%;
    overflow: hidden;
    padding: 5px 0;
    border-top: 1px solid #f5f5f5;
  }

  .nuoan-service-panel .nuoan-service-icon-alt {
    float: left;
    display: flex;
    margin-top: 10px;
    padding-right: 8px;
    color: #999998;
  }

  .nuoan-service-panel .nuoan-service-icon-alt .icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }

  .nuoan-service-panel .nuoan-service-value {
    float: left;
    margin-top: 5px;
    width: 100%;
  }

  .nuoan-service-panel .nuoan-service-value p,
  .nuoan-service-panel .nuoan-service-value a {
    font-size: 13px;
    width: 100%;
    color: #333;
    text-decoration: none;
    margin: 0;
  }

  .nuoan-service-footer {
    left: 0;
    bottom: 0;
    width: 100%;
    overflow: hidden;
    color: #333;
    background-color: #fff;
    flex-grow: 0;
  }

  .nuoan-service-footer p {
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 5px;
  }

  .nuoan-service-kefu-icon {
    color: #999998;
  }

  .nuoan-service-kefu-icon .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }

  .nuoan-service-bottom {
    padding: 0 5px;
  }
}
