/* 社会化分享系统 - 样式文件 */
/* 支持深色/浅色模式，响应式设计 */

:root {
  --share-primary: #3b82f6;
  --share-hover: #2563eb;
  --wechat-color: #07c160;
  --weibo-color: #e6162d;
  --qq-color: #12b7f5;
  --twitter-color: #1da1f2;
  --linkedin-color: #0a66c2;
  --link-color: #6b7280;
  --qr-bg: #ffffff;
  --qr-border: #e5e7eb;
}

[data-theme="dark"] {
  --share-primary: #60a5fa;
  --share-hover: #3b82f6;
  --qr-bg: #1f2937;
  --qr-border: #374151;
  --link-color: #9ca3af;
}

/* 分享按钮容器 */
.share-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  margin: 20px 0;
  transition: all 0.3s ease;
}

.share-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .share-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 分享标题 */
.share-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-right: 8px;
}

/* 分享按钮 */
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: white;
  min-width: 100px;
  position: relative;
  overflow: hidden;
}

.share-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.share-button:active::before {
  width: 300px;
  height: 300px;
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.share-button:active {
  transform: translateY(0);
}

/* 各平台按钮颜色 */
.share-button.wechat {
  background: var(--wechat-color);
}

.share-button.weibo {
  background: var(--weibo-color);
}

.share-button.qq {
  background: var(--qq-color);
}

.share-button.twitter {
  background: var(--twitter-color);
}

.share-button.linkedin {
  background: var(--linkedin-color);
}

.share-button.link {
  background: var(--link-color);
}

/* 图标样式 */
.share-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 分享计数 */
.share-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--background);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.share-count svg {
  width: 14px;
  height: 14px;
}

/* 二维码弹窗 */
.qr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.qr-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.qr-content {
  background: var(--qr-bg);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  max-width: 90%;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.qr-content h3 {
  margin: 0 0 16px;
  color: var(--text-color);
  font-size: 18px;
}

.qr-code {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  border: 2px solid var(--qr-border);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.qr-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.qr-close {
  margin-top: 16px;
  padding: 8px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.qr-close:hover {
  background: var(--primary-hover);
}

/* 复制成功提示 */
.copy-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .share-container {
    padding: 12px;
  }

  .share-button {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 80px;
  }

  .share-button svg {
    width: 16px;
    height: 16px;
  }

  .share-count {
    display: none;
  }

  .qr-content {
    padding: 20px;
    margin: 20px;
  }

  .qr-code {
    width: 180px;
    height: 180px;
  }

  .copy-toast {
    right: 10px;
    left: 10px;
    top: 10px;
  }
}

@media (max-width: 480px) {
  .share-container {
    gap: 8px;
  }

  .share-button {
    flex: 1;
    min-width: 60px;
    padding: 8px;
    font-size: 12px;
  }

  .share-button span {
    display: none;
  }

  .share-button svg {
    width: 20px;
    height: 20px;
  }
}

/* 浮动分享按钮（固定在侧边） */
.floating-share {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.floating-share.visible {
  opacity: 1;
}

.floating-share .share-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.floating-share .share-button span {
  display: none;
}

@media (max-width: 768px) {
  .floating-share {
    display: none;
  }
}

/* 文章底部分享卡片 */
.share-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--background) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0;
}

.share-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.share-card-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-color);
}

.share-card-header svg {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
}

/* 悬浮提示 */
.share-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--text-color);
  color: var(--background);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.share-button:hover .share-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  .share-button,
  .qr-modal,
  .qr-content,
  .copy-toast {
    transition: none;
    animation: none;
  }

  .share-button:hover {
    transform: none;
  }
}

/* 打印样式 */
@media print {
  .share-container,
  .floating-share,
  .share-card {
    display: none;
  }
}
