/* ===== 引流悬浮组件样式 ===== */
#traffic-widget {
  display: none;
}
#traffic-widget.active {
  display: block;
}

/* 主容器 - 固定在底部 */
.traffic-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}
.traffic-bar.hidden {
  transform: translateY(100%);
}

/* 内部布局 */
.traffic-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 左侧标签 */
.traffic-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.traffic-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: traffic-pulse 1.8s infinite;
}
@keyframes traffic-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* 按钮组 */
.traffic-buttons {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* 单个按钮 */
.traffic-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.traffic-btn:active {
  transform: scale(0.95);
}
.traffic-btn .btn-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.traffic-btn .btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 各平台颜色 */
.traffic-btn.qq {
  background: linear-gradient(135deg, #12b7f5, #0d8bd9);
}
.traffic-btn.bilibili {
  background: linear-gradient(135deg, #fb7299, #f7598a);
}
.traffic-btn.douyin {
  background: linear-gradient(135deg, #333333, #111111);
}

/* 关闭按钮 */
.traffic-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.traffic-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  .traffic-bar {
    background: rgba(30, 41, 59, 0.92);
    border-top-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  }
  .traffic-label {
    color: #94a3b8;
  }
  .traffic-close {
    background: rgba(255, 255, 255, 0.08);
    color: #64748b;
  }
  .traffic-close:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* 移动端适配 */
@media (max-width: 480px) {
  .traffic-bar {
    padding: 6px 10px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .traffic-label {
    font-size: 10px;
  }
  .traffic-label .label-text {
    display: none;
  }
  .traffic-btn {
    font-size: 11px;
    padding: 6px 6px;
    border-radius: 8px;
  }
  .traffic-btn .btn-text {
    font-size: 10px;
  }
  .traffic-close {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
}
