/* ========== 统一弹窗样式（简洁、现代、可复用） ========== */
/* 所有弹窗共用遮罩层 */
.contact-modal,
.simple-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  display: none;                  /* ← 改成 none */
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}
.contact-modal.active,
.simple-modal.active {
  display: flex;                  /* ← 只有激活时才 flex */
  animation: modalFadeIn 0.2s ease;
}

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

/* 所有弹窗共用卡片 */
.modal-content,
.simple-modal-content {
  background: var(--bg-card);
  border-radius: 24px;
  max-width: 500px;
  width: 90%;
  padding: 2rem 1.8rem;
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  position: relative;
}
.contact-modal.active .modal-content,

.simple-modal.active .simple-modal-content {
  transform: translateY(0);
}

/* 卡片标题统一样式 */
.modal-content h3,
.simple-modal-content h3 {
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* ---------- 微信 / 联系方式弹窗内部布局 ---------- */
/* 二维码横向并排 */
.modal-qrcodes {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.5rem;
}
.modal-qrcode-item {
  text-align: center;
  flex: 1;
  min-width: 120px;
}
.modal-qrcode-item h4 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.modal-qrcode-item img {
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: white;
  padding: 6px;
}

/* 联系方式列表 */
.contact-details {
  margin-top: 0.5rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 1rem;
}
.contact-action {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.contact-action:hover {
  background: var(--secondary-color);
}

/* 关闭按钮（X） */
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.modal-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}



/* ---------- 语言切换弹窗内部布局 ---------- */
.simple-modal-content {
  max-width: 280px;   /* 从 500px 减小到 280px，更紧凑 */
  padding: 1.5rem 1.2rem;
  text-align: center;
}
.simple-modal-content p {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.simple-modal-content button {
  margin-top: 1.2rem;
  padding: 0.5rem 1.8rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.simple-modal-content button:hover {
  background: var(--secondary-color);
}

/* 响应式调整 */
@media (max-width: 480px) {
  .modal-content,
  .simple-modal-content {
    padding: 1.5rem 1rem;
  }
  .modal-qrcodes {
    gap: 1rem;
  }
  .modal-qrcode-item img {
    max-width: 120px;
  }
  .contact-item {
    flex-direction: column;
    text-align: center;
  }
}

.contact-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--bg-secondary); border-radius: var(--radius-md); }
.contact-action { display: inline-block; background: var(--primary-color); color: white; padding: 0.4rem 1rem; border-radius: var(--radius-full); border: none; cursor: pointer; transition: background var(--transition); }
.contact-action:hover { background: var(--secondary-color); }
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text-primary); color: white; padding: 0.75rem 1.5rem; border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg); opacity: 0; transition: all var(--transition); z-index: var(--z-toast-bottom);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }



/* ========== 分享面板样式（原 share.js 动态注入） ========== */
.share-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: var(--z-share-panel);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.share-panel.active {
  opacity: 1;
  visibility: visible;
}

.share-panel-content {
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

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

.share-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
}

.share-panel-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #1f2937;
}

.share-panel-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 5px;
  font-size: 1.5rem;
  line-height: 1;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: #374151;
}

.share-option:hover {
  background: #f9fafb;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .share-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== 二维码弹窗样式 ========== */
.qr-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-qr-modal);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.qr-modal.active {
  opacity: 1;
  visibility: visible;
}
.qr-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 300px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.qr-modal.active .qr-modal-content {
  transform: scale(1);
}
.qr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.qr-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #1f2937;
}
.qr-modal-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 5px;
  font-size: 1.5rem;
  line-height: 1;
}
.qr-code-container {
  margin: 15px 0;
}
.qr-code-image {
  width: 150px;
  height: 150px;
  margin: 0 auto 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.qr-code-container p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ---------- 二维码弹窗专用样式 ---------- */
.modal-content-sm { max-width: 320px; }
.modal-qr-wrap { text-align: center; padding: 8px 0; }
.modal-qr-img {
    width: 100%; max-width: 200px; height: auto; border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); background: white; padding: 6px;
    display: block; margin: 0 auto;
}
.modal-qr-tip { color: var(--text-secondary); font-size: 0.9rem; margin-top: 12px; }
.text-center { text-align: center; }
