@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600&display=swap');

/* ── 图标贴右固定，号码向左展开 ── */
.online_service {
  --op-accent: #c41262;
  --op-accent-hover: #9e0f4f;
  --op-dark: #121214;
  --op-text: #18181b;
  --op-border: #ececef;
  --op-icon-w: 46px;
  font-family: 'DM Sans', 'microsoft yahei', sans-serif;
}

.online-dock {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999999;
}

.online-dock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* 容器贴右，默认只露出右侧图标 */
.online-dock-item {
  display: flex;
  justify-content: flex-end;
  width: var(--op-icon-w);
  max-width: 300px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--op-border);
  border-right: none;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 2px 18px rgba(0, 0, 0, 0.08);
  transition: width 0.34s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.34s ease,
              border-color 0.34s ease;
}

.online-dock-item:hover {
  width: max-content;
  box-shadow: -10px 4px 28px rgba(0, 0, 0, 0.12);
  border-color: rgba(196, 18, 98, 0.25);
}

/* 图标在右，文字在左；内容右对齐，裁剪时露出图标 */
.online-dock-link {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  flex-shrink: 0;
  width: max-content;
  min-width: var(--op-icon-w);
  min-height: var(--op-icon-w);
  text-decoration: none;
  color: var(--op-text);
  cursor: pointer;
  transition: color 0.25s ease;
}

.online-dock-item:hover .online-dock-link {
  color: var(--op-accent);
}

.online-dock-icon {
  flex-shrink: 0;
  width: var(--op-icon-w);
  height: var(--op-icon-w);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--op-dark);
  color: #fff;
  font-size: 18px;
  transition: background 0.28s ease;
}

.online-dock-item:hover .online-dock-icon {
  background: var(--op-accent);
}

.online-dock-text {
  display: flex;
  align-items: center;
  padding: 0 14px 0 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

/* WeChat — 向左展开二维码 */
.online-dock-item--wechat {
  max-width: 180px;
}

.online-dock-link--wechat {
  align-items: flex-start;
  min-height: var(--op-icon-w);
}

.online-dock-expand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px 10px;
  gap: 8px;
}

.online-dock-link--wechat .online-dock-text {
  padding: 0;
  font-weight: 600;
}

.online-dock-qr {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--op-border);
  object-fit: contain;
  background: #fff;
}

/* 返回顶部 — 贴右固定 */
.online_service .goTop {
  position: static;
}

.online_service .totop {
  position: fixed !important;
  right: 0 !important;
  bottom: 28px !important;
  width: var(--op-icon-w) !important;
  height: var(--op-icon-w) !important;
  margin: 0;
  background: var(--op-dark) url(../images/top.png) center / 18px no-repeat !important;
  border-radius: 12px 0 0 12px !important;
  box-shadow: -4px 2px 18px rgba(0, 0, 0, 0.1);
  opacity: 0.95;
  transition: background-color 0.25s ease, transform 0.25s ease !important;
}

.online_service .totop:hover {
  background-color: var(--op-accent) !important;
  transform: translateX(-4px);
}

@media screen and (max-width: 768px) {
  .online_service .online-dock {
    display: none;
  }

  .online_service .goTop {
    display: none !important;
  }
}
