/**
 * 邀请码系统样式
 */

/* 邀请人信息区 */
.inviter-info-section {
  margin-bottom: 20px;
}

.inviter-card {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
  max-width: 400px;
}

.inviter-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9em;
  font-weight: 600;
}

.inviter-header i {
  margin-right: 8px;
  font-size: 1.1em;
}

.inviter-title {
  color: rgba(255, 255, 255, 0.9);
}

.inviter-details {
  font-size: 0.85em;
}

.inviter-details > div {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.95);
}

.inviter-details > div:last-child {
  margin-bottom: 0;
}

.inviter-details i {
  margin-right: 8px;
  width: 14px;
  text-align: center;
  opacity: 0.8;
}

.inviter-name span {
  font-weight: 600;
}

.inviter-code span,
.inviter-date span {
  font-weight: 500;
}

/* 推广中心容器 */
/* 子级规则列表缩进与样式 */
.sub-rules {
  margin-top: 6px;
  margin-bottom: 6px;
  margin-left: 1.25em;
}
.sub-rules li {
  list-style-type: disc;
}

.wechat-id {
  font-weight: 700;
}
.invite-center-content {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

/* 邀请码展示区 */
.invite-code-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 25px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.invite-code-section h3 {
  margin: 0 0 20px 0;
  font-size: 1.4em;
  font-weight: 600;
}

.invite-code-display {
  text-align: center;
}

.code-box {
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.code-box .code {
  font-size: 2em;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  display: block;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.invite-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.invite-actions .btn {
  min-width: 120px;
}

/* 推广统计区 */
.invite-stats-section {
  margin-bottom: 25px;
}

.invite-stats-section h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3em;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 1.5em;
}

.stat-card:nth-child(1) .stat-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: white;
}

.stat-card:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  color: white;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 1.8em;
  font-weight: bold;
  color: #333;
  line-height: 1;
}

.stat-label {
  color: #666;
  font-size: 0.9em;
  margin-top: 5px;
}

/* 操作按钮区 */
.invite-actions-section {
  text-align: center;
  margin-bottom: 25px;
}

.invite-actions-section .btn {
  margin: 0 10px 10px 0;
  min-width: 150px;
}

/* 规则说明区 */
.invite-rules-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #007bff;
}

.invite-rules-section h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.rules-content ul {
  margin: 0;
  padding-left: 20px;
}

.rules-content li {
  margin-bottom: 10px;
  line-height: 1.6;
  color: #555;
}

.rules-content strong {
  color: #333;
}

/* 错误容器 */
.error-container {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.error-container i {
  font-size: 3em;
  color: #dc3545;
  margin-bottom: 20px;
}

.error-container p {
  font-size: 1.1em;
  margin-bottom: 20px;
}

/* 邀请码验证样式 */
.validation-message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9em;
  display: none;
}

