/* =============================================
   教程中心 & 评测中心 共享样式
   ============================================= */

/* ---- 页面头部 ---- */
.tr-page-header {
  padding: 48px 0 36px;
  text-align: center;
  color: #fff;
}

.tr-header-tutorial {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.tr-header-review {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

.tr-page-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tr-page-title i {
  margin-right: 8px;
}

.tr-page-desc {
  font-size: 15px;
  opacity: 0.85;
}

/* ---- 主内容 ---- */
.tr-main {
  padding: 32px 0 60px;
  background: #f8fafc;
  min-height: 60vh;
}

/* ---- 热门横幅 ---- */
.tr-hot-banner {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tr-hot-card {
  flex: 1;
  min-width: 280px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.tr-hot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(30,41,59,0.25);
}

.tr-hot-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(99,102,241,0.15);
}

.tr-hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  margin-bottom: 12px;
}

.tr-hot-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.tr-hot-summary {
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.tr-hot-meta {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  opacity: 0.65;
  position: relative;
  z-index: 1;
}

/* ---- 筛选栏 ---- */
.tr-filter-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tr-filter-left {
  flex: 1;
}

.tr-difficulty-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tr-diff-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.tr-diff-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.tr-diff-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.tr-filter-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tr-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  min-width: 200px;
}

.tr-search i {
  color: #94a3b8;
  font-size: 14px;
}

.tr-search input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: #1e293b;
}

.tr-sort-select select {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  outline: none;
}

/* ---- 卡片网格 ---- */
.tr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.tr-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.tr-card:hover {
  border-color: #6366f1;
  box-shadow: 0 6px 20px rgba(99,102,241,0.12);
  transform: translateY(-2px);
}

.tr-card-header {
  padding: 18px 20px 12px;
  position: relative;
}

.tr-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-weight: 500;
}

.tr-card-badge.beginner { background: #dcfce7; color: #16a34a; }
.tr-card-badge.intermediate { background: #fef3c7; color: #d97706; }
.tr-card-badge.advanced { background: #fee2e2; color: #dc2626; }
.tr-card-badge.comparison { background: #e0e7ff; color: #4f46e5; }
.tr-card-badge.deep { background: #fce7f3; color: #db2777; }

.tr-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.4;
}

.tr-card-summary {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tr-card-footer {
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tr-card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
}

.tr-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tr-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tr-card-rating .stars {
  color: #f59e0b;
  font-size: 13px;
}

.tr-card-rating .rating-num {
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.tr-card-tool-link {
  font-size: 12px;
  color: #6366f1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tr-card-tool-link:hover {
  text-decoration: underline;
}

/* ---- 加载与空状态 ---- */
.tr-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: #94a3b8;
  font-size: 15px;
}

/* ---- 分页 ---- */
.tr-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tr-page-btn {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.tr-page-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.tr-page-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.tr-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .tr-page-title { font-size: 24px; }
  .tr-filter-bar { flex-direction: column; align-items: stretch; }
  .tr-filter-right { width: 100%; flex-direction: column; }
  .tr-search { min-width: auto; width: 100%; }
  .tr-grid { grid-template-columns: 1fr; }
  .tr-hot-card { min-width: 100%; }
}
