/* CMS 站点插件 widgets */
#cms-plugins-root { display: none; }

.cms-notice-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 40px 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
  overflow: hidden;
}
.cms-notice-bar[data-position="bottom"] {
  top: auto;
  bottom: 0;
}
.cms-notice-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.cms-notice-marquee {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}
.cms-notice-marquee.is-scrolling {
  max-width: none;
  animation: cms-notice-scroll var(--cms-notice-duration, 18s) linear infinite;
}
.cms-notice-marquee.is-scrolling:hover {
  animation-play-state: paused;
}
.cms-notice-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 64px;
}
.cms-notice-inner a {
  text-decoration: underline;
  margin-left: 8px;
  color: inherit;
}
@keyframes cms-notice-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.cms-notice-bar .cms-notice-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  opacity: .7;
  color: inherit;
  flex-shrink: 0;
}
.cms-notice-bar .cms-notice-close:hover { opacity: 1; }
body.cms-has-notice-top { padding-top: var(--cms-notice-h, 40px); }
body.cms-has-notice-bottom { padding-bottom: var(--cms-notice-h, 40px); }

.cms-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 9990;
  pointer-events: none;
  transition: width .05s linear;
}
body.cms-has-notice-top .cms-read-progress {
  top: var(--cms-notice-h, 40px);
}

.cms-kefu {
  position: fixed;
  z-index: 9800;
  font-size: 13px;
  --cms-kefu-color: #409eff;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.cms-kefu[data-position="left"] { align-items: flex-start; }
.cms-kefu[data-position="right"] { align-items: flex-end; }

/* 收起态：方形图标按钮（展开时隐藏，见 .is-open） */
.cms-kefu-launcher {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 6px;
  background: var(--cms-kefu-color, #409eff);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: transform .2s ease, box-shadow .2s ease;
  z-index: 2;
}
.cms-kefu-launcher:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.cms-kefu-launcher svg { width: 28px; height: 28px; display: block; }

/* 展开面板：从按钮下方滑出 */
.cms-kefu-panel {
  width: var(--cms-kefu-width, 190px);
  margin-top: 0;
  background: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  overflow: visible;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: max-height .35s ease, opacity .28s ease, transform .35s ease;
}
.cms-kefu.is-open .cms-kefu-panel {
  max-height: 720px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  border-radius: 6px;
}
/* 展开时只显示面板，隐藏方形对话按钮 */
.cms-kefu.is-open .cms-kefu-launcher {
  display: none !important;
}
.cms-kefu-panel-clip {
  overflow: hidden;
  background: #fff;
  border-radius: 0 0 6px 6px;
}

.cms-kefu-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 36px;
  background: var(--cms-kefu-color, #409eff);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px 6px 0 0;
}
.cms-kefu-close {
  position: absolute;
  top: 0;
  width: 36px;
  height: 40px;
  border: 0;
  background: rgba(0,0,0,.18);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
.cms-kefu-close:hover { background: rgba(0,0,0,.28); }
.cms-kefu[data-position="right"] .cms-kefu-close { left: -36px; border-radius: 4px 0 0 4px; }
.cms-kefu[data-position="left"] .cms-kefu-close { right: -36px; border-radius: 0 4px 4px 0; }

.cms-kefu-body { background: #fff; }
.cms-kefu-list { list-style: none; margin: 0; padding: 0; }
.cms-kefu-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  color: var(--cms-kefu-color, #409eff);
  background: #fff;
  transition: background .15s ease;
}
.cms-kefu-list li:last-child { border-bottom: 0; }
.cms-kefu-list li:hover { background: #f7fbff; }
.cms-kefu-list .cms-kefu-ico {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cms-kefu-list .cms-kefu-ico svg { width: 26px; height: 26px; }
.cms-kefu-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.cms-kefu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cms-kefu-color, #409eff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cms-kefu-value {
  font-size: 12px;
  color: #606266;
  word-break: break-all;
  line-height: 1.3;
}
.cms-kefu-extra {
  padding: 10px 12px 14px;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #f0f0f0;
  line-height: 1.6;
}
.cms-kefu-extra img { max-width: 100%; height: auto; }

.cms-kefu-qr-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cms-kefu-qr-box {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  max-width: 280px;
  width: 86%;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.cms-kefu-qr-box img { max-width: 200px; width: 100%; height: auto; display: block; margin: 0 auto 12px; }
.cms-kefu-qr-box .tip { color: #666; font-size: 13px; margin-bottom: 12px; }
.cms-kefu-qr-box button {
  border: 0;
  background: var(--cms-kefu-color, #409eff);
  color: #fff;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .cms-side-ad { display: none; }
  .cms-kefu { max-width: 86vw; }
  .cms-kefu-panel { width: min(var(--cms-kefu-width, 190px), 86vw); }
}

.cms-side-ad {
  position: fixed;
  z-index: 9700;
}
.cms-side-ad img { display: block; height: auto; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.cms-side-ad .cms-side-ad-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
  line-height: 22px;
  font-size: 14px;
  padding: 0;
}

.cms-gotop {
  position: fixed;
  z-index: 9600;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  border: 0;
  padding: 0;
}
.cms-gotop.show { display: flex; }
.cms-gotop svg { width: 20px; height: 20px; }