.validation-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.validation-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.validation-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.validation-message i {
  margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .invite-center-content {
    padding: 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .invite-actions {
    flex-direction: column;
    align-items: center;
  }

  .invite-actions .btn {
    width: 100%;
    max-width: 250px;
  }

  .invite-actions-section .btn {
    width: 100%;
    max-width: 250px;
    margin: 5px 0;
  }

  .code-box .code {
    font-size: 1.5em;
    letter-spacing: 2px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .code-box .code {
    font-size: 1.3em;
    letter-spacing: 1px;
  }
}


/* ========== 推广+邀请合并布局（V1） ========== */
.invite-merged.two-columns { display: flex; gap: 20px; align-items: flex-start; }
.promotion-panel { flex: 0 0 58%; background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 20px; box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.invite-panel { flex: 0 0 42%; }

.promotion-panel h3 { margin: 0 0 12px; font-size: 1.25em; color: #333; }
.promo-body .promo-desc { color: #444; line-height: 1.6; margin: 4px 0 10px; }
.promo-body .promo-rules { margin: 10px 0 14px; padding-left: 18px; }
.promo-body .promo-rules li { margin: 6px 0; color: #555; }
.promo-hint { color: #6c757d; font-size: 0.9em; margin-top: 10px; }

/* 入口按钮徽标（首页“领积分”） */
.btn-invite { position: relative; }
.btn-invite-red { background: linear-gradient(135deg, #ff4757 0%, #ff1f3a 100%); color: #fff; border: none; border-radius: 999px; padding: 6px 14px; font-weight: 700; box-shadow: 0 6px 14px rgba(255,55,66,0.4); }
.btn-invite-red:hover { background: linear-gradient(135deg, #ff3347 0%, #ff0f2e 100%); transform: translateY(-1px) scale(1.02); box-shadow: 0 8px 18px rgba(255,55,66,0.5); }
/* Force red style to override generic purple .btn-invite rules in style.css */
.btn-invite.btn-invite-red { background: linear-gradient(135deg, #ff4757 0%, #ff1f3a 100%) !important; color: #fff !important; border: none !important; border-radius: 999px; padding: 6px 14px; font-weight: 700; box-shadow: 0 6px 14px rgba(255,55,66,0.4); }
.btn-invite.btn-invite-red:hover { background: linear-gradient(135deg, #ff3347 0%, #ff0f2e 100%) !important; transform: translateY(-1px) scale(1.02); box-shadow: 0 8px 18px rgba(255,55,66,0.5); }

/* 紫色主题按钮样式（更亮的渐变 + 动效） */
.btn-invite-purple {
    /* 更浅更亮的多段渐变 */
    background: linear-gradient(135deg, #8b7cf9 0%, #7a68f7 35%, #5b39d6 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(123, 97, 255, 0.35);
    position: relative;
    overflow: hidden;
    /* 渐变流动 */
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite, glowPulse 2.4s ease-in-out infinite;
}

/* 关闭通用按钮上的旧闪光，避免效果冲突 */
.btn-invite.btn-invite-purple::before { display: none !important; }

/* 高光扫光（循环） */
.btn-invite-purple::after {
    content: '';
    position: absolute;
    top: 0; left: -30%;
    width: 30%; height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: sheenSlide 2.8s ease-in-out infinite;
    pointer-events: none;
}

.btn-invite-purple:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 10px 22px rgba(123, 97, 255, 0.45);
    animation-play-state: paused;
}

/* Force purple style to override generic .btn-invite rules in style.css */
.btn-invite.btn-invite-purple {
    background: linear-gradient(135deg, #8b7cf9 0%, #7a68f7 35%, #5b39d6 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(123, 97, 255, 0.35);
    position: relative;
    overflow: hidden;
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite, glowPulse 2.4s ease-in-out infinite;
}

.btn-invite.btn-invite-purple:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 10px 22px rgba(123, 97, 255, 0.45);
    animation-play-state: paused;
}

/* 渐变流动 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 扫光动效 */
@keyframes sheenSlide {
    0% { left: -40%; }
    60% { left: 110%; }
    100% { left: 110%; }
}

/* 柔和发光脉冲（不改动transform，避免与外部pulse冲突） */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 8px 18px rgba(123,97,255,0.35), 0 0 0 rgba(123,97,255,0); }
    50% { box-shadow: 0 10px 26px rgba(123,97,255,0.50), 0 0 18px rgba(123,97,255,0.35); }
}


/* 内联链接样式（用于说明文字中的“兑换卡密”） */
.link-inline, .btn-link-inline {
  color: #4f46e5; /* indigo-600 */
  text-decoration: underline;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
}
.link-inline:hover, .btn-link-inline:hover {
  color: #4338ca; /* indigo-700 */
}

@media (max-width: 768px) {
  .invite-merged.two-columns { flex-direction: column; }
  .promotion-panel { padding: 16px; }
}

/* Layout tweaks: make right panel content full width inside the column */
.invite-panel .invite-center-content { max-width: none; margin: 0; padding: 0; }


/* ===== Promotion card polish ===== */
.promo-card { background: linear-gradient(180deg,#ffffff 0%, #fafbff 100%); border: 1px solid #e8eaf6; border-radius: 14px; box-shadow: 0 6px 22px rgba(17, 24, 39, 0.08); }
.promo-header { display:flex; align-items:center; gap:12px; padding: 6px 2px 12px; border-bottom: 1px dashed #eaeaea; margin-bottom: 12px; }
.promo-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; background: linear-gradient(135deg,#7c3aed 0%, #6366f1 100%); color:#fff; box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.promo-title { font-size: 16px; font-weight: 700; color:#222; }
.promo-subtitle { font-size: 12.5px; color:#6b7280; margin-top: 2px; }
.promo-body { padding-top: 2px; }
.promo-list { list-style: none; padding: 6px 0 8px; margin: 0; }
.promo-list li { display:flex; align-items:flex-start; gap:8px; margin: 6px 0; color:#444; font-size: 13.5px; }
.promo-list li i { color:#22c55e; margin-top:2px; }
.btn-promo { margin-top: 6px; padding: 10px 14px; border-radius: 10px; font-weight: 600; }

/* ===== Right invite panel typography ===== */
.invite-panel h3 { font-size: 16px; font-weight: 700; color:#2d2d2d; }
.invite-panel .invite-code-display .code-box .code { font-size: 18px; letter-spacing: 2px; }
.invite-panel .invite-actions .btn { font-size: 13px; min-width: 110px; }
.invite-panel .stats-grid .stat-value { font-size: 18px; font-weight: 700; }
.invite-panel .stats-grid .stat-label { font-size: 12.5px; color:#6b7280; }
.invite-panel .invite-actions-section .btn { font-size: 13px; min-width: 140px; }
.invite-panel .invite-rules-section { font-size: 13px; }
.invite-panel .invite-rules-section .rules-content li { margin: 6px 0; }


/* ===== Contrast + urgency for left promo ===== */
.promo-contrast { border-left: 4px solid #10b981; background: linear-gradient(180deg,#ffffff 0%, #f6fffb 100%); }
.promo-icon--teal { background: linear-gradient(135deg,#10b981 0%, #14b8a6 100%); box-shadow: 0 4px 12px rgba(20,184,166,0.35); }
.promo-badge { display:inline-flex; align-items:center; gap:6px; margin-right: 4px; padding: 4px 8px; border-radius: 999px; background: rgba(245, 158, 11, 0.12); color:#b45309; font-weight:600; font-size:12px; border:1px solid rgba(245,158,11,0.35); }
.promo-guide { margin-top: 10px; padding: 10px 12px; background: #f8fafc; border: 1px dashed #e5e7eb; border-radius: 10px; }
.promo-guide .guide-title { font-weight: 700; font-size: 13px; color:#111827; margin-bottom: 6px; display:flex; align-items:center; gap:6px; }
.promo-guide .guide-list { margin: 0; padding-left: 16px; color:#374151; font-size: 13px; }
.promo-guide .guide-list li { margin: 4px 0; }



/* ===== Right panel compact layout ===== */
/* New invite code section design */
.invite-code-section-new {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.invite-code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Remove any pill/red background from the invite header text */
.invite-code-header span {
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.invite-code-header i {
  font-size: 16px;
}

.invite-code-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.code-display-new {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.invite-code-text {
  color: white;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.code-actions-new {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-copy-code, .btn-copy-link {
  flex: 1;
  max-width: 120px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-copy-code {
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
}

.btn-copy-code:hover {
  background: white;
  transform: translateY(-1px);
}

.btn-copy-link {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-copy-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
/* Right panel stats: force single-row compact 3-column layout */
.invite-panel .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px;
  margin-bottom: 12px;
}
.invite-panel .stat-card {
  background: #fafbfc;
  border: 1px solid #eef2f7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  border-radius: 8px;
  padding: 10px 8px;
  display: block;
}
.invite-panel .stat-icon { display: none !important; }
.invite-panel .stat-info { text-align: center; }
.invite-panel .stat-value { font-size: 16px; font-weight: 700; margin-bottom: 2px; color: #1f2937; }
.invite-panel .stat-label { font-size: 12px; color: #6b7280; }


/* Legacy styles for compatibility */
.invite-code-section { padding: 16px; border-radius: 12px; }
.invite-code-display .code-box { padding: 8px 12px; margin-bottom: 8px; }
.invite-actions { gap: 8px; margin-top: 8px; }
.invite-actions .btn { min-width: 90px; font-size: 11.5px; padding: 6px 8px; }

/* Stat chips: 3-column compact horizontal layout - more compact */
.invite-stats-section { margin-bottom: 18px; }
.invite-stats-section h3 { font-size: 13px; margin-bottom: 10px; font-weight: 600; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.stat-card {
  padding: 6px 4px;
  border: 1px solid #eef2f7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  border-radius: 6px;
  text-align: center;
  background: #fafbfc;
}
.stat-icon { display: none; } /* Hide icons to save space */
.stat-value { font-size: 13px; font-weight: 700; margin-bottom: 1px; color: #2d3748; }
.stat-label { font-size: 9px; color:#6b7280; line-height: 1.1; }

/* Invite action buttons row */
.invite-actions-section .btn { font-size: 12px; padding: 7px 10px; min-width: 110px; }

/* Withdrawal reminder */
.withdraw-reminder {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 15px 0;
  font-size: 12px;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 6px;
}

.withdraw-reminder i {
  color: #6c757d;
  font-size: 11px;
}

.withdraw-reminder .wechat-id {
  color: #007bff;
  font-weight: 600;
}

.withdraw-reminder .btn-link {
  font-size: 11px;
  padding: 2px 6px;
  color: #007bff;
  text-decoration: none;
}

.withdraw-reminder .btn-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .stat-card {
    padding: 4px 2px;
  }
  .stat-value {
    font-size: 12px;
  }
  .stat-label {
    font-size: 8px;
  }
  .invite-actions { flex-direction: column; gap: 6px; }
  .invite-actions .btn { width: 100%; max-width: 200px; }
  .withdraw-reminder {
    font-size: 11px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }
  .code-actions-new {
    flex-direction: column;
    gap: 6px;
  }
  .btn-copy-code, .btn-copy-link {
    max-width: none;
  }
}

/* QR Code Interface Styles */
.qr-section {
  margin: 16px 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.qr-toggle-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.qr-toggle-btn:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
}

.qr-toggle-btn i:first-child {
  margin-right: 8px;
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.qr-content {
  padding: 20px;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

.qr-container {
  text-align: center;
  margin-bottom: 16px;
}

.qr-image {
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 12px;
}

.qr-hint {
  color: #666;
  font-size: 13px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-backup {
  width: 100%;
  padding: 10px;
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-backup:hover {
  background: #e9ecef;
  color: #495057;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Mobile optimizations for QR codes */
@media (max-width: 768px) {
  .qr-image {
    max-width: 180px;
  }

  .qr-content {
    padding: 16px;
  }

  .qr-toggle-btn {
    padding: 14px 16px;
    font-size: 15px;
  }

  .qr-hint {
    font-size: 14px;
  }
}
