/* === 基础全局设置 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #f7f8fa;
  min-height: 100vh;
  padding: 24px 16px;
  line-height: 1.5;
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px 0;
}

/* === 标题区域 === */
.title-section {
  text-align: center;
  margin-bottom: 36px;
  padding: 0 8px;
}

.title {
  font-size: 26px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.subtitle {
  color: #86909c;
  font-size: 15px;
}

/* === 群聊卡片容器 === */
.groups-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === 卡片样式 === */
.group-card {
  background-color: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: flex-start; /* 顶部对齐 */
  gap: 12px; /* 内容与按钮的间距 */
  transition: all 0.25s ease;
  border: 1px solid #f2f3f5;
  position: relative;
}

.group-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #e5e6eb;
}

/* === 标签容器 === */
.tags-container {
  position: absolute;
  top: 10px; 
  left: 18px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 1;
}

.group-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.tag-official { background-color: #e8f4fd; color: #0e84c9; }
.tag-paused { background-color: #fef3f2; color: #d92121; }
.tag-common { background-color: #f0fdf4; color: #166534; }
.tag-safe { background-color: #fcfafe; color: #7e22ce; }

/* === 群聊信息 === */
.group-info {
  flex: 1;
  min-width: 0;
  padding-top: 24px; /* 为顶部标签留出空间 */
}

.group-name {
  font-weight: 600;
  font-size: 17px;
  color: #1d2129;
  margin-bottom: 4px;
  line-height: 1.3;
}

.group-desc {
  font-size: 14px;
  color: #86909c;
  line-height: 1.4;
}

/* === 按钮容器 (单按钮和双按钮通用) === */
/* 容器本身固定宽度，且内容垂直居中 */
.btn-container {
  flex-shrink: 0;
  width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center; /* 垂直方向居中 */
  align-items: center;    /* 水平方向居中 (实现单按钮居中) */
  gap: 6px;
  height: 100%; /* 确保容器高度撑满卡片，以便垂直居中生效 */
}

/* === 双按钮组样式 === */
/* 当有多个按钮时，这个内部容器会充满外部容器，并垂直排列 */
.btn-group-vertical {
  width: 100%; /* 充满父容器宽度 */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* === 按钮基础样式 === */
.join-btn {
  width: 100%; /* 按钮宽度由父容器决定 */
  height: 40px;
  line-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.join-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.join-btn:active { 
  transform: translateY(0); 
  box-shadow: none;
}

/* 禁用状态 */
.join-btn.disabled {
  background-color: #c9cdD4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === 平台配色 === */
.telegram-btn { background-color: #25A0DA; }
.qq-btn { background-color: #12B7F5; }
.diange-btn { background-color: #b71c1c; }
.wechat-btn { background-color: #07C160; }

/* === 微信弹窗样式 === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 320px;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease-out;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

.qrcode-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 20px;
}

.modal-desc {
  font-size: 15px;
  color: #666;
  margin-bottom: 20px;
}

.modal-close {
  width: 100%;
  padding: 12px;
  background-color: #f5f7fa;
  color: #333;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.modal-close:hover { 
  background-color: #e8eaed; 
}

/* === 底部说明 === */
.footer-note {
  text-align: center;
  margin-top: 36px;
  color: #86909c;
  font-size: 13px;
  padding: 0 16px;
}

.footer-note p { margin-bottom: 6px; }

.copyright {
  text-align: center;
  padding: 15px 0;
  font-size: 14px;
  color: #666;
  border-top: 1px solid #eee;
  margin-top: 20px;
}

