/* ============================================
   糖心健身打卡与运动社区 - 核心样式表
   设计风格：活力绿+黑 专业运动风格
   ============================================ */

:root {
  --primary: #00C853;
  --primary-light: #B9F6CA;
  --bg: #0D1117;
  --card: #1C2333;
  --accent: #FF6D00;
  --text: #E0E0E0;
  --text-muted: #9E9E9E;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 200, 83, 0.2);
  --shadow-accent: 0 4px 20px rgba(255, 109, 0, 0.2);
  --transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  --font-heading: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* 重置与基础 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* 容器 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* 导航栏 */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 200, 83, 0.1);
  padding: 0.75rem 0;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* 移动端菜单 */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(13, 17, 23, 0.98);
  padding: 1.5rem;
  z-index: 999;
  border-bottom: 1px solid rgba(0, 200, 83, 0.1);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text);
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 首屏英雄区 */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13, 17, 23, 0.9) 0%, rgba(13, 17, 23, 0.6) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 560px;
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #0D1117;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: #00E676;
  color: #0D1117;
  box-shadow: 0 8px 30px rgba(0, 200, 83, 0.35);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
  background: #FF8F00;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #0D1117;
}

/* 区块标题 */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

/* 卡片系统 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(0, 200, 83, 0.08);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(0, 200, 83, 0.25);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

/* 网格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 环形进度条 */
.ring-progress {
  position: relative;
  width: 160px;
  height: 160px;
}

.ring-progress svg {
  transform: rotate(-90deg);
}

.ring-progress circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.ring-progress .ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.ring-progress .ring-fill {
  stroke: var(--primary);
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.ring-progress .ring-fill.animate {
  stroke-dashoffset: 0;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-center .number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.ring-center .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 打卡日历热力图 */
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(0, 200, 83, 0.05);
  transition: var(--transition);
}

.heatmap-cell.level-1 { background: rgba(0, 200, 83, 0.2); }
.heatmap-cell.level-2 { background: rgba(0, 200, 83, 0.4); }
.heatmap-cell.level-3 { background: rgba(0, 200, 83, 0.6); }
.heatmap-cell.level-4 { background: rgba(0, 200, 83, 0.85); }

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 数据卡片 */
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 排行榜 */
.rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.rank-item:hover {
  background: rgba(0, 200, 83, 0.05);
}

.rank-num {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
  min-width: 2rem;
}

.rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.rank-info {
  flex: 1;
}

.rank-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.rank-days {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 课程卡片 */
.course-card {
  overflow: hidden;
  border-radius: var(--radius);
}

.course-cover {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.course-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.course-card:hover .course-cover img {
  transform: scale(1.05);
}

.course-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.course-body {
  padding: 1.25rem;
}

.course-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.course-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 教练卡片 */
.coach-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.coach-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 3px solid var(--primary);
  object-fit: cover;
}

.coach-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.coach-title {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* 计时器 */
.timer {
  text-align: center;
  padding: 2rem;
}

.timer-display {
  font-size: 4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.timer-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 70px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  color: var(--text);
}

/* 页脚 */
.footer {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(0, 200, 83, 0.08);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-item {
  border: 1px solid rgba(0, 200, 83, 0.08);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  transition: var(--transition);
}

.faq-question:hover {
  background: rgba(0, 200, 83, 0.05);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  color: var(--text-muted);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1.25rem;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0, 200, 83, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 200, 83, 0.2);
}

.tag-accent {
  background: rgba(255, 109, 0, 0.1);
  color: var(--accent);
  border-color: rgba(255, 109, 0, 0.2);
}

/* 搜索框 */
.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  padding-right: 3.5rem;
  background: var(--card);
  border: 2px solid rgba(0, 200, 83, 0.15);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(0, 200, 83, 0); }
}

.animate-in {
  animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* 页面内容区 */
.page-header {
  padding: 5rem 0 2rem;
  margin-top: 60px;
  background: linear-gradient(180deg, rgba(0, 200, 83, 0.03) 0%, transparent 100%);
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--text-muted);
  max-width: 600px;
  font-size: 1rem;
}

/* 内容文本 */
.content {
  line-height: 2;
  color: var(--text);
}

.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 2rem 0 1rem;
}

.content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-light);
  margin: 1.5rem 0 0.75rem;
}

.content p {
  margin-bottom: 1rem;
}

.content ul, .content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

/* 响应式工具 */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  .section { padding: 2.5rem 0; }
}

@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
