/* ========== 导航标签 ========== */
.nav-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  cursor: pointer;
  border: none;
  background: transparent;
}
.nav-tab:hover { color: #4169f5; background: #f0f5ff; }
.nav-tab.active { color: #4169f5; background: #e0eaff; font-weight: 600; }

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.25rem 0.75rem;
  font-size: 0.625rem;
  color: #94a3b8;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s;
}
.mobile-tab.active { color: #4169f5; }
.mobile-tab i { font-size: 1.25rem; }

/* ========== 统计卡片 ========== */
.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.stat-card:hover::before { opacity: 1; }
.stat-card.blue::before { background: linear-gradient(90deg, #4169f5, #6590fa); }
.stat-card.pink::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.stat-card.green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* ========== 内容卡片 ========== */
.content-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
}
.content-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.content-card-body { padding: 1.25rem 1.5rem; }

/* ========== 器材卡片（旧版保留） ========== */
.equip-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}
.equip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
  border-color: #c2d5ff;
}
.equip-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ========== 器材卡片 V2（训记风格） ========== */
.equip-card-v2 {
  background: white;
  border-radius: 1rem;
  padding: 1rem 1.125rem;
  border: 1px solid #f1f5f9;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.equip-card-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
  border-color: #c2d5ff;
}
.equip-card-v2::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.3s;
  background: linear-gradient(90deg, #4169f5, #ec4899);
}
.equip-card-v2:hover::after { opacity: 1; }

/* ========== 器材卡片 V3（图片+要点 训记风格） ========== */
.equip-card-v3 {
  background: white;
  border-radius: 1rem;
  border: 1px solid #f1f5f9;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}
.equip-card-v3:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
  border-color: #c2d5ff;
}

.equip-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #f1f5f9;
}
.equip-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.equip-card-v3:hover .equip-card-img {
  transform: scale(1.05);
}
.equip-card-img-wrapper.img-error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0eaff, #fce7f3);
}
.equip-card-img-wrapper.img-error .equip-card-img {
  display: none;
}
.equip-card-img-wrapper.img-error::after {
  content: '🏋️';
  font-size: 2.5rem;
}
.equip-card-img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
  display: flex;
  justify-content: flex-end;
}
.equip-type-badge-float {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.equip-card-no-img {
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}
.equip-card-no-img .equip-type-badge-float {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
}
.equip-card-content {
  padding: 0.875rem 1rem 1rem;
}

/* 动作要点区域 */
.equip-tips-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 0.5rem;
}
.equip-tips-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.35rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.equip-tips-toggle:hover {
  color: #4169f5;
}
.equip-tips-toggle .toggle-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 1rem;
}
.equip-tips-toggle .toggle-arrow.rotated {
  transform: rotate(180deg);
}
.equip-tips-list {
  padding: 0.35rem 0 0.25rem;
}
.equip-tip-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.25rem 0;
  font-size: 0.7rem;
  color: #475569;
  line-height: 1.5;
}
.equip-tip-item i {
  font-size: 0.75rem;
  line-height: 1.5;
}

.equip-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.4;
}

