/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 全局变量 */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-gray: #475569;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局样式 */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Microsoft YaHei", "PingFang SC", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.7;
  letter-spacing: 0.3px;
  scroll-behavior: smooth;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 七彩渐变动画效果 */
.rainbow-text {
  background: linear-gradient(
    90deg,
    #ff0000,
    #ff7f00,
    #ffff00,
    #00ff00,
    #0000ff,
    #4b0082,
    #9400d3,
    #ff0000
  );
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 400% 50%;
  }
}

/* 页面加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-white);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--bg-light);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-size: 16px;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.nav-links a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-extra {
  display: flex;
  gap: 15px;
}

.btn-wechat {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white !important;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-wechat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* 页面标题样式 */
.page-header {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-light) 100%);
  margin-bottom: 48px;
  border-radius: 0 0 var(--radius) var(--radius);
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  font-size: 42px;
  margin-bottom: 20px;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: 18px;
  color: var(--text-gray);
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.quick-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.quick-link-item {
  background-color: var(--bg-white);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--bg-light);
}

.quick-link-item:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

/* 卡片样式 */
.card-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
}

.section-title i {
  color: var(--primary);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.rule-card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.rule-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.rule-card h4 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.rule-card ul {
  list-style: none;
  padding: 0;
}

.rule-card li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-gray);
  font-size: 14px;
}

.rule-card li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.card p {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 15px;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

/* 教程标签样式 */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tab {
  padding: 8px 20px;
  background-color: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tab.active {
  background-color: var(--primary);
  color: white;
}

/* 社群页面样式 */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.community-card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 42px 32px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.community-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

.community-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.community-card h3 {
  font-size: 22px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.qrcode {
  width: 260px;
  height: 260px;
  margin: 0 auto 28px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-gray);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.qrcode:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.qq-group {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #f8fafc 100%);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
}

.community-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.stat-item {
  background-color: var(--bg-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.stat-item:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* 引导跳转区 */
.guide-section {
  background: linear-gradient(135deg, var(--bg-white) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px;
  margin-bottom: 56px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.guide-section:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.guide-card {
  transition: all 0.3s ease;
}

.guide-card:hover {
  transform: translateY(-5px);
}

.guide-card h4 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text-dark);
  font-weight: 600;
}

.guide-card p {
  color: var(--text-gray);
  margin-bottom: 20px;
  line-height: 1.6;
}

.guide-card .btn {
  display: inline-block;
  margin-top: 10px;
}

/* 页脚样式 */
.footer {
  background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
  padding: 40px 0;
  margin-top: 80px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius) var(--radius) 0 0;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer p {
  color: var(--text-gray);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 25px;
  margin-bottom: 15px;
}

.footer-links a {
  color: var(--primary);
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

.footer-links a:hover {
  color: var(--primary-hover);
  transform: translateY(-2px);
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.footer-links a:hover::after {
  width: 100%;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  z-index: 2000;
  display: none;
  animation: slideInRight 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.success {
  background-color: #10b981;
  color: white;
}

.notification.error {
  background-color: #ef4444;
  color: white;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-links {
    gap: 20px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header p {
    font-size: 14px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .community-grid {
    grid-template-columns: 1fr;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .community-stats {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .stat-item {
    width: 100%;
    text-align: center;
  }

  .section-title {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .rule-card,
  .community-card {
    padding: 28px 20px;
    min-height: auto;
  }

  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }

  .quick-links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .quick-link-item {
    width: 100%;
    text-align: center;
    max-width: 200px;
  }
}