.muscle-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ========== 筛选标签（训记风格） ========== */
.equip-filter-bar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.equip-filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.filter-chip:hover { background: #f0f5ff; color: #4169f5; border-color: #c2d5ff; }
.filter-chip.active {
  background: linear-gradient(135deg, #4169f5, #6590fa);
  color: white;
  border-color: #4169f5;
  box-shadow: 0 2px 8px rgba(65,105,245,0.3);
  font-weight: 600;
}

.filter-chip-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.75rem;
  border-radius: 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.filter-chip-sm:hover { background: #f0f5ff; color: #4169f5; border-color: #c2d5ff; }
.filter-chip-sm.active {
  background: #4169f5;
  color: white;
  border-color: #4169f5;
  font-weight: 600;
}

/* 文本行裁剪 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 记录行 ========== */
.record-row {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.2s;
}
.record-row:hover { background: #f8fafc; }
.record-row:last-child { border-bottom: none; }

/* ========== 标签 ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.tag-blue { background: #e0eaff; color: #2f4de8; }
.tag-green { background: #d1fae5; color: #047857; }
.tag-pink { background: #fce7f3; color: #be185d; }
.tag-orange { background: #fef3c7; color: #b45309; }
.tag-purple { background: #ede9fe; color: #6d28d9; }

/* ========== 进度条 ========== */
.progress-bar {
  height: 0.5rem;
  border-radius: 0.25rem;
  background: #f1f5f9;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 0.25rem;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========== 建议卡片 ========== */
.advice-card {
  background: linear-gradient(135deg, #f0f5ff 0%, #fdf2f8 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(65,105,245,0.1);
  position: relative;
  overflow: hidden;
}
.advice-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(65,105,245,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

/* ========== 骨架屏 ========== */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== 淡入动画 ========== */
.fade-in {
  animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 空状态 ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; color: #cbd5e1; }

/* ========== 加载按钮 ========== */
.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading::after {
  content: '';
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== 图表范围按钮 ========== */
.chart-range-btn {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.chart-range-btn:hover { background: #e0eaff; color: #4169f5; }
.chart-range-btn.active { background: #4169f5; color: #fff; font-weight: 600; }

/* ========== 图表容器 ========== */
.chart-container { width: 100%; min-height: 320px; }

/* ========== 行裁剪 ========== */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 肌肉群热力图 ========== */
.muscle-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}
.muscle-cell {
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s;
}
.muscle-cell:hover { transform: scale(1.05); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 200;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: #d1fae5; color: #047857; }
.toast-error { background: #fee2e2; color: #b91c1c; }
.toast-info { background: #e0eaff; color: #2f4de8; }

/* ========== 器材卡片"记录训练"按钮 ========== */
.equip-record-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.5rem 0;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4169f5;
  background: #f0f5ff;
  border: 1px solid #e0eaff;
  cursor: pointer;
  transition: all 0.25s ease;
}
.equip-record-btn:hover {
  background: #4169f5;
  color: #fff;
  border-color: #4169f5;
  box-shadow: 0 4px 12px rgba(65,105,245,0.3);
  transform: translateY(-1px);
}
.equip-record-btn i { font-size: 0.875rem; }

/* ========== 训练弹窗 - 步骤指示器 ========== */
.training-modal-step-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.step-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.step-dot.active {
  background: linear-gradient(135deg, #4169f5, #6590fa);
  color: #fff;
  box-shadow: 0 3px 10px rgba(65,105,245,0.35);
}
.step-dot.done {
  background: #10b981;
  color: #fff;
}
.step-line {
  width: 2.5rem;
  height: 2px;
  background: #e2e8f0;
  transition: background 0.3s;
}
.step-line.done {
  background: #10b981;
}

/* ========== 训练弹窗 - 返回按钮 ========== */
.training-modal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
}
.training-modal-back:hover {
  background: #f0f5ff;
  color: #4169f5;
  border-color: #c2d5ff;
}
.training-modal-back i { font-size: 1rem; }

/* ========== 训练弹窗 - Step 1 部位网格 ========== */
.training-parts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
@media (max-width: 480px) {
  .training-parts-grid { grid-template-columns: repeat(3, 1fr); }
}
.training-part-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.training-part-card:hover {
  border-color: #c2d5ff;
  background: #f0f5ff;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(65,105,245,0.12);
}
.training-part-card:active {
  transform: translateY(-1px);
}
.training-part-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.training-part-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1f2937;
}
.training-part-count {
  font-size: 0.625rem;
  color: #94a3b8;
}

/* ========== 训练弹窗 - Step 2 动作列表 ========== */
.training-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.training-actions-list::-webkit-scrollbar { width: 4px; }
.training-actions-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.training-action-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.875rem;
  background: #f8fafc;
  border: 1.5px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.25s ease;
}
.training-action-card:hover {
  border-color: #c2d5ff;
  background: #f0f5ff;
  box-shadow: 0 4px 16px rgba(65,105,245,0.08);
}
.training-action-thumb {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.training-action-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.training-action-thumb.no-img {
  background: linear-gradient(135deg, #e0eaff, #fce7f3);
}
.training-action-info { flex: 1; min-width: 0; }
.training-action-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.2rem;
}
.training-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.training-action-type {
  font-size: 0.625rem;
  font-weight: 600;
}
.training-action-muscle {
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  background: #f1f5f9;
  color: #64748b;
}

/* ========== 训练弹窗 - Step 3 动作详情 ========== */
.training-detail-card {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #f1f5f9;
  background: #fff;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.training-detail-img {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f1f5f9;
}
.training-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.training-detail-img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.4));
  display: flex;
  justify-content: flex-end;
}
.training-detail-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  font-size: 0.65rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.training-detail-info {
  padding: 0.875rem 1rem;
}

/* 训练要点卡片 */
.training-tips-card {
  border-radius: 0.875rem;
  border: 1px solid #fef3c7;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.training-tips-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.training-tips-header i { font-size: 1.1rem; }
.training-tips-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.training-tip-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #78350f;
  line-height: 1.5;
}
.training-tip-row i {
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

/* 训练表单卡片 */
.training-form-card {
  border-radius: 0.875rem;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.training-form-input {
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.training-form-input:focus {
  border-color: #4169f5;
  box-shadow: 0 0 0 3px rgba(65,105,245,0.1);
}

/* 提交按钮 */
.training-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4169f5, #6590fa);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(65,105,245,0.3);
}
.training-submit-btn:hover {
  background: linear-gradient(135deg, #2f4de8, #4169f5);
  box-shadow: 0 6px 20px rgba(65,105,245,0.4);
  transform: translateY(-1px);
}
.training-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.training-submit-btn i { font-size: 1.1rem; }
